OSDN Git Service

Initial commit
[ultramonkey-l7/l7gui.git] / src / src / org / ultramonkey / l7 / controller / ReplicationData.java
1 package org.ultramonkey.l7.controller;
2
3 import java.io.Serializable;
4 import java.util.HashMap;
5
6 import org.apache.log4j.Logger;
7 import org.ultramonkey.l7.model.LogCategorySet;
8
9 /**
10  * 
11  * <p>class ReplicationData</p>
12  * <p>Copyright(c) NTT COMWARE 2008</p>
13  * @author tanuma
14  */
15 public class ReplicationData implements Serializable {
16     static final long serialVersionUID = 1L;
17
18     /**
19      * Replication Status (MASTER, MASTER_STOP, SLAVE, SLAVE_STOP, SINGLE, OUT)
20      */
21     public ReplicationStatus replicationMode;
22     
23     /**
24      * Network Interface name of using for replication
25      */
26         public String nic;
27         
28         /**
29          * IP address and port number of the other node
30          */
31         public EndPoint otherNode;
32         
33         /**
34          * Replication interval seconds
35          */
36         public int interval;
37
38         /**
39          * Replication component setting
40          */
41         public HashMap<String, Integer> component;
42         
43         /**
44          * 
45          * Constructor
46          *
47          */
48         public ReplicationData() {
49         // --- debug log (constructor) ---
50             Logger repLogger = Logger.getLogger(LogCategorySet.GUI_REPLICATION);
51         if (repLogger.isDebugEnabled()) {
52             repLogger.debug("11508 class ReplicationData created.");
53         }
54         // --- debug log (constructor) ---
55
56                 this.replicationMode = ReplicationStatus.MASTER_STOP;
57                 this.nic = "";
58                 this.otherNode = new EndPoint();
59                 this.interval = 0;
60                 this.component = new HashMap<String, Integer>();
61         }
62         
63         /**
64          * 
65          * {@inheritDoc}
66          */
67         public String toString() {
68                 return
69                         "replicationMode=" + this.replicationMode + ", " +
70                         "nic=\"" + this.nic + "\", " +
71                         "otherNode=(" + this.otherNode + "), " +
72                         "interval=" + this.interval + ", " +
73                         "component=(" + this.component + ")";
74         }
75 }