Package com.emc.documentum.rest.config
Class RepositoryContextHolder
java.lang.Object
com.emc.documentum.rest.config.RepositoryContextHolder
A repository context holder contains the user credentials and other information for
an authenticated security context. It is thread-safe. The repository context holder
will be used first by the security modules to save the authenticated user credentials;
later, it will be used by the persistence to create new session managers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final Stringthe wild repository string -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clear everything in the repository context.static voidClear user name and credentials for the repository context.static ObjectgetAttribute(String attribute) Get the attribute value from the repository context by name.static AuthTypeGet the user authentication type the repository context.static BaseUriInfostatic com.documentum.fc.client.IDfSessionReturn the context session.static StringGet the default_folder for current userGet the locales for the login user.static StringGet the user login name for current userstatic ObjectGet the login ticket for client-token mode from the repository context.static ObjectGet the password of the login user.static LocaleGet the primary locale from the locales.static StringGet the repository for current user livesstatic UserExtendedPrivilegesGet user extended privileges of the login user.Get belonging user groups of the login user.static StringGet the r_object_id value for current user.static StringGet the user_name (instead of user_login_name) for current user The retrieval is done via a DQL query and is not very cheap and the retrieved user_login_name will be stored in ThreadLocal for later use and will be destroyed when the context is destroyedstatic intGet user privileges of the login user.static BooleanCheck from the repository context whether context session is enabled.static booleanCheck from the repository context whether the context session is transactional.static booleanisCurrentRepository(String repositoryName) Return true if the specified repository name is current user's login repositorystatic booleanisGroupAdmin(GroupObject group) Whether the current user is sepcified group's adminstatic booleanisGroupOwner(GroupObject group) Whether the current user is sepcified group's ownerstatic booleanWhether the current user is super userstatic booleanWhether the current user is sysAdminstatic booleanWhether the current user is sysAdmin or super userstatic voidSafely clear the context session.static voidsetAttribute(String attribute, Object value) Set an attribute into the repository context.static voidsetAuthType(AuthType authType) Set the user authentication type into the repository context.static voidset the base uri infostatic voidsetContextSession(com.documentum.fc.client.IDfSession session) Set the context session into the repository context.static voidsetContextSessionEnabled(Boolean enabled) Set the context session enabling into the repository context.static voidsetContextSessionTransactional(boolean b) Set the context session transaction for the repository context.static voidsetLocales(List<Locale> locales) Set the locales for the login user.static voidsetLoginName(String loginName) Set the login user name into the repository context.static voidsetLoginTicket(Object loginTicket) Set the login ticket for client-token mode from the repository context.static voidsetPassword(Object password) Set the user password into the repository context.static voidsetRepositoryName(String repositoryName) Set the repository name into the repository context.static voidsetUserName(String userName) Set the user name into the repository context.
-
Field Details
-
SUPER_USER
public static final int SUPER_USER- See Also:
-
SYS_ADMIN
public static final int SYS_ADMIN- See Also:
-
WILD_REPOSITORY
the wild repository string- See Also:
-
-
Method Details
-
getRepositoryName
Get the repository for current user lives- Returns:
- the repository name
-
getLoginName
Get the user login name for current user- Returns:
- user_login_name for current user
-
getUserName
Get the user_name (instead of user_login_name) for current user The retrieval is done via a DQL query and is not very cheap and the retrieved user_login_name will be stored in ThreadLocal for later use and will be destroyed when the context is destroyed- Returns:
- user_name for the current user
-
getUserId
Get the r_object_id value for current user.- Returns:
- r_object_id value for the current user.
-
getDefaultFolder
Get the default_folder for current user- Returns:
- default_folder for the current user
-
getUserPrivileges
public static int getUserPrivileges()Get user privileges of the login user.- Returns:
- the user privileges
-
getUserExtendedPrivileges
Get user extended privileges of the login user.- Returns:
- the user extended privileges
-
getUserGroups
Get belonging user groups of the login user.- Returns:
- the belonging user groups of the login user
-
getPassword
Get the password of the login user.- Returns:
- the password of the login user.
-
setRepositoryName
Set the repository name into the repository context.- Parameters:
repositoryName- the repository name
-
setBaseUriInfo
set the base uri info- Parameters:
uri- thr base uri
-
getBaseUriInfo
- Returns:
- the base uri info of current context
-
isCurrentRepository
Return true if the specified repository name is current user's login repository- Parameters:
repositoryName- the repository name- Returns:
trueif the specified repository is current user login repository
-
setLoginName
Set the login user name into the repository context.- Parameters:
loginName- the login user name
-
setUserName
Set the user name into the repository context.- Parameters:
userName- the user name
-
setPassword
Set the user password into the repository context.- Parameters:
password- the user password
-
getLoginTicket
Get the login ticket for client-token mode from the repository context. This is maily aimed for CCE.- Returns:
- the user login ticket for Documentum from the repository context
-
setLoginTicket
Set the login ticket for client-token mode from the repository context. This is maily aimed for CCE.- Parameters:
loginTicket- the user login ticket for Documentum from the repository context
-
getAuthType
Get the user authentication type the repository context.- Returns:
- the user authentication type the repository context
-
setAuthType
Set the user authentication type into the repository context.- Parameters:
authType- the user authentication type
-
isSuperUser
public static boolean isSuperUser()Whether the current user is super user- Returns:
trueif current user is super user, else false
-
isSysAdmin
public static boolean isSysAdmin()Whether the current user is sysAdmin- Returns:
trueif current user is super user, else false
-
isSysAdminOrSuperUser
public static boolean isSysAdminOrSuperUser()Whether the current user is sysAdmin or super user- Returns:
trueif current user is super user or sys admin, else false
-
isGroupOwner
Whether the current user is sepcified group's owner- Parameters:
group- the sepcified group. attribute owner_name must be provided.- Returns:
trueif sepcified group's owner, else false
-
isGroupAdmin
Whether the current user is sepcified group's admin- Parameters:
group- the sepcified group. attribute group_admin must be provided.- Returns:
trueif sepcified group's admin, else false
-
isContextSessionTransactional
public static boolean isContextSessionTransactional()Check from the repository context whether the context session is transactional.- Returns:
trueif the context session is transactional
-
setContextSessionTransactional
public static void setContextSessionTransactional(boolean b) Set the context session transaction for the repository context.- Parameters:
b-trueif the context session is transactional;falseotherwise.
-
isContextSessionEnabled
Check from the repository context whether context session is enabled.- Returns:
trueif the context session is enabled
-
setContextSessionEnabled
Set the context session enabling into the repository context.- Parameters:
enabled-trueif the context session is enabled;falseotherwise.
-
getContextSession
public static com.documentum.fc.client.IDfSession getContextSession()Return the context session.- Returns:
- context session
-
setContextSession
public static void setContextSession(com.documentum.fc.client.IDfSession session) Set the context session into the repository context.- Parameters:
session- the DFC session
-
safeClearContextSession
public static void safeClearContextSession()Safely clear the context session. -
setLocales
Set the locales for the login user.- Parameters:
locales- locales supported for the login user
-
getLocales
Get the locales for the login user.- Returns:
- the supported locales for the login user
-
getPrimaryLocale
Get the primary locale from the locales.- Returns:
- the primary locale supported for the login user
-
setAttribute
Set an attribute into the repository context.- Parameters:
attribute- the attribute namevalue- the attribute value
-
getAttribute
Get the attribute value from the repository context by name.- Parameters:
attribute- the attribute name- Returns:
- the attribute value
-
clear
public static void clear()Clear everything in the repository context. -
clearUserCredentials
public static void clearUserCredentials()Clear user name and credentials for the repository context.
-