public class AuthorityDAOImpl extends Object implements AuthorityDAO, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, org.alfresco.util.cache.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(Collection<String> parentNames,
String childName)
Add a child authority to the given parent authorities
|
protected void |
addAuthorityNameIfMatches(Set<String> authorities,
String authorityName,
org.alfresco.service.cmr.security.AuthorityType type) |
protected void |
addAuthorityNameIfMatches(Set<String> authorities,
String authorityName,
org.alfresco.service.cmr.security.AuthorityType type,
Pattern pattern) |
void |
addAuthorityToZones(String authorityName,
Set<String> zones)
Add an authority to zones
|
void |
afterPropertiesSet() |
boolean |
authorityExists(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(String name,
String authorityDisplayName,
Set<String> authorityZones)
Create an authority.
|
void |
deleteAuthority(String name)
Delete an authority.
|
Set<String> |
findAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
String parentAuthority,
boolean immediate,
String displayNamePattern,
String zoneName)
Find authorities by display name pattern.
|
Set<String> |
getAllAuthoritiesInZone(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<String> |
getAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
String zoneName,
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<AuthorityInfo> |
getAuthoritiesInfo(org.alfresco.service.cmr.security.AuthorityType type,
String zoneName,
String displayNameFilter,
String sortBy,
boolean sortAscending,
org.alfresco.query.PagingRequest pagingRequest)
Get AuthorityInfo by type and/or zone (both cannot be null).
|
String |
getAuthorityDisplayName(String authorityName)
Get the display name for an authority
|
String |
getAuthorityName(org.alfresco.service.cmr.repository.NodeRef authorityRef)
Gets the name for the given authority node
|
org.alfresco.service.cmr.repository.NodeRef |
getAuthorityNodeRefOrNull(String name)
Get a node ref for the authority if one exists
|
Set<String> |
getAuthorityZones(String name)
Gets the name of the zone containing the specified authority.
|
String |
getCacheId() |
Set<String> |
getContainedAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
String parentName,
boolean immediate)
Get contained authorities.
|
Set<String> |
getContainingAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
String name,
boolean immediate)
Get the authorities that contain the one given.
|
Set<String> |
getContainingAuthoritiesInZone(org.alfresco.service.cmr.security.AuthorityType type,
String authority,
String zoneName,
AuthorityService.AuthorityFilter filter,
int size)
Get a set of authorities with varying filter criteria
|
long |
getGroupCount()
Count groups i.e.
|
String |
getName(org.alfresco.service.cmr.security.AuthorityType type,
String shortName)
Create the full identifier for an authority given its short name and type.
|
org.alfresco.service.cmr.repository.NodeRef |
getOrCreateZone(String zoneName)
Gets or creates an authority zone node with the specified name
|
long |
getPersonCount()
Count people i.e.
|
Set<String> |
getRootAuthorities(org.alfresco.service.cmr.security.AuthorityType type,
String zoneName)
Get root authorities
|
String |
getShortName(String name)
Extract the short name of an authority from its full identifier.
|
org.alfresco.service.cmr.repository.NodeRef |
getZone(String zoneName)
Gets an authority zone node with the specified name
|
void |
init() |
boolean |
isAuthorityContained(String authority,
String authorityToFind,
Set<String> positiveHits,
Set<String> negativeHits) |
void |
onRefreshableCacheEvent(org.alfresco.util.cache.RefreshableCacheEvent refreshableCacheEvent) |
void |
onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> after)
Called after a node's properties have been changed.
|
void |
removeAuthority(String parentName,
String childName)
Remove an authority.
|
void |
removeAuthority(String parentName,
String childName,
boolean cacheRefresh)
Remove an authority without authorityBridgeTableCache refresh.
|
void |
removeAuthorityFromZones(String authorityName,
Set<String> zones)
Remove an authority from zones.
|
void |
setAclDAO(AclDAO aclDao) |
void |
setAuthorityBridgeDAO(AuthorityBridgeDAO authorityBridgeDAO) |
void |
setAuthorityBridgeTableCache(AuthorityBridgeTableAsynchronouslyRefreshedCache authorityBridgeTableCache) |
void |
setAuthorityDisplayName(String authorityName,
String authorityDisplayName)
Set the display name for an authority
|
void |
setAuthorityLookupCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.util.Pair<String,String>,org.alfresco.service.cmr.repository.NodeRef> authorityLookupCache) |
void |
setCannedQueryDAO(CannedQueryDAO cannedQueryDAO) |
void |
setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<?>> cannedQueryRegistry) |
void |
setChildAuthorityCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.service.cmr.repository.NodeRef,org.alfresco.util.Pair<Map<org.alfresco.service.cmr.repository.NodeRef,String>,List<org.alfresco.service.cmr.repository.NodeRef>>> 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<String,Object> singletonCache) |
void |
setStoreUrl(String storeUrl) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
setUseBridgeTable(boolean useBridgeTable) |
void |
setUserAuthorityCache(org.alfresco.repo.cache.SimpleCache<String,Set<String>> userAuthorityCache) |
void |
setZoneAuthorityCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.util.Pair<String,String>,List<org.alfresco.service.cmr.repository.ChildAssociationRef>> 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(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<org.alfresco.util.Pair<String,String>,org.alfresco.service.cmr.repository.NodeRef> authorityLookupCache)
public void setUserAuthorityCache(org.alfresco.repo.cache.SimpleCache<String,Set<String>> userAuthorityCache)
public void setZoneAuthorityCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.util.Pair<String,String>,List<org.alfresco.service.cmr.repository.ChildAssociationRef>> zoneAuthorityCache)
public void setChildAuthorityCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.service.cmr.repository.NodeRef,org.alfresco.util.Pair<Map<org.alfresco.service.cmr.repository.NodeRef,String>,List<org.alfresco.service.cmr.repository.NodeRef>>> 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<String,Object> 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<org.alfresco.query.CannedQueryFactory<?>> cannedQueryRegistry)
public 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(String name)
AuthorityDAOauthorityExists in interface AuthorityDAOpublic void addAuthority(Collection<String> parentNames, String childName)
AuthorityDAOaddAuthority in interface AuthorityDAOpublic void createAuthority(String name, String authorityDisplayName, Set<String> authorityZones)
AuthorityDAOcreateAuthority in interface AuthorityDAOpublic void deleteAuthority(String name)
AuthorityDAOdeleteAuthority in interface AuthorityDAOpublic org.alfresco.query.PagingResults<AuthorityInfo> getAuthoritiesInfo(org.alfresco.service.cmr.security.AuthorityType type, String zoneName, String displayNameFilter, 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<String> getAuthorities(org.alfresco.service.cmr.security.AuthorityType type, String zoneName, String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, org.alfresco.query.PagingRequest pagingRequest)
AuthorityDAOgetAuthorities in interface AuthorityDAOpublic Set<String> getRootAuthorities(org.alfresco.service.cmr.security.AuthorityType type, String zoneName)
AuthorityDAOgetRootAuthorities in interface AuthorityDAOpublic Set<String> findAuthorities(org.alfresco.service.cmr.security.AuthorityType type, String parentAuthority, boolean immediate, String displayNamePattern, 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 Set<String> getContainedAuthorities(org.alfresco.service.cmr.security.AuthorityType type, String parentName, boolean immediate)
AuthorityDAOgetContainedAuthorities in interface AuthorityDAOparentName - the name of the containing authoritypublic void removeAuthority(String parentName, String childName)
AuthorityDAOremoveAuthority in interface AuthorityDAOpublic void removeAuthority(String parentName, String childName, boolean cacheRefresh)
AuthorityDAOremoveAuthority in interface AuthorityDAOpublic Set<String> getContainingAuthorities(org.alfresco.service.cmr.security.AuthorityType type, String name, boolean immediate)
AuthorityDAOgetContainingAuthorities in interface AuthorityDAOpublic Set<String> getContainingAuthoritiesInZone(org.alfresco.service.cmr.security.AuthorityType type, String authority, 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 String getShortName(String name)
AuthorityDAOgetShortName in interface AuthorityDAOpublic String getName(org.alfresco.service.cmr.security.AuthorityType type, String shortName)
AuthorityDAOgetName in interface AuthorityDAOprotected void addAuthorityNameIfMatches(Set<String> authorities, String authorityName, org.alfresco.service.cmr.security.AuthorityType type)
protected void addAuthorityNameIfMatches(Set<String> authorities, String authorityName, org.alfresco.service.cmr.security.AuthorityType type, Pattern pattern)
public boolean isAuthorityContained(String authority, String authorityToFind, Set<String> positiveHits, Set<String> negativeHits)
isAuthorityContained in interface AuthorityDAOpublic org.alfresco.service.cmr.repository.NodeRef getAuthorityNodeRefOrNull(String name)
AuthorityDAOgetAuthorityNodeRefOrNull in interface AuthorityDAOpublic String getAuthorityName(org.alfresco.service.cmr.repository.NodeRef authorityRef)
AuthorityDAOgetAuthorityName in interface AuthorityDAOauthorityRef - authority nodepublic String getAuthorityDisplayName(String authorityName)
AuthorityDAOgetAuthorityDisplayName in interface AuthorityDAOpublic void setAuthorityDisplayName(String authorityName, String authorityDisplayName)
AuthorityDAOsetAuthorityDisplayName in interface AuthorityDAOpublic org.alfresco.service.cmr.repository.NodeRef getOrCreateZone(String zoneName)
AuthorityDAOgetOrCreateZone in interface AuthorityDAOzoneName - the zone namepublic org.alfresco.service.cmr.repository.NodeRef getZone(String zoneName)
AuthorityDAOgetZone in interface AuthorityDAOzoneName - the zone namepublic Set<String> getAuthorityZones(String name)
AuthorityDAOgetAuthorityZones in interface AuthorityDAOname - the authority long namenull if the authority does not exist.public Set<String> getAllAuthoritiesInZone(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(String authorityName, Set<String> zones)
AuthorityDAOaddAuthorityToZones in interface AuthorityDAOpublic void removeAuthorityFromZones(String authorityName, Set<String> 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,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> 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(org.alfresco.util.cache.RefreshableCacheEvent refreshableCacheEvent)
onRefreshableCacheEvent in interface org.alfresco.util.cache.RefreshableCacheListenerpublic String getCacheId()
getCacheId in interface org.alfresco.util.cache.RefreshableCacheListenerCopyright © 2005–2018 Alfresco Software. All rights reserved.