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.jmx;
12  
13  import java.util.ArrayList;
14  import java.util.Collection;
15  import java.util.Collections;
16  import java.util.List;
17  
18  /**
19   * The Class Cluster.
20   */
21  public class Cluster {
22  
23    /** The name. */
24    private String name;
25  
26    /** The info. */
27    private String info;
28  
29    /** The manager class name. */
30    private String managerClassName;
31  
32    /** The mcast address. */
33    private String mcastAddress;
34  
35    /** The mcast bind address. */
36    private String mcastBindAddress;
37  
38    /** The mcast cluster domain. */
39    private String mcastClusterDomain;
40  
41    /** The mcast drop time. */
42    private long mcastDropTime;
43  
44    /** The mcast frequency. */
45    private long mcastFrequency;
46  
47    /** The mcast port. */
48    private int mcastPort;
49  
50    /** The mcast so timeout. */
51    private int mcastSoTimeout;
52  
53    /** The mcast ttl. */
54    private int mcastTtl;
55  
56    /** The members. */
57    private List<ClusterSender> members = new ArrayList<>();
58  
59    /** The tcp thread count. */
60    private int tcpThreadCount;
61  
62    /** The tcp listen address. */
63    private String tcpListenAddress;
64  
65    /** The tcp listen port. */
66    private int tcpListenPort;
67  
68    /** The tcp selector timeout. */
69    private long tcpSelectorTimeout;
70  
71    /** The nr of msgs received. */
72    private long nrOfMsgsReceived;
73  
74    /** The total received bytes. */
75    private long totalReceivedBytes;
76  
77    /** The sender ack timeout. */
78    private long senderAckTimeout;
79  
80    /** The sender auto connect. */
81    private boolean senderAutoConnect;
82  
83    /** The sender failure counter. */
84    private long senderFailureCounter;
85  
86    /** The sender nr of requests. */
87    private long senderNrOfRequests;
88  
89    /** The sender replication mode. */
90    private String senderReplicationMode;
91  
92    /** The sender total bytes. */
93    private long senderTotalBytes;
94  
95    /**
96     * Gets the name.
97     *
98     * @return the name
99     */
100   public String getName() {
101     return name;
102   }
103 
104   /**
105    * Sets the name.
106    *
107    * @param name the new name
108    */
109   public void setName(String name) {
110     this.name = name;
111   }
112 
113   /**
114    * Gets the info.
115    *
116    * @return the info
117    */
118   public String getInfo() {
119     return info;
120   }
121 
122   /**
123    * Sets the info.
124    *
125    * @param info the new info
126    */
127   public void setInfo(String info) {
128     this.info = info;
129   }
130 
131   /**
132    * Gets the manager class name.
133    *
134    * @return the manager class name
135    */
136   public String getManagerClassName() {
137     return managerClassName;
138   }
139 
140   /**
141    * Sets the manager class name.
142    *
143    * @param managerClassName the new manager class name
144    */
145   public void setManagerClassName(String managerClassName) {
146     this.managerClassName = managerClassName;
147   }
148 
149   /**
150    * Gets the mcast address.
151    *
152    * @return the mcast address
153    */
154   public String getMcastAddress() {
155     return mcastAddress;
156   }
157 
158   /**
159    * Sets the mcast address.
160    *
161    * @param mcastAddress the new mcast address
162    */
163   public void setMcastAddress(String mcastAddress) {
164     this.mcastAddress = mcastAddress;
165   }
166 
167   /**
168    * Gets the mcast bind address.
169    *
170    * @return the mcast bind address
171    */
172   public String getMcastBindAddress() {
173     return mcastBindAddress;
174   }
175 
176   /**
177    * Sets the mcast bind address.
178    *
179    * @param mcastBindAddress the new mcast bind address
180    */
181   public void setMcastBindAddress(String mcastBindAddress) {
182     this.mcastBindAddress = mcastBindAddress;
183   }
184 
185   /**
186    * Gets the mcast cluster domain.
187    *
188    * @return the mcast cluster domain
189    */
190   public String getMcastClusterDomain() {
191     return mcastClusterDomain;
192   }
193 
194   /**
195    * Sets the mcast cluster domain.
196    *
197    * @param mcastClusterDomain the new mcast cluster domain
198    */
199   public void setMcastClusterDomain(String mcastClusterDomain) {
200     this.mcastClusterDomain = mcastClusterDomain;
201   }
202 
203   /**
204    * Gets the members.
205    *
206    * @return the members
207    */
208   public List<ClusterSender> getMembers() {
209     return members == null ? Collections.emptyList() : new ArrayList<>(members);
210   }
211 
212   /**
213    * Sets the members.
214    *
215    * @param members the new members
216    */
217   public void setMembers(Collection<ClusterSender> members) {
218     this.members = members == null ? Collections.emptyList() : new ArrayList<>(members);
219   }
220 
221   /**
222    * Gets the tcp listen address.
223    *
224    * @return the tcp listen address
225    */
226   public String getTcpListenAddress() {
227     return tcpListenAddress;
228   }
229 
230   /**
231    * Sets the tcp listen address.
232    *
233    * @param tcpListenAddress the new tcp listen address
234    */
235   public void setTcpListenAddress(String tcpListenAddress) {
236     this.tcpListenAddress = tcpListenAddress;
237   }
238 
239   /**
240    * Gets the tcp listen port.
241    *
242    * @return the tcp listen port
243    */
244   public int getTcpListenPort() {
245     return tcpListenPort;
246   }
247 
248   /**
249    * Sets the tcp listen port.
250    *
251    * @param tcpListenPort the new tcp listen port
252    */
253   public void setTcpListenPort(int tcpListenPort) {
254     this.tcpListenPort = tcpListenPort;
255   }
256 
257   /**
258    * Gets the tcp selector timeout.
259    *
260    * @return the tcp selector timeout
261    */
262   public long getTcpSelectorTimeout() {
263     return tcpSelectorTimeout;
264   }
265 
266   /**
267    * Sets the tcp selector timeout.
268    *
269    * @param tcpSelectorTimeout the new tcp selector timeout
270    */
271   public void setTcpSelectorTimeout(long tcpSelectorTimeout) {
272     this.tcpSelectorTimeout = tcpSelectorTimeout;
273   }
274 
275   /**
276    * Gets the nr of msgs received.
277    *
278    * @return the nr of msgs received
279    */
280   public long getNrOfMsgsReceived() {
281     return nrOfMsgsReceived;
282   }
283 
284   /**
285    * Sets the nr of msgs received.
286    *
287    * @param nrOfMsgsReceived the new nr of msgs received
288    */
289   public void setNrOfMsgsReceived(long nrOfMsgsReceived) {
290     this.nrOfMsgsReceived = nrOfMsgsReceived;
291   }
292 
293   /**
294    * Gets the sender ack timeout.
295    *
296    * @return the sender ack timeout
297    */
298   public long getSenderAckTimeout() {
299     return senderAckTimeout;
300   }
301 
302   /**
303    * Sets the sender ack timeout.
304    *
305    * @param senderAckTimeout the new sender ack timeout
306    */
307   public void setSenderAckTimeout(long senderAckTimeout) {
308     this.senderAckTimeout = senderAckTimeout;
309   }
310 
311   /**
312    * Checks if is sender auto connect.
313    *
314    * @return true, if is sender auto connect
315    */
316   public boolean isSenderAutoConnect() {
317     return senderAutoConnect;
318   }
319 
320   /**
321    * Sets the sender auto connect.
322    *
323    * @param senderAutoConnect the new sender auto connect
324    */
325   public void setSenderAutoConnect(boolean senderAutoConnect) {
326     this.senderAutoConnect = senderAutoConnect;
327   }
328 
329   /**
330    * Gets the sender failure counter.
331    *
332    * @return the sender failure counter
333    */
334   public long getSenderFailureCounter() {
335     return senderFailureCounter;
336   }
337 
338   /**
339    * Sets the sender failure counter.
340    *
341    * @param senderFailureCounter the new sender failure counter
342    */
343   public void setSenderFailureCounter(long senderFailureCounter) {
344     this.senderFailureCounter = senderFailureCounter;
345   }
346 
347   /**
348    * Gets the sender nr of requests.
349    *
350    * @return the sender nr of requests
351    */
352   public long getSenderNrOfRequests() {
353     return senderNrOfRequests;
354   }
355 
356   /**
357    * Sets the sender nr of requests.
358    *
359    * @param senderNrOfRequests the new sender nr of requests
360    */
361   public void setSenderNrOfRequests(long senderNrOfRequests) {
362     this.senderNrOfRequests = senderNrOfRequests;
363   }
364 
365   /**
366    * Gets the sender replication mode.
367    *
368    * @return the sender replication mode
369    */
370   public String getSenderReplicationMode() {
371     return senderReplicationMode;
372   }
373 
374   /**
375    * Sets the sender replication mode.
376    *
377    * @param senderReplicationMode the new sender replication mode
378    */
379   public void setSenderReplicationMode(String senderReplicationMode) {
380     this.senderReplicationMode = senderReplicationMode;
381   }
382 
383   /**
384    * Gets the sender total bytes.
385    *
386    * @return the sender total bytes
387    */
388   public long getSenderTotalBytes() {
389     return senderTotalBytes;
390   }
391 
392   /**
393    * Sets the sender total bytes.
394    *
395    * @param senderTotalBytes the new sender total bytes
396    */
397   public void setSenderTotalBytes(long senderTotalBytes) {
398     this.senderTotalBytes = senderTotalBytes;
399   }
400 
401   /**
402    * Gets the mcast drop time.
403    *
404    * @return the mcast drop time
405    */
406   public long getMcastDropTime() {
407     return mcastDropTime;
408   }
409 
410   /**
411    * Sets the mcast drop time.
412    *
413    * @param mcastDropTime the new mcast drop time
414    */
415   public void setMcastDropTime(long mcastDropTime) {
416     this.mcastDropTime = mcastDropTime;
417   }
418 
419   /**
420    * Gets the mcast frequency.
421    *
422    * @return the mcast frequency
423    */
424   public long getMcastFrequency() {
425     return mcastFrequency;
426   }
427 
428   /**
429    * Sets the mcast frequency.
430    *
431    * @param mcastFrequency the new mcast frequency
432    */
433   public void setMcastFrequency(long mcastFrequency) {
434     this.mcastFrequency = mcastFrequency;
435   }
436 
437   /**
438    * Gets the mcast port.
439    *
440    * @return the mcast port
441    */
442   public int getMcastPort() {
443     return mcastPort;
444   }
445 
446   /**
447    * Sets the mcast port.
448    *
449    * @param mcastPort the new mcast port
450    */
451   public void setMcastPort(int mcastPort) {
452     this.mcastPort = mcastPort;
453   }
454 
455   /**
456    * Gets the mcast so timeout.
457    *
458    * @return the mcast so timeout
459    */
460   public int getMcastSoTimeout() {
461     return mcastSoTimeout;
462   }
463 
464   /**
465    * Sets the mcast so timeout.
466    *
467    * @param mcastSoTimeout the new mcast so timeout
468    */
469   public void setMcastSoTimeout(int mcastSoTimeout) {
470     this.mcastSoTimeout = mcastSoTimeout;
471   }
472 
473   /**
474    * Gets the mcast ttl.
475    *
476    * @return the mcast ttl
477    */
478   public int getMcastTtl() {
479     return mcastTtl;
480   }
481 
482   /**
483    * Sets the mcast ttl.
484    *
485    * @param mcastTtl the new mcast ttl
486    */
487   public void setMcastTtl(int mcastTtl) {
488     this.mcastTtl = mcastTtl;
489   }
490 
491   /**
492    * Gets the tcp thread count.
493    *
494    * @return the tcp thread count
495    */
496   public int getTcpThreadCount() {
497     return tcpThreadCount;
498   }
499 
500   /**
501    * Sets the tcp thread count.
502    *
503    * @param tcpThreadCount the new tcp thread count
504    */
505   public void setTcpThreadCount(int tcpThreadCount) {
506     this.tcpThreadCount = tcpThreadCount;
507   }
508 
509   /**
510    * Gets the total received bytes.
511    *
512    * @return the total received bytes
513    */
514   public long getTotalReceivedBytes() {
515     return totalReceivedBytes;
516   }
517 
518   /**
519    * Sets the total received bytes.
520    *
521    * @param totalReceivedBytes the new total received bytes
522    */
523   public void setTotalReceivedBytes(long totalReceivedBytes) {
524     this.totalReceivedBytes = totalReceivedBytes;
525   }
526 
527 }