Cumulus4j API
(1.1.0)

org.cumulus4j.keymanager.front.webapp
Class Auth

java.lang.Object
  extended by org.cumulus4j.keymanager.front.webapp.Auth
All Implemented Interfaces:
Serializable

public class Auth
extends Object
implements Serializable

Authentication information (username + password). Can be obtained in every REST service by sub-classing AbstractService and using AbstractService.getAuth() or AbstractService.authenticate(String).

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de
See Also:
Serialized Form

Constructor Summary
Auth()
          Create an empty instance.
Auth(String userName, char[] password)
          Create an instance with the given values.
 
Method Summary
 void clear()
          Clear the sensitive data from this Auth instance.
protected  void finalize()
           
 char[] getPassword()
           Get the password.
 String getUserName()
          Get the user-name.
 void setPassword(char[] password)
           Set the password.
 void setUserName(String userName)
          Set the user-name.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Auth

public Auth()
Create an empty instance.


Auth

public Auth(String userName,
            char[] password)
Create an instance with the given values.

Parameters:
userName - the user-name (might be null).
password - the password (might be null).
Method Detail

getUserName

public String getUserName()
Get the user-name.

Returns:
the user-name or null.

setUserName

public void setUserName(String userName)
Set the user-name.

Parameters:
userName - the user-name or null.

getPassword

public char[] getPassword()

Get the password.

Warning: the char-array returned by this method might be modified later (overwritten with 0), e.g. if clear() is called! If you want to use this char-array elsewhere, you must clone it immediately!

Returns:
the password or null.

setPassword

public void setPassword(char[] password)

Set the password.

Warning: the char-array passed to this method is modified (overwritten with 0), if clear() is called! If you want to use this char-array elsewhere, you must pass a clone here!

Parameters:
password - the password or null.

clear

public void clear()
Clear the sensitive data from this Auth instance. If the password is not null, it is overwritten with 0. This method is called by the finalize() method of this class!


finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.