Class MessageSlicer.Builder
- java.lang.Object
-
- org.opendaylight.controller.cluster.messaging.MessageSlicer.Builder
-
- Enclosing class:
- MessageSlicer
public static class MessageSlicer.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageSlicer
build()
Builds a new MessageSlicer instance.MessageSlicer.Builder
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.MessageSlicer.Builder
fileBackedStreamFactory(FileBackedOutputStreamFactory newFileBackedStreamFactory)
Sets the factory for creating FileBackedOutputStream instances used for streaming messages.MessageSlicer.Builder
logContext(String newLogContext)
Sets the context for log messages.MessageSlicer.Builder
maxSlicingTries(int newMaxSlicingTries)
Sets the maximum number of tries for slicing a message.MessageSlicer.Builder
messageSliceSize(int newMessageSliceSize)
Sets the maximum size (in bytes) for a message slice.
-
-
-
Method Detail
-
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
public MessageSlicer.Builder messageSliceSize(int newMessageSliceSize)
Sets the maximum size (in bytes) for a message slice.- Parameters:
newMessageSliceSize
- the maximum size (in bytes)- Returns:
- this Builder
-
maxSlicingTries
public MessageSlicer.Builder maxSlicingTries(int newMaxSlicingTries)
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
public MessageSlicer.Builder 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. 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
public MessageSlicer.Builder logContext(String newLogContext)
Sets the context for log messages.- Parameters:
newLogContext
- the log context- Returns:
- this Builder
-
build
public MessageSlicer build()
Builds a new MessageSlicer instance.- Returns:
- a new MessageSlicer
-
-