Class OperationBuilder

    • Constructor Detail

      • OperationBuilder

        public OperationBuilder​(org.jboss.dmr.ModelNode operation)
      • OperationBuilder

        public OperationBuilder​(org.jboss.dmr.ModelNode operation,
                                boolean autoCloseStreams)
    • Method Detail

      • addFileAsAttachment

        public OperationBuilder addFileAsAttachment​(File file)
        Associate a file with the operation. This will create a FileInputStream and add it as attachment.
        Parameters:
        file - the file
        Returns:
        the operation builder
      • addFileAsAttachment

        public OperationBuilder addFileAsAttachment​(Path file)
        Associate a file with the operation. This will create a FileInputStream and add it as attachment.
        Parameters:
        file - the file
        Returns:
        the operation builder
      • addInputStream

        public OperationBuilder addInputStream​(InputStream in)
        Associate an input stream with the operation. Closing the input stream is the responsibility of the caller.
        Parameters:
        in - the input stream. Cannot be null
        Returns:
        a builder than can be used to continue building the operation
      • getInputStreamCount

        public int getInputStreamCount()
        Gets the number of input streams currently associated with the operation,
        Returns:
        the number of input streams
      • setAutoCloseStreams

        public void setAutoCloseStreams​(boolean autoCloseStreams)
        Automatically try to close the stream, once the operation finished executing.
        Parameters:
        autoCloseStreams - whether to close the streams or not
      • build

        public Operation build()
        Builds the operation.
        Returns:
        the operation
      • create

        public static OperationBuilder create​(org.jboss.dmr.ModelNode operation)
        Create an operation builder.
        Parameters:
        operation - the operation
        Returns:
        the builder
      • create

        public static OperationBuilder create​(org.jboss.dmr.ModelNode operation,
                                              boolean autoCloseStreams)
        Create an operation builder.
        Parameters:
        operation - the operation
        autoCloseStreams - whether streams should be automatically closed
        Returns:
        the builder