Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opencms.flex
Class CmsEvent  view CmsEvent download CmsEvent.java

java.lang.Object
  extended byjava.util.EventObject
      extended bycom.opencms.flex.CmsEvent
All Implemented Interfaces:
java.io.Serializable

public class CmsEvent
extends java.util.EventObject

Event class for OpenCms for system wide events that are thrown by various operations (e.g. publishing) and can be catched and processed by classes that implement the I_CmsEventListener interface.

Since:
FLEX alpha 1
Version:
$Revision: 1.5 $

Field Summary
private  com.opencms.file.CmsObject m_cms
          The CmsObject on which this event occurred
private  java.util.Map m_data
          The event data associated with this event
private  boolean m_isClusterEvent
          Boolean whether this event should be clustered
private  int m_type
          The event type this instance represents
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CmsEvent(com.opencms.file.CmsObject cms, int type, java.util.Map data)
          Construct a new CmsEvent with the specified parameters, this constructor just calls this(cms, type, data, false).
CmsEvent(com.opencms.file.CmsObject cms, int type, java.util.Map data, boolean isClusterEvent)
          Construct a new CmsEvent with the specified parameters.
 
Method Summary
 com.opencms.file.CmsObject getCmsObject()
          Provides access to the CmsObject that was passed with this event.
 java.util.Map getData()
          Provides access to the event data that was passed with this event.
 int getType()
          Provides access to the event type that was passed with this event.
 boolean isClusterEvent()
          Check whether this event should be forwarded to the other servers in the cluster or not.
 void setClusterEvent(boolean value)
          Set the boolean flag whether this event should be forwarded to the other servers in the cluster.
 java.lang.String toString()
          Return a String representation of this CmsEvent.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_cms

private com.opencms.file.CmsObject m_cms
The CmsObject on which this event occurred


m_data

private java.util.Map m_data
The event data associated with this event


m_type

private int m_type
The event type this instance represents


m_isClusterEvent

private boolean m_isClusterEvent
Boolean whether this event should be clustered

Constructor Detail

CmsEvent

public CmsEvent(com.opencms.file.CmsObject cms,
                int type,
                java.util.Map data)
Construct a new CmsEvent with the specified parameters, this constructor just calls this(cms, type, data, false).


CmsEvent

public CmsEvent(com.opencms.file.CmsObject cms,
                int type,
                java.util.Map data,
                boolean isClusterEvent)
Construct a new CmsEvent with the specified parameters.

The event data Map provides a facility to pass objects with the event that contain information about the event environment. For example, if the event is of type I_CmsEventListener.EVENT_LOGIN_USER 55 the Map contains a single object with the key "data" and a value that is the OpenCms user object that represents the user that just logged in.

If isClusterEvent is true, the event should be forwarded to all servers in the OpenCms cluster. If it is false, is is important only for server running this instance of OpenCms.

Method Detail

getData

public java.util.Map getData()
Provides access to the event data that was passed with this event.


getCmsObject

public com.opencms.file.CmsObject getCmsObject()
Provides access to the CmsObject that was passed with this event.


getType

public int getType()
Provides access to the event type that was passed with this event.

Event types of the core OpenCms classes are defined in I_CmsEventListener. For your extensions, you should define them in a central class or interface as public member variables. Make sure the integer values do not confict with the values from the core classes.


toString

public java.lang.String toString()
Return a String representation of this CmsEvent.


setClusterEvent

public void setClusterEvent(boolean value)
Set the boolean flag whether this event should be forwarded to the other servers in the cluster.


isClusterEvent

public boolean isClusterEvent()
Check whether this event should be forwarded to the other servers in the cluster or not.