public class PersonServiceImpl extends TransactionListenerAdapter implements PersonService, NodeServicePolicies.BeforeCreateNodePolicy, NodeServicePolicies.OnCreateNodePolicy, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy
| Modifier and Type | Class and Description |
|---|---|
static class |
PersonServiceImpl.NodeIdComparator |
PersonService.PersonInfoPolicy.Arg| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
KEY_ALLOW_UID_UPDATE |
static java.lang.String |
PEOPLE_FOLDER_SHORT_QNAME |
static java.lang.String |
SYSTEM_FOLDER_SHORT_QNAME |
QNAMEQNAMEQNAMEARG_0, ARG_1, ARG_2, QNAME| Constructor and Description |
|---|
PersonServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCommit()
Process clean up any duplicates that were flagged during the transaction.
|
void |
beforeCommit(boolean readOnly)
Called before a transaction is committed.
|
void |
beforeCreateNode(org.alfresco.service.cmr.repository.NodeRef parentRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
org.alfresco.service.namespace.QName nodeTypeQName)
Called before a new node is created.
|
void |
beforeCreateNodeValidation(org.alfresco.service.cmr.repository.NodeRef parentRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
org.alfresco.service.namespace.QName nodeTypeQName) |
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Called before a node is deleted.
|
void |
beforeDeleteNodeValidation(org.alfresco.service.cmr.repository.NodeRef nodeRef) |
int |
countPeople()
Counts the number of persons registered with the system.
|
boolean |
createMissingPeople()
Does this service create people on demand if they are missing.
|
org.alfresco.service.cmr.repository.NodeRef |
createPerson(java.util.Map properties)
Create a new person with the given properties.
|
org.alfresco.service.cmr.repository.NodeRef |
createPerson(java.util.Map properties,
java.util.Set zones)
Create a new person with the given properties, recording them against the given zone name (usually identifying an
external user registry from which the details were obtained).
|
void |
deletePerson(org.alfresco.service.cmr.repository.NodeRef personRef)
Delete the person identified by the given ref.
|
void |
deletePerson(java.lang.String userName)
Delete the person identified by the given user name.
|
boolean |
equals(java.lang.Object obj) |
java.util.Set |
getAllPeople()
Deprecated.
see getPeople
|
java.util.Set |
getMutableProperties()
Get the list of properties that are mutable.
|
org.alfresco.query.PagingResults |
getPeople(java.util.List stringPropFilters,
boolean filterIgnoreCase,
java.util.List sortProps,
org.alfresco.query.PagingRequest pagingRequest)
Get paged list of people optionally filtered and/or sorted
|
org.alfresco.service.cmr.repository.NodeRef |
getPeopleContainer()
Return the container that stores people.
|
java.util.Set |
getPeopleFilteredByProperty(org.alfresco.service.namespace.QName propertyKey,
java.io.Serializable propertyValue,
int count)
Get people filtered by the given property name/value pair.
|
org.alfresco.service.cmr.repository.NodeRef |
getPerson(java.lang.String userName)
Get a person by userName.
|
org.alfresco.service.cmr.repository.NodeRef |
getPerson(java.lang.String userName,
boolean autoCreateHomeFolderAndMissingPersonIfAllowed)
Retrieve the person NodeRef for a
username, optionally creating
the home folder if it does not exist and optionally creating the person
if they don't exist AND the PersonService is configured to allow the
creation of missing persons PersonService.setCreateMissingPeople(boolean). |
java.lang.String |
getUserIdentifier(java.lang.String caseSensitiveUserName)
Given the case sensitive user name find the approriate identifier from the person service.
|
boolean |
getUserNamesAreCaseSensitive()
Are user names case sensitive?
|
int |
hashCode() |
void |
init()
Spring bean init method
|
boolean |
isEnabled(java.lang.String userName)
Is the specified user, enabled
|
boolean |
isMutable()
Can this service create, delete and update person information?
|
void |
notifyPerson(java.lang.String userName,
java.lang.String password)
Notifies a user by email that their account has been created, and the details of it.
|
void |
onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Called when a new node has been created.
|
void |
onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
When a uid is changed we need to create an alias for the old uid so permissions are not broken.
|
void |
onUpdatePropertiesUser(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
Track the
enabled/disabled flag on cm:user. |
boolean |
personExists(java.lang.String caseSensitiveUserName)
Check if a person exists.
|
void |
setAclDAO(AclDAO aclDao) |
void |
setAuthenticationService(MutableAuthenticationService authenticationService) |
void |
setAuthorityService(AuthorityService authorityService) |
void |
setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry cannedQueryRegistry)
Set the registry of
canned queries |
void |
setCreateMissingPeople(boolean createMissingPeople)
Set if missing people should be created.
|
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) |
void |
setDuplicateMode(java.lang.String duplicateMode) |
void |
setHomeFolderCreationEager(boolean homeFolderCreationEager)
Indicates if home folders should be created when the person
is created or delayed until first accessed.
|
void |
setHomeFolderManager(HomeFolderManager homeFolderManager) |
void |
setIncludeAutoCreated(boolean includeAutoCreated) |
void |
setLastIsBest(boolean lastIsBest) |
void |
setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPermissionServiceSPI(PermissionServiceSPI permissionServiceSPI) |
void |
setPermissionsManager(PermissionsManager permissionsManager) |
void |
setPersonCache(org.alfresco.repo.cache.SimpleCache personCache)
Set the username to person cache.
|
void |
setPersonProperties(java.lang.String userName,
java.util.Map properties)
Set the properties on a person - some of these may be persisted in
different locations - the home folder is created if it doesn't exist
|
void |
setPersonProperties(java.lang.String userName,
java.util.Map properties,
boolean autoCreateHomeFolder)
Set the properties on a person - some of these may be persisted in different locations.
|
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setProcessDuplicates(boolean processDuplicates) |
void |
setRepoAdminService(RepoAdminService repoAdminService) |
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService) |
void |
setServiceRegistry(ServiceRegistry serviceRegistry) |
void |
setStoreUrl(java.lang.String storeUrl) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
setTransactionService(TransactionService transactionService) |
void |
setUserNameMatcher(UserNameMatcher userNameMatcher) |
static java.lang.String |
updateUsernameForTenancy(java.lang.String username,
org.alfresco.repo.tenant.TenantService tenantService)
Helper for when creating new users and people:
Updates the supplied username with any required tenant
details, and ensures that the tenant domains match.
|
afterRollback, beforeCompletion, flushpublic static final java.lang.String SYSTEM_FOLDER_SHORT_QNAME
public static final java.lang.String PEOPLE_FOLDER_SHORT_QNAME
public static final java.lang.String KEY_ALLOW_UID_UPDATE
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void init()
public void setCreateMissingPeople(boolean createMissingPeople)
setCreateMissingPeople in interface PersonServicecreateMissingPeople - set to true to create peoplePersonService.getPerson(String)public void setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
public void setAuthorityService(AuthorityService authorityService)
public void setAuthenticationService(MutableAuthenticationService authenticationService)
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
public void setPermissionServiceSPI(PermissionServiceSPI permissionServiceSPI)
public void setTransactionService(TransactionService transactionService)
public void setServiceRegistry(ServiceRegistry serviceRegistry)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
public void setRepoAdminService(RepoAdminService repoAdminService)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setStoreUrl(java.lang.String storeUrl)
public void setUserNameMatcher(UserNameMatcher userNameMatcher)
public void setDuplicateMode(java.lang.String duplicateMode)
public void setIncludeAutoCreated(boolean includeAutoCreated)
public void setLastIsBest(boolean lastIsBest)
public void setProcessDuplicates(boolean processDuplicates)
public void setHomeFolderManager(HomeFolderManager homeFolderManager)
public void setHomeFolderCreationEager(boolean homeFolderCreationEager)
public void setAclDAO(AclDAO aclDao)
public void setPermissionsManager(PermissionsManager permissionsManager)
public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry cannedQueryRegistry)
canned queriespublic void setPersonCache(org.alfresco.repo.cache.SimpleCache personCache)
public org.alfresco.service.cmr.repository.NodeRef getPerson(java.lang.String userName)
to create missing people or not.
The home folder will also be created as a side effect if it does not exist.getPerson in interface PersonServiceuserName - -
the userName key to find the personPersonService.setCreateMissingPeople(boolean),
PersonService.createMissingPeople()public org.alfresco.service.cmr.repository.NodeRef getPerson(java.lang.String userName,
boolean autoCreateHomeFolderAndMissingPersonIfAllowed)
username, optionally creating
the home folder if it does not exist and optionally creating the person
if they don't exist AND the PersonService is configured to allow the
creation of missing persons PersonService.setCreateMissingPeople(boolean).
If not allowed to create missing persons and the person does not exist
a NoSuchPersonException exception will be thrown.getPerson in interface PersonServiceuserName - of the person NodeRef to retrieveautoCreateHomeFolderAndMissingPersonIfAllowed - If the person exits:
should we create the home folder if it does not exist?
If the person exists AND the creation of missing persons is allowed
should we create both the person and home folder.public boolean personExists(java.lang.String caseSensitiveUserName)
personExists in interface PersonServicecaseSensitiveUserName - the user namepublic void afterCommit()
afterCommit in interface TransactionListenerafterCommit in class TransactionListenerAdapterpublic boolean createMissingPeople()
createMissingPeople in interface PersonServicepublic java.util.Set getMutableProperties()
getMutableProperties in interface PersonServicepublic void setPersonProperties(java.lang.String userName,
java.util.Map properties)
setPersonProperties in interface PersonServiceuserName - -
the user for which the properties should be set.properties - -
the map of properties to set (as the NodeService)public void setPersonProperties(java.lang.String userName,
java.util.Map properties,
boolean autoCreateHomeFolder)
setPersonProperties in interface PersonServiceuserName - - the user for which the properties should be set.properties - - the map of properties to set (as the NodeService)autoCreateHomeFolder - should we auto-create the home folder if it doesn't exist.public boolean isMutable()
isMutable in interface PersonServicepublic org.alfresco.service.cmr.repository.NodeRef createPerson(java.util.Map properties)
createPerson in interface PersonServicepublic org.alfresco.service.cmr.repository.NodeRef createPerson(java.util.Map properties,
java.util.Set zones)
createPerson in interface PersonServiceproperties - the propertieszones - a set if zones including the identifier for the external user registry owning the person information, or null or an empty setpublic void notifyPerson(java.lang.String userName,
java.lang.String password)
PersonService.createPerson(Map) or PersonService.createPerson(Map, Set)
where email notifications are required.notifyPerson in interface PersonServiceuserName - of the person to notifypassword - of the person to notifypublic org.alfresco.service.cmr.repository.NodeRef getPeopleContainer()
getPeopleContainer in interface PersonServicepublic void deletePerson(java.lang.String userName)
deletePerson in interface PersonServicepublic void deletePerson(org.alfresco.service.cmr.repository.NodeRef personRef)
deletePerson in interface PersonServicepublic java.util.Set getAllPeople()
getAllPeople in interface PersonServicepublic org.alfresco.query.PagingResults getPeople(java.util.List stringPropFilters,
boolean filterIgnoreCase,
java.util.List sortProps,
org.alfresco.query.PagingRequest pagingRequest)
getPeople in interface PersonServicefilterIgnoreCase - true to ignore case when filtering, false to be case-sensitive when filteringsortProps - sort property, eg. cm:username ascendingpagingRequest - skip, max + optional query execution idpublic java.util.Set getPeopleFilteredByProperty(org.alfresco.service.namespace.QName propertyKey,
java.io.Serializable propertyValue,
int count)
PersonService.getPeople(List, boolean, List, PagingRequest)getPeopleFilteredByProperty in interface PersonServicepropertyKey - property key of property to filter people bypropertyValue - property value of property to filter people bycount - the number of results to retrieve, up to a maximum of 1000PersonService.getPeople(List, boolean, List, PagingRequest)public void onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
onCreateNode in interface NodeServicePolicies.OnCreateNodePolicychildAssocRef - the created child association referencepublic void beforeCreateNode(org.alfresco.service.cmr.repository.NodeRef parentRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
org.alfresco.service.namespace.QName nodeTypeQName)
NodeServicePolicies.BeforeCreateNodePolicybeforeCreateNode in interface NodeServicePolicies.BeforeCreateNodePolicyparentRef - the parent node referenceassocTypeQName - the association type qualified nameassocQName - the association qualified namenodeTypeQName - the node type qualified namepublic void beforeCreateNodeValidation(org.alfresco.service.cmr.repository.NodeRef parentRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
org.alfresco.service.namespace.QName nodeTypeQName)
public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeServicePolicies.BeforeDeleteNodePolicybeforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicynodeRef - the node referencepublic void beforeDeleteNodeValidation(org.alfresco.service.cmr.repository.NodeRef nodeRef)
public java.lang.String getUserIdentifier(java.lang.String caseSensitiveUserName)
getUserIdentifier in interface PersonServicepublic boolean getUserNamesAreCaseSensitive()
getUserNamesAreCaseSensitive in interface PersonServicepublic void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicynodeRef - reference to the updated nodebefore - the node's properties before the changeafter - the node's properties after the changepublic void onUpdatePropertiesUser(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
enabled/disabled flag on cm:user.public void beforeCommit(boolean readOnly)
All transaction resources are still available.
beforeCommit in interface TransactionListenerbeforeCommit in class TransactionListenerAdapterreadOnly - true if the transaction is read-onlypublic int countPeople()
PersonServicecountPeople in interface PersonServicepublic static java.lang.String updateUsernameForTenancy(java.lang.String username,
org.alfresco.repo.tenant.TenantService tenantService)
throws TenantDomainMismatchException
TenantDomainMismatchExceptionpublic boolean isEnabled(java.lang.String userName)
PersonServiceisEnabled in interface PersonServiceCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.