- com
- pcbsys
- nirvana
- client
- p2p
- nEventService
Nirvana Client Peer To Peer API Package. More...
Public Member Functions | |
void | close () throws IOException |
Closes the service and informs the remote service that it has been closed. More... | |
void | deregisterListener (final nEventServiceListener listener) throws IOException |
Removes the registered nEventServiceListener from this service. More... | |
nOutOfBandService | getOutOfBandService () |
This function returns an nOutOfBandService. 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... | |
![]() | |
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... | |
Nirvana Client Peer To Peer API Package.
This class implements the end point of an Event based P2P connection.
It allows the user to send and receive nConsumeEvents.
void com.pcbsys.nirvana.client.p2p.nEventService.close | ( | ) | throws IOException |
Closes the service and informs the remote service that it has been closed.
IOException | if unable to perform the close. See the message for further information |
void com.pcbsys.nirvana.client.p2p.nEventService.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
listener | An Instance of an nEventServiceListener that is to be removed |
IOException | if Service is closed or listener is null |
nOutOfBandService com.pcbsys.nirvana.client.p2p.nEventService.getOutOfBandService | ( | ) |
This function returns an nOutOfBandService.
An out of band (OOB) service can be used to pass flow/control information between the remote P2P service
nConsumeEvent com.pcbsys.nirvana.client.p2p.nEventService.read | ( | ) | throws IOException |
Waits for a new nConsumeEvent to be received from the remote service.
IOException | if the lower streams have an error, See the message or more information |
nConsumeEvent com.pcbsys.nirvana.client.p2p.nEventService.read | ( | final long | timeout | ) | throws IOException |
Waits for a new nConsumeEvent to be received from the remote service or the timeout to be reached.
timeout | The number of milliseconds to wait for an event to be received |
IOException | if the lower streams have an error, See the message or more information |
void com.pcbsys.nirvana.client.p2p.nEventService.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
listener | An Instance of an nEventServiceListener that is to be used |
IOException | if Service is closed or listener is null |
void com.pcbsys.nirvana.client.p2p.nEventService.write | ( | final nConsumeEvent | evt | ) | throws IOException |
Writes an nConsumeEvent to the remote P2P service.
evt | An nConsumeEvent to send to the remote P2P service |
IOException | if the lower streams have an error, See the message or more information |