public static class StreamConfiguration.Builder
extends java.lang.Object
new StreamConfiguration.Builder().build()
will create a new StreamConfiguration.
Constructor and Description |
---|
Builder()
Default Builder
|
Builder(StreamConfiguration sc)
Update Builder, useful if you need to update a configuration
|
Modifier and Type | Method and Description |
---|---|
StreamConfiguration.Builder |
addSource(Source source)
Add a source into the StreamConfiguration.
|
StreamConfiguration.Builder |
addSources(java.util.Collection<Source> sources)
Sets the sources in the StreamConfiguration.
|
StreamConfiguration.Builder |
addSources(Source... sources)
Add the sources into the StreamConfiguration.
|
StreamConfiguration.Builder |
addSubjects(java.util.Collection<java.lang.String> subjects)
Adds unique subjects into the StreamConfiguration.
|
StreamConfiguration.Builder |
addSubjects(java.lang.String... subjects)
Adds unique subjects into the StreamConfiguration.
|
StreamConfiguration.Builder |
allowDirect(boolean allowDirect)
Set whether to allow direct message access for a stream
|
StreamConfiguration.Builder |
allowMessageTtl()
Set to allow per message TTL to true
|
StreamConfiguration.Builder |
allowMessageTtl(boolean allowMessageTtl)
Set allow per message TTL flag
|
StreamConfiguration.Builder |
allowRollup(boolean allowRollup)
Set whether to allow the rollup feature for a stream
|
StreamConfiguration |
build()
Builds the StreamConfiguration
|
StreamConfiguration.Builder |
compressionOption(CompressionOption compressionOption)
Sets the compression option in the StreamConfiguration.
|
StreamConfiguration.Builder |
consumerLimits(ConsumerLimits consumerLimits)
Sets the consumerLimits config object
|
StreamConfiguration.Builder |
denyDelete(boolean denyDelete)
Set whether to deny deleting messages from the stream
|
StreamConfiguration.Builder |
denyPurge(boolean denyPurge)
Set whether to deny purging messages from the stream
|
StreamConfiguration.Builder |
description(java.lang.String description)
Sets the description
|
StreamConfiguration.Builder |
discardNewPerSubject(boolean discardNewPerSubject)
Set whether discard policy new with max message per subject applies to existing subjects, not just new subjects.
|
StreamConfiguration.Builder |
discardPolicy(DiscardPolicy policy)
Sets the discard policy in the StreamConfiguration.
|
StreamConfiguration.Builder |
duplicateWindow(java.time.Duration window)
Sets the duplicate checking window in the StreamConfiguration.
|
StreamConfiguration.Builder |
duplicateWindow(long windowMillis)
Sets the duplicate checking window in the StreamConfiguration.
|
StreamConfiguration.Builder |
firstSequence(long firstSeq)
Sets the first sequence to be used.
|
StreamConfiguration.Builder |
maxAge(java.time.Duration maxAge)
Sets the maximum age in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxAge(long maxAgeMillis)
Sets the maximum age in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxBytes(long maxBytes)
Sets the maximum number of bytes in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxConsumers(long maxConsumers)
Sets the maximum number of consumers in the StreamConfiguration.
|
StreamConfiguration.Builder |
maximumMessageSize(int maxMsgSize)
Sets the maximum message size in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxMessages(long maxMsgs)
Sets the maximum number of messages in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxMessagesPerSubject(long maxMsgsPerSubject)
Sets the maximum number of message per subject in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxMsgSize(long maxMsgSize)
Deprecated.
the server value is a 32-bit signed value. Use
maximumMessageSize(int) instead. |
StreamConfiguration.Builder |
metadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Sets the metadata for the configuration
|
StreamConfiguration.Builder |
mirror(Mirror mirror)
Sets the mirror object
|
StreamConfiguration.Builder |
mirrorDirect(boolean mirrorDirect)
Set whether to allow unified direct access for mirrors
|
StreamConfiguration.Builder |
name(java.lang.String name)
Sets the name of the stream.
|
StreamConfiguration.Builder |
noAck(boolean noAck)
Sets the acknowledgement mode of the StreamConfiguration.
|
StreamConfiguration.Builder |
placement(Placement placement)
Sets the placement directive object
|
StreamConfiguration.Builder |
replicas(int replicas)
Sets the number of replicas a message must be stored on in the StreamConfiguration.
|
StreamConfiguration.Builder |
republish(Republish republish)
Sets the republish config object
|
StreamConfiguration.Builder |
retentionPolicy(RetentionPolicy policy)
Sets the retention policy in the StreamConfiguration.
|
StreamConfiguration.Builder |
seal()
Set this stream to be sealed.
|
protected StreamConfiguration.Builder |
sealed(boolean sealed)
Set whether to seal the stream.
|
StreamConfiguration.Builder |
sources(java.util.Collection<Source> sources)
Add the sources into the StreamConfiguration.
|
StreamConfiguration.Builder |
sources(Source... sources)
Sets the sources in the StreamConfiguration.
|
StreamConfiguration.Builder |
storageType(StorageType storageType)
Sets the storage type in the StreamConfiguration.
|
StreamConfiguration.Builder |
subjectDeleteMarkerTtl(java.time.Duration subjectDeleteMarkerTtl)
The time delete marker TTL duration.
|
StreamConfiguration.Builder |
subjects(java.util.Collection<java.lang.String> subjects)
Sets the subjects in the StreamConfiguration.
|
StreamConfiguration.Builder |
subjects(java.lang.String... subjects)
Sets the subjects in the StreamConfiguration.
|
StreamConfiguration.Builder |
subjectTransform(SubjectTransform subjectTransform)
Sets the subjectTransform config object
|
StreamConfiguration.Builder |
templateOwner(java.lang.String templateOwner)
Sets the template a stream in the form of raw JSON.
|
public Builder()
public Builder(StreamConfiguration sc)
sc
- the configuration to copypublic StreamConfiguration.Builder name(java.lang.String name)
name
- name of the stream.public StreamConfiguration.Builder description(java.lang.String description)
description
- the descriptionpublic StreamConfiguration.Builder subjects(java.lang.String... subjects)
subjects
- the stream's subjectspublic StreamConfiguration.Builder subjects(java.util.Collection<java.lang.String> subjects)
subjects
- the stream's subjectspublic StreamConfiguration.Builder addSubjects(java.lang.String... subjects)
subjects
- the stream's subjects to addpublic StreamConfiguration.Builder addSubjects(java.util.Collection<java.lang.String> subjects)
subjects
- the stream's subjects to addpublic StreamConfiguration.Builder retentionPolicy(RetentionPolicy policy)
policy
- the retention policy of the StreamConfigurationpublic StreamConfiguration.Builder compressionOption(CompressionOption compressionOption)
compressionOption
- the compression option of the StreamConfigurationpublic StreamConfiguration.Builder maxConsumers(long maxConsumers)
maxConsumers
- the maximum number of consumerspublic StreamConfiguration.Builder maxMessages(long maxMsgs)
maxMsgs
- the maximum number of messagespublic StreamConfiguration.Builder maxMessagesPerSubject(long maxMsgsPerSubject)
maxMsgsPerSubject
- the maximum number of messagespublic StreamConfiguration.Builder maxBytes(long maxBytes)
maxBytes
- the maximum number of bytespublic StreamConfiguration.Builder maxAge(java.time.Duration maxAge)
maxAge
- the maximum message agepublic StreamConfiguration.Builder maxAge(long maxAgeMillis)
maxAgeMillis
- the maximum message age@Deprecated public StreamConfiguration.Builder maxMsgSize(long maxMsgSize)
maximumMessageSize(int)
instead.maxMsgSize
- the maximum message sizepublic StreamConfiguration.Builder maximumMessageSize(int maxMsgSize)
maxMsgSize
- the maximum message sizepublic StreamConfiguration.Builder storageType(StorageType storageType)
storageType
- the storage typepublic StreamConfiguration.Builder replicas(int replicas)
replicas
- the number of replicas to store this message onpublic StreamConfiguration.Builder noAck(boolean noAck)
noAck
- true to disable acknowledgements.public StreamConfiguration.Builder templateOwner(java.lang.String templateOwner)
templateOwner
- the stream template of the stream.public StreamConfiguration.Builder discardPolicy(DiscardPolicy policy)
policy
- the discard policy of the StreamConfigurationpublic StreamConfiguration.Builder duplicateWindow(java.time.Duration window)
window
- duration to hold message ids for duplicate checking.public StreamConfiguration.Builder duplicateWindow(long windowMillis)
windowMillis
- duration to hold message ids for duplicate checking.public StreamConfiguration.Builder placement(Placement placement)
placement
- the placement directive objectpublic StreamConfiguration.Builder republish(Republish republish)
republish
- the republish config objectpublic StreamConfiguration.Builder subjectTransform(SubjectTransform subjectTransform)
subjectTransform
- the subjectTransform config objectpublic StreamConfiguration.Builder consumerLimits(ConsumerLimits consumerLimits)
consumerLimits
- the consumerLimits config objectpublic StreamConfiguration.Builder mirror(Mirror mirror)
mirror
- the mirror objectpublic StreamConfiguration.Builder sources(Source... sources)
sources
- the stream's sourcespublic StreamConfiguration.Builder sources(java.util.Collection<Source> sources)
sources
- the stream's sourcespublic StreamConfiguration.Builder addSources(Source... sources)
sources
- the stream's sourcespublic StreamConfiguration.Builder addSources(java.util.Collection<Source> sources)
sources
- the stream's sourcespublic StreamConfiguration.Builder addSource(Source source)
source
- a stream sourceprotected StreamConfiguration.Builder sealed(boolean sealed)
sealed
- the sealed settingpublic StreamConfiguration.Builder allowRollup(boolean allowRollup)
allowRollup
- the allow rollup settingpublic StreamConfiguration.Builder allowDirect(boolean allowDirect)
allowDirect
- the allow direct settingpublic StreamConfiguration.Builder mirrorDirect(boolean mirrorDirect)
mirrorDirect
- the allow direct settingpublic StreamConfiguration.Builder denyDelete(boolean denyDelete)
denyDelete
- the deny delete settingpublic StreamConfiguration.Builder denyPurge(boolean denyPurge)
denyPurge
- the deny purge settingpublic StreamConfiguration.Builder discardNewPerSubject(boolean discardNewPerSubject)
discardNewPerSubject
- the settingpublic StreamConfiguration.Builder seal()
public StreamConfiguration.Builder metadata(java.util.Map<java.lang.String,java.lang.String> metadata)
metadata
- the metadata mappublic StreamConfiguration.Builder firstSequence(long firstSeq)
firstSeq
- specify the first_seq in the stream config when creating the stream.public StreamConfiguration.Builder allowMessageTtl()
public StreamConfiguration.Builder allowMessageTtl(boolean allowMessageTtl)
allowMessageTtl
- the flagpublic StreamConfiguration.Builder subjectDeleteMarkerTtl(java.time.Duration subjectDeleteMarkerTtl)
subjectDeleteMarkerTtl
- the TTL durationpublic StreamConfiguration build()