com.objectplanet.survey.event
Class EventBusManager

java.lang.Object
  extended bycom.objectplanet.survey.event.EventBusManager

public class EventBusManager
extends java.lang.Object

The EventBus is the global event notification mechanism. A number of events are sent by opinio; these are classes in the com.objectplanet.survey.event.events package.

Author:
Torgeir Lund
Created:
03. November 2005

Field Summary
static int BUS_TYPE_INVITATION
          Event type for invitation events.
static int BUS_TYPE_PANEL
          Event type for system admin events.
static int BUS_TYPE_REPORT
          Event type for report events.
static int BUS_TYPE_SURVEY
          Event type for Survey events.
static int BUS_TYPE_SURVEY_MANAGEMENT
          Event type for survey management events.
static int BUS_TYPE_SYSTEM_ADMIN
          Event type for system admin events.
static int BUS_TYPE_USER
          Event type for user administration events.
static int EVENT_TYPE_ABANDONED_SURVEY_EVENT
           
static int EVENT_TYPE_ALL
           
static int EVENT_TYPE_BRANCH_CONDITION_DELETED
           
static int EVENT_TYPE_DISPLAY_QUESTION
           
static int EVENT_TYPE_IMPORTED_SURVEY
           
static int EVENT_TYPE_INVITATION_PANELIST_INVITED
           
static int EVENT_TYPE_INVITATION_PRE_DELETE
           
static int EVENT_TYPE_INVITATION_PRE_INVITEE_DELETE
           
static int EVENT_TYPE_INVITATION_PRE_INVITEE_DELETE_ALL
           
static int EVENT_TYPE_INVITATION_TASK_COMPLETE
           
static int EVENT_TYPE_INVITEE_IMPORT
           
static int EVENT_TYPE_LICENSES_SAVED
           
static int EVENT_TYPE_LOAD_SURVEY
           
static int EVENT_TYPE_NEW_BRANCH_CONDITION
           
static int EVENT_TYPE_NEW_LIVE_RESPONDENT
           
static int EVENT_TYPE_NEW_QUESTION
           
static int EVENT_TYPE_NEW_REPORT
           
static int EVENT_TYPE_NEW_RESPONDENT
           
static int EVENT_TYPE_NEW_SIGNUP_SURVEY
           
static int EVENT_TYPE_NEW_SURVEY
           
static int EVENT_TYPE_NEW_SURVEY_FOLDER
           
static int EVENT_TYPE_NEW_TRANSLATED_SURVEY
           
static int EVENT_TYPE_NEW_USER
           
static int EVENT_TYPE_POLL_IMPRESSION
           
static int EVENT_TYPE_POST_DELETE_PANELISTS
           
static int EVENT_TYPE_POST_DELETE_RESPONDENTS
           
static int EVENT_TYPE_PRE_DELETE_RESPONDENTS
           
static int EVENT_TYPE_PRE_SIGNUP_SURVEY_DELETE
           
static int EVENT_TYPE_PRE_SURVEY_DELETE
           
static int EVENT_TYPE_PRE_SURVEY_FOLDER_DELETE
           
static int EVENT_TYPE_PRE_SURVEY_PAGE
           
static int EVENT_TYPE_PRE_USER_DELETE
           
static int EVENT_TYPE_QUESTION_DELETED
           
static int EVENT_TYPE_REPORT_DELETED
           
static int EVENT_TYPE_RESPONDENT_COMPLETE
           
static int EVENT_TYPE_RESPONDENT_DATA_FOUND
           
static int EVENT_TYPE_RESPONDENT_STORE
           
static int EVENT_TYPE_RESPONDENTS_EXPORTED
           
static int EVENT_TYPE_RESPONSE
           
static int EVENT_TYPE_SURVEY_DELETED
           
static int EVENT_TYPE_SURVEY_FOLDER_DELETED
           
static int EVENT_TYPE_SURVEY_SAVE
           
static int EVENT_TYPE_SURVEY_UPDATED
           
static int EVENT_TYPE_SYSTEM_INFO_SAVED
           
static int EVENT_TYPE_TRANSIENT_RESPONDENT_COMPLETE
           
static int EVENT_TYPE_TRANSLATED_SURVEY_DELETED
           
static int EVENT_TYPE_USER_DELETED
           
static int EVENT_TYPE_USER_UPDATE
           
 
Method Summary
 void addListener(IEventListener listener)
          Adds a listener to the bus.
 void addListener(IEventListener listener, int busType)
          Adds a listener to the bus.
 void addListener(IEventListener listener, int busType, int eventType)
          Adds a listener to the bus.
 void addListener(IEventListener listener, int busType, int eventType, long resourceId)
          Adds a listener to a specific bus and event type, and a particular resource.
static EventBusManager instance()
          Returns or creates the singleton instance of the search engine manager class
 void removeListener(IEventListener listener)
          Removes a listener from the bus.
 void removeListener(IEventListener listener, int busType)
          Removes a listener from the bus, that listens to events on a specific bus.
 void removeListener(IEventListener listener, int busType, int eventType)
          Removes a listener from the bus, that listens to events on a specific bus.
 void removeListener(IEventListener listener, int busType, int eventType, long resourceId)
          Removes a listener from the bus, that listens to events on a specific bus.
 void send(Event event)
          Special/internal use only.
 void send(Event event, int busType)
          Special/internal use only.
 void send(Event event, int busType, int eventType)
          Sends an event of a specified type on a specific event bus.
 void send(Event event, int busType, int eventType, long resourceId)
          Sends an event (of specified type) on a specific event bus, for a specific resource (a survey, for example).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUS_TYPE_SURVEY

public static final int BUS_TYPE_SURVEY
Event type for Survey events.

See Also:
Constant Field Values

BUS_TYPE_USER

public static final int BUS_TYPE_USER
Event type for user administration events.

See Also:
Constant Field Values

BUS_TYPE_REPORT

public static final int BUS_TYPE_REPORT
Event type for report events.

See Also:
Constant Field Values

BUS_TYPE_INVITATION

public static final int BUS_TYPE_INVITATION
Event type for invitation events.

See Also:
Constant Field Values

BUS_TYPE_SURVEY_MANAGEMENT

public static final int BUS_TYPE_SURVEY_MANAGEMENT
Event type for survey management events.

See Also:
Constant Field Values

BUS_TYPE_SYSTEM_ADMIN

public static final int BUS_TYPE_SYSTEM_ADMIN
Event type for system admin events.

See Also:
Constant Field Values

BUS_TYPE_PANEL

public static final int BUS_TYPE_PANEL
Event type for system admin events.

See Also:
Constant Field Values

EVENT_TYPE_ALL

public static final int EVENT_TYPE_ALL
See Also:
Constant Field Values

EVENT_TYPE_NEW_USER

public static final int EVENT_TYPE_NEW_USER
See Also:
Constant Field Values

EVENT_TYPE_PRE_USER_DELETE

public static final int EVENT_TYPE_PRE_USER_DELETE
See Also:
Constant Field Values

EVENT_TYPE_USER_DELETED

public static final int EVENT_TYPE_USER_DELETED
See Also:
Constant Field Values

EVENT_TYPE_USER_UPDATE

public static final int EVENT_TYPE_USER_UPDATE
See Also:
Constant Field Values

EVENT_TYPE_PRE_SURVEY_PAGE

public static final int EVENT_TYPE_PRE_SURVEY_PAGE
See Also:
Constant Field Values

EVENT_TYPE_NEW_RESPONDENT

public static final int EVENT_TYPE_NEW_RESPONDENT
See Also:
Constant Field Values

EVENT_TYPE_RESPONDENT_STORE

public static final int EVENT_TYPE_RESPONDENT_STORE
See Also:
Constant Field Values

EVENT_TYPE_RESPONDENT_COMPLETE

public static final int EVENT_TYPE_RESPONDENT_COMPLETE
See Also:
Constant Field Values

EVENT_TYPE_RESPONDENT_DATA_FOUND

public static final int EVENT_TYPE_RESPONDENT_DATA_FOUND
See Also:
Constant Field Values

EVENT_TYPE_RESPONSE

public static final int EVENT_TYPE_RESPONSE
See Also:
Constant Field Values

EVENT_TYPE_DISPLAY_QUESTION

public static final int EVENT_TYPE_DISPLAY_QUESTION
See Also:
Constant Field Values

EVENT_TYPE_TRANSIENT_RESPONDENT_COMPLETE

public static final int EVENT_TYPE_TRANSIENT_RESPONDENT_COMPLETE
See Also:
Constant Field Values

EVENT_TYPE_ABANDONED_SURVEY_EVENT

public static final int EVENT_TYPE_ABANDONED_SURVEY_EVENT
See Also:
Constant Field Values

EVENT_TYPE_SURVEY_SAVE

public static final int EVENT_TYPE_SURVEY_SAVE
See Also:
Constant Field Values

EVENT_TYPE_NEW_LIVE_RESPONDENT

public static final int EVENT_TYPE_NEW_LIVE_RESPONDENT
See Also:
Constant Field Values

EVENT_TYPE_POLL_IMPRESSION

public static final int EVENT_TYPE_POLL_IMPRESSION
See Also:
Constant Field Values

EVENT_TYPE_NEW_SURVEY

public static final int EVENT_TYPE_NEW_SURVEY
See Also:
Constant Field Values

EVENT_TYPE_PRE_SURVEY_DELETE

public static final int EVENT_TYPE_PRE_SURVEY_DELETE
See Also:
Constant Field Values

EVENT_TYPE_SURVEY_DELETED

public static final int EVENT_TYPE_SURVEY_DELETED
See Also:
Constant Field Values

EVENT_TYPE_PRE_DELETE_RESPONDENTS

public static final int EVENT_TYPE_PRE_DELETE_RESPONDENTS
See Also:
Constant Field Values

EVENT_TYPE_POST_DELETE_RESPONDENTS

public static final int EVENT_TYPE_POST_DELETE_RESPONDENTS
See Also:
Constant Field Values

EVENT_TYPE_IMPORTED_SURVEY

public static final int EVENT_TYPE_IMPORTED_SURVEY
See Also:
Constant Field Values

EVENT_TYPE_PRE_SIGNUP_SURVEY_DELETE

public static final int EVENT_TYPE_PRE_SIGNUP_SURVEY_DELETE
See Also:
Constant Field Values

EVENT_TYPE_NEW_SIGNUP_SURVEY

public static final int EVENT_TYPE_NEW_SIGNUP_SURVEY
See Also:
Constant Field Values

EVENT_TYPE_NEW_SURVEY_FOLDER

public static final int EVENT_TYPE_NEW_SURVEY_FOLDER
See Also:
Constant Field Values

EVENT_TYPE_PRE_SURVEY_FOLDER_DELETE

public static final int EVENT_TYPE_PRE_SURVEY_FOLDER_DELETE
See Also:
Constant Field Values

EVENT_TYPE_SURVEY_FOLDER_DELETED

public static final int EVENT_TYPE_SURVEY_FOLDER_DELETED
See Also:
Constant Field Values

EVENT_TYPE_NEW_QUESTION

public static final int EVENT_TYPE_NEW_QUESTION
See Also:
Constant Field Values

EVENT_TYPE_QUESTION_DELETED

public static final int EVENT_TYPE_QUESTION_DELETED
See Also:
Constant Field Values

EVENT_TYPE_NEW_TRANSLATED_SURVEY

public static final int EVENT_TYPE_NEW_TRANSLATED_SURVEY
See Also:
Constant Field Values

EVENT_TYPE_TRANSLATED_SURVEY_DELETED

public static final int EVENT_TYPE_TRANSLATED_SURVEY_DELETED
See Also:
Constant Field Values

EVENT_TYPE_NEW_REPORT

public static final int EVENT_TYPE_NEW_REPORT
See Also:
Constant Field Values

EVENT_TYPE_REPORT_DELETED

public static final int EVENT_TYPE_REPORT_DELETED
See Also:
Constant Field Values

EVENT_TYPE_NEW_BRANCH_CONDITION

public static final int EVENT_TYPE_NEW_BRANCH_CONDITION
See Also:
Constant Field Values

EVENT_TYPE_BRANCH_CONDITION_DELETED

public static final int EVENT_TYPE_BRANCH_CONDITION_DELETED
See Also:
Constant Field Values

EVENT_TYPE_LOAD_SURVEY

public static final int EVENT_TYPE_LOAD_SURVEY
See Also:
Constant Field Values

EVENT_TYPE_RESPONDENTS_EXPORTED

public static final int EVENT_TYPE_RESPONDENTS_EXPORTED
See Also:
Constant Field Values

EVENT_TYPE_SURVEY_UPDATED

public static final int EVENT_TYPE_SURVEY_UPDATED
See Also:
Constant Field Values

EVENT_TYPE_INVITATION_TASK_COMPLETE

public static final int EVENT_TYPE_INVITATION_TASK_COMPLETE
See Also:
Constant Field Values

EVENT_TYPE_INVITATION_PRE_INVITEE_DELETE

public static final int EVENT_TYPE_INVITATION_PRE_INVITEE_DELETE
See Also:
Constant Field Values

EVENT_TYPE_INVITATION_PRE_INVITEE_DELETE_ALL

public static final int EVENT_TYPE_INVITATION_PRE_INVITEE_DELETE_ALL
See Also:
Constant Field Values

EVENT_TYPE_INVITATION_PANELIST_INVITED

public static final int EVENT_TYPE_INVITATION_PANELIST_INVITED
See Also:
Constant Field Values

EVENT_TYPE_INVITATION_PRE_DELETE

public static final int EVENT_TYPE_INVITATION_PRE_DELETE
See Also:
Constant Field Values

EVENT_TYPE_INVITEE_IMPORT

public static final int EVENT_TYPE_INVITEE_IMPORT
See Also:
Constant Field Values

EVENT_TYPE_SYSTEM_INFO_SAVED

public static final int EVENT_TYPE_SYSTEM_INFO_SAVED
See Also:
Constant Field Values

EVENT_TYPE_LICENSES_SAVED

public static final int EVENT_TYPE_LICENSES_SAVED
See Also:
Constant Field Values

EVENT_TYPE_POST_DELETE_PANELISTS

public static final int EVENT_TYPE_POST_DELETE_PANELISTS
See Also:
Constant Field Values
Method Detail

instance

public static EventBusManager instance()
Returns or creates the singleton instance of the search engine manager class

Returns:
The Search Engine manager instance

addListener

public void addListener(IEventListener listener)
Adds a listener to the bus. It will receive all events sent on the bus.

Parameters:
listener - The listener to add

addListener

public void addListener(IEventListener listener,
                        int busType)
Adds a listener to the bus. It will receive events being sent on a specific bus type. No event type is specified with this method, so the receiver will get all events for all event types on this bus.

Parameters:
listener - The listener to add
busType - Event Bus to add the listener to

addListener

public void addListener(IEventListener listener,
                        int busType,
                        int eventType)
Adds a listener to the bus. It will receive events of a specific event type sent on the bus. No resource id is specified, so the listener will get all events for the specified event type (all "new survey event" for all surveys, for example).

Parameters:
listener - The listener to add
busType - Event Bus to add the listener to
eventType - The event type. The listener will receive events for this type only

addListener

public void addListener(IEventListener listener,
                        int busType,
                        int eventType,
                        long resourceId)
Adds a listener to a specific bus and event type, and a particular resource.

Parameters:
listener - The listener to add
busType - The bus type to add the listener to.
eventType - The event type to add the listener to.
resourceId - the id of the resource associated with the event. Use 0 (zero) for all recourses.

removeListener

public void removeListener(IEventListener listener)
Removes a listener from the bus. Only listeners that listens to all events will be removed.

Parameters:
listener - The listener to remove

removeListener

public void removeListener(IEventListener listener,
                           int busType)
Removes a listener from the bus, that listens to events on a specific bus.


removeListener

public void removeListener(IEventListener listener,
                           int busType,
                           int eventType)
Removes a listener from the bus, that listens to events on a specific bus.


removeListener

public void removeListener(IEventListener listener,
                           int busType,
                           int eventType,
                           long resourceId)
Removes a listener from the bus, that listens to events on a specific bus.


send

public void send(Event event)
Special/internal use only. Use send methods that specify target listeners as much as possible (specify with bus type, event type, and resource id if possible) Sends an event to listeners that listens to all events. It will *not* send the event to all listeners (listeners that listens events for a specific event bus, for example). The event will be sent to all listeners in turn, with the original sender receiving it last. The sender will receive the event event when it is vetoed.

Parameters:
event - The event

send

public void send(Event event,
                 int busType)
Special/internal use only. Use send methods that specify target listeners as much as possible (specify with event type, and resource id if possible) Sends an event on the event bus of a specific type. The event will also be sent to listeners listening to all events in the system.

Parameters:
event - The event to send
busType - Bus to send the event on

send

public void send(Event event,
                 int busType,
                 int eventType)
Sends an event of a specified type on a specific event bus. The event will also be sent to listeners listening on all events for this bus type, and to listeners listening to all events in the system. If resource id associated with event is available, use the send method that specifies this id.

Parameters:
event -
busType -
eventType -

send

public void send(Event event,
                 int busType,
                 int eventType,
                 long resourceId)
Sends an event (of specified type) on a specific event bus, for a specific resource (a survey, for example). The event will also be sent to listeners listening on all events for this bus type, and to listeners listening to all events in the system.

Parameters:
event - The event to send
busType - Bus to send the event on
eventType - The type of event
resourceId - Resource id of the entity related to this event

Copyright © ObjectPlanet Inc. All Rights Reserved.

Built on January 31 2008