View Javadoc
1   /*
2    * Licensed under the GPL License. You may not use this file except in compliance with the License.
3    * You may obtain a copy of the License at
4    *
5    *   https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6    *
7    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
8    * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
9    * PURPOSE.
10   */
11  package psiprobe.model;
12  
13  import java.util.ArrayList;
14  import java.util.List;
15  
16  /**
17   * POJO representing a Connector and its RequestProcessors.
18   */
19  public class Connector {
20  
21    /** The protocolHandler. */
22    private String protocolHandler;
23  
24    /** The max time. */
25    private long maxTime;
26  
27    /** The processing time. */
28    private long processingTime;
29  
30    /** The request count. */
31    private int requestCount;
32  
33    /** The status. */
34    private String status;
35  
36    /** The protocol. */
37    private String protocol;
38  
39    /** The local port. */
40    private Integer localPort;
41  
42    /** The port. */
43    private Integer port;
44  
45    /** The schema. */
46    private String schema;
47  
48    /** The secure. */
49    private boolean secure;
50  
51    /** The error count. */
52    private int errorCount;
53  
54    /** The bytes received. */
55    private long bytesReceived;
56  
57    /** The bytes sent. */
58    private long bytesSent;
59  
60    /** The request processors. */
61    private List<RequestProcessor> requestProcessors = new ArrayList<>();
62  
63    /**
64     * Gets the protocol handler.
65     *
66     * @return the protocol handler
67     */
68    public String getProtocolHandler() {
69      return protocolHandler;
70    }
71  
72    /**
73     * Sets the protocol handler.
74     *
75     * @param protocolHandler the new protocol handler
76     */
77    public void setProtocolHandler(String protocolHandler) {
78      this.protocolHandler = protocolHandler;
79    }
80  
81    /**
82     * Gets the max time.
83     *
84     * @return the max time
85     */
86    public long getMaxTime() {
87      return maxTime;
88    }
89  
90    /**
91     * Sets the max time.
92     *
93     * @param maxTime the new max time
94     */
95    public void setMaxTime(long maxTime) {
96      this.maxTime = maxTime;
97    }
98  
99    /**
100    * Gets the processing time.
101    *
102    * @return the processing time
103    */
104   public long getProcessingTime() {
105     return processingTime;
106   }
107 
108   /**
109    * Sets the processing time.
110    *
111    * @param processingTime the new processing time
112    */
113   public void setProcessingTime(long processingTime) {
114     this.processingTime = processingTime;
115   }
116 
117   /**
118    * Gets the request count.
119    *
120    * @return the request count
121    */
122   public int getRequestCount() {
123     return requestCount;
124   }
125 
126   /**
127    * Sets the request count.
128    *
129    * @param requestCount the new request count
130    */
131   public void setRequestCount(int requestCount) {
132     this.requestCount = requestCount;
133   }
134 
135   /**
136    * Gets the bytes received.
137    *
138    * @return the bytes received
139    */
140   public long getBytesReceived() {
141     return bytesReceived;
142   }
143 
144   /**
145    * Sets the bytes received.
146    *
147    * @param bytesReceived the new bytes received
148    */
149   public void setBytesReceived(long bytesReceived) {
150     this.bytesReceived = bytesReceived;
151   }
152 
153   /**
154    * Gets the bytes sent.
155    *
156    * @return the bytes sent
157    */
158   public long getBytesSent() {
159     return bytesSent;
160   }
161 
162   /**
163    * Sets the bytes sent.
164    *
165    * @param bytesSent the new bytes sent
166    */
167   public void setBytesSent(long bytesSent) {
168     this.bytesSent = bytesSent;
169   }
170 
171   /**
172    * Gets the error count.
173    *
174    * @return the error count
175    */
176   public int getErrorCount() {
177     return errorCount;
178   }
179 
180   /**
181    * Sets the error count.
182    *
183    * @param errorCount the new error count
184    */
185   public void setErrorCount(int errorCount) {
186     this.errorCount = errorCount;
187   }
188 
189   /**
190    * Gets the request processors.
191    *
192    * @return the request processors
193    */
194   public List<RequestProcessor> getRequestProcessors() {
195     return requestProcessors;
196   }
197 
198   /**
199    * Sets the request processors.
200    *
201    * @param requestProcessors the new request processors
202    */
203   public void setRequestProcessors(List<RequestProcessor> requestProcessors) {
204     this.requestProcessors = requestProcessors;
205   }
206 
207   /**
208    * Adds the request processor.
209    *
210    * @param rp the rp
211    */
212   public void addRequestProcessor(RequestProcessor rp) {
213     requestProcessors.add(rp);
214   }
215 
216   /**
217    * get current connector status.
218    *
219    * @return the status
220    */
221   public String getStatus() {
222     return status;
223   }
224 
225   /**
226    * Sets the status.
227    *
228    * @param status the new status
229    */
230   public void setStatus(String status) {
231     this.status = status;
232   }
233 
234   /**
235    * get current connector protocol.
236    *
237    * @return the protocol
238    */
239   public String getProtocol() {
240     return protocol;
241   }
242 
243   /**
244    * Sets the protocol.
245    *
246    * @param protocol the new protocol
247    */
248   public void setProtocol(String protocol) {
249     this.protocol = protocol;
250   }
251 
252   /**
253    * Gets the local port.
254    *
255    * @return the local port
256    */
257   public Integer getLocalPort() {
258     return localPort;
259   }
260 
261   /**
262    * Sets the local port.
263    *
264    * @param localPort the new local port
265    */
266   public void setLocalPort(Integer localPort) {
267     this.localPort = localPort;
268   }
269 
270   /**
271    * Gets the port.
272    *
273    * @return the port
274    */
275   public Integer getPort() {
276     return port;
277   }
278 
279   /**
280    * Sets the port.
281    *
282    * @param port the new port
283    */
284   public void setPort(Integer port) {
285     this.port = port;
286   }
287 
288   /**
289    * Gets the schema.
290    *
291    * @return the schema
292    */
293   public String getSchema() {
294     return schema;
295   }
296 
297   /**
298    * Sets the schema.
299    *
300    * @param schema the new schema
301    */
302   public void setSchema(String schema) {
303     this.schema = schema;
304   }
305 
306   /**
307    * Checks if is secure.
308    *
309    * @return true, if is secure
310    */
311   public boolean isSecure() {
312     return secure;
313   }
314 
315   /**
316    * Sets the secure.
317    *
318    * @param secure the new secure
319    */
320   public void setSecure(boolean secure) {
321     this.secure = secure;
322   }
323 
324 }