Package com.caplin.datasource.publisher
Interface BroadcastPublisher
-
- All Superinterfaces:
Publisher
public interface BroadcastPublisher extends Publisher
This implementation of
Publisher
sends (broadcasts) updates to all connected peers regardless of whether they have requested (subscribed to) the subject. To obtain aBroadcastPublisher
, call the appropriate method on the Caplin APIIn general, the use of broadcast messaging is not recommended, because it presents difficulties when handling failover of the DataSource application instance to another instance; the new DataSource instance does not know what data needs to be updated on the DataSource peers. However, broadcast messaging can be useful in situations where messages are transient and the data in them does not need to be always available to peers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
publishSubjectErrorEvent(Peer peer, SubjectErrorEvent subjectErrorEvent)
Publishes to the specified peer subscribed to a subject an event detailing an error in the subscription for that subject.void
publishSubjectStatusEvent(Peer peer, SubjectStatusEvent subjectStatusEvent)
Publishes to the specified peer an event about the change in status of a subject.void
publishToPeer(Peer peer, Message message)
-
Methods inherited from interface com.caplin.datasource.publisher.Publisher
getMessageFactory, publishInitialMessage, publishMappingMessage, publishSubjectErrorEvent, publishSubjectStatusEvent, publishToSubscribedPeers
-
-
-
-
Method Detail
-
publishSubjectErrorEvent
void publishSubjectErrorEvent(Peer peer, SubjectErrorEvent subjectErrorEvent)
Publishes to the specified peer subscribed to a subject an event detailing an error in the subscription for that subject. Typically aDataProvider
will use this to notify the remote peers that the data they are subscribed to is no longer available.- Parameters:
peer
- the peer to publish to.subjectErrorEvent
- The error event to be published.
-
publishSubjectStatusEvent
void publishSubjectStatusEvent(Peer peer, SubjectStatusEvent subjectStatusEvent)
Publishes to the specified peer an event about the change in status of a subject.- Parameters:
peer
- the peer to publish to.subjectStatusEvent
- The subject status event to be published.
-
-