Methods Summary |
---|
public void | clearPassword()Clear the password field.
this.password = null;
|
public java.lang.Object | clone()Copies the current instance.
UserInfo retval = new UserInfo();
try {
retval.setUser(user);
retval.setPassword(password);
} catch (IllegalArgumentException e) {
// intentionally ignored
// it shoild be impossible to get here due to this.user
// and this.password are verified values
}
return retval;
|
public java.lang.String | encode()Encode the user information as a string.
if (password != null) {
return new StringBuffer().
append(user).append(Separators.COLON).
append(password).toString();
} else {
return user;
}
|
public boolean | equals(java.lang.Object obj)Compare for equality.
if (!getClass().getName().equals(obj.getClass().getName())) {
return false;
}
UserInfo other = (UserInfo) obj;
if (this.userType != other.userType) {
return false;
}
String u1 = this.user;
String u2 = other.user;
if (u1 == null) u1 = "";
if (u2 == null) u2 = "";
if (!u1.toLowerCase().equals
(u2.toLowerCase())) {
return false;
}
u1 = this.password;
u2 = other.password;
if (u1 == null) u1 = "";
if (u2 == null) u2 = "";
if (!u1.equals(u2)) {
return false;
}
return (true);
|
public java.lang.String | getPassword()Get the password field.
return password;
|
public java.lang.String | getUser()Get the user field.
return user;
|
public int | getUserType()Gets the user type (which can be set to TELEPHONE_SUBSCRIBER or USER).
return userType;
|
public void | setPassword(java.lang.String p)Set the password member.
// IMPL_NOTE: check for the password validity
password = p;
|
public void | setUser(java.lang.String user)Set the user member.
if (false == Lexer.isValidUserName(user)) {
throw new IllegalArgumentException("User name '" + user +
"' contains " +
"illegal characters");
}
this.user = user;
// add this (taken form sip_messageParser)
// otherwise comparison of two SipUrl will fail because this
// parameter is not set (whereas it is set in sip_messageParser).
if (user != null && (user.indexOf(Separators.POUND) >= 0 ||
user.indexOf(Separators.SEMICOLON) >= 0)) {
setUserType(UserInfo.TELEPHONE_SUBSCRIBER);
} else {
setUserType(UserInfo.USER);
}
|
public void | setUserType(int type)Set the user type (to TELEPHONE_SUBSCRIBER or USER).
if (type != TELEPHONE_SUBSCRIBER && type != USER) {
throw new IllegalArgumentException
("Parameter not in range");
}
userType = type;
|