org.alfresco.bm.user
Class CreateUser
java.lang.Object
org.alfresco.bm.event.AbstractEventProcessor
org.alfresco.bm.http.AuthenticatedHttpEventProcessor
org.alfresco.bm.user.CreateUser
- All Implemented Interfaces:
- EventProcessor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware
public class CreateUser
- extends AuthenticatedHttpEventProcessor
Event processor that creates a test-user in the alfresco-system based on the
username present in the event and inserts an entry in mongo.
Input
Username of user to create
Data
Collection containing users. User will be marked as created and alfresco node-id
will be stored.
Actions
The user is created in alfresco through REST. An exception is thrown when user creation fails. When
user already existed in alfresco when processed and 'ignoreExistingUsers' property is set to true,
the event is considered processed successfuly instead of throwing an exception.
Output
No next event will be scheduled.
- Since:
- 1.1
- Author:
- Frederik Heremans
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PEOPLE_URL
public static final String PEOPLE_URL
- URL for people-related operations
- See Also:
- Constant Field Values
PEOPLE_PICKER_URL
public static final String PEOPLE_PICKER_URL
- URL for getting a single cm:person object based on a username.
Parameters:
- The username. Be sure this name is unique and isn't part of another username.
Eg. 'user1' and 'user12' will both appear when searching 'user1', with 'user12' as first result. This is not desirable so
make sure usernames end with a constant, eg: 'user-1-' to have unique name-parts.
- See Also:
- Constant Field Values
PEOPLE_JSON_USERNAME
public static final String PEOPLE_JSON_USERNAME
- See Also:
- Constant Field Values
PEOPLE_JSON_FIRSTNAME
public static final String PEOPLE_JSON_FIRSTNAME
- See Also:
- Constant Field Values
PEOPLE_JSON_LASTNAME
public static final String PEOPLE_JSON_LASTNAME
- See Also:
- Constant Field Values
PEOPLE_JSON_EMAIL
public static final String PEOPLE_JSON_EMAIL
- See Also:
- Constant Field Values
PEOPLE_JSON_PASSWORD
public static final String PEOPLE_JSON_PASSWORD
- See Also:
- Constant Field Values
PEOPLE_JSON_NODEREF
public static final String PEOPLE_JSON_NODEREF
- See Also:
- Constant Field Values
CreateUser
public CreateUser(UserDataService userDataService,
HttpClientProvider httpClientProvider,
AuthenticationDetailsProvider authenticationDetailsProvider)
processEvent
public EventResult processEvent(Event event)
throws Exception
- Description copied from interface:
EventProcessor
- Process an event.
NOTE: All errors are treated as terminal i.e. there will be no
follow-up events published. The event and result services are provided to allow
event processing to be aware of previous and future work. If the service is used
to modify queues, the results could be unexpected e.g. clearing the queue will not
always mean that no more events will be processed.
- Specified by:
processEvent in interface EventProcessor- Specified by:
processEvent in class AuthenticatedHttpEventProcessor
- Parameters:
event - the event (along with associated data)
- Returns:
- the result of the process (includes errors and next events)
- Throws:
Exception
setIgnoreExistingUsers
public void setIgnoreExistingUsers(boolean ignoreExistingUsers)
- Parameters:
ignoreExistingUsers - whether or not to ignore existing users when creating. If set to true
the event will be successful when executed. If set to false, an exception will be thrown when
user already exists.
Copyright © 2012. All Rights Reserved.