org.alfresco.repo.security.authority
Interface AuthorityDAO

All Known Implementing Classes:
AuthorityDAOImpl

public interface AuthorityDAO


Method Summary
 void addAuthority(java.util.Collection parentNames, java.lang.String childName)
          Add a child authority to the given parent authorities
 void addAuthorityToZones(java.lang.String authorityName, java.util.Set zones)
          Add an authority to zones
 boolean authorityExists(java.lang.String name)
          Test if an authority already exists.
 void createAuthority(java.lang.String name, java.lang.String authorityDisplayName, java.util.Set authorityZones)
          Create an authority.
 void deleteAuthority(java.lang.String name)
          Delete an authority.
 java.util.Set findAuthorities(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String parentAuthority, boolean immediate, java.lang.String displayNamePattern, java.lang.String zoneName)
          Find authorities by display name pattern.
 java.util.Set getAllAuthoritiesInZone(java.lang.String zoneName, org.alfresco.service.cmr.security.AuthorityType type)
          Gets the names of all authorities in a zone, optionally filtered by type.
 org.alfresco.query.PagingResults getAuthorities(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String zoneName, java.lang.String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, org.alfresco.query.PagingRequest pagingRequest)
          Get authorities by type and/or zone
 java.lang.String getAuthorityDisplayName(java.lang.String authorityName)
          Get the display name for an authority
 java.lang.String getAuthorityName(org.alfresco.service.cmr.repository.NodeRef authorityRef)
          Gets the name for the given authority node
 org.alfresco.service.cmr.repository.NodeRef getAuthorityNodeRefOrNull(java.lang.String name)
          Get a node ref for the authority if one exists
 java.util.Set getAuthorityZones(java.lang.String name)
          Gets the name of the zone containing the specified authority.
 java.util.Set getContainedAuthorities(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String parentName, boolean immediate)
          Get contained authorities.
 java.util.Set getContainingAuthorities(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String name, boolean immediate)
          Get the authorities that contain the one given.
 java.util.Set getContainingAuthoritiesInZone(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String authority, java.lang.String zoneName, AuthorityService.AuthorityFilter filter, int size)
          Get a set of authorities with varying filter criteria
 java.lang.String getName(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String shortName)
          Create the full identifier for an authority given its short name and type.
 org.alfresco.service.cmr.repository.NodeRef getOrCreateZone(java.lang.String zoneName)
          Gets or creates an authority zone node with the specified name
 java.util.Set getRootAuthorities(org.alfresco.service.cmr.security.AuthorityType type, java.lang.String zoneName)
          Get root authorities
 java.lang.String getShortName(java.lang.String name)
          Extract the short name of an authority from its full identifier.
 org.alfresco.service.cmr.repository.NodeRef getZone(java.lang.String zoneName)
          Gets an authority zone node with the specified name
 boolean isAuthorityContained(org.alfresco.service.cmr.repository.NodeRef authorityNodeRef, java.lang.String authorityToFind)
           
 void removeAuthority(java.lang.String parentName, java.lang.String childName)
          Remove an authority.
 void removeAuthorityFromZones(java.lang.String authorityName, java.util.Set zones)
          Remove an authority from zones.
 void setAuthorityDisplayName(java.lang.String authorityName, java.lang.String authorityDisplayName)
          Set the display name for an authority
 

Method Detail

addAuthority

void addAuthority(java.util.Collection parentNames,
                  java.lang.String childName)
Add a child authority to the given parent authorities

Parameters:
parentNames -
childName -

createAuthority

void createAuthority(java.lang.String name,
                     java.lang.String authorityDisplayName,
                     java.util.Set authorityZones)
Create an authority.

Parameters:
name -
authorityDisplayName -
authorityZones -

deleteAuthority

void deleteAuthority(java.lang.String name)
Delete an authority.

Parameters:
name -

getContainedAuthorities

java.util.Set getContainedAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
                                      java.lang.String parentName,
                                      boolean immediate)
Get contained authorities.

Parameters:
type -
parentName - the name of the containing authority
immediate -
Returns:

isAuthorityContained

boolean isAuthorityContained(org.alfresco.service.cmr.repository.NodeRef authorityNodeRef,
                             java.lang.String authorityToFind)

removeAuthority

void removeAuthority(java.lang.String parentName,
                     java.lang.String childName)
Remove an authority.

Parameters:
parentName -
childName -

getContainingAuthorities

java.util.Set getContainingAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
                                       java.lang.String name,
                                       boolean immediate)
Get the authorities that contain the one given.

Parameters:
type -
name -
immediate -
Returns:

getContainingAuthoritiesInZone

java.util.Set getContainingAuthoritiesInZone(org.alfresco.service.cmr.security.AuthorityType type,
                                             java.lang.String authority,
                                             java.lang.String zoneName,
                                             AuthorityService.AuthorityFilter filter,
                                             int size)
Get a set of authorities with varying filter criteria

Parameters:
type - authority type or null for all types
authority - if non-null, only return those authorities who contain this authority
zoneName - if non-null, only include authorities in the named zone
filter - optional callback to apply further filter criteria or null
size - if greater than zero, the maximum results to return. The search strategy used is varied depending on this number.
Returns:
a set of authorities

getAuthorities

org.alfresco.query.PagingResults getAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
                                                java.lang.String zoneName,
                                                java.lang.String displayNameFilter,
                                                boolean sortByDisplayName,
                                                boolean sortAscending,
                                                org.alfresco.query.PagingRequest pagingRequest)
Get authorities by type and/or zone

Parameters:
type -
zoneName -
displayNameFilter -
sortByDisplayName -
sortAscending -
pagingRequest -
Returns:

authorityExists

boolean authorityExists(java.lang.String name)
Test if an authority already exists.

Parameters:
name -
Returns:

getAuthorityNodeRefOrNull

org.alfresco.service.cmr.repository.NodeRef getAuthorityNodeRefOrNull(java.lang.String name)
Get a node ref for the authority if one exists

Parameters:
name -
Returns:

getAuthorityName

java.lang.String getAuthorityName(org.alfresco.service.cmr.repository.NodeRef authorityRef)
Gets the name for the given authority node

Parameters:
authorityRef - authority node
Returns:
name

getAuthorityDisplayName

java.lang.String getAuthorityDisplayName(java.lang.String authorityName)
Get the display name for an authority

Parameters:
authorityName -
Returns:
the display name

setAuthorityDisplayName

void setAuthorityDisplayName(java.lang.String authorityName,
                             java.lang.String authorityDisplayName)
Set the display name for an authority

Parameters:
authorityName -
authorityDisplayName -

getRootAuthorities

java.util.Set getRootAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
                                 java.lang.String zoneName)
Get root authorities

Parameters:
type -
zoneName -
Returns:

findAuthorities

java.util.Set findAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
                              java.lang.String parentAuthority,
                              boolean immediate,
                              java.lang.String displayNamePattern,
                              java.lang.String zoneName)
Find authorities by display name pattern.

Parameters:
type -
parentAuthority - if non-null, will look only for authorities who are a child of the named parent
immediate - if true then only search root groups if parentAuthority is null, or immediate children of parentAuthority if it is non-null.
displayNamePattern -
zoneName - - may be null to indicate all zones
Returns:

getShortName

java.lang.String getShortName(java.lang.String name)
Extract the short name of an authority from its full identifier.

Parameters:
name -
Returns:

getName

java.lang.String getName(org.alfresco.service.cmr.security.AuthorityType type,
                         java.lang.String shortName)
Create the full identifier for an authority given its short name and type.

Parameters:
type -
shortName -
Returns:

getOrCreateZone

org.alfresco.service.cmr.repository.NodeRef getOrCreateZone(java.lang.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

org.alfresco.service.cmr.repository.NodeRef getZone(java.lang.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

java.util.Set getAuthorityZones(java.lang.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 null if the authority does not exist.

getAllAuthoritiesInZone

java.util.Set getAllAuthoritiesInZone(java.lang.String zoneName,
                                      org.alfresco.service.cmr.security.AuthorityType type)
Gets the names of all authorities in a zone, optionally filtered by type.

Parameters:
zoneName - the zone name
type - the authority type to filter by or null for all authority types
Returns:
the names of all authorities in a zone, optionally filtered by type

addAuthorityToZones

void addAuthorityToZones(java.lang.String authorityName,
                         java.util.Set zones)
Add an authority to zones

Parameters:
authorityName -
zones -

removeAuthorityFromZones

void removeAuthorityFromZones(java.lang.String authorityName,
                              java.util.Set zones)
Remove an authority from zones.

Parameters:
authorityName -
zones -


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.