@@ -71,42 +71,42 @@ public class StreamConfiguration implements JsonSerializable {
7171 private final Duration subjectDeleteMarkerTtl ;
7272
7373 static StreamConfiguration instance (JsonValue v ) {
74- Builder builder = new Builder ();
75- builder .retentionPolicy (RetentionPolicy .get (readString (v , RETENTION )));
76- builder .compressionOption (CompressionOption .get (readString (v , COMPRESSION )));
77- builder .storageType (StorageType .get (readString (v , STORAGE )));
78- builder .discardPolicy (DiscardPolicy .get (readString (v , DISCARD )));
79- builder .name (readString (v , NAME ));
80- builder .description (readString (v , DESCRIPTION ));
81- builder .maxConsumers (readLong (v , MAX_CONSUMERS , -1 ));
82- builder .maxMessages (readLong (v , MAX_MSGS , -1 ));
83- builder .maxMessagesPerSubject (readLong (v , MAX_MSGS_PER_SUB , -1 ));
84- builder .maxBytes (readLong (v , MAX_BYTES , -1 ));
85- builder .maxAge (readNanos (v , MAX_AGE ));
86- builder .maximumMessageSize (readInteger (v , MAX_MSG_SIZE , -1 ));
87- builder .replicas (readInteger (v , NUM_REPLICAS , 1 ));
88- builder .noAck (readBoolean (v , NO_ACK ));
89- builder .templateOwner (readString (v , TEMPLATE_OWNER ));
90- builder .duplicateWindow (readNanos (v , DUPLICATE_WINDOW ));
91- builder .subjects (readStringList (v , SUBJECTS ));
92- builder .placement (Placement .optionalInstance (readValue (v , PLACEMENT )));
93- builder .republish (Republish .optionalInstance (readValue (v , REPUBLISH )));
94- builder .subjectTransform (SubjectTransform .optionalInstance (readValue (v , SUBJECT_TRANSFORM )));
95- builder .consumerLimits (ConsumerLimits .optionalInstance (readValue (v , CONSUMER_LIMITS )));
96- builder .mirror (Mirror .optionalInstance (readValue (v , MIRROR )));
97- builder .sources (Source .optionalListOf (readValue (v , SOURCES )));
98- builder .sealed (readBoolean (v , SEALED ));
99- builder .allowRollup (readBoolean (v , ALLOW_ROLLUP_HDRS ));
100- builder .allowDirect (readBoolean (v , ALLOW_DIRECT ));
101- builder .mirrorDirect (readBoolean (v , MIRROR_DIRECT ));
102- builder .denyDelete (readBoolean (v , DENY_DELETE ));
103- builder .denyPurge (readBoolean (v , DENY_PURGE ));
104- builder .discardNewPerSubject (readBoolean (v , DISCARD_NEW_PER_SUBJECT ));
105- builder .metadata (readStringStringMap (v , METADATA ));
106- builder .firstSequence (readLong (v , FIRST_SEQ , 1 ));
107- // builder .allowMessageTtl(readBoolean(v, ALLOW_MSG_TTL));
108- // builder .subjectDeleteMarkerTtl(readNanos(v, SUBJECT_DELETE_MARKER_TTL));
109- return builder .build ();
74+ return new Builder ()
75+ .retentionPolicy (RetentionPolicy .get (readString (v , RETENTION )))
76+ .compressionOption (CompressionOption .get (readString (v , COMPRESSION )))
77+ .storageType (StorageType .get (readString (v , STORAGE )))
78+ .discardPolicy (DiscardPolicy .get (readString (v , DISCARD )))
79+ .name (readString (v , NAME ))
80+ .description (readString (v , DESCRIPTION ))
81+ .maxConsumers (readLong (v , MAX_CONSUMERS , -1 ))
82+ .maxMessages (readLong (v , MAX_MSGS , -1 ))
83+ .maxMessagesPerSubject (readLong (v , MAX_MSGS_PER_SUB , -1 ))
84+ .maxBytes (readLong (v , MAX_BYTES , -1 ))
85+ .maxAge (readNanos (v , MAX_AGE ))
86+ .maximumMessageSize (readInteger (v , MAX_MSG_SIZE , -1 ))
87+ .replicas (readInteger (v , NUM_REPLICAS , 1 ))
88+ .noAck (readBoolean (v , NO_ACK ))
89+ .templateOwner (readString (v , TEMPLATE_OWNER ))
90+ .duplicateWindow (readNanos (v , DUPLICATE_WINDOW ))
91+ .subjects (readStringList (v , SUBJECTS ))
92+ .placement (Placement .optionalInstance (readValue (v , PLACEMENT )))
93+ .republish (Republish .optionalInstance (readValue (v , REPUBLISH )))
94+ .subjectTransform (SubjectTransform .optionalInstance (readValue (v , SUBJECT_TRANSFORM )))
95+ .consumerLimits (ConsumerLimits .optionalInstance (readValue (v , CONSUMER_LIMITS )))
96+ .mirror (Mirror .optionalInstance (readValue (v , MIRROR )))
97+ .sources (Source .optionalListOf (readValue (v , SOURCES )))
98+ .sealed (readBoolean (v , SEALED ))
99+ .allowRollup (readBoolean (v , ALLOW_ROLLUP_HDRS ))
100+ .allowDirect (readBoolean (v , ALLOW_DIRECT ))
101+ .mirrorDirect (readBoolean (v , MIRROR_DIRECT ))
102+ .denyDelete (readBoolean (v , DENY_DELETE ))
103+ .denyPurge (readBoolean (v , DENY_PURGE ))
104+ .discardNewPerSubject (readBoolean (v , DISCARD_NEW_PER_SUBJECT ))
105+ .metadata (readStringStringMap (v , METADATA ))
106+ .firstSequence (readLong (v , FIRST_SEQ , 1 ))
107+ .allowMessageTtl (readBoolean (v , ALLOW_MSG_TTL ))
108+ .subjectDeleteMarkerTtl (readNanos (v , SUBJECT_DELETE_MARKER_TTL ))
109+ .build ();
110110 }
111111
112112 // For the builder, assumes all validations are already done in builder
@@ -1060,35 +1060,35 @@ public Builder firstSequence(long firstSeq) {
10601060 return this ;
10611061 }
10621062
1063- // /**
1064- // * Set to allow per message TTL to true
1065- // * @return The Builder
1066- // */
1067- // public Builder allowMessageTtl() {
1068- // this.allowMessageTtl = true;
1069- // return this;
1070- // }
1071-
1072- // /**
1073- // * Set allow per message TTL flag
1074- // * @param allowMessageTtl the flag
1075- // * @return The Builder
1076- // */
1077- // public Builder allowMessageTtl(boolean allowMessageTtl) {
1078- // this.allowMessageTtl = allowMessageTtl;
1079- // return this;
1080- // }
1081-
1082- // /**
1083- // * The time delete marker TTL duration. Server accepts 1 second or more.
1084- // * CLIENT DOES NOT VALIDATE
1085- // * @param subjectDeleteMarkerTtl the TTL duration
1086- // * @return The Builder
1087- // */
1088- // public Builder subjectDeleteMarkerTtl(Duration subjectDeleteMarkerTtl) {
1089- // this.subjectDeleteMarkerTtl = subjectDeleteMarkerTtl;
1090- // return this;
1091- // }
1063+ /**
1064+ * Set to allow per message TTL to true
1065+ * @return The Builder
1066+ */
1067+ public Builder allowMessageTtl () {
1068+ this .allowMessageTtl = true ;
1069+ return this ;
1070+ }
1071+
1072+ /**
1073+ * Set allow per message TTL flag
1074+ * @param allowMessageTtl the flag
1075+ * @return The Builder
1076+ */
1077+ public Builder allowMessageTtl (boolean allowMessageTtl ) {
1078+ this .allowMessageTtl = allowMessageTtl ;
1079+ return this ;
1080+ }
1081+
1082+ /**
1083+ * The time delete marker TTL duration. Server accepts 1 second or more.
1084+ * CLIENT DOES NOT VALIDATE
1085+ * @param subjectDeleteMarkerTtl the TTL duration
1086+ * @return The Builder
1087+ */
1088+ public Builder subjectDeleteMarkerTtl (Duration subjectDeleteMarkerTtl ) {
1089+ this .subjectDeleteMarkerTtl = subjectDeleteMarkerTtl ;
1090+ return this ;
1091+ }
10921092
10931093 /**
10941094 * Builds the StreamConfiguration
0 commit comments