Class EventPositionImpl
- java.lang.Object
-
- com.microsoft.azure.eventhubs.impl.EventPositionImpl
-
- All Implemented Interfaces:
EventPosition,Serializable
public final class EventPositionImpl extends Object implements EventPosition
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EventPositionImplfromEndOfStream()Returns the position for the end of a stream.static EventPositionImplfromEnqueuedTime(Instant dateTime)Creates a position at the givenInstant.static EventPositionImplfromOffset(String offset)Creates a position at the given offset.static EventPositionImplfromOffset(String offset, boolean inclusiveFlag)Creates a position at the given offset.static EventPositionImplfromSequenceNumber(Long sequenceNumber)Creates a position at the given sequence number.static EventPositionImplfromSequenceNumber(Long sequenceNumber, boolean inclusiveFlag)Creates a position at the given sequence number.static EventPositionImplfromStartOfStream()Returns the position for the start of a stream.InstantgetEnqueuedTime()Gets the enqueued time.booleangetInclusiveFlag()Gets the inclusive value.StringgetOffset()Gets the offset.LonggetSequenceNumber()Gets the sequence number.StringtoString()
-
-
-
Method Detail
-
fromOffset
public static EventPositionImpl fromOffset(String offset)
Description copied from interface:EventPositionCreates a position at the given offset. The specified event will not be included. Instead, the next event is returned.- Parameters:
offset- is the byte offset of the event.- Returns:
- An
EventPositionobject.
-
fromOffset
public static EventPositionImpl fromOffset(String offset, boolean inclusiveFlag)
Description copied from interface:EventPositionCreates a position at the given offset.- Parameters:
offset- is the byte offset of the event.inclusiveFlag- will include the specified event when set to true; otherwise, the next event is returned.- Returns:
- An
EventPositionobject.
-
fromSequenceNumber
public static EventPositionImpl fromSequenceNumber(Long sequenceNumber)
Description copied from interface:EventPositionCreates a position at the given sequence number. The specified event will not be included. Instead, the next event is returned.- Parameters:
sequenceNumber- is the sequence number of the event.- Returns:
- An
EventPositionobject.
-
fromSequenceNumber
public static EventPositionImpl fromSequenceNumber(Long sequenceNumber, boolean inclusiveFlag)
Description copied from interface:EventPositionCreates a position at the given sequence number. The specified event will not be included. Instead, the next event is returned.- Parameters:
sequenceNumber- is the sequence number of the event.inclusiveFlag- will include the specified event when set to true; otherwise, the next event is returned.- Returns:
- An
EventPositionobject.
-
fromEnqueuedTime
public static EventPositionImpl fromEnqueuedTime(Instant dateTime)
Description copied from interface:EventPositionCreates a position at the givenInstant.- Parameters:
dateTime- is the enqueued time of the event.- Returns:
- An
EventPositionobject.
-
fromStartOfStream
public static EventPositionImpl fromStartOfStream()
Description copied from interface:EventPositionReturns 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:
- An
EventPositionset to the start of an Event Hubs stream.
-
fromEndOfStream
public static EventPositionImpl fromEndOfStream()
Description copied from interface:EventPositionReturns 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:
- An
EventPositionset to the end of an Event Hubs stream.
-
getSequenceNumber
public Long getSequenceNumber()
Description copied from interface:EventPositionGets the sequence number.- Specified by:
getSequenceNumberin interfaceEventPosition- Returns:
- the sequence number.
-
getEnqueuedTime
public Instant getEnqueuedTime()
Description copied from interface:EventPositionGets the enqueued time.- Specified by:
getEnqueuedTimein interfaceEventPosition- Returns:
- the enqueued time.
-
getOffset
public String getOffset()
Description copied from interface:EventPositionGets the offset.- Specified by:
getOffsetin interfaceEventPosition- Returns:
- the offset.
-
getInclusiveFlag
public boolean getInclusiveFlag()
Description copied from interface:EventPositionGets the inclusive value.- Specified by:
getInclusiveFlagin interfaceEventPosition- Returns:
- the inclusive value.
-
-