com.pcbsys.nirvana.client.p2p.nOutOfBandService Class Reference

This class enables services to pass flow information or control information between them. More...

Inheritance diagram for com.pcbsys.nirvana.client.p2p.nOutOfBandService:
com.pcbsys.nirvana.client.p2p.nService

Public Member Functions

void close ()
 Closes the OOB session with the remote P2P service. More...
 
void deregisterListener (final nEventServiceListener listener) throws IOException
 Removes the registered nEventServiceListener from this service. More...
 
nConsumeEvent read () throws IOException
 Waits for a new nConsumeEvent to be received from the remote service. More...
 
nConsumeEvent read (final long timeout) throws IOException
 Waits for a new nConsumeEvent to be received from the remote service or the timeout to be reached. More...
 
void registerListener (final nEventServiceListener listener) throws IOException
 Registers an nEventServiceListener with this class. More...
 
void write (final nConsumeEvent evt) throws IOException
 Writes an nConsumeEvent to the remote P2P service. More...
 
- Public Member Functions inherited from com.pcbsys.nirvana.client.p2p.nService
void close () throws IOException
 Closes the service and informs the remote service that it has been closed. More...
 
final nServiceInfo getServiceInfo ()
 Returns the description of the service connected to. More...
 
nServiceStateListener getStateListener ()
 Return the state listener associated with this service. More...
 
final boolean isClosed ()
 Returns a flag indicating if the service has been closed with the close() method. More...
 
boolean isConnected ()
 Returns whether the service is physically connected to the realm. More...
 
void setStateListener (nServiceStateListener listener)
 Set the listener that will receive callbacks for state changes to the service. More...
 

Detailed Description

This class enables services to pass flow information or control information between them.

It enables prioritised messaging between the services

Member Function Documentation

void com.pcbsys.nirvana.client.p2p.nOutOfBandService.close ( )

Closes the OOB session with the remote P2P service.

It does NOT close the main p2p service

void com.pcbsys.nirvana.client.p2p.nOutOfBandService.deregisterListener ( final nEventServiceListener  listener) throws IOException

Removes the registered nEventServiceListener from this service.

When all listeners are removed then the read() method can then be called

Parameters
listeneran nEventServiceListener to stop getting the callbacks
Exceptions
IOExceptionif Service is closed or listener is null
nConsumeEvent com.pcbsys.nirvana.client.p2p.nOutOfBandService.read ( ) throws IOException

Waits for a new nConsumeEvent to be received from the remote service.

Returns
nConsumeEvent received from the remote service
Exceptions
IOExceptionif the lower streams have an error, See the message or more information
nConsumeEvent com.pcbsys.nirvana.client.p2p.nOutOfBandService.read ( final long  timeout) throws IOException

Waits for a new nConsumeEvent to be received from the remote service or the timeout to be reached.

Parameters
timeoutTime in milliseconds to wait for the event to be received
Returns
nConsumeEvent received from the remote service
Exceptions
IOExceptionif the lower streams have an error, See the message or more information
void com.pcbsys.nirvana.client.p2p.nOutOfBandService.registerListener ( final nEventServiceListener  listener) throws IOException

Registers an nEventServiceListener with this class.

This nEventServiceListener will be called whenever there is a new event received

Once this is called then this will preclude the use of the read() method

Parameters
listeneran nEventServiceListener to receive the callbacks
Exceptions
IOExceptionif Service is closed or listener is null
void com.pcbsys.nirvana.client.p2p.nOutOfBandService.write ( final nConsumeEvent  evt) throws IOException

Writes an nConsumeEvent to the remote P2P service.

Parameters
evtAn nConsumeEvent to send to the remote service
Exceptions
IOExceptionif the lower streams have an error, See the message or more information