org.ow2.jonas.lib.management.domain
Class AuthenticationInformation
java.lang.Object
org.ow2.jonas.lib.management.domain.AuthenticationInformation
public final class AuthenticationInformation
- extends Object
Stores the authentication information for a server.
- Author:
- S. Ali Tokmen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuthenticationInformation
public AuthenticationInformation(String username,
String password)
throws UnsupportedEncodingException
- Saves the authentication information.
- Parameters:
username
- user namepassword
- password, may be encoded in the following formats:
- None, don't prefix at all
- Encoded using base64, prefix with {base64}
- Throws:
UnsupportedEncodingException
- If password is not base64 encoded UTF-8
getUsername
public String getUsername()
- Returns:
- the username
getPassword
public String getPassword()
- Returns:
- the password, original format
decodePassword
public String decodePassword()
throws UnsupportedEncodingException
- Returns:
- the password, decoded format
- Throws:
UnsupportedEncodingException
- Shouldn't be thrown since
constructor already checks for it.
encodePassword
public static String encodePassword(String password)
throws UnsupportedEncodingException
- Encode a password.
- Parameters:
password
- Password to encode.
- Returns:
- Encoded password.
- Throws:
UnsupportedEncodingException
- If password is not UTF-8 encoded.
Copyright © 2010 OW2 Consortium. All Rights Reserved.