- com
- pcbsys
- nirvana
- client
- nChannelIterator
This class iterates synchronously over a Nirvana Realm channel. More...
Inherited by com.pcbsys.nirvana.base.clientimpl.multiconnection.nChannelIteratorWrapper.
Public Member Functions | |
void | ack (long eid) throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Acknowledge an event id consumed by this iterator when not using auto ack. More... | |
synchronized void | ack (long eid, boolean isIndividualAck, boolean ackPrevious) throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Acknowledge an event id consumed by this iterator when not using auto ack. More... | |
synchronized void | close () |
This method will initiate a close to the server for this Iterator. More... | |
synchronized nConsumeEvent | getFirst () throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
This returns the first event in the channel or null if there are no events in the channel. More... | |
synchronized nConsumeEvent | getLast () throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
This returns the last event in the channel or null if there are no events in the channel. More... | |
nConsumeEvent | getNext () throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Returns the next event in the channel, or will block until an event is published. More... | |
nConsumeEvent | getNext (long timeout) throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Returns the next event in the channel, or if none will block for the time in milliseconds for the next event to be published onto the channel. More... | |
synchronized nConsumeEvent | getPrev () throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Gets the previous event in the channel or null if there are no more previous events. More... | |
boolean | hasEventsCached () throws nIllegalStateException |
The method will return true is we have locally cached events in the iterator or in the HS layer. More... | |
boolean | isAutoAck () |
Whether this iterator is set to auto acknowledge. More... | |
int | receiveCacheReturnOutstandingRequests (List< nConsumeEvent > cacheList) throws nIllegalStateException |
This method will return the number of outstanding iterate client requests, sent to the server, while also filling up the provided list with all the client-side cached events. More... | |
synchronized void | rollback () throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nRealmNotFoundException, nSecurityException, nUnexpectedResponseException, nChannelNotFoundException, nSelectorParserException |
If this is a shared named object, this method can be used to push any consumed messages back onto the resource on the server, ready for re-consumption. More... | |
synchronized void | rollback (long eventID) throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nRealmNotFoundException, nSecurityException, nUnexpectedResponseException, nChannelNotFoundException, nSelectorParserException |
Static Public Attributes | |
static final int | INFINITE_WINDOW = com.pcbsys.nirvana.base.nConstants.INFINITE_WINDOW |
Used for specifying infinite window size when creating a channel iterator. | |
Protected Member Functions | |
void | handleWindowSize (nChannelIterate evt) |
Sets the client window size for maximum received unacknowledged events. More... | |
void | reconnect () |
This is called to resubscribe a channel iterator after a disconnect event. | |
This class iterates synchronously over a Nirvana Realm channel.
By using the methods the channel can be traversed forwards/backwards
void com.pcbsys.nirvana.client.nChannelIterator.ack | ( | long | eid | ) | throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Acknowledge an event id consumed by this iterator when not using auto ack.
eid | the event id to acknowledge |
nSecurityException | User is not authorised for the function |
nChannelNotFoundException | The channel doesn't exist |
nSessionNotConnectedException | Current session is not connected |
nSessionPausedException | The session is currently paused, please resume |
nRequestTimedOutException | The server has not responded to the request in the timeout period |
nRealmNotFoundException | The realm is not known by the server |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSelectorParserException | The selector has syntax errors |
synchronized void com.pcbsys.nirvana.client.nChannelIterator.ack | ( | long | eid, |
boolean | isIndividualAck, | ||
boolean | ackPrevious | ||
) | throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Acknowledge an event id consumed by this iterator when not using auto ack.
eid | the event id to acknowledge |
isIndividualAck | whether events must be acknowledge individually |
ackPrevious | whether previous events must be acknowledged |
nSecurityException | User is not authorised for the function |
nChannelNotFoundException | The channel doesn't exist |
nSessionNotConnectedException | Current session is not connected |
nSessionPausedException | The session is currently paused, please resume |
nRequestTimedOutException | The server has not responded to the request in the timeout period |
nRealmNotFoundException | The realm is not known by the server |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSelectorParserException | The selector has syntax errors |
synchronized void com.pcbsys.nirvana.client.nChannelIterator.close | ( | ) |
This method will initiate a close to the server for this Iterator.
synchronized nConsumeEvent com.pcbsys.nirvana.client.nChannelIterator.getFirst | ( | ) | throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
This returns the first event in the channel or null if there are no events in the channel.
nSecurityException | If the client does not have the ability to subscribe to the channel |
nChannelNotFoundException | The channel is no longer valid |
nSessionNotConnectedException | The session has been disconnected |
nRequestTimedOutException | if the time out for the event to be published is exceeded |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused, please resume |
nSelectorParserException | Invalid selector specified |
nRealmNotFoundException | The remote realm could not be found |
synchronized nConsumeEvent com.pcbsys.nirvana.client.nChannelIterator.getLast | ( | ) | throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
This returns the last event in the channel or null if there are no events in the channel.
nSecurityException | If the client does not have the ability to subscribe to the channel |
nChannelNotFoundException | The channel is no longer valid |
nSessionNotConnectedException | The session has been disconnected |
nRequestTimedOutException | if the time out for the event to be published is exceeded |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused, please resume |
nSelectorParserException | Invalid selector specified |
nRealmNotFoundException | The remote realm could not be found |
nConsumeEvent com.pcbsys.nirvana.client.nChannelIterator.getNext | ( | ) | throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Returns the next event in the channel, or will block until an event is published.
nSecurityException | If the client does not have the ability to subscribe to the channel |
nChannelNotFoundException | The channel is no longer valid |
nSessionNotConnectedException | The session has been disconnected |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused, please resume |
nSelectorParserException | Invalid selector specified |
nRealmNotFoundException | The remote realm could not be found |
nConsumeEvent com.pcbsys.nirvana.client.nChannelIterator.getNext | ( | long | timeout | ) | throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Returns the next event in the channel, or if none will block for the time in milliseconds for the next event to be published onto the channel.
timeout | time in milliseconds to wait for the event. Wait indefinitely if timeout is negative. |
nSecurityException | If the client does not have the ability to subscribe to the channel |
nChannelNotFoundException | The channel is no longer valid |
nSessionNotConnectedException | The session has been disconnected |
nRequestTimedOutException | if the time out for the event to be published is exceeded |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused, please resume |
nSelectorParserException | Invalid selector specified |
nRealmNotFoundException | The remote realm could not be found |
synchronized nConsumeEvent com.pcbsys.nirvana.client.nChannelIterator.getPrev | ( | ) | throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nRealmNotFoundException, nUnexpectedResponseException, nSelectorParserException |
Gets the previous event in the channel or null if there are no more previous events.
nSecurityException | If the client does not have the ability to subscribe to the channel |
nChannelNotFoundException | The channel is no longer valid |
nSessionNotConnectedException | The session has been disconnected |
nRequestTimedOutException | if the time out for the event to be published is exceeded |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused, please resume |
nSelectorParserException | Invalid selector specified |
nRealmNotFoundException | The remote realm could not be found |
|
protected |
Sets the client window size for maximum received unacknowledged events.
evt | the event in which the window size will be sent |
boolean com.pcbsys.nirvana.client.nChannelIterator.hasEventsCached | ( | ) | throws nIllegalStateException |
The method will return true is we have locally cached events in the iterator or in the HS layer.
nIllegalStateException | if the iterator is closed |
boolean com.pcbsys.nirvana.client.nChannelIterator.isAutoAck | ( | ) |
Whether this iterator is set to auto acknowledge.
int com.pcbsys.nirvana.client.nChannelIterator.receiveCacheReturnOutstandingRequests | ( | List< nConsumeEvent > | cacheList | ) | throws nIllegalStateException |
This method will return the number of outstanding iterate client requests, sent to the server, while also filling up the provided list with all the client-side cached events.
If the provided list is null, no cached events will be extracted. The outstanding requests value is only relevant in horizontal scalability landscape. When iterator tries to get an event, if there are none cached, then an iterate request is sent to all of the nodes in the HS landscape. Outstanding are those requests, for which the client is still waiting for the response.
cacheList | the list, which will be filled up with all the cached events |
nIllegalStateException | if the iterator is closed |
synchronized void com.pcbsys.nirvana.client.nChannelIterator.rollback | ( | ) | throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nRealmNotFoundException, nSecurityException, nUnexpectedResponseException, nChannelNotFoundException, nSelectorParserException |
If this is a shared named object, this method can be used to push any consumed messages back onto the resource on the server, ready for re-consumption.
nRequestTimedOutException | If we do not receive a response from the server this will be thrown |
nSessionPausedException | If the session is paused |
nSessionNotConnectedException | If the session is currently disconnected |
synchronized void com.pcbsys.nirvana.client.nChannelIterator.rollback | ( | long | eventID | ) | throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nRealmNotFoundException, nSecurityException, nUnexpectedResponseException, nChannelNotFoundException, nSelectorParserException |
eventID | The event ID to Rollback events up to and including this event ID |
nSecurityException | User is not authorised for the function |
nChannelNotFoundException | The channel doesn't exist |
nSessionNotConnectedException | Current session is not connected |
nSessionPausedException | The session is currently paused, please resume |
nRequestTimedOutException | The server has not responded to the request in the timeout period |
nRealmNotFoundException | The realm is not known by the server |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSelectorParserException | The selector has syntax errors |