com.pcbsys.nirvana.client.nRegisteredEvent Class Reference

This class enables a client to maintain a copy of an event, make changes to the properties and then when commit is called only the changes are published to the server. More...


Public Member Functions

synchronized void commitChanges (boolean replace) throws nSecurityException, nSessionPausedException, nIllegalArgumentException, nSessionNotConnectedException, nTransactionException, nRequestTimedOutException, nChannelNotFoundException, nUnexpectedResponseException
 Writes all changes to the server and resets any internal counts, timers and copies.
void commitChanges () throws nSecurityException, nSessionPausedException, nIllegalArgumentException, nSessionNotConnectedException, nTransactionException, nRequestTimedOutException, nChannelNotFoundException, nUnexpectedResponseException
 Writes all changes to the server and resets any internal counts, timers and copies.
int getChangeSize ()
 Returns the number of changes made since the last commitChanges was called.
byte[] getData ()
 Returns the byte[] data payload of the event.
String getPrimaryKeyName ()
 Retrieves the name of the primary key name used for this event.
Object getPrimaryKeyValue ()
 Retrieves the unique value for the primary key used for this event.
nEventProperties getProperties ()
 Retrieves the properties for the event.
String getTag ()
 Returns the string tag of the event.
void setData (byte[] data)
 Sets the byte[] data payload for the event.
void setTag (String tag)
 Sets the tag for the event.
long timeSinceLastChange ()
 Returns the time in milliseconds since the last change was made to the event.

Protected Member Functions

synchronized nConsumeEvent getChangedEvent (boolean replace) throws nSecurityException, nSessionPausedException, nIllegalArgumentException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException
 Writes all changes to the server and resets any internal counts, timers and copies.

Detailed Description

This class enables a client to maintain a copy of an event, make changes to the properties and then when commit is called only the changes are published to the server.

This enables a mechanism whereby only changes are published and not full events


Member Function Documentation

Writes all changes to the server and resets any internal counts, timers and copies.

Parameters:
replace,if true the server will replace the referenced event with a complete copy of this event and will not merge any data from previous events.
Exceptions:
nSecurityException User is not authorised for the function
nSessionPausedException The session is currently paused, please resume
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionNotConnectedException Current session is not connected
nTransactionException thrown if any transactional errors occur
nRequestTimedOutException The server has not responded to the request in the timeout period
nChannelNotFoundException The channel specified could not be found
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence

Writes all changes to the server and resets any internal counts, timers and copies.

Exceptions:
nSecurityException User is not authorised for the function
nSessionPausedException The session is currently paused, please resume
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionNotConnectedException Current session is not connected
nTransactionException thrown if any transactional errors occur
nRequestTimedOutException The server has not responded to the request in the timeout period
nChannelNotFoundException The channel specified could not be found
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence

synchronized nConsumeEvent com.pcbsys.nirvana.client.nRegisteredEvent.getChangedEvent ( boolean  replace  )  throws nSecurityException, nSessionPausedException, nIllegalArgumentException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException [protected]

Writes all changes to the server and resets any internal counts, timers and copies.

Parameters:
replace,if true the server will replace the referenced event with a complete copy of this event and will not merge any data from previous events.
Exceptions:
nSecurityException User is not authorised for the function
nSessionPausedException The session is currently paused, please resume
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionNotConnectedException Current session is not connected
nTransactionException thrown if any transactional errors occur
nRequestTimedOutException The server has not responded to the request in the timeout period
nChannelNotFoundException The channel specified could not be found
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence

int com.pcbsys.nirvana.client.nRegisteredEvent.getChangeSize (  ) 

Returns the number of changes made since the last commitChanges was called.

Returns:
int number of changes since the last commitChanges

byte [] com.pcbsys.nirvana.client.nRegisteredEvent.getData (  ) 

Returns the byte[] data payload of the event.

Returns:
byte[] of user data

String com.pcbsys.nirvana.client.nRegisteredEvent.getPrimaryKeyName (  ) 

Retrieves the name of the primary key name used for this event.

This key name is setup during channel construction using the publish key API

Returns:
String name of the key

Object com.pcbsys.nirvana.client.nRegisteredEvent.getPrimaryKeyValue (  ) 

Retrieves the unique value for the primary key used for this event.

Returns:
Object value of the key

nEventProperties com.pcbsys.nirvana.client.nRegisteredEvent.getProperties (  ) 

Retrieves the properties for the event.

The client can then change the key/value pairs in the properties. When the commitChanges() is called all changes will be sent to the server

Returns:
The events nEventProperties

String com.pcbsys.nirvana.client.nRegisteredEvent.getTag (  ) 

Returns the string tag of the event.

Returns:
String tag for the event

void com.pcbsys.nirvana.client.nRegisteredEvent.setData ( byte[]  data  ) 

Sets the byte[] data payload for the event.

Parameters:
data a byte[] to be sent

void com.pcbsys.nirvana.client.nRegisteredEvent.setTag ( String  tag  ) 

Sets the tag for the event.

Parameters:
tag String representation of the tag to use

long com.pcbsys.nirvana.client.nRegisteredEvent.timeSinceLastChange (  ) 

Returns the time in milliseconds since the last change was made to the event.

If no change then the function will return 0

Returns:
time in milliseconds since the last change