- com
- pcbsys
- nirvana
- base
- nConsumeEvent
This class defines the nirvana event that publishers publish and subscribers receive. More...
Public Member Functions | |
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... | |
Document | getDocument () |
Gets the XML DOM Document associated with this event, if set. 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... | |
nEventProperties | getProperties () |
Gets this event's properties. More... | |
byte[] | getSignature () |
Returns the digital signature of the event if it was signed by the publisher else it returns null. More... | |
long | getTTL () |
Returns how long the event will be stored on disk in a mixed channel. More... | |
boolean | isDom () |
Gets the isDom flag to find out if the event is marked as XML DOM. 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, byte[] data, boolean dom) | |
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... | |
nConsumeEvent (String tag, Document adom) | |
Constructs a new nConsumeEvent with the specified event tag and XML data. More... | |
nConsumeEvent (nEventProperties properties, Document adom) | |
Constructs a new nConsumeEvent with the specified event tag and XML 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 | setPersistant (boolean flag) |
Sets the persistant flag. More... | |
void | setProperties (nEventProperties newProperties) |
Sets this event's properties. More... | |
void | setTTL (long ttl) |
Sets the TTL for this event. More... | |
Protected Member Functions | |
void | encodeDOM (xmlHelper helper) |
Encode the Dom in this conduit event to byte[]. More... | |
This class defines the nirvana event that publishers publish and subscribers receive.
com.pcbsys.nirvana.base.nConsumeEvent.nConsumeEvent | ( | byte[] | tag, |
byte[] | data | ||
) |
Constructs a new nConsumeEvent with the specified event tag and data.
tag | the event tag byte[] encoded |
data | the event data byte[] encoded |
com.pcbsys.nirvana.base.nConsumeEvent.nConsumeEvent | ( | String | tag, |
byte[] | data | ||
) |
Constructs a new nConsumeEvent with the specified event tag and data.
tag | the event tag as a string |
data | the event data byte[] encoded |
com.pcbsys.nirvana.base.nConsumeEvent.nConsumeEvent | ( | String | tag, |
byte[] | data, | ||
boolean | dom | ||
) |
Constructs a new nConsumeEvent with the specified event tag and data.
The event will be flagged as an XML DOM document if the dom flag is true.
tag | the event tag as a string |
data | the event data byte[] encoded |
dom | a flag specifying whether the event should be marked as an XML DOM document |
com.pcbsys.nirvana.base.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.
tag | the event tag as a string |
properties | the collection of key-value pairs that can be used for filter rules |
data | the event data byte[] encoded |
com.pcbsys.nirvana.base.nConsumeEvent.nConsumeEvent | ( | String | tag, |
Document | adom | ||
) |
Constructs a new nConsumeEvent with the specified event tag and XML data.
The event will be flagged as an XML DOM document.
tag | the event tag as a string |
adom | the event data as an XML DOM document |
com.pcbsys.nirvana.base.nConsumeEvent.nConsumeEvent | ( | nEventProperties | properties, |
Document | adom | ||
) |
Constructs a new nConsumeEvent with the specified event tag and XML data.
The event will be flagged as an XML DOM document.
properties | <Enter Parameter Description> |
adom | the event data as an XML DOM document |
void com.pcbsys.nirvana.base.nConsumeEvent.ack | ( | boolean | isSynchronous, |
boolean | ackPrevious | ||
) | throws Exception |
Sends an acknowledgment request for this nConsumeEvent.
isSynchronous | when set to true we will not return until the server has processed this call, if false we return once we send the request |
ackPrevious | When set to true will ack all nConsumeEvent up to and including this nConsumeEvent, false can only be used with Queue's or Shared Durables (including nDurableType.SharedQueued) |
Exception | If unable to send the rollback request to the server |
void com.pcbsys.nirvana.base.nConsumeEvent.ack | ( | boolean | isSynchronous | ) | throws Exception |
Sends an ack for this event to the server, we will ack all previous events.
isSynchronous | when set to true we will not return until the server has processed this call, if false we return once we send the request |
Exception | If unable to send the rollback request to the server |
void com.pcbsys.nirvana.base.nConsumeEvent.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.
A timeout of <0 denotes infinite retry attempts, 0 denotes no retries, and >0 is the timeout value that will be honored.
timeout | specify a timeout to enable retrying of the acknowledgement in case of a disconnection or failure |
isSynchronous | when set to true we will not return until the server has processed this call, if false we return once we send the request |
ackPrevious | When set to true will ack all nConsumeEvent up to and including this nConsumeEvent, false can only be used with Queue's or Shared Durables (including nDurableType.SharedQueued) |
Exception | If unable to send the rollback request to the server |
void com.pcbsys.nirvana.base.nConsumeEvent.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.
A timeout of <0 denotes infinite retry attempts, 0 denotes no retries, and >0 is the timeout value that will be honored. This will acknowledge all nConsumeEvent up to and including this nConsumeEvent and will also await a response from the server
timeout | specify a timeout to enable retrying of the acknowledgement in case of a disconnection or failure |
Exception | If unable to send the rollback request to the server |
|
protected |
Encode the Dom in this conduit event to byte[].
An internal method not to be used by individuals writing Nirvana applications.
Document com.pcbsys.nirvana.base.nConsumeEvent.getDocument | ( | ) |
Gets the XML DOM Document associated with this event, if set.
byte [] com.pcbsys.nirvana.base.nConsumeEvent.getEventData | ( | ) |
Gets the event data set for this event.
long com.pcbsys.nirvana.base.nConsumeEvent.getEventID | ( | ) |
Gets the unique (for its channel) event id value.
String com.pcbsys.nirvana.base.nConsumeEvent.getEventTag | ( | ) |
Gets the event tag set for this event.
nEventProperties com.pcbsys.nirvana.base.nConsumeEvent.getProperties | ( | ) |
Gets this event's properties.
byte [] com.pcbsys.nirvana.base.nConsumeEvent.getSignature | ( | ) |
Returns the digital signature of the event if it was signed by the publisher else it returns null.
long com.pcbsys.nirvana.base.nConsumeEvent.getTTL | ( | ) |
Returns how long the event will be stored on disk in a mixed channel.
boolean com.pcbsys.nirvana.base.nConsumeEvent.isDom | ( | ) |
Gets the isDom flag to find out if the event is marked as XML DOM.
boolean com.pcbsys.nirvana.base.nConsumeEvent.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.
boolean com.pcbsys.nirvana.base.nConsumeEvent.isPersistant | ( | ) |
Returns the perisitant flag.
If true the event is stored to disk on the server
void com.pcbsys.nirvana.base.nConsumeEvent.rollback | ( | boolean | isSynchronous | ) | throws Exception |
Requests the server to roll back this nConsumeEvent.
isSynchronous | if true we will wait for a response from server |
Exception | If unable to send the rollback request to the server |
void com.pcbsys.nirvana.base.nConsumeEvent.rollback | ( | boolean | isSynchronous, |
boolean | individualRollback | ||
) | throws Exception |
Requests the server to roll back this nConsumeEvent.
Exception | If unable to send the rollback request to the server |
void com.pcbsys.nirvana.base.nConsumeEvent.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.
A timeout of <0 denotes infinite retry attempts, 0 denotes no retries, and >0 is the timeout value that will be honored.
timeout | specify a timeout to enable retrying of the rollback |
isSynchronous | when set to true we will not return until the server has processed this call, if false we return once we send the request |
individualRollback | if true, discard only this nConsumeEvent and request redelivery. If false, keep this nConsumeEvent but redeliver anything received after this event. |
Exception | If unable to send the rollback request to the server |
void com.pcbsys.nirvana.base.nConsumeEvent.setEventID | ( | long | newID | ) |
Sets the event id value of this event.
newID | a long specifying the new event ID of the event |
void com.pcbsys.nirvana.base.nConsumeEvent.setPersistant | ( | boolean | flag | ) |
Sets the persistant flag.
On mixed channels, if set, will cause this event to be stored to disk
flag | boolean flag |
void com.pcbsys.nirvana.base.nConsumeEvent.setProperties | ( | nEventProperties | newProperties | ) |
Sets this event's properties.
newProperties | The properties to set for this event |
void com.pcbsys.nirvana.base.nConsumeEvent.setTTL | ( | long | ttl | ) |
Sets the TTL for this event.
On a mixe channel this time is how long the event is kept
ttl | Time in milliseconds |