FileDocCategorySizeDatePackage
ServerConnectionIdentifier.javaAPI DocGlassfish v2 API6693Fri May 04 22:34:36 BST 2007com.sun.enterprise.deployment.client

ServerConnectionIdentifier

public class ServerConnectionIdentifier extends Object
This class defines all necessary information to connect to a particular application server deployment backend.
author
Jerome Dochez

Fields Summary
private String
hostName
Holds value of property hostName.
private int
hostPort
Holds value of property hostPort.
private String
userName
Holds value of property userName.
private String
password
Holds value of property password.
private String
protocol
Holds value of property protocol.
private boolean
secure
private ServerConnectionEnvironment
env
Constructors Summary
public ServerConnectionIdentifier()
Creates a new instance of ServerConnectionIdentifier

    
           
      
    
Methods Summary
public booleanequals(java.lang.Object other)

return
true if I am the equals to the other object

        if (other instanceof ServerConnectionIdentifier) {
            ServerConnectionIdentifier dci = (ServerConnectionIdentifier) other;
            if (hostName==null) {
                return false;
            } else {
                if (!hostName.equals(dci.hostName))
                    return false;
            }
            if (hostPort!=dci.hostPort) {
                return false;
            }
            if (!getConnectionEnvironment().equals(dci.getConnectionEnvironment())) {
                return false;
            }
	    if (protocol==null) {
		return dci.protocol==null;
            } else { 
		return protocol.equals(dci.protocol);
            }
        } else {
            return false;
        }
    
public ServerConnectionEnvironmentgetConnectionEnvironment()

        if (env == null) {
            env = new ServerConnectionEnvironment();
        }
        return env;
    
public java.lang.StringgetHostName()
Getter for property hostName.

return
Value of property hostName.

        return this.hostName;
    
public intgetHostPort()
Getter for property hostPort.

return
Value of property hostPort.

        return this.hostPort;
    
public java.lang.StringgetPassword()
Getter for property password.

return
Value of property password.

        return this.password;
    
public java.lang.StringgetProtocol()
Getter for property protocol. the protocol can only be two values: either DefaultConfiguration.S1_HTTPS_PROTOCOL, if secure or DefaultConfiguration.S1_HTTP_PROTOCOL, if not secure

return
Value of property protocol.

        if (isSecure()) {
            return DefaultConfiguration.S1_HTTPS_PROTOCOL;
        } else {
            return DefaultConfiguration.S1_HTTP_PROTOCOL;
        }
    
public java.lang.StringgetUserName()
Getter for property userName.

return
Value of property userName.

        return this.userName;
    
public inthashCode()

        int result = 17;
        result = 37*result + (hostName == null ? 0 : hostName.hashCode());
        result = 37*result + hostPort;
        result = 37*result + getConnectionEnvironment().hashCode();
        result = 37*result + (protocol == null ? 0: protocol.hashCode());
        return result;
    
public booleanisSecure()

        return this.secure;
    
public voidsetConnectionEnvironment(ServerConnectionEnvironment env)

        this.env = env;
    
public voidsetHostName(java.lang.String hostName)
Setter for property hostName.

param
hostName New value of property hostName.

        this.hostName = hostName;
    
public voidsetHostPort(int hostPort)
Setter for property hostPort.

param
hostPort New value of property hostPort.

        this.hostPort = hostPort;
    
public voidsetPassword(java.lang.String password)
Setter for property password.

param
password New value of property password.

        this.password = password;
    
public voidsetSecure(boolean secure)

        this.secure = secure;
    
public voidsetUserName(java.lang.String userName)
Setter for property userName.

param
userName New value of property userName.

        this.userName = userName;
    
public java.lang.StringtoString()

        return getUserName()+"("+ getPassword()+")@(" + getHostName() 
            + "):(" + getHostPort()+")" + ":" + getProtocol();