Class UserContext
java.lang.Object
com.suncode.pwfl.administration.user.UserContext
- All Implemented Interfaces:
Context
Context that holds informations about current user.- Author:
- Cezary Kozar 14 cze 2016
-
Method Summary
Modifier and TypeMethodDescriptionstatic UserContextActivates context of given user socurrent()will return context created for given user.static voidactivate(UserInfo user, InContext<UserContext> action) Activates context of given user and invokes provided action in created context.static UserContextActivates context of given user socurrent()will return context created for given user.static UserContextcurrent()Returns current user context.static UserContextDeactivates current user contextgetUser()Returns user associated with this context.Returns serialized user in JSON notation.static booleanisActive()Returns true if this context is active.name()Returns this context name (for identification purposes)
-
Method Details
-
name
Description copied from interface:ContextReturns this context name (for identification purposes) -
getUser
Returns user associated with this context.- Returns:
- user
-
getUserJson
Returns serialized user in JSON notation.- Returns:
- json representation of user
-
isActive
public static boolean isActive()Returns true if this context is active. -
current
Returns current user context.- Throws:
ContextNotActiveException
-
activate
Activates context of given user socurrent()will return context created for given user.- Parameters:
userName- user name- Returns:
- user context
-
activate
Activates context of given user socurrent()will return context created for given user.- Parameters:
user- user- Returns:
- user context
-
activate
Activates context of given user and invokes provided action in created context.- Parameters:
user- useraction- action executed in user context
-
deactivate
Deactivates current user context- Returns:
- deactivated context
-