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 interfaceSubscribeToShardEvent.Builderprotected static classSubscribeToShardEvent.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 protectedSubscribeToShardEvent(SubscribeToShardEvent.BuilderImpl builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(SubscribeToShardResponseHandler.Visitor visitor)Calls the appropriate visit method depending on the subtype ofSubscribeToShardEvent.static SubscribeToShardEvent.Builderbuilder()List<ChildShard>childShards()The list of the child shards of the current shard, returned only at the end of the current shard.StringcontinuationSequenceNumber()Use this asSequenceNumberin the next call to SubscribeToShard, withStartingPositionset toAT_SEQUENCE_NUMBERorAFTER_SEQUENCE_NUMBER.SubscribeToShardEventcopy(Consumer<? super SubscribeToShardEvent.Builder> modifier)booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)booleanhasChildShards()For responses, this returns true if the service returned a value for the ChildShards property.inthashCode()booleanhasRecords()For responses, this returns true if the service returned a value for the Records property.LongmillisBehindLatest()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.EventTypesdkEventType()The type of this event.List<SdkField<?>>sdkFields()static Class<? extends SubscribeToShardEvent.Builder>serializableBuilderClass()SubscribeToShardEvent.BuildertoBuilder()StringtoString()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
SequenceNumberin the next call to SubscribeToShard, withStartingPositionset toAT_SEQUENCE_NUMBERorAFTER_SEQUENCE_NUMBER. UseContinuationSequenceNumberfor checkpointing because it captures your shard progress even when no data is written to the shard.- Returns:
- Use this as
SequenceNumberin the next call to SubscribeToShard, withStartingPositionset toAT_SEQUENCE_NUMBERorAFTER_SEQUENCE_NUMBER. UseContinuationSequenceNumberfor 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:
toBuilderin 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:
equalsBySdkFieldsin 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:
copyin interfaceToCopyableBuilder<SubscribeToShardEvent.Builder,SubscribeToShardEvent>
-
sdkEventType
public SubscribeToShardEventStream.EventType sdkEventType()
Description copied from interface:SubscribeToShardEventStreamThe type of this event. Corresponds to the:event-typeheader on the Message.- Specified by:
sdkEventTypein interfaceSubscribeToShardEventStream
-
accept
public void accept(SubscribeToShardResponseHandler.Visitor visitor)
Calls the appropriate visit method depending on the subtype ofSubscribeToShardEvent.- Specified by:
acceptin interfaceSubscribeToShardEventStream- Parameters:
visitor- Visitor to invoke.
-
-