Class SliceOptions.Builder
- java.lang.Object
-
- org.opendaylight.controller.cluster.messaging.SliceOptions.Builder
-
- Enclosing class:
- SliceOptions
public static class SliceOptions.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SliceOptions
build()
Builds a new SliceOptions instance.protected void
checkSealed()
SliceOptions.Builder
fileBackedOutputStream(FileBackedOutputStream newFileBackedStream)
Sets theFileBackedOutputStream
containing the message data to slice.SliceOptions.Builder
identifier(Identifier newIdentifier)
Sets the identifier of the component to slice.<T extends Serializable>
SliceOptions.Buildermessage(T newMessage)
Sets the message to slice.SliceOptions.Builder
onFailureCallback(Consumer<Throwable> newOnFailureCallback)
Sets the callback to be notified of failure.SliceOptions.Builder
replyTo(akka.actor.ActorRef newReplyTo)
Sets the reference of the actor to which message slice replies should be sent.SliceOptions.Builder
sendTo(akka.actor.ActorRef sendTo)
Sets the reference of the actor to which to send the message slices.SliceOptions.Builder
sendTo(akka.actor.ActorSelection sendTo)
Sets the ActorSelection to which to send the message slices.
-
-
-
Method Detail
-
identifier
public SliceOptions.Builder identifier(Identifier newIdentifier)
Sets the identifier of the component to slice.- Parameters:
newIdentifier
- the identifier- Returns:
- this Builder
-
fileBackedOutputStream
public SliceOptions.Builder fileBackedOutputStream(FileBackedOutputStream newFileBackedStream)
Sets theFileBackedOutputStream
containing the message data to slice.- Parameters:
newFileBackedStream
- theFileBackedOutputStream
- Returns:
- this Builder
-
message
public <T extends Serializable> SliceOptions.Builder message(T newMessage)
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
public SliceOptions.Builder sendTo(akka.actor.ActorRef sendTo)
Sets the reference of the actor to which to send the message slices.- Parameters:
sendTo
- the ActorRef- Returns:
- this Builder
-
sendTo
public SliceOptions.Builder sendTo(akka.actor.ActorSelection sendTo)
Sets the ActorSelection to which to send the message slices.- Parameters:
sendTo
- the ActorSelection- Returns:
- this Builder
-
replyTo
public SliceOptions.Builder replyTo(akka.actor.ActorRef newReplyTo)
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
public SliceOptions.Builder onFailureCallback(Consumer<Throwable> newOnFailureCallback)
Sets the callback to be notified of failure.- Parameters:
newOnFailureCallback
- the callback- Returns:
- this Builder
-
build
public SliceOptions build()
Builds a new SliceOptions instance.- Returns:
- a new SliceOptions
-
checkSealed
protected void checkSealed()
-
-