com.elasticpath.service.cmuser
Interface UserRoleService

All Superinterfaces:
EpPersistenceService, EpService
All Known Implementing Classes:
UserRoleServiceImpl

public interface UserRoleService
extends EpPersistenceService

Provide userRole-related business service.


Method Summary
 UserRole add(UserRole userRole)
          Adds the given userRole.
 UserRole findByName(java.lang.String name)
          Find the userRole with the given name.
 UserRole get(long userRoleUid)
          Get the userRole with the given UID.
 java.util.Map getAllUserPermissionsMap()
          Return the system configured permission map.
 UserRole getDefaultUserRole()
          Return the deafalt userRole, namely, the userRole with name "USER".
 java.util.List getUserRoleInUseUidList()
          Get the list of uids of UserRole used by existing CmUsers.
 java.util.List list()
          Lists all userRoles stored in the database.
 UserRole load(long userRoleUid)
          Load the userRole with the given UID.
 boolean nameExists(java.lang.String name)
          Checks whether the given userRole name exists or not.
 boolean nameExists(UserRole userRole)
          Check whether the given userRole's name exists or not.
 void remove(UserRole userRole)
          Delete the userRole.
 void setAllUserPermissionsMap(java.util.Map allUserPermissionsMap)
          Set the system configured permission map.
 void update(UserRole userRole)
          Updates the given userRole.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

UserRole add(UserRole userRole)
             throws UserRoleNameExistException
Adds the given userRole.

Parameters:
userRole - the userRole to add
Returns:
the persisted instance of userRole
Throws:
UserRoleNameExistException - - if userRole with the specified name already exists

findByName

UserRole findByName(java.lang.String name)
                    throws EpServiceException
Find the userRole with the given name.

Parameters:
name - the userRole name.
Returns:
the userRole that matches the given name, otherwise null
Throws:
EpServiceException - - in case of any errors

get

UserRole get(long userRoleUid)
             throws EpServiceException
Get the userRole with the given UID. Return null if no matching record exists.

Parameters:
userRoleUid - the userRole UID
Returns:
the userRole if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getAllUserPermissionsMap

java.util.Map getAllUserPermissionsMap()
Return the system configured permission map.

Returns:
the system configured permission map.

getDefaultUserRole

UserRole getDefaultUserRole()
                            throws EpServiceException
Return the deafalt userRole, namely, the userRole with name "USER".

Returns:
the default userRole.
Throws:
EpServiceException - - in case of any errors

getUserRoleInUseUidList

java.util.List getUserRoleInUseUidList()
Get the list of uids of UserRole used by existing CmUsers.

Returns:
the list of uids of UserRoles in use.

list

java.util.List list()
                    throws EpServiceException
Lists all userRoles stored in the database.

Returns:
a list of userRoles
Throws:
EpServiceException - - in case of any errors

load

UserRole load(long userRoleUid)
              throws EpServiceException
Load the userRole with the given UID. Throw an unrecoverable exception if there is no matching database row.

Parameters:
userRoleUid - the userRole UID
Returns:
the userRole if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

nameExists

boolean nameExists(java.lang.String name)
                   throws EpServiceException
Checks whether the given userRole name exists or not.

Parameters:
name - the userRole name.
Returns:
true if the given name exists.
Throws:
EpServiceException - - in case of any errors

nameExists

boolean nameExists(UserRole userRole)
                   throws EpServiceException
Check whether the given userRole's name exists or not.

Parameters:
userRole - the userRole to check
Returns:
true if a different userRole with the given userRole's name exists
Throws:
EpServiceException - - in case of any errors

remove

void remove(UserRole userRole)
            throws EpServiceException
Delete the userRole.

Parameters:
userRole - the userRole to remove
Throws:
EpServiceException - - in case of any errors

setAllUserPermissionsMap

void setAllUserPermissionsMap(java.util.Map allUserPermissionsMap)
Set the system configured permission map.

Parameters:
allUserPermissionsMap - the system configured permission map.

update

void update(UserRole userRole)
            throws UserRoleNameExistException
Updates the given userRole.

Parameters:
userRole - the userRole to update
Throws:
UserRoleNameExistException - - if userRole with the specified name already exists