Class SystemServiceImpl
- java.lang.Object
-
- de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
-
- de.hybris.platform.cockpit.services.impl.SystemServiceImpl
-
- All Implemented Interfaces:
SystemService
- Direct Known Subclasses:
MockSystemService
public class SystemServiceImpl extends AbstractServiceImpl implements SystemService
-
-
Field Summary
Fields Modifier and Type Field Description protected UserRightsCache
urCache
-
Fields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeService
-
-
Constructor Summary
Constructors Constructor Description SystemServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addUserRightToCache(PK relatedObject, java.lang.String right, boolean value)
boolean
checkAttributePermissionOn(java.lang.String typeCode, java.lang.String attributeQualifier, java.lang.String permissionCode)
boolean
checkPermissionOn(UserModel user, java.lang.String typeCode, java.lang.String permissionCode)
boolean
checkPermissionOn(java.lang.String typeCode, java.lang.String permissionCode)
check the type access rights for the current userjava.util.Set<java.lang.String>
getAllReadableLanguageIsos()
Returns all for the user readable available hybris languages iso codes.java.util.Set<LanguageModel>
getAllReadableLanguages()
Returns all for the user readable hybris languages as beans.java.util.Set<java.lang.String>
getAllWriteableLanguageIsos()
Returns all for the user writeable available hybris languages iso codes.java.util.Set<LanguageModel>
getAllWriteableLanguages()
Returns all for the user writeable hybris languages as beans.java.util.Set<java.lang.String>
getAvailableLanguageIsos()
Returns all available hybris languages iso codes.java.util.Set<LanguageModel>
getAvailableLanguages()
Returns all available hybris languages as beans.CatalogVersionModel
getCatalogVersion(TypedObject typedObject)
get the catalog version for passed typedObjectLanguageModel
getCurrentLanguage()
get the current hybris session languageUserModel
getCurrentUser()
get the user from the current sessionLanguageModel
getLanguageForLocale(java.util.Locale loc)
Tries to find a matching hybris language for a given locale.UserModel
getUserByName(java.lang.String name)
get the first user with a given nameUserModel
getUserByUID(java.lang.String uid)
get the user with a given uuidprotected java.lang.Boolean
getUserRightFromCache(PK relatedObject, java.lang.String right)
java.util.List<java.lang.String>
getUsersByName(java.lang.String name, java.lang.String typecode)
get a list of all user with a given nameUserService
getUserService()
boolean
itemExist(PK pk)
void
setSessionLanguage(LanguageModel lang)
set the language of the current sessionvoid
setUserRightsCache(UserRightsCache urCache)
void
setUserService(UserService userService)
-
Methods inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelService
-
-
-
-
Field Detail
-
urCache
protected UserRightsCache urCache
-
-
Method Detail
-
getAvailableLanguages
public java.util.Set<LanguageModel> getAvailableLanguages()
Description copied from interface:SystemService
Returns all available hybris languages as beans.- Specified by:
getAvailableLanguages
in interfaceSystemService
-
getAvailableLanguageIsos
public java.util.Set<java.lang.String> getAvailableLanguageIsos()
Description copied from interface:SystemService
Returns all available hybris languages iso codes.- Specified by:
getAvailableLanguageIsos
in interfaceSystemService
-
getAllReadableLanguages
public java.util.Set<LanguageModel> getAllReadableLanguages()
Description copied from interface:SystemService
Returns all for the user readable hybris languages as beans.- Specified by:
getAllReadableLanguages
in interfaceSystemService
-
getAllReadableLanguageIsos
public java.util.Set<java.lang.String> getAllReadableLanguageIsos()
Description copied from interface:SystemService
Returns all for the user readable available hybris languages iso codes.- Specified by:
getAllReadableLanguageIsos
in interfaceSystemService
-
getAllWriteableLanguages
public java.util.Set<LanguageModel> getAllWriteableLanguages()
Description copied from interface:SystemService
Returns all for the user writeable hybris languages as beans.- Specified by:
getAllWriteableLanguages
in interfaceSystemService
-
getAllWriteableLanguageIsos
public java.util.Set<java.lang.String> getAllWriteableLanguageIsos()
Description copied from interface:SystemService
Returns all for the user writeable available hybris languages iso codes.- Specified by:
getAllWriteableLanguageIsos
in interfaceSystemService
-
getLanguageForLocale
public LanguageModel getLanguageForLocale(java.util.Locale loc)
Description copied from interface:SystemService
Tries to find a matching hybris language for a given locale. If this fails the method returns the current hybris session language !- Specified by:
getLanguageForLocale
in interfaceSystemService
- Parameters:
loc
- the locale to find a hybris language for
-
getCurrentLanguage
public LanguageModel getCurrentLanguage()
Description copied from interface:SystemService
get the current hybris session language- Specified by:
getCurrentLanguage
in interfaceSystemService
- Returns:
- the current hybris session language
-
getCurrentUser
public UserModel getCurrentUser()
Description copied from interface:SystemService
get the user from the current session- Specified by:
getCurrentUser
in interfaceSystemService
- Returns:
- the user
-
getUserByUID
public UserModel getUserByUID(java.lang.String uid)
Description copied from interface:SystemService
get the user with a given uuid- Specified by:
getUserByUID
in interfaceSystemService
- Parameters:
uid
- the uuid- Returns:
- the user
-
getUsersByName
public java.util.List<java.lang.String> getUsersByName(java.lang.String name, java.lang.String typecode)
Description copied from interface:SystemService
get a list of all user with a given name- Specified by:
getUsersByName
in interfaceSystemService
- Parameters:
name
- the name of the userstypecode
- the typecode of the class representing a user, or null for classUser
- Returns:
- the user list
-
getUserByName
public UserModel getUserByName(java.lang.String name)
Description copied from interface:SystemService
get the first user with a given name- Specified by:
getUserByName
in interfaceSystemService
- Parameters:
name
- the username- Returns:
- the user
-
setSessionLanguage
public void setSessionLanguage(LanguageModel lang)
Description copied from interface:SystemService
set the language of the current session- Specified by:
setSessionLanguage
in interfaceSystemService
- Parameters:
lang
- the language
-
checkPermissionOn
public boolean checkPermissionOn(UserModel user, java.lang.String typeCode, java.lang.String permissionCode)
-
checkPermissionOn
public boolean checkPermissionOn(java.lang.String typeCode, java.lang.String permissionCode)
Description copied from interface:SystemService
check the type access rights for the current user- Specified by:
checkPermissionOn
in interfaceSystemService
- Parameters:
typeCode
- the code of the type to checkpermissionCode
- the code of the right to check, seeAccessManager
- Returns:
- true, if the current user has the specified access right, false otherwise
-
checkAttributePermissionOn
public boolean checkAttributePermissionOn(java.lang.String typeCode, java.lang.String attributeQualifier, java.lang.String permissionCode)
- Specified by:
checkAttributePermissionOn
in interfaceSystemService
-
getCatalogVersion
public CatalogVersionModel getCatalogVersion(TypedObject typedObject)
Description copied from interface:SystemService
get the catalog version for passed typedObject- Specified by:
getCatalogVersion
in interfaceSystemService
- Returns:
- appropriate catalog version when found
-
setUserRightsCache
public void setUserRightsCache(UserRightsCache urCache)
-
getUserRightFromCache
protected java.lang.Boolean getUserRightFromCache(PK relatedObject, java.lang.String right)
-
addUserRightToCache
protected void addUserRightToCache(PK relatedObject, java.lang.String right, boolean value)
-
setUserService
public void setUserService(UserService userService)
-
getUserService
public UserService getUserService()
-
itemExist
public boolean itemExist(PK pk)
- Specified by:
itemExist
in interfaceSystemService
- Parameters:
pk
- the pk of item- Returns:
- true if item exist, false if it was deleted.
-
-