OSDN Git Service

Initial commit
[ultramonkey-l7/l7gui.git] / src / src / org / ultramonkey / l7 / controller / L7vsAdmData.java
1 package org.ultramonkey.l7.controller;
2
3 import java.util.*;
4 import java.io.Serializable;
5
6 import org.apache.log4j.Logger;
7 import org.ultramonkey.l7.model.LogCategorySet;
8
9 /**
10  * 
11  * <p>class L7vsAdmData</p>
12  * <p>Copyright(c) NTT COMWARE 2008</p>
13  * @author tanuma
14  */
15 public class L7vsAdmData extends VirtualSetting implements Serializable {
16     static final long serialVersionUID = 1L;
17
18     /**
19      * Virtual service setting.
20      */
21         public Vector<VirtualSetting> virtualSettings;
22         
23         /**
24          * Replication status. (MASTER, MASTER_STOP, SLAVE, SLAVE_STOP, SINGLE, OUT)
25          */
26         public ReplicationStatus replicationMode;
27         
28         /**
29          * SNMP Agent status. (CONNECTING, NON_CONNECTING)
30          */
31         public SnmpAgentStatus snmpStatus;
32         
33         /**
34          * l7vsd log level
35          */
36         public HashMap<LogData.LogCategory, LogData.LogLevel> l7vsdLogLevel;
37         
38         /**
39          * SNMP Agent log level
40          */
41         public HashMap<LogData.LogCategory, LogData.LogLevel> snmpLogLevel;
42         
43         private Logger ioCommandLogger = Logger.getLogger(LogCategorySet.GUI_IO_COMMAND); 
44
45         /**
46          * 
47          * Constructor
48          *
49          */
50         public L7vsAdmData() {
51         // --- debug log (constructor) ---
52         if (ioCommandLogger.isDebugEnabled()) {
53             ioCommandLogger.debug("11509 class L7vsAdmData created.");
54         }
55         // --- debug log (constructor) ---
56
57                 this.virtualSettings = new Vector<VirtualSetting>();
58                 this.l7vsdLogLevel = new HashMap<LogData.LogCategory, LogData.LogLevel>();
59                 this.snmpLogLevel = new HashMap<LogData.LogCategory, LogData.LogLevel>();
60                 this.replicationMode = ReplicationStatus.OUT;
61                 this.snmpStatus = SnmpAgentStatus.NON_CONNECTING;
62         }
63
64         /**
65          * 
66          * <p> equals method</p>
67          *
68          * @param admData
69          * @return Compares this L7vsAdmData to the specified object. 
70          *                      The result is true if and only if the argument is not null
71          *                      and is a L7vsAdmData object that represents the same field as this object. 
72          */
73         public boolean equals(L7vsAdmData admData) {
74         // --- debug log (in method) ---
75         if (ioCommandLogger.isDebugEnabled()) {
76             ioCommandLogger.debug("11510 L7vsAdmData::equals(L7vsAdmData admData) in admData=(" + admData + ")");
77         }
78         // --- debug log (in method) ---
79
80                 if (admData != null &&
81                         this.virtualSettings.equals(admData.virtualSettings) &&
82                         this.replicationMode == admData.replicationMode &&
83                         this.snmpStatus == admData.snmpStatus &&
84                         this.l7vsdLogLevel.equals(admData.l7vsdLogLevel) &&
85                         this.snmpLogLevel.equals(admData.snmpLogLevel)) {
86                 // --- debug log (in method) ---
87                 if (ioCommandLogger.isDebugEnabled()) {
88                     ioCommandLogger.debug("11511 L7vsAdmData::equals(L7vsAdmData admData) out return=true");
89                 }
90                 // --- debug log (in method) ---
91                         return true;
92                 }
93                 
94         // --- debug log (in method) ---
95         if (ioCommandLogger.isDebugEnabled()) {
96             ioCommandLogger.debug("11512 L7vsAdmData::equals(L7vsAdmData admData) out return=false");
97         }
98         // --- debug log (in method) ---
99                 return false;
100         }
101         
102         /**
103          * 
104          * {@inheritDoc}
105          */
106         public String toString() {
107                 return 
108                         "virtualSettings=" + this.virtualSettings + ", " +
109                         "replicationMode=" + this.replicationMode + ", " +
110                         "snmpLogLevel=" + this.snmpLogLevel + ", " +
111                         "l7vsdLogLevel=" + this.l7vsdLogLevel + ", " +
112                         "snmpLogLevel=" + this.snmpLogLevel;
113         }
114 }