1 package org.ultramonkey.l7.controller;
3 import java.io.Serializable;
5 import org.apache.log4j.Logger;
6 import org.ultramonkey.l7.model.LogCategorySet;
14 * Copyright(c) NTT COMWARE 2008
19 public class EndPoint implements Serializable {
20 static final long serialVersionUID = 1L;
43 * Inactive connections
45 public long inActConn;
53 // --- debug log (constructor) ---
54 Logger vsLogger = Logger.getLogger(LogCategorySet.GUI_VIRTUALSERVICE);
55 if (vsLogger.isDebugEnabled()) {
56 vsLogger.debug("11513 class EndPoint created.");
58 // --- debug log (constructor) ---
69 * Constructor for real server
77 public EndPoint(String host, String port, int weight, long actConn,
79 // --- debug log (constructor) ---
80 Logger vsLogger = Logger.getLogger(LogCategorySet.GUI_VIRTUALSERVICE);
81 if (vsLogger.isDebugEnabled()) {
82 vsLogger.debug("11514 class EndPoint created.");
84 // --- debug log (constructor) ---
89 this.host = new String(host);
93 this.port = new String(port);
95 this.actConn = actConn;
96 this.inActConn = inActConn;
101 * Constructor for virtual service, sorry server
106 public EndPoint(String host, String port) {
107 // --- debug log (constructor) ---
108 Logger vsLogger = Logger.getLogger(LogCategorySet.GUI_VIRTUALSERVICE);
109 if (vsLogger.isDebugEnabled()) {
110 vsLogger.debug("11515 class EndPoint created.");
112 // --- debug log (constructor) ---
117 this.host = new String(host);
121 this.port = new String(port);
133 public EndPoint(EndPoint e) {
134 // --- debug log (constructor) ---
135 Logger vsLogger = Logger.getLogger(LogCategorySet.GUI_VIRTUALSERVICE);
136 if (vsLogger.isDebugEnabled()) {
137 vsLogger.debug("11516 class EndPoint created.");
139 // --- debug log (constructor) ---
149 this.host = new String(e.host);
151 this.port = new String(e.port);
152 this.weight = e.weight;
153 this.actConn = e.actConn;
154 this.inActConn = e.inActConn;
167 public boolean equals(EndPoint e) {
168 // --- debug log (in method) ---
169 Logger vsLogger = Logger.getLogger(LogCategorySet.GUI_VIRTUALSERVICE);
170 if (vsLogger.isDebugEnabled()) {
171 vsLogger.debug("11517 EndPoint::equals(EndPoint e) in e=(" + e + ")");
173 // --- debug log (in method) ---
175 if (e != null && this.host.equals(e.host) && this.port.equals(e.port)) {
176 // --- debug log (out method) ---
177 if (vsLogger.isDebugEnabled()) {
178 vsLogger.debug("11518 EndPoint::equals(EndPoint e) out return=true");
180 // --- debug log (out method) ---
184 // --- debug log (out method) ---
185 if (vsLogger.isDebugEnabled()) {
186 vsLogger.debug("11519 EndPoint::equals(EndPoint e) out return=false");
188 // --- debug log (out method) ---
196 public String toString() {
198 "host=\"" + host + "\", " +
199 "port=\"" + port + "\", " +
200 "weight=" + weight + ", " +
201 "actConn=" + actConn + ", " +
202 "inActConn=" + inActConn;