pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.request
Interface ServiceSession

All Superinterfaces:
JDOMable, java.io.Serializable
All Known Implementing Classes:
HttpBoundSession

public interface ServiceSession
extends JDOMable, java.io.Serializable

The ServiceSession associated with the request to the pulse service.

Version:
$Revision: 1741 $
Author:
Thomas Weber

Method Summary
 void addSessionRole(Role role)
          Adds the given Role to the to the Roles only valid for the session.
 java.io.Serializable getAttribute(java.lang.String name)
          returns the Serializable bound with the specified name in this ServiceSession, or <strong>null</strong> if no Serializable is bound under the name.
 java.util.Set<java.lang.String> getAttributeNames()
          returns a List with the attribute names of this ServiceSession.
 long getCreationTime()
          get the time when this ServiceSession was created, measured in milliseconds since midnight January 1, 1970 GMT.
 byte[] getSecret()
          returns a per session secret which is used in token computation.
 java.util.Set<Role> getSessionRoles()
          Returns the Roles only valid for the session.
 boolean hasState()
          returns whether the ServiceSession has a different state than upon creation.
 boolean isBound()
          returns whether the ServiceSession is actually bound to the underlying session management.
 void removeAttribute(java.lang.String name)
          removes an attribute from the ServiceSession.
 void setAttribute(java.lang.String name, java.io.Serializable value)
          add an attribute to the ServiceSession.
 
Methods inherited from interface org.torweg.pulse.bundle.JDOMable
deserializeToJDOM
 

Method Detail

isBound

boolean isBound()
returns whether the ServiceSession is actually bound to the underlying session management.

Returns:
true, if and only if the ServiceSession is bound to the underlying session management. Otherwise false.

hasState

boolean hasState()
returns whether the ServiceSession has a different state than upon creation.

Returns:
true, if and only if the ServiceSession has a different state than upon creation. Otherwise false.

getAttribute

java.io.Serializable getAttribute(java.lang.String name)
returns the Serializable bound with the specified name in this ServiceSession, or <strong>null</strong> if no Serializable is bound under the name.

Parameters:
name - the attribute's name
Returns:
the attribute bound with the specified name

getAttributeNames

java.util.Set<java.lang.String> getAttributeNames()
returns a List with the attribute names of this ServiceSession.

Returns:
the list of attribute names

getCreationTime

long getCreationTime()
get the time when this ServiceSession was created, measured in milliseconds since midnight January 1, 1970 GMT.

Returns:
the creation time

setAttribute

void setAttribute(java.lang.String name,
                  java.io.Serializable value)
add an attribute to the ServiceSession.

Any previously added attributes of the same name will be removed from the ServiceSession and be replaced by the specified value.

Parameters:
name - the attribute's name
value - the attribute's value

removeAttribute

void removeAttribute(java.lang.String name)
removes an attribute from the ServiceSession.

Parameters:
name - the attribute to be removed

getSecret

byte[] getSecret()
returns a per session secret which is used in token computation.

Implementations must not return null under any circumstances!

Returns:
a per session secret.
See Also:
RequireToken

addSessionRole

void addSessionRole(Role role)
Adds the given Role to the to the Roles only valid for the session.

Parameters:
role - the Role to add

getSessionRoles

java.util.Set<Role> getSessionRoles()
Returns the Roles only valid for the session.

Returns:
the Roles