org.alfresco.bm.user
Class ScheduleInvites

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

public class ScheduleInvites
extends org.alfresco.bm.event.AbstractEventProcessor

Schedule Alfresco Cloud invites. This processor does not have to issue the invites but merely creates a queue of events that will lead to invitations being issues.

Input

No input requirements

Data

A MongoDB collection containing a population of users that need to be invited to join Alfresco.

Actions

The MongoDB collection is examined to find (see some users that have not registered. Events are created containing the user details and output and regular intervals. If the batch size is reached an event is created to schedule more invites.

Output

EVENT_NAME_INVITE: The user's email
EVENT_NAME_SCHEDULE_INVITES: No data

Since:
1.0
Author:
Derek Hulley

Field Summary
static int DEFAULT_BATCH_SIZE
           
static long DEFAULT_MIN_TIME_BETWEEN_INVITES
           
static float DEFAULT_TIME_BETWEEN_INVITES_BATCH_ADJUSTMENT
           
static String EVENT_NAME_INVITE
           
static String EVENT_NAME_SCHEDULE_INVITES
           
 
Fields inherited from class org.alfresco.bm.event.AbstractEventProcessor
DEFAULT_WARN_DELAY, logger
 
Constructor Summary
ScheduleInvites(org.springframework.data.mongodb.core.MongoTemplate mongo, String userData, long maxActiveUsers, long timeBetweenInvites)
           
 
Method Summary
 org.alfresco.bm.event.EventResult processEvent(org.alfresco.bm.event.Event event)
           
 void setBatchSize(int batchSize)
          Override the default batch size before the processor reschedules itself
 void setEventNameInvite(String eventNameInvite)
          Override the default invite event name.
 void setEventNameScheduleInvites(String eventNameScheduleInvite)
          Override the default schedule invites event name.
 void setMinTimeBetweenInvites(long minTimeBetweenInvites)
          Override the default minimum time between invites
 void setTimeBetweenInvitesBatchAdjustment(float timeBetweenInvitesBatchAdjustment)
          Override the default time between invites adjustment
 
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_BATCH_SIZE

public static final int DEFAULT_BATCH_SIZE
See Also:
Constant Field Values

DEFAULT_TIME_BETWEEN_INVITES_BATCH_ADJUSTMENT

public static final float DEFAULT_TIME_BETWEEN_INVITES_BATCH_ADJUSTMENT
See Also:
Constant Field Values

DEFAULT_MIN_TIME_BETWEEN_INVITES

public static final long DEFAULT_MIN_TIME_BETWEEN_INVITES
See Also:
Constant Field Values

EVENT_NAME_INVITE

public static final String EVENT_NAME_INVITE
See Also:
Constant Field Values

EVENT_NAME_SCHEDULE_INVITES

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

ScheduleInvites

public ScheduleInvites(org.springframework.data.mongodb.core.MongoTemplate mongo,
                       String userData,
                       long maxActiveUsers,
                       long timeBetweenInvites)
Parameters:
mongo - connection to MongoDB
userData - name of DB collection containing user details
maxActiveUsers - total number of users subscribed or invited
timeBetweenInvites - how long between each invite
Method Detail

setBatchSize

public void setBatchSize(int batchSize)
Override the default batch size before the processor reschedules itself


setTimeBetweenInvitesBatchAdjustment

public void setTimeBetweenInvitesBatchAdjustment(float timeBetweenInvitesBatchAdjustment)
Override the default time between invites adjustment


setMinTimeBetweenInvites

public void setMinTimeBetweenInvites(long minTimeBetweenInvites)
Override the default minimum time between invites


setEventNameInvite

public void setEventNameInvite(String eventNameInvite)
Override the default invite event name.


setEventNameScheduleInvites

public void setEventNameScheduleInvites(String eventNameScheduleInvite)
Override the default schedule invites event name.


processEvent

public org.alfresco.bm.event.EventResult processEvent(org.alfresco.bm.event.Event event)
                                               throws Exception
Throws:
Exception


Copyright © 2012. All Rights Reserved.