001: /*
002: * <copyright>
003: *
004: * Copyright 2000-2004 BBNT Solutions, LLC
005: * under sponsorship of the Defense Advanced Research Projects
006: * Agency (DARPA).
007: *
008: * You can redistribute this software and/or modify it under the
009: * terms of the Cougaar Open Source License as published on the
010: * Cougaar Open Source Website (www.cougaar.org).
011: *
012: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023: *
024: * </copyright>
025: */
026:
027: package org.cougaar.tools.csmart.ui.console;
028:
029: import org.cougaar.tools.server.RemoteHost;
030:
031: import java.util.List;
032: import java.util.Properties;
033:
034: /**
035: * The information needed to start, stop or attach to a running node.
036: * Used to exchange information between the CSMARTConsole and
037: * AppServerSupport classes.
038: */
039:
040: public final class NodeInfo {
041: private final RemoteHost appServer;
042: private final String nodeName;
043: private final String hostName;
044: private final Properties properties;
045: private final List args;
046:
047: public NodeInfo(final RemoteHost appServer, final String nodeName,
048: final String hostName, final Properties properties,
049: final List args) {
050: this .appServer = appServer;
051: this .nodeName = nodeName;
052: this .hostName = hostName;
053: this .properties = properties;
054: this .args = args;
055: }
056:
057: public RemoteHost getAppServer() {
058: return appServer;
059: }
060:
061: public String getNodeName() {
062: return nodeName;
063: }
064:
065: public String getHostName() {
066: return hostName;
067: }
068:
069: public Properties getProperties() {
070: return properties;
071: }
072:
073: public List getArgs() {
074: return args;
075: }
076:
077: public boolean equals(final Object o) {
078: if (this == o)
079: return true;
080: if (!(o instanceof NodeInfo))
081: return false;
082:
083: final NodeInfo nodeInfo = (NodeInfo) o;
084:
085: if (!appServer.equals(nodeInfo.appServer))
086: return false;
087: if (!args.equals(nodeInfo.args))
088: return false;
089: if (!hostName.equals(nodeInfo.hostName))
090: return false;
091: if (!nodeName.equals(nodeInfo.nodeName))
092: return false;
093: if (!properties.equals(nodeInfo.properties))
094: return false;
095:
096: return true;
097: }
098:
099: public int hashCode() {
100: int result;
101: result = appServer.hashCode();
102: result = 29 * result + nodeName.hashCode();
103: result = 29 * result + hostName.hashCode();
104: result = 29 * result + properties.hashCode();
105: result = 29 * result + args.hashCode();
106: return result;
107: }
108: }
|