public class AuthorityDAOImpl extends 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(Collection<String> parentNames,
String childName)
Add a child authority to the given parent authorities
|
protected void |
addAuthorityNameIfMatches(Set<String> authorities,
String authorityName,
AuthorityType type) |
protected void |
addAuthorityNameIfMatches(Set<String> authorities,
String authorityName,
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(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(AuthorityType type,
String parentAuthority,
boolean immediate,
String displayNamePattern,
String zoneName)
Find authorities by display name pattern.
|
Set<String> |
getAllAuthoritiesInZone(String zoneName,
AuthorityType type)
Gets the names of all authorities in a zone, optionally filtered by type.
|
PagingResults<String> |
getAuthorities(AuthorityType type,
String zoneName,
String displayNameFilter,
boolean sortByDisplayName,
boolean sortAscending,
PagingRequest pagingRequest)
Get authority names by type and/or zone (both cannot be null).
|
PagingResults<AuthorityInfo> |
getAuthoritiesInfo(AuthorityType type,
String zoneName,
String displayNameFilter,
String sortBy,
boolean sortAscending,
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(NodeRef authorityRef)
Gets the name for the given authority node
|
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(AuthorityType type,
String parentName,
boolean immediate)
Get contained authorities.
|
Set<String> |
getContainingAuthorities(AuthorityType type,
String name,
boolean immediate)
Get the authorities that contain the one given.
|
Set<String> |
getContainingAuthoritiesInZone(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(AuthorityType type,
String shortName)
Create the full identifier for an authority given its short name and type.
|
NodeRef |
getOrCreateZone(String zoneName)
Gets or creates an authority zone node with the specified name
|
long |
getPersonCount()
Count people i.e.
|
Set<String> |
getRootAuthorities(AuthorityType type,
String zoneName)
Get root authorities
|
String |
getShortName(String name)
Extract the short name of an authority from its full identifier.
|
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(RefreshableCacheEvent refreshableCacheEvent) |
void |
onUpdateProperties(NodeRef nodeRef,
Map<QName,Serializable> before,
Map<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(SimpleCache<Pair<String,String>,NodeRef> authorityLookupCache) |
void |
setCannedQueryDAO(CannedQueryDAO cannedQueryDAO) |
void |
setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<?>> cannedQueryRegistry) |
void |
setChildAuthorityCache(SimpleCache<NodeRef,Pair<Map<NodeRef,String>,List<NodeRef>>> childAuthorityCache) |
void |
setDictionaryService(DictionaryService dictionaryService) |
void |
setFindAuthoritiesLimit(int findAuthoritiesLimit) |
void |
setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver) |
void |
setNodeService(NodeService nodeService) |
void |
setPersonService(PersonService personService) |
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setQnameDAO(QNameDAO qnameDAO) |
void |
setSearchService(SearchService searchService) |
void |
setSingletonCache(SimpleCache<String,Object> singletonCache) |
void |
setStoreUrl(String storeUrl) |
void |
setTenantService(TenantService tenantService) |
void |
setUseBridgeTable(boolean useBridgeTable) |
void |
setUserAuthorityCache(SimpleCache<String,Set<String>> userAuthorityCache) |
void |
setZoneAuthorityCache(SimpleCache<Pair<String,String>,List<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(DictionaryService dictionaryService)
public void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)
public void setNodeService(NodeService nodeService)
public void setSearchService(SearchService searchService)
public void setAuthorityLookupCache(SimpleCache<Pair<String,String>,NodeRef> authorityLookupCache)
public void setUserAuthorityCache(SimpleCache<String,Set<String>> userAuthorityCache)
public void setZoneAuthorityCache(SimpleCache<Pair<String,String>,List<ChildAssociationRef>> zoneAuthorityCache)
public void setChildAuthorityCache(SimpleCache<NodeRef,Pair<Map<NodeRef,String>,List<NodeRef>>> childAuthorityCache)
public void setAuthorityBridgeTableCache(AuthorityBridgeTableAsynchronouslyRefreshedCache authorityBridgeTableCache)
public void setUseBridgeTable(boolean useBridgeTable)
useBridgeTable - the useBridgeTable to setpublic void setPersonService(PersonService personService)
public void setTenantService(TenantService tenantService)
public void setSingletonCache(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(NamedObjectRegistry<CannedQueryFactory<?>> cannedQueryRegistry)
public void setAuthorityBridgeDAO(AuthorityBridgeDAO authorityBridgeDAO)
authorityBridgeDAO - the authorityBridgeDAO to setpublic void setFindAuthoritiesLimit(int findAuthoritiesLimit)
public 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 PagingResults<AuthorityInfo> getAuthoritiesInfo(AuthorityType type, String zoneName, String displayNameFilter, String sortBy, boolean sortAscending, PagingRequest pagingRequest)
AuthorityDAOgetAuthoritiesInfo in interface AuthorityDAOsortBy - either "displayName", "shortName", "authorityName" or null if no sorting.public PagingResults<String> getAuthorities(AuthorityType type, String zoneName, String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, PagingRequest pagingRequest)
AuthorityDAOgetAuthorities in interface AuthorityDAOpublic Set<String> getRootAuthorities(AuthorityType type, String zoneName)
AuthorityDAOgetRootAuthorities in interface AuthorityDAOpublic Set<String> findAuthorities(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(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(AuthorityType type, String name, boolean immediate)
AuthorityDAOgetContainingAuthorities in interface AuthorityDAOpublic Set<String> getContainingAuthoritiesInZone(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(AuthorityType type, String shortName)
AuthorityDAOgetName in interface AuthorityDAOprotected void addAuthorityNameIfMatches(Set<String> authorities, String authorityName, AuthorityType type)
protected void addAuthorityNameIfMatches(Set<String> authorities, String authorityName, AuthorityType type, Pattern pattern)
public boolean isAuthorityContained(String authority, String authorityToFind, Set<String> positiveHits, Set<String> negativeHits)
isAuthorityContained in interface AuthorityDAOpublic NodeRef getAuthorityNodeRefOrNull(String name)
AuthorityDAOgetAuthorityNodeRefOrNull in interface AuthorityDAOpublic String getAuthorityName(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 NodeRef getOrCreateZone(String zoneName)
AuthorityDAOgetOrCreateZone in interface AuthorityDAOzoneName - the zone namepublic 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, 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(NodeRef nodeRef)
beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicynodeRef - the node referencepublic void onUpdateProperties(NodeRef nodeRef, Map<QName,Serializable> before, Map<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(RefreshableCacheEvent refreshableCacheEvent)
onRefreshableCacheEvent in interface RefreshableCacheListenerpublic String getCacheId()
getCacheId in interface RefreshableCacheListenerCopyright © 2005–2020 Alfresco Software. All rights reserved.