FileDocCategorySizeDatePackage
LoginInfo.javaAPI DocGlassfish v2 API4629Fri May 04 22:30:32 BST 2007com.sun.appserv.management.client.prefs

LoginInfo

public final class LoginInfo extends Object implements Comparable
An immutable class that represents an arbitrary LoginInfo for Appserver Administration Client. A LoginInfo is specific to an admin host and admin port. Thus, with this scheme, there can be at the most one LoginInfo for an operating system user of Appserver, for a given admin host and admin port.
since
Appserver 9.0

Fields Summary
private String
host
private int
port
private String
user
private String
password
Constructors Summary
public LoginInfo(String host, int port, String user, String password)
Creates an Immutable instance of a LoginInfo from given 4-tuple. The host, user and password may not be null. The port may not be a negative integer.

param
host String representing host
param
port integer representing port
param
user String representing user
param
password String representing password
throws
IllegalArgumentException if parameter contract is violated

        if (host == null || port < 0 || user == null || password == null)
            throw new IllegalArgumentException("null value"); // TODO
        init(host, port, user, password);
    
Methods Summary
public intcompareTo(com.sun.appserv.management.client.prefs.LoginInfo that)

        final String thisKey = this.user + this.host + this.port;
        final String thatKey = that.user + that.host + that.port;        
        return ( thisKey.compareTo(thatKey) );
    
public booleanequals(java.lang.Object other)

        boolean same = false;
        if (other instanceof LoginInfo) {
            final LoginInfo that = (LoginInfo) other;
            same = this.host.equals(that.host) &&
                   this.port == that.port      &&
                   this.user.equals(that.user) &&
                   this.password.equals(that.password);
        }
        return ( same );
    
public java.lang.StringgetHost()

        return ( host );
    
public java.lang.StringgetPassword()

        return ( password );
    
public intgetPort()

        return ( port );
    
public java.lang.StringgetUser()

        return ( user );
    
public inthashCode()

        return ( (int) 31 * host.hashCode() + 23 * port + 53 * user.hashCode() + 13 * password.hashCode() );
    
private voidinit(java.lang.String host, int port, java.lang.String user, java.lang.String password)

        this.host     = host;
        this.port     = port;
        this.user     = user;
        this.password = password;
    
public java.lang.StringtoString()

        return ( host + port + user + password );