Class MessageAssembler.Builder
java.lang.Object
org.opendaylight.controller.cluster.messaging.MessageAssembler.Builder
- Enclosing class:
MessageAssembler
-
Method Summary
Modifier and TypeMethodDescriptionassembledMessageCallback(BiConsumer<Object, ActorRef> newAssembledMessageCallback) Sets theBiConsumercallback 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 creatingFileBackedOutputStreaminstances used for streaming messages.logContext(String newLogContext) Sets the context for log messages.objectStreams(RestrictedObjectStreams newObjectStreams) Sets theRestrictedObjectStreamsto use for object de-serialization.
-
Method Details
-
fileBackedStreamFactory
public MessageAssembler.Builder fileBackedStreamFactory(FileBackedOutputStreamFactory newFileBackedStreamFactory) Sets the factory for creatingFileBackedOutputStreaminstances used for streaming messages.- Parameters:
newFileBackedStreamFactory- the factory for creatingFileBackedOutputStreaminstances- Returns:
- this Builder
-
assembledMessageCallback
public MessageAssembler.Builder assembledMessageCallback(BiConsumer<Object, ActorRef> newAssembledMessageCallback) Sets theBiConsumercallback for assembled messages. The callback takes the assembled message and the original senderActorRefas arguments.- Parameters:
newAssembledMessageCallback- theBiConsumercallback- Returns:
- this Builder
-
objectStreams
Sets theRestrictedObjectStreamsto use for object de-serialization.- Parameters:
newObjectStreams- theRestrictedObjectStreamsuse- 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
- Throws:
NullPointerException- if one of the mandatory fields is not set
-