org.alfresco.repo.security.authority
Class AuthorityDAOImpl

java.lang.Object
  extended by org.alfresco.repo.security.authority.AuthorityDAOImpl
All Implemented Interfaces:
NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, ClassPolicy, Policy, AuthorityDAO

public class AuthorityDAOImpl
extends java.lang.Object
implements AuthorityDAO, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Field Summary
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAME
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
AuthorityDAOImpl()
           
 
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 beforeDeleteNode(NodeRef nodeRef)
          Called before a node is deleted.
 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(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 getAllAuthorities(AuthorityType type)
          Get all authorities by type
 java.util.Set getAllAuthoritiesInZone(java.lang.String zoneName, AuthorityType type)
          Gets the names of all authorities in a zone, optionally filtered by type.
 java.lang.String getAuthorityDisplayName(java.lang.String authorityName)
          Get the display name for an authority
 java.lang.String getAuthorityName(NodeRef authorityRef)
          Gets the name for the given authority node
 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(AuthorityType type, java.lang.String name, boolean immediate)
          Get contained authorities.
 java.util.Set getContainingAuthorities(AuthorityType type, java.lang.String name, boolean immediate)
          Get the authorities that contain the one given.
 java.lang.String getName(AuthorityType type, java.lang.String shortName)
          Create the full identifier for an authority given its short name and type.
 NodeRef getOrCreateZone(java.lang.String zoneName)
          Gets or creates an authority zone node with the specified name
 java.lang.String getShortName(java.lang.String name)
          Extract the short name of an authority from its full identifier.
 NodeRef getZone(java.lang.String zoneName)
          Gets an authority zone node with the specified name
 void init()
           
 void onUpdateProperties(NodeRef nodeRef, java.util.Map before, java.util.Map after)
          Called after a node's properties have been changed.
 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 setAclDao(AclDaoComponent aclDao)
           
 void setAuthorityDisplayName(java.lang.String authorityName, java.lang.String authorityDisplayName)
          Set the display name for an authority
 void setAuthorityLookupCache(SimpleCache authorityLookupCache)
           
 void setDictionaryService(DictionaryService dictionaryService)
           
 void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)
           
 void setNodeService(NodeService nodeService)
           
 void setPersonService(PersonService personService)
           
 void setPolicyComponent(PolicyComponent policyComponent)
           
 void setSearchService(SearchService searchService)
           
 void setStoreUrl(java.lang.String storeUrl)
           
 void setTenantService(TenantService tenantService)
           
 void setUserAuthorityCache(SimpleCache userAuthorityCache)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorityDAOImpl

public AuthorityDAOImpl()
Method Detail

setStoreUrl

public void setStoreUrl(java.lang.String storeUrl)

setDictionaryService

public void setDictionaryService(DictionaryService dictionaryService)

setNamespacePrefixResolver

public void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)

setNodeService

public void setNodeService(NodeService nodeService)

setSearchService

public void setSearchService(SearchService searchService)

setAuthorityLookupCache

public void setAuthorityLookupCache(SimpleCache authorityLookupCache)

setUserAuthorityCache

public void setUserAuthorityCache(SimpleCache userAuthorityCache)

setPersonService

public void setPersonService(PersonService personService)

setTenantService

public void setTenantService(TenantService tenantService)

setAclDao

public void setAclDao(AclDaoComponent aclDao)

setPolicyComponent

public void setPolicyComponent(PolicyComponent policyComponent)

authorityExists

public boolean authorityExists(java.lang.String name)
Description copied from interface: AuthorityDAO
Test if an authority already exists.

Specified by:
authorityExists in interface AuthorityDAO
Returns:

addAuthority

public void addAuthority(java.util.Collection parentNames,
                         java.lang.String childName)
Description copied from interface: AuthorityDAO
Add a child authority to the given parent authorities

Specified by:
addAuthority in interface AuthorityDAO

createAuthority

public void createAuthority(java.lang.String name,
                            java.lang.String authorityDisplayName,
                            java.util.Set authorityZones)
Description copied from interface: AuthorityDAO
Create an authority.

Specified by:
createAuthority in interface AuthorityDAO

deleteAuthority

public void deleteAuthority(java.lang.String name)
Description copied from interface: AuthorityDAO
Delete an authority.

Specified by:
deleteAuthority in interface AuthorityDAO

getAllAuthorities

public java.util.Set getAllAuthorities(AuthorityType type)
Description copied from interface: AuthorityDAO
Get all authorities by type

Specified by:
getAllAuthorities in interface AuthorityDAO
Returns:

findAuthorities

public java.util.Set findAuthorities(AuthorityType type,
                                     java.lang.String parentAuthority,
                                     boolean immediate,
                                     java.lang.String displayNamePattern,
                                     java.lang.String zoneName)
Description copied from interface: AuthorityDAO
Find authorities by display name pattern.

Specified by:
findAuthorities in interface AuthorityDAO
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.
zoneName - - may be null to indicate all zones
Returns:

getContainedAuthorities

public java.util.Set getContainedAuthorities(AuthorityType type,
                                             java.lang.String name,
                                             boolean immediate)
Description copied from interface: AuthorityDAO
Get contained authorities.

Specified by:
getContainedAuthorities in interface AuthorityDAO
Returns:

removeAuthority

public void removeAuthority(java.lang.String parentName,
                            java.lang.String childName)
Description copied from interface: AuthorityDAO
Remove an authority.

Specified by:
removeAuthority in interface AuthorityDAO

getContainingAuthorities

public java.util.Set getContainingAuthorities(AuthorityType type,
                                              java.lang.String name,
                                              boolean immediate)
Description copied from interface: AuthorityDAO
Get the authorities that contain the one given.

Specified by:
getContainingAuthorities in interface AuthorityDAO
Returns:

getShortName

public java.lang.String getShortName(java.lang.String name)
Description copied from interface: AuthorityDAO
Extract the short name of an authority from its full identifier.

Specified by:
getShortName in interface AuthorityDAO
Returns:

getName

public java.lang.String getName(AuthorityType type,
                                java.lang.String shortName)
Description copied from interface: AuthorityDAO
Create the full identifier for an authority given its short name and type.

Specified by:
getName in interface AuthorityDAO
Returns:

getAuthorityNodeRefOrNull

public NodeRef getAuthorityNodeRefOrNull(java.lang.String name)
Description copied from interface: AuthorityDAO
Get a node ref for the authority if one exists

Specified by:
getAuthorityNodeRefOrNull in interface AuthorityDAO
Returns:

getAuthorityName

public java.lang.String getAuthorityName(NodeRef authorityRef)
Description copied from interface: AuthorityDAO
Gets the name for the given authority node

Specified by:
getAuthorityName in interface AuthorityDAO
Parameters:
authorityRef - authority node
Returns:
name

getAuthorityDisplayName

public java.lang.String getAuthorityDisplayName(java.lang.String authorityName)
Description copied from interface: AuthorityDAO
Get the display name for an authority

Specified by:
getAuthorityDisplayName in interface AuthorityDAO
Returns:
the display name

setAuthorityDisplayName

public void setAuthorityDisplayName(java.lang.String authorityName,
                                    java.lang.String authorityDisplayName)
Description copied from interface: AuthorityDAO
Set the display name for an authority

Specified by:
setAuthorityDisplayName in interface AuthorityDAO

getOrCreateZone

public NodeRef getOrCreateZone(java.lang.String zoneName)
Description copied from interface: AuthorityDAO
Gets or creates an authority zone node with the specified name

Specified by:
getOrCreateZone in interface AuthorityDAO
Parameters:
zoneName - the zone name
Returns:
reference to the zone node

getZone

public NodeRef getZone(java.lang.String zoneName)
Description copied from interface: AuthorityDAO
Gets an authority zone node with the specified name

Specified by:
getZone in interface AuthorityDAO
Parameters:
zoneName - the zone name
Returns:
reference to the zone node ot null if the zone does not exists

getAuthorityZones

public java.util.Set getAuthorityZones(java.lang.String name)
Description copied from interface: AuthorityDAO
Gets the name of the zone containing the specified authority.

Specified by:
getAuthorityZones in interface AuthorityDAO
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

public java.util.Set getAllAuthoritiesInZone(java.lang.String zoneName,
                                             AuthorityType type)
Description copied from interface: AuthorityDAO
Gets the names of all authorities in a zone, optionally filtered by type.

Specified by:
getAllAuthoritiesInZone in interface AuthorityDAO
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

public void addAuthorityToZones(java.lang.String authorityName,
                                java.util.Set zones)
Description copied from interface: AuthorityDAO
Add an authority to zones

Specified by:
addAuthorityToZones in interface AuthorityDAO

removeAuthorityFromZones

public void removeAuthorityFromZones(java.lang.String authorityName,
                                     java.util.Set zones)
Description copied from interface: AuthorityDAO
Remove an authority from zones.

Specified by:
removeAuthorityFromZones in interface AuthorityDAO

beforeDeleteNode

public void beforeDeleteNode(NodeRef nodeRef)
Description copied from interface: NodeServicePolicies.BeforeDeleteNodePolicy
Called before a node is deleted.

Specified by:
beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicy
Parameters:
nodeRef - the node reference

onUpdateProperties

public void onUpdateProperties(NodeRef nodeRef,
                               java.util.Map before,
                               java.util.Map after)
Description copied from interface: NodeServicePolicies.OnUpdatePropertiesPolicy
Called after a node's properties have been changed.

Specified by:
onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
Parameters:
nodeRef - reference to the updated node
before - the node's properties before the change
after - the node's properties after the change

init

public void init()


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