org.xcmis.spi
Class UserContext

java.lang.Object
  extended by org.xcmis.spi.UserContext

public final class UserContext
extends Object

Holder information about current caller.

Version:
$Id: UserContext.java 1676 2010-09-09 10:23:40Z andrew00x $
Author:
Andrey Parfonov

Field Summary
static Permission USER_CONTEXT_PERMISSION
           
 
Constructor Summary
UserContext(String userId)
          Create new context for user with specified ID.
 
Method Summary
static UserContext getCurrent()
          Get context of current caller.
 String getProperty(String name)
          Get optional context property with specified name.
 String getUserId()
          Get user's ID.
static void setCurrent(UserContext ctx)
          Set context of current caller.
 void setProperty(String name, String value)
          Update or set property.To be able do this java.lang.RuntimePermission "updateUserContext" required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_CONTEXT_PERMISSION

public static final Permission USER_CONTEXT_PERMISSION
Constructor Detail

UserContext

public UserContext(String userId)
Create new context for user with specified ID.

Parameters:
userId - user's ID
Method Detail

getCurrent

public static UserContext getCurrent()
Get context of current caller.

Returns:
current user context or null if current context is not initialized yet

setCurrent

public static void setCurrent(UserContext ctx)
Set context of current caller. To be able do this java.lang.RuntimePermission "updateUserContext" required.

Throws:
SecurityException - if operation is not permitted
See Also:
SecurityManager, Permission

getUserId

public String getUserId()
Get user's ID.

Returns:
user's ID

getProperty

public String getProperty(String name)
Get optional context property with specified name.

Parameters:
name - property name
Returns:
property value or null

setProperty

public void setProperty(String name,
                        String value)
Update or set property.To be able do this java.lang.RuntimePermission "updateUserContext" required.

Parameters:
name - property name
value - property value
Throws:
SecurityException - if operation is not permitted
See Also:
SecurityManager, Permission


Copyright © 2011 eXo Platform SAS. All Rights Reserved.