org.nakedobjects.metamodel.authentication
Class AuthenticationSessionAbstract

java.lang.Object
  extended by org.nakedobjects.metamodel.authentication.AuthenticationSessionAbstract
All Implemented Interfaces:
java.io.Serializable, AuthenticationSession, Encodable
Direct Known Subclasses:
AuthenticationSessionNoRuntime

public abstract class AuthenticationSessionAbstract
extends java.lang.Object
implements AuthenticationSession, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
AuthenticationSessionAbstract(DataInputExtended input)
           
AuthenticationSessionAbstract(java.lang.String name, java.util.List<java.lang.String> roles, java.lang.String code)
           
AuthenticationSessionAbstract(java.lang.String name, java.lang.String code)
           
 
Method Summary
 void encode(DataOutputExtended output)
          Returns the domain object's value as an encoded byte array via the encoder.
 java.lang.Object getAttribute(java.lang.String attributeName)
          For viewers (in particular) to store additional attributes, analogous to an HttpSession.
 java.util.List<java.lang.String> getRoles()
          Can be overridden.
 java.lang.String getUserName()
          The name of the authenticated user; for display purposes only.
 java.lang.String getValidationCode()
          A unique code given to this session during authentication.
 boolean hasUserNameOf(java.lang.String userName)
           
 void setAttribute(java.lang.String attributeName, java.lang.Object attribute)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuthenticationSessionAbstract

public AuthenticationSessionAbstract(java.lang.String name,
                                     java.lang.String code)

AuthenticationSessionAbstract

public AuthenticationSessionAbstract(java.lang.String name,
                                     java.util.List<java.lang.String> roles,
                                     java.lang.String code)

AuthenticationSessionAbstract

public AuthenticationSessionAbstract(DataInputExtended input)
                              throws java.io.IOException
Throws:
java.io.IOException
Method Detail

encode

public void encode(DataOutputExtended output)
            throws java.io.IOException
Description copied from interface: Encodable
Returns the domain object's value as an encoded byte array via the encoder.

Specified by:
encode in interface Encodable
Throws:
java.io.IOException

getUserName

public java.lang.String getUserName()
Description copied from interface: AuthenticationSession
The name of the authenticated user; for display purposes only.

Specified by:
getUserName in interface AuthenticationSession

hasUserNameOf

public boolean hasUserNameOf(java.lang.String userName)
Specified by:
hasUserNameOf in interface AuthenticationSession

getRoles

public java.util.List<java.lang.String> getRoles()
Can be overridden.

Specified by:
getRoles in interface AuthenticationSession

getValidationCode

public java.lang.String getValidationCode()
Description copied from interface: AuthenticationSession
A unique code given to this session during authentication.

This can be used to confirm that this session has been properly created and the user has been authenticated. It should return an empty string ("") if this is unauthenticated user (i.e., as created within an exploration system).

Specified by:
getValidationCode in interface AuthenticationSession

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)
Description copied from interface: AuthenticationSession
For viewers (in particular) to store additional attributes, analogous to an HttpSession.

Specified by:
getAttribute in interface AuthenticationSession

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.Object attribute)
Specified by:
setAttribute in interface AuthenticationSession
See Also:
AuthenticationSession.getAttribute(String)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.