public class AuthorityDAOImpl extends Object implements AuthorityDAO, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, org.alfresco.util.cache.RefreshableCacheListener, org.springframework.beans.factory.InitializingBean
Policy.Arg
QNAME
ARG_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()
AuthorityDAO
type cm:person
.getPersonCount
in interface AuthorityDAO
public long getGroupCount()
AuthorityDAO
type cm:authorityContainer
.getGroupCount
in interface AuthorityDAO
public boolean authorityExists(String name)
AuthorityDAO
authorityExists
in interface AuthorityDAO
public void addAuthority(Collection<String> parentNames, String childName)
AuthorityDAO
addAuthority
in interface AuthorityDAO
public void createAuthority(String name, String authorityDisplayName, Set<String> authorityZones)
AuthorityDAO
createAuthority
in interface AuthorityDAO
public void deleteAuthority(String name)
AuthorityDAO
deleteAuthority
in interface AuthorityDAO
public 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)
AuthorityDAO
getAuthoritiesInfo
in interface AuthorityDAO
sortBy
- 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)
AuthorityDAO
getAuthorities
in interface AuthorityDAO
public Set<String> getRootAuthorities(org.alfresco.service.cmr.security.AuthorityType type, String zoneName)
AuthorityDAO
getRootAuthorities
in interface AuthorityDAO
public Set<String> findAuthorities(org.alfresco.service.cmr.security.AuthorityType type, String parentAuthority, boolean immediate, String displayNamePattern, String zoneName)
AuthorityDAO
findAuthorities
in interface AuthorityDAO
parentAuthority
- 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)
AuthorityDAO
getContainedAuthorities
in interface AuthorityDAO
parentName
- the name of the containing authoritypublic void removeAuthority(String parentName, String childName)
AuthorityDAO
removeAuthority
in interface AuthorityDAO
public void removeAuthority(String parentName, String childName, boolean cacheRefresh)
AuthorityDAO
removeAuthority
in interface AuthorityDAO
public Set<String> getContainingAuthorities(org.alfresco.service.cmr.security.AuthorityType type, String name, boolean immediate)
AuthorityDAO
getContainingAuthorities
in interface AuthorityDAO
public Set<String> getContainingAuthoritiesInZone(org.alfresco.service.cmr.security.AuthorityType type, String authority, String zoneName, AuthorityService.AuthorityFilter filter, int size)
AuthorityDAO
getContainingAuthoritiesInZone
in interface AuthorityDAO
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.public String getShortName(String name)
AuthorityDAO
getShortName
in interface AuthorityDAO
public String getName(org.alfresco.service.cmr.security.AuthorityType type, String shortName)
AuthorityDAO
getName
in interface AuthorityDAO
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)
public boolean isAuthorityContained(String authority, String authorityToFind, Set<String> positiveHits, Set<String> negativeHits)
isAuthorityContained
in interface AuthorityDAO
public org.alfresco.service.cmr.repository.NodeRef getAuthorityNodeRefOrNull(String name)
AuthorityDAO
getAuthorityNodeRefOrNull
in interface AuthorityDAO
public String getAuthorityName(org.alfresco.service.cmr.repository.NodeRef authorityRef)
AuthorityDAO
getAuthorityName
in interface AuthorityDAO
authorityRef
- authority nodepublic String getAuthorityDisplayName(String authorityName)
AuthorityDAO
getAuthorityDisplayName
in interface AuthorityDAO
public void setAuthorityDisplayName(String authorityName, String authorityDisplayName)
AuthorityDAO
setAuthorityDisplayName
in interface AuthorityDAO
public org.alfresco.service.cmr.repository.NodeRef getOrCreateZone(String zoneName)
AuthorityDAO
getOrCreateZone
in interface AuthorityDAO
zoneName
- the zone namepublic org.alfresco.service.cmr.repository.NodeRef getZone(String zoneName)
AuthorityDAO
getZone
in interface AuthorityDAO
zoneName
- the zone namepublic Set<String> getAuthorityZones(String name)
AuthorityDAO
getAuthorityZones
in interface AuthorityDAO
name
- the authority long namenull
if the authority does not exist.public Set<String> getAllAuthoritiesInZone(String zoneName, org.alfresco.service.cmr.security.AuthorityType type)
AuthorityDAO
getAllAuthoritiesInZone
in interface AuthorityDAO
zoneName
- the zone nametype
- the authority type to filter by or null
for all authority typespublic void addAuthorityToZones(String authorityName, Set<String> zones)
AuthorityDAO
addAuthorityToZones
in interface AuthorityDAO
public void removeAuthorityFromZones(String authorityName, Set<String> zones)
AuthorityDAO
removeAuthorityFromZones
in interface AuthorityDAO
public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
beforeDeleteNode
in interface NodeServicePolicies.BeforeDeleteNodePolicy
nodeRef
- 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.OnUpdatePropertiesPolicy
onUpdateProperties
in interface NodeServicePolicies.OnUpdatePropertiesPolicy
nodeRef
- 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.RefreshableCacheListener
public String getCacheId()
getCacheId
in interface org.alfresco.util.cache.RefreshableCacheListener
Copyright © 2005–2017 Alfresco Software. All rights reserved.