Class MessageAssembler.Builder
java.lang.Object
org.opendaylight.controller.cluster.messaging.MessageAssembler.Builder
- Enclosing class:
MessageAssembler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassembledMessageCallback
(BiConsumer<Object, ActorRef> newAssembledMessageCallback) Sets the Consumer callback for assembled messages.build()
Builds a new MessageAssembler instance.expireStateAfterInactivity
(long duration, TimeUnit unit) Sets the duration and time unit whereby assembled message state is purged from the cache due to inactivity from the slicing 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.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
fileBackedStreamFactory
public MessageAssembler.Builder fileBackedStreamFactory(FileBackedOutputStreamFactory newFileBackedStreamFactory) Sets the factory for creating FileBackedOutputStream instances used for streaming messages.- Parameters:
newFileBackedStreamFactory
- the factory for creating FileBackedOutputStream instances- Returns:
- this Builder
-
assembledMessageCallback
public MessageAssembler.Builder assembledMessageCallback(BiConsumer<Object, ActorRef> newAssembledMessageCallback) Sets the Consumer callback for assembled messages. The callback takes the assembled message and the original sender ActorRef as arguments.- Parameters:
newAssembledMessageCallback
- the Consumer callback- Returns:
- this Builder
-
expireStateAfterInactivity
Sets the duration and time unit whereby assembled message state is purged from the cache due to inactivity from the slicing component on the other end. By default, state is purged after 1 minute of 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 MessageAssembler instance.- Returns:
- a new MessageAssembler
-