public interface Peer
Represents a DataSource peer.
You do not have to implement this interface yourself. Peer
instances will be
retrieved from classes such as RequestEvent
or
DiscardEvent
, which will be passed to your implementation
of DataProvider
via the
DataProvider.onRequest(com.caplin.datasource.publisher.RequestEvent)
and
DataProvider.onDiscard(com.caplin.datasource.publisher.DiscardEvent)
methods.
Modifier and Type | Method and Description |
---|---|
int |
getIndex()
Gets the index of this peer.
|
int |
getMessageQueueSize()
Gets the current number of queued messages on the peer.
|
java.lang.String |
getName()
Gets the name of this peer.
|
PeerStatus |
getPeerStatus()
Gets the status that the peer has changed state to.
|
void |
setStatusDown()
Stops this peer from making connections to its remote peer.
|
void |
setStatusUp()
Allows this peer to make connections to its remote peer.
|
int getIndex()
Gets the index of this peer.
Generally a DataSource application should not care about the index of the peer. However, the index does provide a unique identifier of the peer whilst the DataSource application is running.
java.lang.String getName()
Gets the name of this peer. This is the name of the peer that the DataSource application is connected to.
It is possible for the name of the peer to change - the name returned here is provided by the remote peer which is user configurable on the remote peer.
void setStatusUp()
void setStatusDown()
Stops this peer from making connections to its remote peer.
If the remote peer is connected, this method disconnects it.
PeerStatus getPeerStatus()
int getMessageQueueSize()
Please send bug reports and comments to Caplin support