public class DomainClientImpl extends Object implements DomainClient
DomainClient.Factory
Constructor and Description |
---|
DomainClientImpl(InetAddress address,
int port) |
DomainClientImpl(InetAddress address,
int port,
CallbackHandler handler) |
Modifier and Type | Method and Description |
---|---|
byte[] |
addDeploymentContent(InputStream stream)
Add the content for a deployment to the domain controller.
|
void |
close() |
org.jboss.dmr.ModelNode |
execute(org.jboss.dmr.ModelNode operation)
Execute an operation synchronously.
|
org.jboss.dmr.ModelNode |
execute(org.jboss.dmr.ModelNode operation,
OperationMessageHandler messageHandler)
Execute an operation synchronously, optionally receiving progress reports.
|
org.jboss.dmr.ModelNode |
execute(Operation operation)
Execute an operation synchronously.
|
org.jboss.dmr.ModelNode |
execute(Operation operation,
OperationMessageHandler messageHandler)
Execute an operation synchronously, optionally receiving progress reports.
|
org.jboss.threads.AsyncFuture<org.jboss.dmr.ModelNode> |
executeAsync(org.jboss.dmr.ModelNode operation,
OperationMessageHandler messageHandler)
Execute an operation.
|
org.jboss.threads.AsyncFuture<org.jboss.dmr.ModelNode> |
executeAsync(Operation operation,
OperationMessageHandler messageHandler)
Execute an operation.
|
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 org.jboss.dmr.ModelNode execute(org.jboss.dmr.ModelNode operation) throws IOException
ModelControllerClient
execute
in interface ModelControllerClient
operation
- the operation to executeIOException
- if an I/O error occurs while executing the operationpublic org.jboss.dmr.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 org.jboss.dmr.ModelNode execute(org.jboss.dmr.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 org.jboss.dmr.ModelNode execute(Operation operation, OperationMessageHandler messageHandler) throws IOException
ModelControllerClient
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<org.jboss.dmr.ModelNode> executeAsync(org.jboss.dmr.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<org.jboss.dmr.ModelNode> executeAsync(Operation operation, OperationMessageHandler messageHandler)
ModelControllerClient
OperationAttachments.isAutoCloseStreams()
.executeAsync
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 © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.