org.alfresco.repo.security.person
Class PersonServiceImpl

java.lang.Object
  extended by org.alfresco.repo.transaction.TransactionListenerAdapter
      extended by org.alfresco.repo.security.person.PersonServiceImpl
All Implemented Interfaces:
NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnCreateNodePolicy, ClassPolicy, Policy, TransactionListener, PersonService

public class PersonServiceImpl
extends TransactionListenerAdapter
implements PersonService, NodeServicePolicies.OnCreateNodePolicy, NodeServicePolicies.BeforeDeleteNodePolicy


Nested Class Summary
static class PersonServiceImpl.CreationDateComparator
           
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Field Summary
static java.lang.String PEOPLE_FOLDER_SHORT_QNAME
           
static java.lang.String SYSTEM_FOLDER_SHORT_QNAME
           
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
PersonServiceImpl()
           
 
Method Summary
 void afterCommit()
          Process clean up any duplicates that were flagged during the transaction.
 void beforeDeleteNode(NodeRef nodeRef)
          Called before a node is deleted.
 boolean createMissingPeople()
          Does this service create people on demand if they are missing.
 NodeRef createPerson(java.util.Map properties)
          Create a new person with the given properties.
 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()
          Get all the people we know about.
 java.util.Set getMutableProperties()
          Get the list of properties that are mutable.
 NodeRef getPeopleContainer()
          Return the container that stores people.
 java.util.Set getPeopleFilteredByProperty(QName propertyKey, java.io.Serializable propertyValue)
          Get people filtered by the given property name/value pair
 NodeRef getPerson(java.lang.String userName)
          Retrieve the person NodeRef for a username key.
 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 isMutable()
          Can this service create, delete and update person information?
 void onCreateNode(ChildAssociationRef childAssocRef)
          Called when a new node has been created.
 boolean personExists(java.lang.String caseSensitiveUserName)
          Check if a person exists.
 void setAuthorityService(AuthorityService authorityService)
           
 void setCreateMissingPeople(boolean createMissingPeople)
          Set if missing people should be created.
 void setDictionaryService(DictionaryService dictionaryService)
           
 void setDuplicateMode(java.lang.String duplicateMode)
           
 void setIncludeAutoCreated(boolean includeAutoCreated)
           
 void setLastIsBest(boolean lastIsBest)
           
 void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)
           
 void setNodeService(NodeService nodeService)
           
 void setPermissionServiceSPI(PermissionServiceSPI permissionServiceSPI)
           
 void setPersonCache(SimpleCache personCache)
          Set the username to person cache.
 void setPersonDao(PersonDao personDao)
           
 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.
 void setPolicyComponent(PolicyComponent policyComponent)
           
 void setProcessDuplicates(boolean processDuplicates)
           
 void setSearchService(SearchService searchService)
           
 void setStoreUrl(java.lang.String storeUrl)
           
 void setTenantService(TenantService tenantService)
           
 void setTransactionService(TransactionService transactionService)
           
 void setUserNamesAreCaseSensitive(boolean userNamesAreCaseSensitive)
           
 
Methods inherited from class org.alfresco.repo.transaction.TransactionListenerAdapter
afterRollback, beforeCommit, beforeCompletion, flush
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSTEM_FOLDER_SHORT_QNAME

public static final java.lang.String SYSTEM_FOLDER_SHORT_QNAME
See Also:
Constant Field Values

PEOPLE_FOLDER_SHORT_QNAME

public static final java.lang.String PEOPLE_FOLDER_SHORT_QNAME
See Also:
Constant Field Values
Constructor Detail

PersonServiceImpl

public PersonServiceImpl()
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

init

public void init()
Spring bean init method


getUserNamesAreCaseSensitive

public boolean getUserNamesAreCaseSensitive()
Description copied from interface: PersonService
Are user names case sensitive?

Specified by:
getUserNamesAreCaseSensitive in interface PersonService
Returns:

setUserNamesAreCaseSensitive

public void setUserNamesAreCaseSensitive(boolean userNamesAreCaseSensitive)

setDuplicateMode

public void setDuplicateMode(java.lang.String duplicateMode)

setIncludeAutoCreated

public void setIncludeAutoCreated(boolean includeAutoCreated)

setLastIsBest

public void setLastIsBest(boolean lastIsBest)

setProcessDuplicates

public void setProcessDuplicates(boolean processDuplicates)

setPersonDao

public void setPersonDao(PersonDao personDao)

setPersonCache

public void setPersonCache(SimpleCache personCache)
Set the username to person cache.

Parameters:
personCache - a transactionally safe cache

getPerson

public NodeRef getPerson(java.lang.String userName)
Retrieve the person NodeRef for a username key. Depending on configuration missing people will be created if not found, else a NoSuchPersonException exception will be thrown.

Specified by:
getPerson in interface PersonService
Parameters:
userName - of the person NodeRef to retrieve
Returns:
NodeRef of the person as specified by the username
Throws:
NoSuchPersonException
See Also:
PersonService.setCreateMissingPeople(boolean), PersonService.createMissingPeople()

personExists

public boolean personExists(java.lang.String caseSensitiveUserName)
Description copied from interface: PersonService
Check if a person exists.

Specified by:
personExists in interface PersonService
Parameters:
caseSensitiveUserName - the user name
Returns:
Returns true if the user exists, otherwise false

afterCommit

public void afterCommit()
Process clean up any duplicates that were flagged during the transaction.

Specified by:
afterCommit in interface TransactionListener
Overrides:
afterCommit in class TransactionListenerAdapter

createMissingPeople

public boolean createMissingPeople()
Description copied from interface: PersonService
Does this service create people on demand if they are missing. If this is true, a call to getPerson() will create a person if they are missing.

Specified by:
createMissingPeople in interface PersonService
Returns:
true if people are created on demand and false otherwise.

getMutableProperties

public java.util.Set getMutableProperties()
Description copied from interface: PersonService
Get the list of properties that are mutable. Some service may only allow a limited list of properties to be changed. This may be those persisted in the repository or those that can be changed in some other implementation such as LDAP.

Specified by:
getMutableProperties in interface PersonService
Returns:
A set of QNames that identify properties that can be changed

setPersonProperties

public void setPersonProperties(java.lang.String userName,
                                java.util.Map properties)
Description copied from interface: PersonService
Set the properties on a person - some of these may be persisted in different locations.

Specified by:
setPersonProperties in interface PersonService
Parameters:
userName - - the user for which the properties should be set.
properties - - the map of properties to set (as the NodeService)

isMutable

public boolean isMutable()
Description copied from interface: PersonService
Can this service create, delete and update person information?

Specified by:
isMutable in interface PersonService
Returns:
true if this service allows mutation to people.

createPerson

public NodeRef createPerson(java.util.Map properties)
Description copied from interface: PersonService
Create a new person with the given properties. The userName is one of the properties. Users with duplicate userNames are not allowed.

Specified by:
createPerson in interface PersonService
Returns:

getPeopleContainer

public NodeRef getPeopleContainer()
Description copied from interface: PersonService
Return the container that stores people.

Specified by:
getPeopleContainer in interface PersonService
Returns:

deletePerson

public void deletePerson(java.lang.String userName)
Description copied from interface: PersonService
Delete the person identified by the given user name.

Specified by:
deletePerson in interface PersonService

getAllPeople

public java.util.Set getAllPeople()
Description copied from interface: PersonService
Get all the people we know about.

Specified by:
getAllPeople in interface PersonService
Returns:
a set of people in no specific order.

getPeopleFilteredByProperty

public java.util.Set getPeopleFilteredByProperty(QName propertyKey,
                                                 java.io.Serializable propertyValue)
Description copied from interface: PersonService
Get people filtered by the given property name/value pair

Specified by:
getPeopleFilteredByProperty in interface PersonService
Parameters:
propertyKey - property key of property to filter people by
propertyValue - property value of property to filter people by
Returns:
people filtered by the given property name/value pair

onCreateNode

public void onCreateNode(ChildAssociationRef childAssocRef)
Description copied from interface: NodeServicePolicies.OnCreateNodePolicy
Called when a new node has been created.

Specified by:
onCreateNode in interface NodeServicePolicies.OnCreateNodePolicy
Parameters:
childAssocRef - the created child association reference

beforeDeleteNode

public void beforeDeleteNode(NodeRef nodeRef)
Description copied from interface: NodeServicePolicies.BeforeDeleteNodePolicy
Called before a node is deleted.

Specified by:
beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicy
Parameters:
nodeRef - the node reference

setCreateMissingPeople

public void setCreateMissingPeople(boolean createMissingPeople)
Description copied from interface: PersonService
Set if missing people should be created.

Specified by:
setCreateMissingPeople in interface PersonService
Parameters:
createMissingPeople - set to true to create people
See Also:
PersonService.getPerson(String)

setNamespacePrefixResolver

public void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)

setAuthorityService

public void setAuthorityService(AuthorityService authorityService)

setDictionaryService

public void setDictionaryService(DictionaryService dictionaryService)

setPermissionServiceSPI

public void setPermissionServiceSPI(PermissionServiceSPI permissionServiceSPI)

setTransactionService

public void setTransactionService(TransactionService transactionService)

setNodeService

public void setNodeService(NodeService nodeService)

setTenantService

public void setTenantService(TenantService tenantService)

setSearchService

public void setSearchService(SearchService searchService)

setPolicyComponent

public void setPolicyComponent(PolicyComponent policyComponent)

setStoreUrl

public void setStoreUrl(java.lang.String storeUrl)

getUserIdentifier

public java.lang.String getUserIdentifier(java.lang.String caseSensitiveUserName)
Description copied from interface: PersonService
Given the case sensitive user name find the approriate identifier from the person service. If the system is case sensitive it will return the same string. If case insentive it will return the common object. If the user does not exist it will return null;

Specified by:
getUserIdentifier in interface PersonService
Returns:


Copyright © 2005 - 2008 Alfresco Software, Inc. All Rights Reserved.