Package org.exoplatform.commons.utils
Class CommonsUtils
java.lang.Object
org.exoplatform.commons.utils.CommonsUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidendRequest(Object service) static org.exoplatform.services.security.ConversationRegistrystatic org.exoplatform.services.security.ConversationStategetConversationState(String userId) Get the last added ConversationState of a given user.static StringGet the current domain name by configurationstatic StringGet current portal ownerstatic org.exoplatform.portal.mop.SiteKeyGetSiteKeyof current sitestatic Collection<String> getGroupsOfUser(String userId) Gets groups of user from ConversationRegistry, if not found, get it from OrgnizationServicestatic org.exoplatform.services.organization.OrganizationServicestatic Stringstatic <T> TgetService(Class<T> clazz) Gets the service.static <T> TgetService(Class<T> clazz, String containerName) Gets the service.static org.exoplatform.services.organization.UserGet the lastUserinstance added in ConversationState of a given userstatic booleanisFeatureActive(String featureName) static booleanisFeatureActive(String featureName, String username) static booleanisUserEnabled(String userId) Gets the user state enabled/disabled from ConversationRegistry, if not found, get it from OrgnizationServicestatic voidstartRequest(Object service)
-
Field Details
-
CONFIGURED_TENANT_MASTER_HOST_KEY
- See Also:
-
CONFIGURED_DOMAIN_URL_KEY
- See Also:
-
DEFAULT_DOMAIN_URL
- See Also:
-
-
Constructor Details
-
CommonsUtils
public CommonsUtils()
-
-
Method Details
-
getOrganizationService
public static org.exoplatform.services.organization.OrganizationService getOrganizationService() -
getConversationRegistry
public static org.exoplatform.services.security.ConversationRegistry getConversationRegistry() -
isUserEnabled
Gets the user state enabled/disabled from ConversationRegistry, if not found, get it from OrgnizationService- Parameters:
userId- username- Returns:
- true if enabled, else false
- Throws:
Exception- if an error occured during requesting the user from OrganizationService
-
getConversationState
public static org.exoplatform.services.security.ConversationState getConversationState(String userId) Get the last added ConversationState of a given user.- Parameters:
userId- username- Returns:
- ConversationState entity of user
-
getUser
Get the lastUserinstance added in ConversationState of a given user- Parameters:
userId-- Returns:
User- Throws:
Exception- thrown when an exception occurs while getting user from IDM store
-
getGroupsOfUser
Gets groups of user from ConversationRegistry, if not found, get it from OrgnizationService- Parameters:
userId- username- Returns:
- a collection of group Id of type String
- Throws:
Exception- if an error occured during requesting the user from OrganizationService
-
getService
Gets the service.- Parameters:
clazz- the clazz- Returns:
- the service
-
getService
Gets the service.- Parameters:
clazz- the classcontainerName- the container's name- Returns:
- the service
-
getRestContextName
-
isFeatureActive
-
isFeatureActive
-
getCurrentDomain
Get the current domain name by configuration- Returns:
- the current domain name.
-
getCurrentPortalOwner
Get current portal owner- Returns:
- current portal owner
-
getCurrentSite
public static org.exoplatform.portal.mop.SiteKey getCurrentSite()GetSiteKeyof current site- Returns:
- currentSite if available or default site in otherwise
-
startRequest
-
endRequest
-