org.alfresco.bm.user
Class PrepareUsers

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

public class PrepareUsers
extends AbstractEventProcessor

Prepare a specific number of users for interaction with Alfresco. This does not actually create users in Alfresco but merely creates a population of users (email addresses, names, etc) that can be used by subsequent operations.
User data will be similar to this:

      {
        "_id" : ObjectId("504f19ce4ece382c484d3dc1"),
        "_class" : "org.alfresco.bm.user.UserData",
        "randomizer" : 774971,
        "username" : "0000001.test@00000.test",
        "password" : "0000001.test@00000.test",
        "created" : false,
        "firstName" : "0000001",
        "lastName" : "Test",
        "email" : "0000001.test@00000.test",
        "domain" : "00000.test",
        "cloudSignUp" :
        {
          "_id" : "activiti$10056",
          "key" : "2ef295d9-4c5e-45d2-b56a-a6693a8d36c9",
          "complete" : true
        }
      }
 
where the "randomizer" field is used to return users in a random order when querying for lists of users.

Input

None.

Data

No data requirements.

Actions

Users data objects are created. This data is local only.

Output

EVENT_NAME_USERS_PREPARED: Marker indicating completion

Since:
1.1
Author:
Derek Hulley

Field Summary
static long DEFAULT_USERS_PER_DOMAIN
           
static String EVENT_NAME_USERS_PREPARED
           
 
Fields inherited from class org.alfresco.bm.event.AbstractEventProcessor
DEFAULT_WARN_DELAY, logger
 
Constructor Summary
PrepareUsers(UserDataService userDataService, long numberOfUsers)
           
 
Method Summary
 EventResult processEvent(Event event)
          Process an event.
 void setEventNameUsersCreated(String eventNameUsersPrepared)
          Override the default event name when users have been prepared.
 void setUsersPerDomain(long usersPerDomain)
          Override the default number of users per email domain
 
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

DEFAULT_USERS_PER_DOMAIN

public static final long DEFAULT_USERS_PER_DOMAIN
See Also:
Constant Field Values

EVENT_NAME_USERS_PREPARED

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

PrepareUsers

public PrepareUsers(UserDataService userDataService,
                    long numberOfUsers)
Parameters:
userDataService - service for UserData operations
numberOfUsers - number of users to create in total
Method Detail

setUsersPerDomain

public void setUsersPerDomain(long usersPerDomain)
Override the default number of users per email domain


setEventNameUsersCreated

public void setEventNameUsersCreated(String eventNameUsersPrepared)
Override the default event name when users have been prepared.


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.