Package org.jboss.as.controller.client
Class OperationBuilder
java.lang.Object
org.jboss.as.controller.client.OperationBuilder
- Direct Known Subclasses:
Operations.CompositeOperationBuilder
Builder for a
Operation.- Author:
- Kabir Khan, Brian Stansberry (c) 2011 Red Hat Inc.
-
Constructor Summary
ConstructorsConstructorDescriptionOperationBuilder(ModelNode operation) OperationBuilder(ModelNode operation, boolean autoCloseStreams) -
Method Summary
Modifier and TypeMethodDescriptionaddFileAsAttachment(File file) Associate a file with the operation.addFileAsAttachment(Path file) Associate a file with the operation.Associate an input stream with the operation.build()Builds the operation.static OperationBuilderCreate an operation builder.static OperationBuilderCreate an operation builder.intGets the number of input streams currently associated with the operation,voidsetAutoCloseStreams(boolean autoCloseStreams) Automatically try to close the stream, once the operation finished executing.
-
Constructor Details
-
OperationBuilder
-
OperationBuilder
-
-
Method Details
-
addFileAsAttachment
Associate a file with the operation. This will create aFileInputStreamand add it as attachment.- Parameters:
file- the file- Returns:
- the operation builder
-
addFileAsAttachment
Associate a file with the operation. This will create aFileInputStreamand add it as attachment.- Parameters:
file- the file- Returns:
- the operation builder
-
addInputStream
Associate an input stream with the operation. Closing the input stream is the responsibility of the caller.- Parameters:
in- the input stream. Cannot benull- 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
Builds the operation.- Returns:
- the operation
-
create
Create an operation builder.- Parameters:
operation- the operation- Returns:
- the builder
-
create
Create an operation builder.- Parameters:
operation- the operationautoCloseStreams- whether streams should be automatically closed- Returns:
- the builder
-