ehsbe CommonsTM
Version 1.1.0rc3

com.ehsbe.commons.util.jms
Class QueueEvent

java.lang.Object
  extended by com.ehsbe.commons.util.jms.QueueEvent

public class QueueEvent
extends Object

Event to inform listeners about CRUD events received from a JMS topic queue and disconnection/reconnection to a JMS topic queue.

Version:
$Revision: 432 $
Author:
Jens Elkner

Constructor Summary
QueueEvent(String topic, boolean connected)
          Create a new connect/disconnect event.
QueueEvent(String topic, long id, CrudEvent<?> e)
          Create a new Queue event message.
 
Method Summary
 String getClassname()
          Convinience method to get the classname of the object, to which the CRUD event is related.
 Boolean getConnected()
          Get the state of the connection to the JMS queue.
 CrudEvent<?> getCrudEvent()
          Get the CRUD event, which caused this event to be sent.
 Integer[] getIntegerIds()
          Convinience method to get the object ids of the related CRUD event.
 int[] getIntIds()
          Convinience method to get the object ids of the related CRUD event.
 long[] getLongIds()
          Convinience method to get the object ids of the related CRUD event.
 Long[] getLongObjectIds()
          Convinience method to get the object ids of the related CRUD event.
 long getMessageId()
          Get the id of the corresponding message, which contained the CRUD event.
 String[] getStringIds()
          Convinience method to get the object ids of the related CRUD event.
 String getTopic()
          Get the topic of the message queue.
 CrudEvent.CrudType getType()
          Conviniece mthod to get the type of the CRUD event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueEvent

public QueueEvent(String topic,
                  long id,
                  CrudEvent<?> e)
Create a new Queue event message.

Parameters:
topic - The topic of the corresponding JMS message.
id - The sequence number of the corresponding JMS message. A negative number, if one or more messages have been lost, a positive sequence number otherwise.
e - The CRUD event

QueueEvent

public QueueEvent(String topic,
                  boolean connected)
Create a new connect/disconnect event.

Parameters:
topic - The topic of the JMS queue, which the receiver has been connected/disconnected.
connected - true if the connection has been re-established, false if the connection has ben lost.
Method Detail

getTopic

public String getTopic()
Get the topic of the message queue.

Returns:
always a none-null string.

getConnected

public Boolean getConnected()
Get the state of the connection to the JMS queue.

Returns:
null if this event is not a connect/disconnect notification. Otherwise Boolean.TRUE if this is a notification, that the connection to the JMS queue was re-established; Boolean.FALSE if the connection got lost.

getMessageId

public long getMessageId()
Get the id of the corresponding message, which contained the CRUD event.

Returns:
0 if this is a connect/disconnect notification, a negative number, if one or more messages were lost, a positive sequence number otherwise.

getCrudEvent

public CrudEvent<?> getCrudEvent()
Get the CRUD event, which caused this event to be sent.

Returns:
null if this is a connect/disconnect notification, the event otherwise.

getClassname

public String getClassname()
Convinience method to get the classname of the object, to which the CRUD event is related.

Returns:
null if this is a connect/disconnect notification, the classname otherwise.
See Also:
CrudEvent.getClassname()

getType

public CrudEvent.CrudType getType()
Conviniece mthod to get the type of the CRUD event.

Returns:
null, if this is a connect/disconnect notification, the CRUD type otherwise
See Also:
CrudEvent.getType()

getStringIds

public String[] getStringIds()
Convinience method to get the object ids of the related CRUD event.

Returns:
an array of Ids of the CRUD objects. Might be empty.
See Also:
getCrudEvent(), CrudEvent.getIds()

getIntIds

public int[] getIntIds()
Convinience method to get the object ids of the related CRUD event.

Returns:
an array of Ids of the CRUD objects. Might be empty.
See Also:
getCrudEvent(), CrudEvent.getIds()

getIntegerIds

public Integer[] getIntegerIds()
Convinience method to get the object ids of the related CRUD event.

Returns:
an array of Ids of the CRUD objects. Might be empty.
See Also:
getCrudEvent(), CrudEvent.getIds()

getLongIds

public long[] getLongIds()
Convinience method to get the object ids of the related CRUD event.

Returns:
an array of Ids of the CRUD objects. Might be empty.
See Also:
getCrudEvent(), CrudEvent.getIds()

getLongObjectIds

public Long[] getLongObjectIds()
Convinience method to get the object ids of the related CRUD event.

Returns:
an array of Ids of the CRUD objects. Might be empty.
See Also:
getCrudEvent(), CrudEvent.getIds()

ehsbe CommonsTM
Version 1.1.0rc3

Copyright ©2005-2009 EHSBE, Walther-Rathenau-Str. 58, 39104 Magdeburg, Sachsen-Anhalt, Germany. All Rights Reserved.