org.wso2.carbon.registry.core.session
Class CurrentSession

java.lang.Object
  extended by org.wso2.carbon.registry.core.session.CurrentSession

public final class CurrentSession
extends Object

A class to keep track of the session associated with a registry operation. This session values are only valid inside it is call tree that root any operation go trough user registry.


Method Summary
static Object getAttribute(String key)
          Methods to return the session attribute.
static int getCallerTenantId()
          Methods that abstract the set and get of the stack values.
static String getChroot()
          Methods that abstract the set and get of the stack values.
static Map<String,String> getLocalPathMap()
          Methods that abstract the set and get of the stack values.
static int getTenantId()
          Methods that abstract the set and get of the stack values.
static String getUser()
          Methods that abstract the set and get of the stack values of user realm.
static org.wso2.carbon.user.core.UserRealm getUserRealm()
          Methods that abstract the set and get of the stack values of user realm.
static UserRegistry getUserRegistry()
          Methods that abstract the set and get of the stack values.
static void removeAttribute(String key)
          Remove named session attribute.
static void removeAttributes()
          Remove all the session attributes.
static void removeCallerTenantId()
          Remove the callers tenant id from the session stack.
static void removeChroot()
          Remove the chroot from the session stack.
static void removeLocalPathMap()
          Remove the local path map from the session stack.
static void removeTenantId()
          Remove the tenant id from the session stack.
static void removeUser()
          Remove the user from the session stack.
static void removeUserRealm()
          Remove the user realm from the session stack.
static void removeUserRegistry()
          Remove the user registry from the session stack.
static void setAttribute(String key, Object value)
          Method to set session attributes
static void setCallerTenantId(int callerTenantId)
          Inserting the callers tenant id to the session stack.
static void setChroot(String chroot)
          Inserting the chroot to the session stack.
static void setLocalPathMap(Map<String,String> localPathMap)
          Inserting the local path map to the session stack.
static void setTenantId(int tenantId)
          Inserting the tenant id to the session stack.
static void setUser(String userID)
          Inserting the user to the session stack.
static void setUserRealm(org.wso2.carbon.user.core.UserRealm userRealm)
          Inserting the user realm to the session stack.
static void setUserRegistry(UserRegistry userRegistry)
          Inserting the user registry to the session stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getUser

public static String getUser()
Methods that abstract the set and get of the stack values of user realm.

Returns:
the current associated with the session.

setUser

public static void setUser(String userID)
Inserting the user to the session stack.

Parameters:
userID - the id of th user

removeUser

public static void removeUser()
Remove the user from the session stack.


getUserRealm

public static org.wso2.carbon.user.core.UserRealm getUserRealm()
Methods that abstract the set and get of the stack values of user realm.

Returns:
the user realm associated with the session.

setUserRealm

public static void setUserRealm(org.wso2.carbon.user.core.UserRealm userRealm)
Inserting the user realm to the session stack.

Parameters:
userRealm - the user realm.

removeUserRealm

public static void removeUserRealm()
Remove the user realm from the session stack.


getTenantId

public static int getTenantId()
Methods that abstract the set and get of the stack values.

Returns:
the tenant id associated with the session.

setTenantId

public static void setTenantId(int tenantId)
Inserting the tenant id to the session stack.

Parameters:
tenantId - the tenant id.

removeTenantId

public static void removeTenantId()
Remove the tenant id from the session stack.


getCallerTenantId

public static int getCallerTenantId()
Methods that abstract the set and get of the stack values.

Returns:
the callers tenant id associated with the session.

setCallerTenantId

public static void setCallerTenantId(int callerTenantId)
Inserting the callers tenant id to the session stack.

Parameters:
callerTenantId - the callers tenant id

removeCallerTenantId

public static void removeCallerTenantId()
Remove the callers tenant id from the session stack.


getChroot

public static String getChroot()
Methods that abstract the set and get of the stack values.

Returns:
the chroot associated with the session.

setChroot

public static void setChroot(String chroot)
Inserting the chroot to the session stack.

Parameters:
chroot - the chroot.

removeChroot

public static void removeChroot()
Remove the chroot from the session stack.


getUserRegistry

public static UserRegistry getUserRegistry()
Methods that abstract the set and get of the stack values.

Returns:
the user registry associated with the session.

setUserRegistry

public static void setUserRegistry(UserRegistry userRegistry)
Inserting the user registry to the session stack.

Parameters:
userRegistry - the user registry.

removeUserRegistry

public static void removeUserRegistry()
Remove the user registry from the session stack.


getLocalPathMap

public static Map<String,String> getLocalPathMap()
Methods that abstract the set and get of the stack values.

Returns:
the local path map associated with the session.

setLocalPathMap

public static void setLocalPathMap(Map<String,String> localPathMap)
Inserting the local path map to the session stack.

Parameters:
localPathMap - the local path map.

removeLocalPathMap

public static void removeLocalPathMap()
Remove the local path map from the session stack.


getAttribute

public static Object getAttribute(String key)
Methods to return the session attribute.

Parameters:
key - the parameter key
Returns:
the object of the attribute

setAttribute

public static void setAttribute(String key,
                                Object value)
Method to set session attributes

Parameters:
key - the session attribute key
value - the session attribute value

removeAttributes

public static void removeAttributes()
Remove all the session attributes.


removeAttribute

public static void removeAttribute(String key)
Remove named session attribute.

Parameters:
key - key of attribute to be removed


Copyright © 2012 WSO2 Inc. All Rights Reserved.