org.ow2.jonas.lib.management.domain
Class AuthenticationInformation

java.lang.Object
  extended by org.ow2.jonas.lib.management.domain.AuthenticationInformation

public final class AuthenticationInformation
extends Object

Stores the authentication information for a server.

Author:
S. Ali Tokmen

Constructor Summary
AuthenticationInformation(String username, String password)
          Saves the authentication information.
 
Method Summary
 String decodePassword()
           
static String encodePassword(String password)
          Encode a password.
 String getPassword()
           
 String getUsername()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationInformation

public AuthenticationInformation(String username,
                                 String password)
                          throws UnsupportedEncodingException
Saves the authentication information.

Parameters:
username - user name
password - 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
Method Detail

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.