org.resoa.node.core
Class ResoaSecurity

java.lang.Object
  extended by org.resoa.node.core.ResoaSecurity

public class ResoaSecurity
extends java.lang.Object

ResoaSecurity manages the session and permissions of Resoa nodes.


Nested Class Summary
 class ResoaSecurity.RestSessionDescriptor
          A helper class for caching RestSessions
 
Constructor Summary
ResoaSecurity(ResoaBaseGateway gateway)
          Constructor sets Protocol Stack and ResoaGateway handlers and instances internal objects
 
Method Summary
 void awakeRestSession(org.resoa.topology.RestSession session, int newTimeOut, boolean broadCastToController)
          Awakes a RestSession.
 ResoaSecurity.RestSessionDescriptor cacheRestSession(org.resoa.topology.RestSession session, int timeOut)
          Cache a RestSession handle in local session cache
 void disconnectSessions()
          Disconnects all base sessions.
 ResoaSecurity.RestSessionDescriptor getRestSessionDescriptor(java.lang.String sessionID)
          Returns RestSessionDescriptor from local cache or from controller.
 org.resoa.topology.RestSession getRestSessionFromCache(java.lang.String sessionID)
          Returns a RestSession handle
 javolution.util.FastMap<java.lang.String,org.resoa.topology.Permission> getStackPermission(org.resoa.grid.GridSession session)
          Returns stack session permission list
 javolution.util.FastMap<java.lang.String,org.resoa.topology.Permission> mapPermissions(java.util.List<org.resoa.topology.Permission> perms)
          Creates map for domain - permission relationship
 void removeIdleSession()
          Removes idle REST sessions
 org.resoa.topology.RestSession removeRestSession(java.lang.String sessionID)
          Removes a Rest session from cahce
 void removeStackSession(java.lang.String stackSessionID)
          Remove a stack session handle from cache
 void stackSessionAuthorized(org.resoa.grid.GridSession session, java.util.List<org.resoa.topology.Permission> perms)
          Set a base session as authorized (registers session and sets permissions)
 void updateStackPermission(java.lang.String stackSession, java.util.List<org.resoa.topology.Permission> newPermission)
          Sets/updates permissions for a base session
 org.resoa.topology.NodeState updateState(org.resoa.topology.NodeState currState)
          Updates nodeState monitoring instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResoaSecurity

public ResoaSecurity(ResoaBaseGateway gateway)
Constructor sets Protocol Stack and ResoaGateway handlers and instances internal objects

Parameters:
gateway - the underlying gateway
Method Detail

mapPermissions

public javolution.util.FastMap<java.lang.String,org.resoa.topology.Permission> mapPermissions(java.util.List<org.resoa.topology.Permission> perms)
Creates map for domain - permission relationship

Parameters:
perms - a List of permissions
Returns:
the domain mapped permissions

getRestSessionFromCache

public org.resoa.topology.RestSession getRestSessionFromCache(java.lang.String sessionID)
Returns a RestSession handle

Parameters:
sessionID - the session ID or null, if a new session should be created
Returns:
the RestSession handle or null, if not present

getStackPermission

public javolution.util.FastMap<java.lang.String,org.resoa.topology.Permission> getStackPermission(org.resoa.grid.GridSession session)
                                                                                           throws org.resoa.exception.InvalidSessionException
Returns stack session permission list

Parameters:
session - the session
Returns:
The domain mapped permissions of the stack session.
Throws:
org.resoa.exception.InvalidSessionException

getRestSessionDescriptor

public ResoaSecurity.RestSessionDescriptor getRestSessionDescriptor(java.lang.String sessionID)
Returns RestSessionDescriptor from local cache or from controller.

Parameters:
sessionID - the rest sessionID
Returns:
the RestSessionDescriptor
Throws:
org.resoa.exception.InvalidSessionException

updateStackPermission

public void updateStackPermission(java.lang.String stackSession,
                                  java.util.List<org.resoa.topology.Permission> newPermission)
Sets/updates permissions for a base session

Parameters:
stackSession - the stack session
newPermission - the new permissions

disconnectSessions

public void disconnectSessions()
Disconnects all base sessions.


cacheRestSession

public ResoaSecurity.RestSessionDescriptor cacheRestSession(org.resoa.topology.RestSession session,
                                                            int timeOut)
Cache a RestSession handle in local session cache

Parameters:
session - the RestSession
timeOut - the timeout

awakeRestSession

public void awakeRestSession(org.resoa.topology.RestSession session,
                             int newTimeOut,
                             boolean broadCastToController)
Awakes a RestSession. This prevents a timeout and removal from cache. Automatically invoked, if a service request call happens on behalf of this session.

Parameters:
session - the RestSession handle
newTimeOut - the new timeout to set
broadCastToController - true, if the awake should be broadcasted to controller

removeRestSession

public org.resoa.topology.RestSession removeRestSession(java.lang.String sessionID)
Removes a Rest session from cahce

Parameters:
sessionID - the Rest session ID

removeIdleSession

public void removeIdleSession()
Removes idle REST sessions


stackSessionAuthorized

public void stackSessionAuthorized(org.resoa.grid.GridSession session,
                                   java.util.List<org.resoa.topology.Permission> perms)
Set a base session as authorized (registers session and sets permissions)

Parameters:
session - the stack session
perms - the permissions for the stack session

removeStackSession

public void removeStackSession(java.lang.String stackSessionID)
Remove a stack session handle from cache

Parameters:
stackSessionID -

updateState

public org.resoa.topology.NodeState updateState(org.resoa.topology.NodeState currState)
Updates nodeState monitoring instance

Parameters:
currState - the state object, where updates should be set
Returns:
the state object


Read more about license conditions at www.resoa.org.