public class OperationBuilder extends Object
Operation
.Constructor and Description |
---|
OperationBuilder(ModelNode operation) |
OperationBuilder(ModelNode operation,
boolean autoCloseStreams) |
Modifier and Type | Method and Description |
---|---|
OperationBuilder |
addFileAsAttachment(File file)
Associate a file with the operation.
|
OperationBuilder |
addInputStream(InputStream in)
Associate an input stream with the operation.
|
Operation |
build()
Builds the operation.
|
static OperationBuilder |
create(ModelNode operation)
Create an operation builder.
|
static OperationBuilder |
create(ModelNode operation,
boolean autoCloseStreams)
Create an operation builder.
|
int |
getInputStreamCount()
Gets the number of input streams currently associated with the operation,
|
void |
setAutoCloseStreams(boolean autoCloseStreams)
Automatically try to close the stream, once the operation finished executing.
|
public OperationBuilder(ModelNode operation)
public OperationBuilder(ModelNode operation, boolean autoCloseStreams)
public OperationBuilder addFileAsAttachment(File file)
FileInputStream
and add it as attachment.file
- the filepublic OperationBuilder addInputStream(InputStream in)
in
- the input stream. Cannot be null
public int getInputStreamCount()
public void setAutoCloseStreams(boolean autoCloseStreams)
autoCloseStreams
- whether to close the streams or notpublic Operation build()
public static OperationBuilder create(ModelNode operation)
operation
- the operationpublic static OperationBuilder create(ModelNode operation, boolean autoCloseStreams)
operation
- the operationautoCloseStreams
- whether streams should be automatically closedCopyright © 2018 JBoss by Red Hat. All rights reserved.