public final class PublicationImage extends Object implements LossHandler, DriverManagedResource, Subscribable
| Modifier and Type | Method and Description |
|---|---|
void |
addSubscriber(SubscriptionLink subscriptionLink,
ReadablePosition subscriberPosition)
Add a subscriber and its position used for tracking consumption.
|
String |
channel()
Get the string representation of the channel URI.
|
void |
close()
Close resources that are not external.
|
long |
correlationId()
The correlation id assigned by the driver when created.
|
boolean |
free()
Free external resources such as files.
|
boolean |
hasReachedEndOfLife()
Has resource reached end of its life and should be reclaimed?
|
void |
onGapDetected(int termId,
int termOffset,
int length)
Called from the
LossDetector when gap is detected by the DriverConductor thread. |
void |
onTimeEvent(long timeNs,
long timesMs,
DriverConductor conductor)
Inform resource of timeNs passing and pass it DriverConductor to inform of any state transitions.
|
void |
removeSubscriber(SubscriptionLink subscriptionLink,
ReadablePosition subscriberPosition)
Remove a subscriber and its position used for tracking consumption.
|
int |
sessionId()
The session id of the channel from a publisher.
|
int |
streamId()
The stream id of this image within a channel.
|
public boolean free()
free in interface DriverManagedResourcepublic void close()
close in interface DriverManagedResourceclose in interface AutoCloseablepublic long correlationId()
public int sessionId()
public int streamId()
public String channel()
public void addSubscriber(SubscriptionLink subscriptionLink, ReadablePosition subscriberPosition)
addSubscriber in interface SubscribablesubscriptionLink - for identifying the subscriber.subscriberPosition - for tracking the subscriber.public void removeSubscriber(SubscriptionLink subscriptionLink, ReadablePosition subscriberPosition)
Note: The Subscribable is responsible for calling ReadablePosition.close() on
removed positions.
removeSubscriber in interface SubscribablesubscriptionLink - for identifying the subscriber.subscriberPosition - for tracking the subscriber.public void onGapDetected(int termId,
int termOffset,
int length)
LossDetector when gap is detected by the DriverConductor thread.
Called when a gap in the message stream has been detected.
onGapDetected in interface LossHandlertermId - for the gaptermOffset - for the beginning of the gaplength - of the gappublic void onTimeEvent(long timeNs,
long timesMs,
DriverConductor conductor)
onTimeEvent in interface DriverManagedResourcetimeNs - now in nanoseconds.timesMs - now in milliseconds for epoch.conductor - to inform of any state transitions.public boolean hasReachedEndOfLife()
hasReachedEndOfLife in interface DriverManagedResourceCopyright © 2014-2020 Real Logic Limited. All Rights Reserved.