org.alfresco.bm.user
Class CreateUsers

java.lang.Object
  extended by org.alfresco.bm.event.AbstractEventProcessor
      extended by org.alfresco.bm.user.CreateUsers
All Implemented Interfaces:
EventProcessor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

public class CreateUsers
extends AbstractEventProcessor

Input

None

Data

No data requirements.

Actions

A number of users is scheduled to be created in batches. This event will reschedule itself repeatedly until enough users have been created.

Output

EVENT_NAME_CREATE_USER: User to create EVENT_NAME_CREATE_USERS: Returned when more users should be scheduled

Author:
Frederik Heremans

Field Summary
static String EVENT_NAME_CREATE_USER
           
static String EVENT_NAME_CREATE_USERS
           
static String EVENT_NAME_USERS_CREATED
           
 
Fields inherited from class org.alfresco.bm.event.AbstractEventProcessor
DEFAULT_WARN_DELAY, logger
 
Constructor Summary
CreateUsers(UserDataService userDataService, long numberOfUsers)
          Creates a new instance.
 
Method Summary
 EventResult processEvent(Event event)
          Process an event.
 void setBatchSize(int batchSize)
          Override the default batch size
 void setEventNameCreateUsers(String eventNameCreateUsers)
          Override the default event name for more user creation scheduling
 void setEventNameUsersCreated(String eventNameUsersCreated)
          Override the default event name indicating that enough users have been created
 
Methods inherited from class org.alfresco.bm.event.AbstractEventProcessor
getWarnDelay, register, setBeanName, setEventName, setEventNames, setRegistry, setWarnDelay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_NAME_CREATE_USER

public static final String EVENT_NAME_CREATE_USER
See Also:
Constant Field Values

EVENT_NAME_CREATE_USERS

public static final String EVENT_NAME_CREATE_USERS
See Also:
Constant Field Values

EVENT_NAME_USERS_CREATED

public static final String EVENT_NAME_USERS_CREATED
See Also:
Constant Field Values
Constructor Detail

CreateUsers

public CreateUsers(UserDataService userDataService,
                   long numberOfUsers)
Creates a new instance.

Parameters:
numberOfUsers - number of users to create in total
userDataService - service for UserData operations
Method Detail

setBatchSize

public void setBatchSize(int batchSize)
Override the default batch size


setEventNameCreateUsers

public void setEventNameCreateUsers(String eventNameCreateUsers)
Override the default event name for more user creation scheduling


setEventNameUsersCreated

public void setEventNameUsersCreated(String eventNameUsersCreated)
Override the default event name indicating that enough users have been created


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.

Parameters:
event - the event (along with associated data)
Returns:
the result of the process (includes errors and next events)
Throws:
Exception


Copyright © 2012. All Rights Reserved.