Interface AuthorityDAO
-
- All Known Implementing Classes:
AuthorityDAOImpl
public interface AuthorityDAO
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAuthority(Collection<String> parentNames, String childName)Add a child authority to the given parent authoritiesvoidaddAuthorityToZones(String authorityName, Set<String> zones)Add an authority to zonesbooleanauthorityExists(String name)Test if an authority already exists.voidcreateAuthority(String name, String authorityDisplayName, Set<String> authorityZones)Create an authority.voiddeleteAuthority(String name)Delete an authority.Set<String>findAuthorities(AuthorityType type, String parentAuthority, boolean immediate, String displayNamePattern, String zoneName)Find authorities by display name pattern.Set<String>getAllAuthoritiesInZone(String zoneName, AuthorityType type)Gets the names of all authorities in a zone, optionally filtered by type.PagingResults<String>getAuthorities(AuthorityType type, String zoneName, String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, PagingRequest pagingRequest)Get authority names by type and/or zone (both cannot be null).PagingResults<AuthorityInfo>getAuthoritiesInfo(AuthorityType type, String zoneName, String displayNameFilter, String sortBy, boolean sortAscending, PagingRequest pagingRequest)Get AuthorityInfo by type and/or zone (both cannot be null).StringgetAuthorityDisplayName(String authorityName)Get the display name for an authorityStringgetAuthorityName(NodeRef authorityRef)Gets the name for the given authority nodeNodeRefgetAuthorityNodeRefOrNull(String name)Get a node ref for the authority if one existsSet<String>getAuthorityZones(String name)Gets the name of the zone containing the specified authority.Set<String>getContainedAuthorities(AuthorityType type, String parentName, boolean immediate)Get contained authorities.Set<String>getContainingAuthorities(AuthorityType type, String name, boolean immediate)Get the authorities that contain the one given.Set<String>getContainingAuthoritiesInZone(AuthorityType type, String authority, String zoneName, AuthorityService.AuthorityFilter filter, int size)Get a set of authorities with varying filter criterialonggetGroupCount()Count groups i.e.StringgetName(AuthorityType type, String shortName)Create the full identifier for an authority given its short name and type.NodeRefgetOrCreateZone(String zoneName)Gets or creates an authority zone node with the specified namelonggetPersonCount()Count people i.e.Set<String>getRootAuthorities(AuthorityType type, String zoneName)Get root authoritiesStringgetShortName(String name)Extract the short name of an authority from its full identifier.NodeRefgetZone(String zoneName)Gets an authority zone node with the specified namebooleanisAuthorityContained(String authority, String authorityToFind, Set<String> positiveHits, Set<String> negativeHits)voidremoveAuthority(String parentName, String childName)Remove an authority.voidremoveAuthority(String parentName, String childName, boolean cacheRefresh)Remove an authority without authorityBridgeTableCache refresh.voidremoveAuthorityFromZones(String authorityName, Set<String> zones)Remove an authority from zones.voidsetAuthorityDisplayName(String authorityName, String authorityDisplayName)Set the display name for an authority
-
-
-
Method Detail
-
getPersonCount
long getPersonCount()
Count people i.e. nodes oftype cm:person.- Returns:
- the number of people
-
getGroupCount
long getGroupCount()
Count groups i.e. nodes oftype cm:authorityContainer.- Returns:
- the number of groups
-
addAuthority
void addAuthority(Collection<String> parentNames, String childName)
Add a child authority to the given parent authorities
-
createAuthority
void createAuthority(String name, String authorityDisplayName, Set<String> authorityZones)
Create an authority.
-
deleteAuthority
void deleteAuthority(String name)
Delete an authority.
-
getContainedAuthorities
Set<String> getContainedAuthorities(AuthorityType type, String parentName, boolean immediate)
Get contained authorities.- Parameters:
parentName- the name of the containing authority
-
isAuthorityContained
boolean isAuthorityContained(String authority, String authorityToFind, Set<String> positiveHits, Set<String> negativeHits)
-
removeAuthority
void removeAuthority(String parentName, String childName, boolean cacheRefresh)
Remove an authority without authorityBridgeTableCache refresh.
-
getContainingAuthorities
Set<String> getContainingAuthorities(AuthorityType type, String name, boolean immediate)
Get the authorities that contain the one given.
-
getContainingAuthoritiesInZone
Set<String> getContainingAuthoritiesInZone(AuthorityType type, String authority, String zoneName, AuthorityService.AuthorityFilter filter, int size)
Get a set of authorities with varying filter criteria- Parameters:
type- authority type or null for all typesauthority- if non-null, only return those authorities who contain this authorityzoneName- if non-null, only include authorities in the named zonefilter- optional callback to apply further filter criteria or nullsize- if greater than zero, the maximum results to return. The search strategy used is varied depending on this number.- Returns:
- a set of authorities
-
getAuthoritiesInfo
PagingResults<AuthorityInfo> getAuthoritiesInfo(AuthorityType type, String zoneName, String displayNameFilter, String sortBy, boolean sortAscending, PagingRequest pagingRequest)
Get AuthorityInfo by type and/or zone (both cannot be null).- Parameters:
sortBy- either "displayName", "shortName", "authorityName" or null if no sorting.
-
getAuthorities
PagingResults<String> getAuthorities(AuthorityType type, String zoneName, String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, PagingRequest pagingRequest)
Get authority names by type and/or zone (both cannot be null).
-
authorityExists
boolean authorityExists(String name)
Test if an authority already exists.
-
getAuthorityNodeRefOrNull
NodeRef getAuthorityNodeRefOrNull(String name)
Get a node ref for the authority if one exists
-
getAuthorityName
String getAuthorityName(NodeRef authorityRef)
Gets the name for the given authority node- Parameters:
authorityRef- authority node
-
getAuthorityDisplayName
String getAuthorityDisplayName(String authorityName)
Get the display name for an authority- Returns:
- the display name
-
setAuthorityDisplayName
void setAuthorityDisplayName(String authorityName, String authorityDisplayName)
Set the display name for an authority
-
getRootAuthorities
Set<String> getRootAuthorities(AuthorityType type, String zoneName)
Get root authorities
-
findAuthorities
Set<String> findAuthorities(AuthorityType type, String parentAuthority, boolean immediate, String displayNamePattern, String zoneName)
Find authorities by display name pattern.- Parameters:
parentAuthority- if non-null, will look only for authorities who are a child of the named parentimmediate- iftruethen only search root groups if parentAuthority is null, or immediate children of parentAuthority if it is non-null.zoneName- - may be null to indicate all zones
-
getShortName
String getShortName(String name)
Extract the short name of an authority from its full identifier.
-
getName
String getName(AuthorityType type, String shortName)
Create the full identifier for an authority given its short name and type.
-
getOrCreateZone
NodeRef getOrCreateZone(String zoneName)
Gets or creates an authority zone node with the specified name- Parameters:
zoneName- the zone name- Returns:
- reference to the zone node
-
getZone
NodeRef getZone(String zoneName)
Gets an authority zone node with the specified name- Parameters:
zoneName- the zone name- Returns:
- reference to the zone node ot null if the zone does not exists
-
getAuthorityZones
Set<String> getAuthorityZones(String name)
Gets the name of the zone containing the specified authority.- Parameters:
name- the authority long name- Returns:
- the set of names of all zones containing the specified authority, an empty set if the
authority exists but has no zone, or
nullif the authority does not exist.
-
getAllAuthoritiesInZone
Set<String> getAllAuthoritiesInZone(String zoneName, AuthorityType type)
Gets the names of all authorities in a zone, optionally filtered by type.- Parameters:
zoneName- the zone nametype- the authority type to filter by ornullfor all authority types- Returns:
- the names of all authorities in a zone, optionally filtered by type
-
addAuthorityToZones
void addAuthorityToZones(String authorityName, Set<String> zones)
Add an authority to zones
-
-