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
Modifier and TypeFieldDescriptionstatic final int
static final int
static final String
the wild repository string -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
Clear everything in the repository context.static void
Clear user name and credentials for the repository context.static Object
getAttribute
(String attribute) Get the attribute value from the repository context by name.static AuthType
Get the user authentication type the repository context.static BaseUriInfo
static com.documentum.fc.client.IDfSession
Return the context session.static String
Get the default_folder for current userGet the locales for the login user.static String
Get the user login name for current userstatic Object
Get the login ticket for client-token mode from the repository context.static Object
Get the password of the login user.static Locale
Get the primary locale from the locales.static String
Get the repository for current user livesstatic UserExtendedPrivileges
Get user extended privileges of the login user.Get belonging user groups of the login user.static String
Get the r_object_id value for current user.static String
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 destroyedstatic int
Get user privileges of the login user.static Boolean
Check from the repository context whether context session is enabled.static boolean
Check from the repository context whether the context session is transactional.static boolean
isCurrentRepository
(String repositoryName) Return true if the specified repository name is current user's login repositorystatic boolean
isGroupAdmin
(GroupObject group) Whether the current user is sepcified group's adminstatic boolean
isGroupOwner
(GroupObject group) Whether the current user is sepcified group's ownerstatic boolean
Whether the current user is super userstatic boolean
Whether the current user is sysAdminstatic boolean
Whether the current user is sysAdmin or super userstatic void
Safely clear the context session.static void
setAttribute
(String attribute, Object value) Set an attribute into the repository context.static void
setAuthType
(AuthType authType) Set the user authentication type into the repository context.static void
set the base uri infostatic void
setContextSession
(com.documentum.fc.client.IDfSession session) Set the context session into the repository context.static void
setContextSessionEnabled
(Boolean enabled) Set the context session enabling into the repository context.static void
setContextSessionTransactional
(boolean b) Set the context session transaction for the repository context.static void
setLocales
(List<Locale> locales) Set the locales for the login user.static void
setLoginName
(String loginName) Set the login user name into the repository context.static void
setLoginTicket
(Object loginTicket) Set the login ticket for client-token mode from the repository context.static void
setPassword
(Object password) Set the user password into the repository context.static void
setRepositoryName
(String repositoryName) Set the repository name into the repository context.static void
setUserName
(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:
true
if 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:
true
if current user is super user, else false
-
isSysAdmin
public static boolean isSysAdmin()Whether the current user is sysAdmin- Returns:
true
if current user is super user, else false
-
isSysAdminOrSuperUser
public static boolean isSysAdminOrSuperUser()Whether the current user is sysAdmin or super user- Returns:
true
if 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:
true
if 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:
true
if sepcified group's admin, else false
-
isContextSessionTransactional
public static boolean isContextSessionTransactional()Check from the repository context whether the context session is transactional.- Returns:
true
if the context session is transactional
-
setContextSessionTransactional
public static void setContextSessionTransactional(boolean b) Set the context session transaction for the repository context.- Parameters:
b
-true
if the context session is transactional;false
otherwise.
-
isContextSessionEnabled
Check from the repository context whether context session is enabled.- Returns:
true
if the context session is enabled
-
setContextSessionEnabled
Set the context session enabling into the repository context.- Parameters:
enabled
-true
if the context session is enabled;false
otherwise.
-
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.
-