EventPosition Interface
public interface EventPosition
Defines a position of an EventData in the event hub partition. The position can be an Offset, Sequence Number, or EnqueuedTime.
Method Summary
Modifier and Type | Method and Description |
---|---|
Event |
fromEndOfStream()
Returns the position for the end of a stream. Provide this position in receiver creation to start receiving from the next available event in the partition after the receiver is created. |
Event |
fromEnqueuedTime(Instant dateTime)
Creates a position at the given Instant. |
Event |
fromOffset(String offset)
Creates a position at the given offset. The specified event will not be included. Instead, the next event is returned. |
Event |
fromOffset(String offset, boolean inclusiveFlag)
Creates a position at the given offset. |
Event |
fromSequenceNumber(Long sequenceNumber)
Creates a position at the given sequence number. The specified event will not be included. Instead, the next event is returned. |
Event |
fromSequenceNumber(Long sequenceNumber, boolean inclusiveFlag)
Creates a position at the given sequence number. The specified event will not be included. Instead, the next event is returned. |
Event |
fromStartOfStream()
Returns the position for the start of a stream. Provide this position in receiver creation to start receiving from the first available event in the partition. |
Instant |
getEnqueuedTime()
Gets the enqueued time. |
boolean |
getInclusiveFlag()
Gets the inclusive value. |
String |
getOffset()
Gets the offset. |
Long |
getSequenceNumber()
Gets the sequence number. |
Method Details
fromEndOfStream
public static EventPosition fromEndOfStream()
Returns the position for the end of a stream. Provide this position in receiver creation to start receiving from the next available event in the partition after the receiver is created.
Returns:
fromEnqueuedTime
public static EventPosition fromEnqueuedTime(Instant dateTime)
Creates a position at the given Instant.
Parameters:
Returns:
fromOffset
public static EventPosition fromOffset(String offset)
Creates a position at the given offset. The specified event will not be included. Instead, the next event is returned.
Parameters:
Returns:
fromOffset
public static EventPosition fromOffset(String offset, boolean inclusiveFlag)
Creates a position at the given offset.
Parameters:
Returns:
fromSequenceNumber
public static EventPosition fromSequenceNumber(Long sequenceNumber)
Creates a position at the given sequence number. The specified event will not be included. Instead, the next event is returned.
Parameters:
Returns:
fromSequenceNumber
public static EventPosition fromSequenceNumber(Long sequenceNumber, boolean inclusiveFlag)
Creates a position at the given sequence number. The specified event will not be included. Instead, the next event is returned.
Parameters:
Returns:
fromStartOfStream
public static EventPosition fromStartOfStream()
Returns the position for the start of a stream. Provide this position in receiver creation to start receiving from the first available event in the partition.
Returns:
getEnqueuedTime
public Instant getEnqueuedTime()
Gets the enqueued time.
Returns:
getInclusiveFlag
public boolean getInclusiveFlag()
Gets the inclusive value.
Returns:
getOffset
public String getOffset()
Gets the offset.
Returns:
getSequenceNumber
public Long getSequenceNumber()
Gets the sequence number.
Returns:
Applies to
Azure SDK for Java