Class SubscribeToShardEvent
- java.lang.Object
-
- software.amazon.awssdk.services.kinesis.model.SubscribeToShardEvent
-
- All Implemented Interfaces:
Serializable
,SdkPojo
,SubscribeToShardEventStream
,ToCopyableBuilder<SubscribeToShardEvent.Builder,SubscribeToShardEvent>
@Generated("software.amazon.awssdk:codegen") public class SubscribeToShardEvent extends Object implements SdkPojo, Serializable, ToCopyableBuilder<SubscribeToShardEvent.Builder,SubscribeToShardEvent>, SubscribeToShardEventStream
After you call SubscribeToShard, Kinesis Data Streams sends events of this type over an HTTP/2 connection to your consumer.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SubscribeToShardEvent.Builder
protected static class
SubscribeToShardEvent.BuilderImpl
-
Nested classes/interfaces inherited from interface software.amazon.awssdk.services.kinesis.model.SubscribeToShardEventStream
SubscribeToShardEventStream.EventType
-
-
Field Summary
-
Fields inherited from interface software.amazon.awssdk.services.kinesis.model.SubscribeToShardEventStream
UNKNOWN
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SubscribeToShardEvent(SubscribeToShardEvent.BuilderImpl builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(SubscribeToShardResponseHandler.Visitor visitor)
Calls the appropriate visit method depending on the subtype ofSubscribeToShardEvent
.static SubscribeToShardEvent.Builder
builder()
List<ChildShard>
childShards()
The list of the child shards of the current shard, returned only at the end of the current shard.String
continuationSequenceNumber()
Use this asSequenceNumber
in the next call to SubscribeToShard, withStartingPosition
set toAT_SEQUENCE_NUMBER
orAFTER_SEQUENCE_NUMBER
.SubscribeToShardEvent
copy(Consumer<? super SubscribeToShardEvent.Builder> modifier)
boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
boolean
hasChildShards()
For responses, this returns true if the service returned a value for the ChildShards property.int
hashCode()
boolean
hasRecords()
For responses, this returns true if the service returned a value for the Records property.Long
millisBehindLatest()
The number of milliseconds the read records are from the tip of the stream, indicating how far behind current time the consumer is.List<Record>
records()
SubscribeToShardEventStream.EventType
sdkEventType()
The type of this event.List<SdkField<?>>
sdkFields()
static Class<? extends SubscribeToShardEvent.Builder>
serializableBuilderClass()
SubscribeToShardEvent.Builder
toBuilder()
String
toString()
Returns a string representation of this object.
-
-
-
Constructor Detail
-
SubscribeToShardEvent
protected SubscribeToShardEvent(SubscribeToShardEvent.BuilderImpl builder)
-
-
Method Detail
-
hasRecords
public final boolean hasRecords()
For responses, this returns true if the service returned a value for the Records property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
records
public final List<Record> records()
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasRecords()
method.- Returns:
-
continuationSequenceNumber
public final String continuationSequenceNumber()
Use this as
SequenceNumber
in the next call to SubscribeToShard, withStartingPosition
set toAT_SEQUENCE_NUMBER
orAFTER_SEQUENCE_NUMBER
. UseContinuationSequenceNumber
for checkpointing because it captures your shard progress even when no data is written to the shard.- Returns:
- Use this as
SequenceNumber
in the next call to SubscribeToShard, withStartingPosition
set toAT_SEQUENCE_NUMBER
orAFTER_SEQUENCE_NUMBER
. UseContinuationSequenceNumber
for checkpointing because it captures your shard progress even when no data is written to the shard.
-
millisBehindLatest
public final Long millisBehindLatest()
The number of milliseconds the read records are from the tip of the stream, indicating how far behind current time the consumer is. A value of zero indicates that record processing is caught up, and there are no new records to process at this moment.
- Returns:
- The number of milliseconds the read records are from the tip of the stream, indicating how far behind current time the consumer is. A value of zero indicates that record processing is caught up, and there are no new records to process at this moment.
-
hasChildShards
public final boolean hasChildShards()
For responses, this returns true if the service returned a value for the ChildShards property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
childShards
public final List<ChildShard> childShards()
The list of the child shards of the current shard, returned only at the end of the current shard.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasChildShards()
method.- Returns:
- The list of the child shards of the current shard, returned only at the end of the current shard.
-
toBuilder
public SubscribeToShardEvent.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<SubscribeToShardEvent.Builder,SubscribeToShardEvent>
-
builder
public static SubscribeToShardEvent.Builder builder()
-
serializableBuilderClass
public static Class<? extends SubscribeToShardEvent.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFields
in interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
copy
public final SubscribeToShardEvent copy(Consumer<? super SubscribeToShardEvent.Builder> modifier)
- Specified by:
copy
in interfaceToCopyableBuilder<SubscribeToShardEvent.Builder,SubscribeToShardEvent>
-
sdkEventType
public SubscribeToShardEventStream.EventType sdkEventType()
Description copied from interface:SubscribeToShardEventStream
The type of this event. Corresponds to the:event-type
header on the Message.- Specified by:
sdkEventType
in interfaceSubscribeToShardEventStream
-
accept
public void accept(SubscribeToShardResponseHandler.Visitor visitor)
Calls the appropriate visit method depending on the subtype ofSubscribeToShardEvent
.- Specified by:
accept
in interfaceSubscribeToShardEventStream
- Parameters:
visitor
- Visitor to invoke.
-
-