LoginInfopublic final class LoginInfo extends Object implements ComparableAn 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. |
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.
if (host == null || port < 0 || user == null || password == null)
throw new IllegalArgumentException("null value"); // TODO
init(host, port, user, password);
|
Methods Summary |
---|
public int | compareTo(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 boolean | equals(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.String | getHost()
return ( host );
| public java.lang.String | getPassword()
return ( password );
| public int | getPort()
return ( port );
| public java.lang.String | getUser()
return ( user );
| public int | hashCode()
return ( (int) 31 * host.hashCode() + 23 * port + 53 * user.hashCode() + 13 * password.hashCode() );
| private void | init(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.String | toString()
return ( host + port + user + password );
|
|