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 EventPositionImpl
fromEndOfStream()
Returns the position for the end of a stream.static EventPositionImpl
fromEnqueuedTime(Instant dateTime)
Creates a position at the givenInstant
.static EventPositionImpl
fromOffset(String offset)
Creates a position at the given offset.static EventPositionImpl
fromOffset(String offset, boolean inclusiveFlag)
Creates a position at the given offset.static EventPositionImpl
fromSequenceNumber(Long sequenceNumber)
Creates a position at the given sequence number.static EventPositionImpl
fromSequenceNumber(Long sequenceNumber, boolean inclusiveFlag)
Creates a position at the given sequence number.static EventPositionImpl
fromStartOfStream()
Returns the position for the start of a stream.Instant
getEnqueuedTime()
Gets the enqueued time.boolean
getInclusiveFlag()
Gets the inclusive value.String
getOffset()
Gets the offset.Long
getSequenceNumber()
Gets the sequence number.String
toString()
-
-
-
Method Detail
-
fromOffset
public static EventPositionImpl fromOffset(String offset)
Description copied from interface:EventPosition
Creates 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
EventPosition
object.
-
fromOffset
public static EventPositionImpl fromOffset(String offset, boolean inclusiveFlag)
Description copied from interface:EventPosition
Creates 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
EventPosition
object.
-
fromSequenceNumber
public static EventPositionImpl fromSequenceNumber(Long sequenceNumber)
Description copied from interface:EventPosition
Creates 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
EventPosition
object.
-
fromSequenceNumber
public static EventPositionImpl fromSequenceNumber(Long sequenceNumber, boolean inclusiveFlag)
Description copied from interface:EventPosition
Creates 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
EventPosition
object.
-
fromEnqueuedTime
public static EventPositionImpl fromEnqueuedTime(Instant dateTime)
Description copied from interface:EventPosition
Creates a position at the givenInstant
.- Parameters:
dateTime
- is the enqueued time of the event.- Returns:
- An
EventPosition
object.
-
fromStartOfStream
public static EventPositionImpl fromStartOfStream()
Description copied from interface:EventPosition
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:
- An
EventPosition
set to the start of an Event Hubs stream.
-
fromEndOfStream
public static EventPositionImpl fromEndOfStream()
Description copied from interface:EventPosition
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:
- An
EventPosition
set to the end of an Event Hubs stream.
-
getSequenceNumber
public Long getSequenceNumber()
Description copied from interface:EventPosition
Gets the sequence number.- Specified by:
getSequenceNumber
in interfaceEventPosition
- Returns:
- the sequence number.
-
getEnqueuedTime
public Instant getEnqueuedTime()
Description copied from interface:EventPosition
Gets the enqueued time.- Specified by:
getEnqueuedTime
in interfaceEventPosition
- Returns:
- the enqueued time.
-
getOffset
public String getOffset()
Description copied from interface:EventPosition
Gets the offset.- Specified by:
getOffset
in interfaceEventPosition
- Returns:
- the offset.
-
getInclusiveFlag
public boolean getInclusiveFlag()
Description copied from interface:EventPosition
Gets the inclusive value.- Specified by:
getInclusiveFlag
in interfaceEventPosition
- Returns:
- the inclusive value.
-
-