Class SliceOptions.Builder
java.lang.Object
org.opendaylight.controller.cluster.messaging.SliceOptions.Builder
- Enclosing class:
- SliceOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new SliceOptions instance.protected void
fileBackedOutputStream
(FileBackedOutputStream newFileBackedStream) Sets theFileBackedOutputStream
containing the message data to slice.identifier
(Identifier newIdentifier) Sets the identifier of the component to slice.<T extends Serializable>
SliceOptions.Buildermessage
(T newMessage) Sets the message to slice.onFailureCallback
(Consumer<Throwable> newOnFailureCallback) Sets the callback to be notified of failure.Sets the reference of the actor to which message slice replies should be sent.Sets the reference of the actor to which to send the message slices.sendTo
(ActorSelection sendTo) Sets the ActorSelection to which to send the message slices.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
identifier
Sets the identifier of the component to slice.- Parameters:
newIdentifier
- the identifier- Returns:
- this Builder
-
fileBackedOutputStream
Sets theFileBackedOutputStream
containing the message data to slice.- Parameters:
newFileBackedStream
- theFileBackedOutputStream
- Returns:
- this Builder
-
message
Sets the message to slice. The message is first serialized to aFileBackedOutputStream
. If the message doesn't need to be sliced, ie its serialized size is less than the maximum message slice size, then the original message is sent. Otherwise the first message slice is sent.Note: a
FileBackedOutputStreamFactory
must be set in theMessageSlicer
.- Type Parameters:
T
- the Serializable message type- Parameters:
newMessage
- the message- Returns:
- this Builder
-
sendTo
Sets the reference of the actor to which to send the message slices.- Parameters:
sendTo
- the ActorRef- Returns:
- this Builder
-
sendTo
Sets the ActorSelection to which to send the message slices.- Parameters:
sendTo
- the ActorSelection- Returns:
- this Builder
-
replyTo
Sets the reference of the actor to which message slice replies should be sent. The actor should forward the replies to theMessageSlicer.handleMessage(Object)
method.- Parameters:
newReplyTo
- the ActorRef- Returns:
- this Builder
-
onFailureCallback
Sets the callback to be notified of failure.- Parameters:
newOnFailureCallback
- the callback- Returns:
- this Builder
-
build
Builds a new SliceOptions instance.- Returns:
- a new SliceOptions
-
checkSealed
protected void checkSealed()
-