mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
16780: Fix failing unit test - HeartBeat now needs to be constructed inside a transaction. 16765: Merged DEV/BELARUS/V3.2-2009_10_05 to V3.2 16754: ETHREEOH-2534: SPP does not authenticate when authentication chain contains both alfrescoNtlm and passthru types. - NTLM Authentication handler for Sharepoint module was implemented as singleton. But after it was integrated into Alfresco Authentication Subsystem, instance of this object is created for each type of NTLM authentication. As result static field with NTLM flags was rewrited for each instance. Bug was resolved by removing static indicator. 16751: LDAP sync improvements - Correction to the way retried transactional errors are reported - Addition of unit test for synchronization with a mock user registry generating a large volume of users, groups and associations 16749: Removed UserUsageBootstrapJob from scheduled jobs and moved UserUsageTrackingComponent to bootstrap - files missed from CHK-9619 16748: User Usage Tracking Component bootstrapped synchronously to avoid its expensive queries across all users 'stepping on top of' other bootstrap activity such as LDAP synchronization - Its startup messages are no longer masked out by log4j.properties - Logged ETHREEOH-3009 regarding upgrade impact of new faster queries 16747: Lower impact of HeartBeat service on server performance - More efficient AuthorityService APIs used to determine the total number of groups and users more efficiently - Queries of all users and groups done synchronously at startup only 16746: Improvements for faster user and group lookup and association on a large repository (unfortunately intertwined) - NodeService getChildAssocRefsByTypeQNames query rewritten to use a subquery to force a more logical evaluation order on MySQL - NodeService getChildAssocs method made to use more efficient getChildAssocRefsByTypeQNames DAO call when a type qname but no assoc qname is specified - NodeService getUsersWithoutUsage / getUsersWithUsage queries rewritten to avoid an expensive outer join on all users - PersonService getPersonIgnoreCase query corrected to include the type QName ID of the child associations it is querying (thus avoiding unnecessarily triggering duplicate person removal) - PersonService now supports an optional boolean argument to getPerson that indicates whether the auto-create + home folder creation behaviour should be triggered. - AuthorityDAOImpl now uses false argument to getPerson call to avoid lazy home folder creation during creation of group associations - AuthorityDAOImpl now specifies assoc type to getChildAssocs in getAllAuthoritiesInZone and findAuthorities calls so that the more efficient query variant is used - Redundant personExists() call removed from authorityServiceImpl git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16914 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
227 lines
8.1 KiB
Java
227 lines
8.1 KiB
Java
/*
|
|
* Copyright (C) 2005-2009 Alfresco Software Limited.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
* As a special exception to the terms and conditions of version 2.0 of
|
|
* the GPL, you may redistribute this Program in connection with Free/Libre
|
|
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
|
* FLOSS exception. You should have received a copy of the text describing
|
|
* the FLOSS exception, and it is also available here:
|
|
* http://www.alfresco.com/legal/licensing"
|
|
*/
|
|
package org.alfresco.service.cmr.security;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
|
|
import org.alfresco.service.Auditable;
|
|
import org.alfresco.service.NotAuditable;
|
|
import org.alfresco.service.PublicService;
|
|
import org.alfresco.service.cmr.repository.NodeRef;
|
|
import org.alfresco.service.namespace.QName;
|
|
|
|
/**
|
|
* This service encapsulates the management of people and groups.
|
|
* <p>
|
|
* <p>
|
|
* People and groups may be managed entirely in the repository or entirely in
|
|
* some other implementation such as LDAP or via NTLM. Some properties may in
|
|
* the repository and some in another store. Individual properties may or may
|
|
* not be mutable.
|
|
* <p>
|
|
*
|
|
* @author Andy Hind
|
|
*/
|
|
@PublicService
|
|
public interface PersonService
|
|
{
|
|
/**
|
|
* Get a person by userName. The person is store in the repository. The
|
|
* person may be created as a side effect of this call, depending on the
|
|
* setting to
|
|
* {@link #setCreateMissingPeople(boolean) create missing people or not}.
|
|
*
|
|
* @param userName -
|
|
* the userName key to find the person
|
|
* @return Returns the person node, either existing or new
|
|
* @throws NoSuchPersonException
|
|
* if the user doesn't exist and could not be created
|
|
* automatically
|
|
*
|
|
* @see #setCreateMissingPeople(boolean)
|
|
* @see #createMissingPeople()
|
|
*/
|
|
@Auditable(parameters = {"userName"})
|
|
public NodeRef getPerson(String userName);
|
|
|
|
/**
|
|
* Retrieve the person NodeRef for a username key. Depending on the <code>autoCreate</code> parameter and
|
|
* configuration missing people will be created if not found, else a NoSuchPersonException exception will be thrown.
|
|
*
|
|
* @param userName
|
|
* of the person NodeRef to retrieve
|
|
* @param autoCreate
|
|
* should we auto-create the person node and home folder if they don't exist? (and configuration allows
|
|
* us to)
|
|
* @return NodeRef of the person as specified by the username
|
|
* @throws NoSuchPersonException
|
|
* if the person doesn't exist and can't be created
|
|
*/
|
|
@Auditable(parameters = {"userName", "autoCreate"})
|
|
public NodeRef getPerson(final String userName, final boolean autoCreate);
|
|
|
|
/**
|
|
* Check if a person exists.
|
|
*
|
|
* @param userName
|
|
* the user name
|
|
* @return Returns true if the user exists, otherwise false
|
|
*/
|
|
@Auditable(parameters = {"userName"})
|
|
public boolean personExists(String userName);
|
|
|
|
/**
|
|
* 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.
|
|
*
|
|
* @return true if people are created on demand and false otherwise.
|
|
*/
|
|
@Auditable
|
|
public boolean createMissingPeople();
|
|
|
|
/**
|
|
* Set if missing people should be created.
|
|
*
|
|
* @param createMissing
|
|
* set to true to create people
|
|
*
|
|
* @see #getPerson(String)
|
|
*/
|
|
@Auditable(parameters = {"createMissing"})
|
|
public void setCreateMissingPeople(boolean createMissing);
|
|
|
|
/**
|
|
* 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.
|
|
*
|
|
* @return A set of QNames that identify properties that can be changed
|
|
*/
|
|
@Auditable
|
|
public Set<QName> getMutableProperties();
|
|
|
|
/**
|
|
* Set the properties on a person - some of these may be persisted in
|
|
* different locations.
|
|
*
|
|
* @param userName -
|
|
* the user for which the properties should be set.
|
|
* @param properties -
|
|
* the map of properties to set (as the NodeService)
|
|
*/
|
|
@Auditable(parameters = {"userName", "properties"})
|
|
public void setPersonProperties(String userName, Map<QName, Serializable> properties);
|
|
|
|
/**
|
|
* Can this service create, delete and update person information?
|
|
*
|
|
* @return true if this service allows mutation to people.
|
|
*/
|
|
@Auditable
|
|
public boolean isMutable();
|
|
|
|
/**
|
|
* Create a new person with the given properties. The userName is one of the
|
|
* properties. Users with duplicate userNames are not allowed.
|
|
*
|
|
* @param properties
|
|
* @return
|
|
*/
|
|
@Auditable(parameters = {"properties"})
|
|
public NodeRef createPerson(Map<QName, Serializable> properties);
|
|
|
|
/**
|
|
* 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). The userName is one of the properties. Users with
|
|
* duplicate userNames are not allowed.
|
|
*
|
|
* @param properties
|
|
* the properties
|
|
* @param zones
|
|
* a set if zones including the identifier for the external user registry owning the person information, or <code>null</code> or an empty set
|
|
* @return the node ref
|
|
*/
|
|
@Auditable(parameters = {"properties", "zones"})
|
|
public NodeRef createPerson(Map<QName, Serializable> properties, Set<String> zones);
|
|
|
|
/**
|
|
* Delete the person identified by the given user name.
|
|
*
|
|
* @param userName
|
|
*/
|
|
@Auditable(parameters = {"userName"})
|
|
public void deletePerson(String userName);
|
|
|
|
/**
|
|
* Get all the people we know about.
|
|
*
|
|
* @return a set of people in no specific order.
|
|
*/
|
|
@Auditable
|
|
public Set<NodeRef> getAllPeople();
|
|
|
|
/**
|
|
* Get people filtered by the given property name/value pair
|
|
*
|
|
* @param propertyKey property key of property to filter people by
|
|
* @param propertyValue property value of property to filter people by
|
|
* @return people filtered by the given property name/value pair
|
|
*/
|
|
@Auditable
|
|
public Set<NodeRef> getPeopleFilteredByProperty(QName propertyKey, Serializable propertyValue);
|
|
|
|
/**
|
|
* Return the container that stores people.
|
|
*
|
|
* @return
|
|
*/
|
|
@Auditable
|
|
public NodeRef getPeopleContainer();
|
|
|
|
/**
|
|
* Are user names case sensitive?
|
|
*
|
|
* @return
|
|
*/
|
|
@Auditable
|
|
public boolean getUserNamesAreCaseSensitive();
|
|
|
|
/**
|
|
* 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;
|
|
*
|
|
* @param caseSensitiveUserName
|
|
* @return
|
|
*/
|
|
@NotAuditable
|
|
public String getUserIdentifier(String caseSensitiveUserName);
|
|
|
|
}
|