Class MessageSlicer.Builder
java.lang.Object
org.opendaylight.controller.cluster.messaging.MessageSlicer.Builder
- Enclosing class:
MessageSlicer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new MessageSlicer instance.expireStateAfterInactivity
(long duration, TimeUnit unit) Sets the duration and time unit whereby sliced message state is purged from the cache and the associated failure callback is notified due to inactivity from the assembling component on the other end.fileBackedStreamFactory
(FileBackedOutputStreamFactory newFileBackedStreamFactory) Sets the factory for creating FileBackedOutputStream instances used for streaming messages.logContext
(String newLogContext) Sets the context for log messages.maxSlicingTries
(int newMaxSlicingTries) Sets the maximum number of tries for slicing a message.messageSliceSize
(int newMessageSliceSize) Sets the maximum size (in bytes) for a message slice.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
fileBackedStreamFactory
public MessageSlicer.Builder fileBackedStreamFactory(FileBackedOutputStreamFactory newFileBackedStreamFactory) Sets the factory for creating FileBackedOutputStream instances used for streaming messages. This factory is used by theMessageSlicer.slice(SliceOptions)
method if a Serializable message is passed. If Serializable messages aren't passed then the factory need not be set.- Parameters:
newFileBackedStreamFactory
- the factory for creating FileBackedOutputStream instances- Returns:
- this Builder
-
messageSliceSize
Sets the maximum size (in bytes) for a message slice.- Parameters:
newMessageSliceSize
- the maximum size (in bytes)- Returns:
- this Builder
-
maxSlicingTries
Sets the maximum number of tries for slicing a message. If exceeded, slicing fails. The default is defined byMessageSlicer.DEFAULT_MAX_SLICING_TRIES
- Parameters:
newMaxSlicingTries
- the maximum number of tries- Returns:
- this Builder
-
expireStateAfterInactivity
Sets the duration and time unit whereby sliced message state is purged from the cache and the associated failure callback is notified due to inactivity from the assembling component on the other end. By default, state is not purged due to inactivity.- Parameters:
duration
- the length of time after which a state entry is purgedunit
- the unit the duration is expressed in- Returns:
- this Builder
-
logContext
Sets the context for log messages.- Parameters:
newLogContext
- the log context- Returns:
- this Builder
-
build
Builds a new MessageSlicer instance.- Returns:
- a new MessageSlicer
-