Class RetentionDescription
java.lang.Object
com.azure.resourcemanager.eventhubs.models.RetentionDescription
- All Implemented Interfaces:
com.azure.json.JsonSerializable<RetentionDescription>
public final class RetentionDescription
extends Object
implements com.azure.json.JsonSerializable<RetentionDescription>
Properties to configure retention settings for the eventhub.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the cleanupPolicy property: Enumerates the possible values for cleanup policy.static RetentionDescriptionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of RetentionDescription from the JsonReader.Get the retentionTimeInHours property: Number of hours to retain the events for this Event Hub.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Get the tombstoneRetentionTimeInHours property: Number of hours to retain the tombstone markers of a compacted Event Hub.voidvalidate()Validates the instance.withCleanupPolicy(CleanupPolicyRetentionDescription cleanupPolicy) Set the cleanupPolicy property: Enumerates the possible values for cleanup policy.withRetentionTimeInHours(Long retentionTimeInHours) Set the retentionTimeInHours property: Number of hours to retain the events for this Event Hub.withTombstoneRetentionTimeInHours(Integer tombstoneRetentionTimeInHours) Set the tombstoneRetentionTimeInHours property: Number of hours to retain the tombstone markers of a compacted Event Hub.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
RetentionDescription
public RetentionDescription()Creates an instance of RetentionDescription class.
-
-
Method Details
-
cleanupPolicy
Get the cleanupPolicy property: Enumerates the possible values for cleanup policy.- Returns:
- the cleanupPolicy value.
-
withCleanupPolicy
Set the cleanupPolicy property: Enumerates the possible values for cleanup policy.- Parameters:
cleanupPolicy- the cleanupPolicy value to set.- Returns:
- the RetentionDescription object itself.
-
retentionTimeInHours
Get the retentionTimeInHours property: Number of hours to retain the events for this Event Hub. This value is only used when cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue.- Returns:
- the retentionTimeInHours value.
-
withRetentionTimeInHours
Set the retentionTimeInHours property: Number of hours to retain the events for this Event Hub. This value is only used when cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue.- Parameters:
retentionTimeInHours- the retentionTimeInHours value to set.- Returns:
- the RetentionDescription object itself.
-
tombstoneRetentionTimeInHours
Get the tombstoneRetentionTimeInHours property: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key described by the tombstone marker within the compacted Event Hub.- Returns:
- the tombstoneRetentionTimeInHours value.
-
withTombstoneRetentionTimeInHours
public RetentionDescription withTombstoneRetentionTimeInHours(Integer tombstoneRetentionTimeInHours) Set the tombstoneRetentionTimeInHours property: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key described by the tombstone marker within the compacted Event Hub.- Parameters:
tombstoneRetentionTimeInHours- the tombstoneRetentionTimeInHours value to set.- Returns:
- the RetentionDescription object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<RetentionDescription>- Throws:
IOException
-
fromJson
public static RetentionDescription fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of RetentionDescription from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of RetentionDescription if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the RetentionDescription.
-