public class DomainClientImpl extends Object implements DomainClient
DomainClient.Factory
Constructor and Description |
---|
DomainClientImpl(InetAddress address,
int port) |
DomainClientImpl(InetAddress address,
int port,
CallbackHandler handler) |
DomainClientImpl(ModelControllerClient delegate) |
Modifier and Type | Method and Description |
---|---|
byte[] |
addDeploymentContent(InputStream stream)
Add the content for a deployment to the domain controller.
|
void |
close() |
ModelNode |
execute(ModelNode operation)
Execute an operation synchronously.
|
ModelNode |
execute(ModelNode operation,
OperationMessageHandler messageHandler)
Execute an operation synchronously, optionally receiving progress reports.
|
ModelNode |
execute(Operation operation)
Execute an operation synchronously.
|
ModelNode |
execute(Operation operation,
OperationMessageHandler messageHandler)
Execute an operation synchronously, optionally receiving progress reports.
|
org.jboss.threads.AsyncFuture<ModelNode> |
executeAsync(ModelNode operation,
OperationMessageHandler messageHandler)
Execute an operation in another thread, optionally receiving progress reports.
|
org.jboss.threads.AsyncFuture<ModelNode> |
executeAsync(Operation operation,
OperationMessageHandler messageHandler)
Execute an operation in another thread, optionally receiving progress reports.
|
OperationResponse |
executeOperation(Operation operation,
OperationMessageHandler messageHandler)
Execute an operation synchronously, optionally receiving progress reports, with the response
to the operation making available any input streams that the server may associate with the response.
|
org.jboss.threads.AsyncFuture<OperationResponse> |
executeOperationAsync(Operation operation,
OperationMessageHandler messageHandler)
Execute an operation in another thread, optionally receiving progress reports, with the response
to the operation making available any input streams that the server may associate with the response.
|
DomainDeploymentManager |
getDeploymentManager()
Gets a
DomainDeploymentManager that provides a convenience API
for manipulating domain deployments. |
List<String> |
getHostControllerNames()
Gets the list of currently running host controllers.
|
Map<ServerIdentity,ServerStatus> |
getServerStatuses()
Gets a list of all servers known to the domain, along with their current
status . |
ServerStatus |
restartServer(String hostControllerName,
String serverName,
long gracefulShutdownTimeout,
TimeUnit timeUnit)
Restarts the given server.
|
ServerStatus |
startServer(String hostControllerName,
String serverName)
Starts the given server.
|
ServerStatus |
stopServer(String hostControllerName,
String serverName,
long gracefulShutdownTimeout,
TimeUnit timeUnit)
Stops the given server.
|
public DomainClientImpl(InetAddress address, int port)
public DomainClientImpl(InetAddress address, int port, CallbackHandler handler)
public DomainClientImpl(ModelControllerClient delegate)
public ModelNode execute(ModelNode operation) throws IOException
ModelControllerClient
execute
in interface ModelControllerClient
operation
- the operation to executeIOException
- if an I/O error occurs while executing the operationpublic ModelNode execute(Operation operation) throws IOException
ModelControllerClient
OperationAttachments.isAutoCloseStreams()
.execute
in interface ModelControllerClient
operation
- the operation to executeIOException
- if an I/O error occurs while executing the operationpublic ModelNode execute(ModelNode operation, OperationMessageHandler messageHandler) throws IOException
ModelControllerClient
execute
in interface ModelControllerClient
operation
- the operation to executemessageHandler
- the message handler to use for operation progress reporting, or null
for noneIOException
- if an I/O error occurs while executing the operationpublic ModelNode execute(Operation operation, OperationMessageHandler messageHandler) throws IOException
ModelControllerClient
Note that associated input-streams have to be closed by the caller, after the
operation completed OperationAttachments.isAutoCloseStreams()
.
execute
in interface ModelControllerClient
operation
- the operation to executemessageHandler
- the message handler to use for operation progress reporting, or null
for noneIOException
- if an I/O error occurs while executing the operationpublic org.jboss.threads.AsyncFuture<ModelNode> executeAsync(ModelNode operation, OperationMessageHandler messageHandler)
ModelControllerClient
executeAsync
in interface ModelControllerClient
operation
- the operation to executemessageHandler
- the message handler to use for operation progress reporting, or null
for nonepublic org.jboss.threads.AsyncFuture<ModelNode> executeAsync(Operation operation, OperationMessageHandler messageHandler)
ModelControllerClient
Note that associated input-streams have to be closed by the caller, after the
operation completed OperationAttachments.isAutoCloseStreams()
.
executeAsync
in interface ModelControllerClient
operation
- the operation to executemessageHandler
- the message handler to use for operation progress reporting, or null
for nonepublic OperationResponse executeOperation(Operation operation, OperationMessageHandler messageHandler) throws IOException
ModelControllerClient
Note that associated input-streams have to be closed by the caller, after the
operation completed OperationAttachments.isAutoCloseStreams()
.
executeOperation
in interface ModelControllerClient
operation
- the operation to executemessageHandler
- the message handler to use for operation progress reporting, or null
for noneIOException
- if an I/O error occurs while executing the operationpublic org.jboss.threads.AsyncFuture<OperationResponse> executeOperationAsync(Operation operation, OperationMessageHandler messageHandler)
ModelControllerClient
Note that associated input-streams have to be closed by the caller, after the
operation completed OperationAttachments.isAutoCloseStreams()
.
executeOperationAsync
in interface ModelControllerClient
operation
- the operation to executemessageHandler
- the message handler to use for operation progress reporting, or null
for nonepublic byte[] addDeploymentContent(InputStream stream)
DomainClient
addDeploymentContent
in interface DomainClient
stream
- the data stream for the deploymentpublic DomainDeploymentManager getDeploymentManager()
DomainClient
DomainDeploymentManager
that provides a convenience API
for manipulating domain deployments.getDeploymentManager
in interface DomainClient
null
public List<String> getHostControllerNames()
DomainClient
getHostControllerNames
in interface DomainClient
null
public Map<ServerIdentity,ServerStatus> getServerStatuses()
DomainClient
status
. Servers associated with host controllers that
are currently off line will not be included.getServerStatuses
in interface DomainClient
null
public ServerStatus startServer(String hostControllerName, String serverName)
DomainClient
startServer
in interface DomainClient
hostControllerName
- the name of the host controller responsible for the serverserverName
- the name of the servernull
public ServerStatus stopServer(String hostControllerName, String serverName, long gracefulShutdownTimeout, TimeUnit timeUnit)
DomainClient
stopServer
in interface DomainClient
hostControllerName
- the name of the host controller responsible for the serverserverName
- the name of the servergracefulShutdownTimeout
- maximum period to wait to allow the server
to gracefully handle long running tasks before shutting down,
or -1
to shutdown immediatelytimeUnit
- time unit in which gracefulShutdownTimeout
is expressednull
public ServerStatus restartServer(String hostControllerName, String serverName, long gracefulShutdownTimeout, TimeUnit timeUnit)
DomainClient
restartServer
in interface DomainClient
hostControllerName
- the name of the host controller responsible for the serverserverName
- the name of the servergracefulShutdownTimeout
- maximum period to wait to allow the server
to gracefully handle long running tasks before shutting down,
or -1
to shutdown immediatelytimeUnit
- time unit in which gracefulShutdownTimeout
is expressednull
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2018 JBoss by Red Hat. All rights reserved.