Interface DomainsManager
public interface DomainsManager
Provides administrative (crud) domain management; currently limited to only
AuthRole
s of an existing domain.
Note that this manager only provides and allows operations on DomainAuth
s in a valid location!
A domain location is valid if:
- it is a domain (directly) under a hipposys:domainfolder parent node below /hippo:configuration/hippo:domains
- it is a domain (directly) under a hipposys:federateddomainfolder parent node with depth >= 2
Likewise, access and operations on AuthRole
s is only provided for authroles directly under a valid
domain location.
All modifying operations require the underlying HippoSession to have userRole
SecurityConstants.USERROLE_SECURITY_APPLICATION_ADMIN
-
Method Summary
Modifier and TypeMethodDescriptionaddAuthRole
(AuthRole authRoleTemplate) Add a newAuthRole
to an existingDomainAuth
.boolean
deleteAuthRole
(AuthRole authRoleTemplate) Delete an existingAuthRole
getAuthRole
(String authRolePath) Get aAuthRole
by its (node) path.getDomainAuth
(String domainPath) Get aDomainAuth
by its (node) path.getDomainAuthsForGroup
(String group) getDomainAuthsForUser
(String user) getDomainAuthsForUserRole
(String userRole) updateAuthRole
(AuthRole authRoleTemplate) Update an existingAuthRole
-
Method Details
-
getDomainAuth
Get aDomainAuth
by its (node) path. Only a domain in a valid location will be returned.- Parameters:
domainPath
- the path of the domain to get- Returns:
- the DomainAuth object
- Throws:
ItemNotFoundException
- when the domain node doesn't exist, or is in an invalid locationRepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
getDomainAuths
- Returns:
- all the
DomainAuth
s. Only DomainAuths in a valid location will be returned. - Throws:
RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
getDomainAuthsForUser
SortedSet<DomainAuth> getDomainAuthsForUser(String user) throws IllegalArgumentException, RepositoryException - Parameters:
user
- the name of the user- Returns:
- the
DomainAuth
s having at least oneAuthRole
with the provided user name. Only domains in a valid location will be returned. - Throws:
IllegalArgumentException
- if the provided user name is null or invalidRepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
getDomainAuthsForUserRole
SortedSet<DomainAuth> getDomainAuthsForUserRole(String userRole) throws IllegalArgumentException, RepositoryException - Parameters:
userRole
- the name of the userRole- Returns:
- the
DomainAuth
s having at least oneAuthRole
with the provided userRole. Only domains in a valid location will be returned. - Throws:
IllegalArgumentException
- if the provided userRole name is null or invalidRepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
getDomainAuthsForGroup
SortedSet<DomainAuth> getDomainAuthsForGroup(String group) throws IllegalArgumentException, RepositoryException - Parameters:
group
- the name of the group- Returns:
- the
DomainAuth
s having at least oneAuthRole
with the provided group. Only domains in a valid location will be returned. - Throws:
IllegalArgumentException
- if the provided group name is null or invalidRepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
getAuthRole
Get aAuthRole
by its (node) path. Only an authrole in a valid location will be returned.- Parameters:
authRolePath
- the path of the authrole to get- Returns:
- the AuthRole object
- Throws:
ItemNotFoundException
- when the authrole node doesn't exist, or is in an invalid locationRepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
addAuthRole
AuthRole addAuthRole(AuthRole authRoleTemplate) throws IllegalArgumentException, AccessDeniedException, RepositoryException Add a newAuthRole
to an existingDomainAuth
.- Parameters:
authRoleTemplate
- A template for the AuthRole to create from, for example aAuthRoleBean
instance- Returns:
- the created AuthRole
- Throws:
IllegalArgumentException
- When the template, template.name, template.domainPath or template.role is null.ItemNotFoundException
- When there is no (valid) domain located at template.domainPathItemExistsException
- When there already is an AuthRole named template.name under template.domainPathAccessDeniedException
- if the underlying HippoSession doesn't have the userRoleSecurityConstants.USERROLE_SECURITY_APPLICATION_ADMIN
RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
updateAuthRole
AuthRole updateAuthRole(AuthRole authRoleTemplate) throws IllegalArgumentException, AccessDeniedException, RepositoryException Update an existingAuthRole
- Parameters:
authRoleTemplate
- A template for the AuthRole to update from, for example aAuthRoleBean
instance- Returns:
- a fresh instance of the AuthRole after the update
- Throws:
IllegalArgumentException
- When the template, template.name, template.domainPath or template.role is null.ItemNotFoundException
- When there is no (valid) domain located at template.domainPathAccessDeniedException
- if the underlying HippoSession doesn't have the userRoleSecurityConstants.USERROLE_SECURITY_APPLICATION_ADMIN
RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
deleteAuthRole
boolean deleteAuthRole(AuthRole authRoleTemplate) throws IllegalArgumentException, AccessDeniedException, RepositoryException Delete an existingAuthRole
- Parameters:
authRoleTemplate
- The AuthRole to delete- Returns:
- true if the AuthRole was deleted; false if not (not found or in an invalid location)
- Throws:
IllegalArgumentException
- When the template or template.path is null.AccessDeniedException
- if the underlying HippoSession doesn't have the userRoleSecurityConstants.USERROLE_SECURITY_APPLICATION_ADMIN
RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-