com.pcbsys.nirvana.client.nConsumeEvent Class Reference

This class represents a Nirvana event, which consists of either a tag and some data or an event dictionary and some data. More...

Inheritance diagram for com.pcbsys.nirvana.client.nConsumeEvent:
com.pcbsys.nirvana.base.nConsumeEvent com.pcbsys.nirvana.client.nProtobufEvent

Public Member Functions

void ack () throws Exception
 Sends an ack for this event to the server. More...
 
nEventAttributes getAttributes ()
 Method that returns the nEventAttributes for this event. More...
 
String getChannelName ()
 This function will return the name of the channel / queue that the event was delivered from. More...
 
String getDataGroupName ()
 Get the name of the nDataGroup that this event was published to.
 
String getFullChannelName () throws nBaseClientException
 This function will return the fully qualified name of the channel / queue that the event was delivered from. More...
 
String getPublishHost ()
 Return the hostname from which the event was published. More...
 
String getPublishUser ()
 Return the id of the user that published this event. More...
 
long getTimestamp ()
 Return the timestamp of this event. More...
 
boolean hasAttributes ()
 Method indicating whether there is an nEventAttributes associated with this event. More...
 
 nConsumeEvent (byte[] tag, byte[] data)
 Constructs a new nConsumeEvent with the specified event tag and data. More...
 
 nConsumeEvent (String tag, byte[] data)
 Constructs a new nConsumeEvent with the specified event tag and data. More...
 
 nConsumeEvent (nEventProperties properties, byte[] data)
 Constructs a new nConsumeEvent with the specified event properties and data. More...
 
 nConsumeEvent (String tag, nEventProperties properties, byte[] data)
 Constructs a new nConsumeEvent with the specified event properties and data. More...
 
void rollback () throws Exception
 Tells the server that it does not ack this event. More...
 
void setAttributes (nEventAttributes attributes)
 Method that sets the nEventAttributes for this event. More...
 
void setSubscriberHost (byte[] host)
 Sets the host name or ip address representing the consumers of this event. More...
 
void setSubscriberName (byte[] subName)
 Sets the session name that will be the only consumer of this event. More...
 
void setSubscriberName (String subName) throws Exception
 Sets the session name that will be the only consumer of this event. More...
 
void setSubscriberNames (String[] subName) throws nIllegalArgumentException
 Sets the session names that will be the only consumers of this event. More...
 
- Public Member Functions inherited from com.pcbsys.nirvana.base.nConsumeEvent
void ack (boolean isSynchronous, boolean ackPrevious) throws Exception
 Sends an acknowledgment request for this nConsumeEvent. More...
 
void ack (boolean isSynchronous) throws Exception
 Sends an ack for this event to the server, we will ack all previous events. More...
 
void ack (long timeout, boolean isSynchronous, boolean ackPrevious) throws Exception
 Sends an ack for this event to the server, if a timeout value is passed, the ack will be retried if there is a failure. More...
 
void ack (long timeout) throws Exception
 Sends an ack for this event to the server, if a timeout value is passed, the ack will be retried if there is a failure. More...
 
byte[] getEventData ()
 Gets the event data set for this event. More...
 
long getEventID ()
 Gets the unique (for its channel) event id value. More...
 
String getEventTag ()
 Gets the event tag set for this event. More...
 
nHeader getHeader ()
 Returns event's Header information. More...
 
nEventProperties getProperties ()
 Gets this event's properties. More...
 
long getTTL ()
 Returns how long the event will be stored on disk in a mixed channel. More...
 
boolean isEndOfChannel ()
 When you subscribe to a channel, and the channel's data contains a finite and reasonably static set of events, the last event in the channel is sent and marked as the end of the channel. More...
 
boolean isPersistant ()
 Returns the perisitant flag. More...
 
 nConsumeEvent (byte[] tag, byte[] data)
 Constructs a new nConsumeEvent with the specified event tag and data. More...
 
 nConsumeEvent (String tag, byte[] data)
 Constructs a new nConsumeEvent with the specified event tag and data. More...
 
 nConsumeEvent (String tag, nEventProperties properties, byte[] data)
 Constructs a new nConsumeEvent with the specified event properties and data. More...
 
void rollback (boolean isSynchronous) throws Exception
 Requests the server to roll back this nConsumeEvent. More...
 
void rollback (boolean isSynchronous, boolean individualRollback) throws Exception
 Requests the server to roll back this nConsumeEvent. More...
 
void rollback (long timeout, boolean isSynchronous, boolean individualRollback) throws Exception
 Tells the server that it does not ack this event, if a timeout value is passed, the rollback will be retried if there is a failure. More...
 
void setEventID (long newID)
 Sets the event id value of this event. More...
 
void setHeader (nHeader header)
 Allows to set event's Header information. More...
 
void setPersistant (boolean flag)
 Sets the persistant flag. More...
 
void setProperties (nEventProperties newProperties)
 Sets this event's properties. More...
 
void setTransient (boolean aTransient)
 Sets whether the event is transient. More...
 
void setTTL (long ttl)
 Sets the TTL for this event. More...
 

Additional Inherited Members

- Protected Member Functions inherited from com.pcbsys.nirvana.base.nConsumeEvent
void setQueueReader (nQueueReader reader)
 Sets the queue reader this event was received with (only applicable for queues). More...
 

Detailed Description

This class represents a Nirvana event, which consists of either a tag and some data or an event dictionary and some data.

Constructor & Destructor Documentation

com.pcbsys.nirvana.client.nConsumeEvent.nConsumeEvent ( byte[]  tag,
byte[]  data 
)

Constructs a new nConsumeEvent with the specified event tag and data.

Parameters
tagthe event tag byte[] encoded
datathe event data byte[] encoded
com.pcbsys.nirvana.client.nConsumeEvent.nConsumeEvent ( String  tag,
byte[]  data 
)

Constructs a new nConsumeEvent with the specified event tag and data.

Parameters
tagthe event tag as a string
datathe event data byte[] encoded
com.pcbsys.nirvana.client.nConsumeEvent.nConsumeEvent ( nEventProperties  properties,
byte[]  data 
)

Constructs a new nConsumeEvent with the specified event properties and data.

The event properties can be used to create filter rules.

Parameters
propertiesthe collection of key-value pairs that can be used for filter rules
datathe event data byte[] encoded
com.pcbsys.nirvana.client.nConsumeEvent.nConsumeEvent ( String  tag,
nEventProperties  properties,
byte[]  data 
)

Constructs a new nConsumeEvent with the specified event properties and data.

The event properties can be used to create filter rules.

Parameters
propertiesthe collection of key-value pairs that can be used for filter rules
datathe event data byte[] encoded

Member Function Documentation

void com.pcbsys.nirvana.client.nConsumeEvent.ack ( ) throws Exception

Sends an ack for this event to the server.

Exceptions
ExceptionIf unable to send the ack request to the server
nEventAttributes com.pcbsys.nirvana.client.nConsumeEvent.getAttributes ( )

Method that returns the nEventAttributes for this event.

Returns
the nEventAttributes for this event
See Also
nEventAttributes
Since
4.0
String com.pcbsys.nirvana.client.nConsumeEvent.getChannelName ( )

This function will return the name of the channel / queue that the event was delivered from.

Returns
the name of the channel or queue
String com.pcbsys.nirvana.client.nConsumeEvent.getFullChannelName ( ) throws nBaseClientException

This function will return the fully qualified name of the channel / queue that the event was delivered from.

Returns
the fully qualified name of the channel or queue
Exceptions
nBaseClientExceptionIf the fully qualified name is not set
Since
3.1
String com.pcbsys.nirvana.client.nConsumeEvent.getPublishHost ( )

Return the hostname from which the event was published.

This value will be obtained from the nEventAttributes associated with this event.

Returns
the hostname from which the event was published
See Also
nEventAttributes
Since
4.0
String com.pcbsys.nirvana.client.nConsumeEvent.getPublishUser ( )

Return the id of the user that published this event.

This value will be obtained from the nEventAttributes associated with this event.

Returns
the user who published this event
See Also
nEventAttributes
Since
4.0
long com.pcbsys.nirvana.client.nConsumeEvent.getTimestamp ( )

Return the timestamp of this event.

This value will be obtained from the nEventAttributes associated with this event.

Returns
the timestamp when the event was received by the server
See Also
nEventAttributes
Since
4.0
boolean com.pcbsys.nirvana.client.nConsumeEvent.hasAttributes ( )

Method indicating whether there is an nEventAttributes associated with this event.

Returns
whether the nEventAttributes exists for this event
See Also
nEventAttributes
Since
4.0
void com.pcbsys.nirvana.client.nConsumeEvent.rollback ( ) throws Exception

Tells the server that it does not ack this event.

Exceptions
ExceptionIf unable to send the rollback request to the server
void com.pcbsys.nirvana.client.nConsumeEvent.setAttributes ( nEventAttributes  attributes)

Method that sets the nEventAttributes for this event.

Parameters
attributesnEventAttributes for this event
See Also
nEventAttributes
Since
4.0
void com.pcbsys.nirvana.client.nConsumeEvent.setSubscriberHost ( byte[]  host)

Sets the host name or ip address representing the consumers of this event.

By setting this, only connections matching the host name or ip address will consume this event. Wildcard * are also supported, so you can have *.abc.com fore example

Note: Subscriber filtering is disabled by default for queues since 10.5. This can be enabled on the Universal Messaging server using "QueueSubscriberFiltering" advanced configuration option in the "Event Storage" realm configuration section.

Parameters
host- the host name or ip address of connections that will consume this event
void com.pcbsys.nirvana.client.nConsumeEvent.setSubscriberName ( byte[]  subName)

Sets the session name that will be the only consumer of this event.

By setting this, no other subscribers, either on a queue or channel will consume this event.

Note: Subscriber filtering is disabled by default for queues since 10.5. This can be enabled on the Universal Messaging server using "QueueSubscriberFiltering" advanced configuration option in the "Event Storage" realm configuration section.

Parameters
subName- the subscriber name, equal to the session name of the designated user. Note : This must be a toLowerCase() representation of the subject / principal string
void com.pcbsys.nirvana.client.nConsumeEvent.setSubscriberName ( String  subName) throws Exception

Sets the session name that will be the only consumer of this event.

By setting this, no other subscribers, either on a queue or channel will consume this event.

Note: Subscriber filtering is disabled by default for queues since 10.5. This can be enabled on the Universal Messaging server using "QueueSubscriberFiltering" advanced configuration option in the "Event Storage" realm configuration section.

Parameters
subName- the subscriber name, equal to the session name of the designated user (will be converted to Lower Case)
Exceptions
Exceptionwhen there is an encoding issue with the provided string
void com.pcbsys.nirvana.client.nConsumeEvent.setSubscriberNames ( String[]  subName) throws nIllegalArgumentException

Sets the session names that will be the only consumers of this event.

By setting this, no other subscribers, either on a queue or channel will consume this event.

Note: Subscriber filtering is disabled by default for queues since 10.5. This can be enabled on the Universal Messaging server using "QueueSubscriberFiltering" advanced configuration option in the "Event Storage" realm configuration section.

Parameters
subName- the subscriber names, equal to the session names of the designated users
Exceptions
nIllegalArgumentExceptionThrown if the length of the array is greater than 32767