Class SliceOptions.Builder

java.lang.Object
org.opendaylight.controller.cluster.messaging.SliceOptions.Builder
Enclosing class:
SliceOptions

public static class SliceOptions.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • 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 the FileBackedOutputStream containing the message data to slice.
      Parameters:
      newFileBackedStream - the FileBackedOutputStream
      Returns:
      this Builder
    • message

      public <T extends Serializable> SliceOptions.Builder message(T newMessage)
      Sets the message to slice. The message is first serialized to a FileBackedOutputStream. 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 the MessageSlicer.

      Type Parameters:
      T - the Serializable message type
      Parameters:
      newMessage - the message
      Returns:
      this Builder
    • sendTo

      public SliceOptions.Builder sendTo(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(ActorSelection sendTo)
      Sets the ActorSelection to which to send the message slices.
      Parameters:
      sendTo - the ActorSelection
      Returns:
      this Builder
    • replyTo

      public SliceOptions.Builder replyTo(ActorRef newReplyTo)
      Sets the reference of the actor to which message slice replies should be sent. The actor should forward the replies to the MessageSlicer.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()