public class AuthorityDAOImpl extends java.lang.Object implements AuthorityDAO, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, RefreshableCacheListener, org.springframework.beans.factory.InitializingBean
Policy.ArgQNAMEARG_0, ARG_1, ARG_2, QNAME| Constructor and Description |
|---|
AuthorityDAOImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAuthority(java.util.Collection parentNames,
java.lang.String childName)
Add a child authority to the given parent authorities
|
protected void |
addAuthorityNameIfMatches(java.util.Set authorities,
java.lang.String authorityName,
org.alfresco.service.cmr.security.AuthorityType type) |
protected void |
addAuthorityNameIfMatches(java.util.Set authorities,
java.lang.String authorityName,
org.alfresco.service.cmr.security.AuthorityType type,
java.util.regex.Pattern pattern) |
void |
addAuthorityToZones(java.lang.String authorityName,
java.util.Set zones)
Add an authority to zones
|
void |
afterPropertiesSet() |
boolean |
authorityExists(java.lang.String name)
Test if an authority already exists.
|
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Listen out for person removals so that we can clear cached authorities.
|
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 authority names by type and/or zone (both cannot be null).
|
org.alfresco.query.PagingResults |
getAuthoritiesInfo(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String zoneName,
java.lang.String displayNameFilter,
java.lang.String sortBy,
boolean sortAscending,
org.alfresco.query.PagingRequest pagingRequest)
Get AuthorityInfo by type and/or zone (both cannot be null).
|
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.lang.String |
getCacheId()
Cache id so broadcast can be constrained to matching caches
|
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
|
long |
getGroupCount()
Count groups i.e.
|
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
|
long |
getPersonCount()
Count people i.e.
|
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
|
void |
init() |
boolean |
isAuthorityContained(java.lang.String authority,
java.lang.String authorityToFind,
java.util.Set positiveHits,
java.util.Set negativeHits) |
void |
onRefreshableCacheEvent(RefreshableCacheEvent refreshableCacheEvent)
Callback made when a cache refresh occurs
|
void |
onUpdateProperties(org.alfresco.service.cmr.repository.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(AclDAO aclDao) |
void |
setAuthorityBridgeDAO(AuthorityBridgeDAO authorityBridgeDAO) |
void |
setAuthorityBridgeTableCache(AuthorityBridgeTableAsynchronouslyRefreshedCache authorityBridgeTableCache) |
void |
setAuthorityDisplayName(java.lang.String authorityName,
java.lang.String authorityDisplayName)
Set the display name for an authority
|
void |
setAuthorityLookupCache(org.alfresco.repo.cache.SimpleCache authorityLookupCache) |
void |
setCannedQueryDAO(CannedQueryDAO cannedQueryDAO) |
void |
setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry cannedQueryRegistry) |
void |
setChildAuthorityCache(org.alfresco.repo.cache.SimpleCache childAuthorityCache) |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) |
void |
setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPersonService(PersonService personService) |
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setQnameDAO(QNameDAO qnameDAO) |
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService) |
void |
setSingletonCache(org.alfresco.repo.cache.SimpleCache singletonCache) |
void |
setStoreUrl(java.lang.String storeUrl) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
setUseBridgeTable(boolean useBridgeTable) |
void |
setUseGetContainingAuthoritiesForIsAuthorityContained(boolean useGetContainingAuthoritiesForIsAuthorityContained) |
void |
setUserAuthorityCache(org.alfresco.repo.cache.SimpleCache userAuthorityCache) |
void |
setZoneAuthorityCache(org.alfresco.repo.cache.SimpleCache zoneAuthorityCache) |
void |
setZoneAuthoritySampleSize(int zoneAuthoritySampleSize)
Sets number of authorities in a zone to pre-cache, allowing quick generation of 'first n' results and adaption of
search technique based on hit rate.
|
public void setZoneAuthoritySampleSize(int zoneAuthoritySampleSize)
zoneAuthoritySampleSize - the zoneAuthoritySampleSize to setpublic void setStoreUrl(java.lang.String storeUrl)
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
public void setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
public void setAuthorityLookupCache(org.alfresco.repo.cache.SimpleCache authorityLookupCache)
public void setUserAuthorityCache(org.alfresco.repo.cache.SimpleCache userAuthorityCache)
public void setZoneAuthorityCache(org.alfresco.repo.cache.SimpleCache zoneAuthorityCache)
public void setChildAuthorityCache(org.alfresco.repo.cache.SimpleCache childAuthorityCache)
public void setAuthorityBridgeTableCache(AuthorityBridgeTableAsynchronouslyRefreshedCache authorityBridgeTableCache)
public void setUseBridgeTable(boolean useBridgeTable)
useBridgeTable - the useBridgeTable to setpublic void setPersonService(PersonService personService)
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public void setSingletonCache(org.alfresco.repo.cache.SimpleCache singletonCache)
public void setQnameDAO(QNameDAO qnameDAO)
public void setCannedQueryDAO(CannedQueryDAO cannedQueryDAO)
public void setAclDAO(AclDAO aclDao)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry cannedQueryRegistry)
public void setUseGetContainingAuthoritiesForIsAuthorityContained(boolean useGetContainingAuthoritiesForIsAuthorityContained)
useGetContainingAuthoritiesForHasAuthority - the useGetContainingAuthoritiesForHasAuthority to setpublic void setAuthorityBridgeDAO(AuthorityBridgeDAO authorityBridgeDAO)
authorityBridgeDAO - the authorityBridgeDAO to setpublic long getPersonCount()
AuthorityDAOtype cm:person.getPersonCount in interface AuthorityDAOpublic long getGroupCount()
AuthorityDAOtype cm:authorityContainer.getGroupCount in interface AuthorityDAOpublic boolean authorityExists(java.lang.String name)
AuthorityDAOauthorityExists in interface AuthorityDAOpublic void addAuthority(java.util.Collection parentNames,
java.lang.String childName)
AuthorityDAOaddAuthority in interface AuthorityDAOpublic void createAuthority(java.lang.String name,
java.lang.String authorityDisplayName,
java.util.Set authorityZones)
AuthorityDAOcreateAuthority in interface AuthorityDAOpublic void deleteAuthority(java.lang.String name)
AuthorityDAOdeleteAuthority in interface AuthorityDAOpublic org.alfresco.query.PagingResults getAuthoritiesInfo(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String zoneName,
java.lang.String displayNameFilter,
java.lang.String sortBy,
boolean sortAscending,
org.alfresco.query.PagingRequest pagingRequest)
AuthorityDAOgetAuthoritiesInfo in interface AuthorityDAOsortBy - either "displayName", "shortName", "authorityName" or null if no sorting.public 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)
AuthorityDAOgetAuthorities in interface AuthorityDAOpublic java.util.Set getRootAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String zoneName)
AuthorityDAOgetRootAuthorities in interface AuthorityDAOpublic 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)
AuthorityDAOfindAuthorities in interface AuthorityDAOparentAuthority - if non-null, will look only for authorities who are a child of the named parentimmediate - 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 zonespublic java.util.Set getContainedAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String parentName,
boolean immediate)
AuthorityDAOgetContainedAuthorities in interface AuthorityDAOparentName - the name of the containing authoritypublic void removeAuthority(java.lang.String parentName,
java.lang.String childName)
AuthorityDAOremoveAuthority in interface AuthorityDAOpublic java.util.Set getContainingAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String name,
boolean immediate)
AuthorityDAOgetContainingAuthorities in interface AuthorityDAOpublic java.util.Set getContainingAuthoritiesInZone(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String authority,
java.lang.String zoneName,
AuthorityService.AuthorityFilter filter,
int size)
AuthorityDAOgetContainingAuthoritiesInZone in interface AuthorityDAOtype - 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.public java.lang.String getShortName(java.lang.String name)
AuthorityDAOgetShortName in interface AuthorityDAOpublic java.lang.String getName(org.alfresco.service.cmr.security.AuthorityType type,
java.lang.String shortName)
AuthorityDAOgetName in interface AuthorityDAOprotected void addAuthorityNameIfMatches(java.util.Set authorities,
java.lang.String authorityName,
org.alfresco.service.cmr.security.AuthorityType type)
protected void addAuthorityNameIfMatches(java.util.Set authorities,
java.lang.String authorityName,
org.alfresco.service.cmr.security.AuthorityType type,
java.util.regex.Pattern pattern)
public boolean isAuthorityContained(java.lang.String authority,
java.lang.String authorityToFind,
java.util.Set positiveHits,
java.util.Set negativeHits)
isAuthorityContained in interface AuthorityDAOpublic org.alfresco.service.cmr.repository.NodeRef getAuthorityNodeRefOrNull(java.lang.String name)
AuthorityDAOgetAuthorityNodeRefOrNull in interface AuthorityDAOpublic java.lang.String getAuthorityName(org.alfresco.service.cmr.repository.NodeRef authorityRef)
AuthorityDAOgetAuthorityName in interface AuthorityDAOauthorityRef - authority nodepublic java.lang.String getAuthorityDisplayName(java.lang.String authorityName)
AuthorityDAOgetAuthorityDisplayName in interface AuthorityDAOpublic void setAuthorityDisplayName(java.lang.String authorityName,
java.lang.String authorityDisplayName)
AuthorityDAOsetAuthorityDisplayName in interface AuthorityDAOpublic org.alfresco.service.cmr.repository.NodeRef getOrCreateZone(java.lang.String zoneName)
AuthorityDAOgetOrCreateZone in interface AuthorityDAOzoneName - the zone namepublic org.alfresco.service.cmr.repository.NodeRef getZone(java.lang.String zoneName)
AuthorityDAOgetZone in interface AuthorityDAOzoneName - the zone namepublic java.util.Set getAuthorityZones(java.lang.String name)
AuthorityDAOgetAuthorityZones in interface AuthorityDAOname - the authority long namenull if the authority does not exist.public java.util.Set getAllAuthoritiesInZone(java.lang.String zoneName,
org.alfresco.service.cmr.security.AuthorityType type)
AuthorityDAOgetAllAuthoritiesInZone in interface AuthorityDAOzoneName - the zone nametype - the authority type to filter by or null for all authority typespublic void addAuthorityToZones(java.lang.String authorityName,
java.util.Set zones)
AuthorityDAOaddAuthorityToZones in interface AuthorityDAOpublic void removeAuthorityFromZones(java.lang.String authorityName,
java.util.Set zones)
AuthorityDAOremoveAuthorityFromZones in interface AuthorityDAOpublic void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicynodeRef - the node referencepublic void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
NodeServicePolicies.OnUpdatePropertiesPolicyonUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicynodeRef - reference to the updated nodebefore - the node's properties before the changeafter - the node's properties after the changepublic void init()
public void onRefreshableCacheEvent(RefreshableCacheEvent refreshableCacheEvent)
RefreshableCacheListeneronRefreshableCacheEvent in interface RefreshableCacheListenerpublic java.lang.String getCacheId()
RefreshableCacheListenergetCacheId in interface RefreshableCacheListenerpublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.ExceptionCopyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.