Package org.jboss.as.controller.client
Interface OperationResponse
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
OperationResponseProxy
public interface OperationResponse extends Closeable
A response to a management request, incorporating aModelNode
containing the detyped response, along with zero or more input streams that may have been associated with the response.Streams must be consumed promptly once a response is obtained. To prevent resource leaks, the server side will close its side of the stream approximately 30 seconds after the latter of its transmittal of the
OperationResponse
or any remote read of one of its associated streams.- Author:
- Brian Stansberry (c) 2014 Red Hat Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
OperationResponse.Factory
static interface
OperationResponse.StreamEntry
An additional stream, besides the normalresponse ModelNode
that is associated with the response.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes anyassociated stream entries
.OperationResponse.StreamEntry
getInputStream(String uuid)
Gets a stream associated with the response that has the givenuuid
.List<OperationResponse.StreamEntry>
getInputStreams()
Gets any streams that were associated with the operation response.ModelNode
getResponseNode()
Gets the DMR response to the operation.
-
-
-
Method Detail
-
getResponseNode
ModelNode getResponseNode()
Gets the DMR response to the operation.- Returns:
- the response. Will not be
null
-
getInputStreams
List<OperationResponse.StreamEntry> getInputStreams()
Gets any streams that were associated with the operation response. Streams will be in the order in which they were attached, but callers should exercise caution when making assumptions about that order if the operation executes across multiple servers in a managed domain. Aspects of domain execution often occur concurrently so streams may not be associated with the response in the order in which steps are listed in a multistep operation.- Returns:
- the streams. Will not be
null
but may be empty
-
getInputStream
OperationResponse.StreamEntry getInputStream(String uuid)
Gets a stream associated with the response that has the givenuuid
.Server side operation step handlers that associate a stream with a response should provide the stream's uuid as the step's
result
value in theDMR response
.- Parameters:
uuid
- the uuid. Cannot benull
- Returns:
- the stream entry, or
null
if no entry with the given uuid is associated
-
close
void close() throws IOException
Closes anyassociated stream entries
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-