Class DomainClientImpl
- java.lang.Object
-
- org.jboss.as.controller.client.helpers.domain.impl.DomainClientImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,DomainClient,ModelControllerClient
public class DomainClientImpl extends Object implements DomainClient
Domain client implementation.- Author:
- John Bailey
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.as.controller.client.helpers.domain.DomainClient
DomainClient.Factory
-
-
Constructor Summary
Constructors Constructor Description DomainClientImpl(String protocol, InetAddress address, int port)DomainClientImpl(String protocol, InetAddress address, int port, CallbackHandler handler)DomainClientImpl(InetAddress address, int port)DomainClientImpl(InetAddress address, int port, CallbackHandler handler)DomainClientImpl(ModelControllerClient delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]addDeploymentContent(InputStream stream)Add the content for a deployment to the domain controller.voidclose()org.jboss.dmr.ModelNodeexecute(Operation operation)Execute an operation synchronously.org.jboss.dmr.ModelNodeexecute(Operation operation, OperationMessageHandler messageHandler)Execute an operation synchronously, optionally receiving progress reports.org.jboss.dmr.ModelNodeexecute(org.jboss.dmr.ModelNode operation)Execute an operation synchronously.org.jboss.dmr.ModelNodeexecute(org.jboss.dmr.ModelNode operation, OperationMessageHandler messageHandler)Execute an operation synchronously, optionally receiving progress reports.org.jboss.threads.AsyncFuture<org.jboss.dmr.ModelNode>executeAsync(Operation operation, OperationMessageHandler messageHandler)Execute an operation in another thread, optionally receiving progress reports.org.jboss.threads.AsyncFuture<org.jboss.dmr.ModelNode>executeAsync(org.jboss.dmr.ModelNode operation, OperationMessageHandler messageHandler)Execute an operation in another thread, optionally receiving progress reports.OperationResponseexecuteOperation(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.DomainDeploymentManagergetDeploymentManager()Gets aDomainDeploymentManagerthat 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 currentstatus.ServerStatusrestartServer(String hostControllerName, String serverName, long gracefulShutdownTimeout, TimeUnit timeUnit)Restarts the given server.ServerStatusstartServer(String hostControllerName, String serverName)Starts the given server.ServerStatusstopServer(String hostControllerName, String serverName, long gracefulShutdownTimeout, TimeUnit timeUnit)Stops the given server.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.controller.client.ModelControllerClient
executeAsync, executeAsync
-
-
-
-
Constructor Detail
-
DomainClientImpl
public DomainClientImpl(InetAddress address, int port)
-
DomainClientImpl
public DomainClientImpl(InetAddress address, int port, CallbackHandler handler)
-
DomainClientImpl
public DomainClientImpl(String protocol, InetAddress address, int port)
-
DomainClientImpl
public DomainClientImpl(String protocol, InetAddress address, int port, CallbackHandler handler)
-
DomainClientImpl
public DomainClientImpl(ModelControllerClient delegate)
-
-
Method Detail
-
execute
public org.jboss.dmr.ModelNode execute(org.jboss.dmr.ModelNode operation) throws IOExceptionDescription copied from interface:ModelControllerClientExecute an operation synchronously.- Specified by:
executein interfaceModelControllerClient- Parameters:
operation- the operation to execute- Returns:
- the result of the operation
- Throws:
IOException- if an I/O error occurs while executing the operation
-
execute
public org.jboss.dmr.ModelNode execute(Operation operation) throws IOException
Description copied from interface:ModelControllerClientExecute an operation synchronously. Note that associated input-streams have to be closed by the caller, after the operation completedOperationAttachments.isAutoCloseStreams().- Specified by:
executein interfaceModelControllerClient- Parameters:
operation- the operation to execute- Returns:
- the result of the operation
- Throws:
IOException- if an I/O error occurs while executing the operation
-
execute
public org.jboss.dmr.ModelNode execute(org.jboss.dmr.ModelNode operation, OperationMessageHandler messageHandler) throws IOExceptionDescription copied from interface:ModelControllerClientExecute an operation synchronously, optionally receiving progress reports.- Specified by:
executein interfaceModelControllerClient- Parameters:
operation- the operation to executemessageHandler- the message handler to use for operation progress reporting, ornullfor none- Returns:
- the result of the operation
- Throws:
IOException- if an I/O error occurs while executing the operation
-
execute
public org.jboss.dmr.ModelNode execute(Operation operation, OperationMessageHandler messageHandler) throws IOException
Description copied from interface:ModelControllerClientExecute an operation synchronously, optionally receiving progress reports.Note that associated input-streams have to be closed by the caller, after the operation completed
OperationAttachments.isAutoCloseStreams().- Specified by:
executein interfaceModelControllerClient- Parameters:
operation- the operation to executemessageHandler- the message handler to use for operation progress reporting, ornullfor none- Returns:
- the result of the operation
- Throws:
IOException- if an I/O error occurs while executing the operation
-
executeAsync
public org.jboss.threads.AsyncFuture<org.jboss.dmr.ModelNode> executeAsync(org.jboss.dmr.ModelNode operation, OperationMessageHandler messageHandler)Description copied from interface:ModelControllerClientExecute an operation in another thread, optionally receiving progress reports.- Specified by:
executeAsyncin interfaceModelControllerClient- Parameters:
operation- the operation to executemessageHandler- the message handler to use for operation progress reporting, ornullfor none- Returns:
- the future result of the operation
-
executeAsync
public org.jboss.threads.AsyncFuture<org.jboss.dmr.ModelNode> executeAsync(Operation operation, OperationMessageHandler messageHandler)
Description copied from interface:ModelControllerClientExecute an operation in another thread, optionally receiving progress reports.Note that associated input-streams have to be closed by the caller, after the operation completed
OperationAttachments.isAutoCloseStreams().- Specified by:
executeAsyncin interfaceModelControllerClient- Parameters:
operation- the operation to executemessageHandler- the message handler to use for operation progress reporting, ornullfor none- Returns:
- the future result of the operation
-
executeOperation
public OperationResponse executeOperation(Operation operation, OperationMessageHandler messageHandler) throws IOException
Description copied from interface:ModelControllerClientExecute 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.Note that associated input-streams have to be closed by the caller, after the operation completed
OperationAttachments.isAutoCloseStreams().- Specified by:
executeOperationin interfaceModelControllerClient- Parameters:
operation- the operation to executemessageHandler- the message handler to use for operation progress reporting, ornullfor none- Returns:
- the result of the operation
- Throws:
IOException- if an I/O error occurs while executing the operation
-
executeOperationAsync
public org.jboss.threads.AsyncFuture<OperationResponse> executeOperationAsync(Operation operation, OperationMessageHandler messageHandler)
Description copied from interface:ModelControllerClientExecute 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.Note that associated input-streams have to be closed by the caller, after the operation completed
OperationAttachments.isAutoCloseStreams().- Specified by:
executeOperationAsyncin interfaceModelControllerClient- Parameters:
operation- the operation to executemessageHandler- the message handler to use for operation progress reporting, ornullfor none- Returns:
- the future result of the operation
-
addDeploymentContent
public byte[] addDeploymentContent(InputStream stream)
Description copied from interface:DomainClientAdd the content for a deployment to the domain controller. Note thatthe DomainDeploymentManager offers a more convenient API for manipulating domain deployments.- Specified by:
addDeploymentContentin interfaceDomainClient- Parameters:
stream- the data stream for the deployment- Returns:
- the unique hash for the deployment
-
getDeploymentManager
public DomainDeploymentManager getDeploymentManager()
Description copied from interface:DomainClientGets aDomainDeploymentManagerthat provides a convenience API for manipulating domain deployments.- Specified by:
getDeploymentManagerin interfaceDomainClient- Returns:
- the deployment manager. Will not be
null
-
getHostControllerNames
public List<String> getHostControllerNames()
Description copied from interface:DomainClientGets the list of currently running host controllers.- Specified by:
getHostControllerNamesin interfaceDomainClient- Returns:
- the names of the host controllers. Will not be
null
-
getServerStatuses
public Map<ServerIdentity,ServerStatus> getServerStatuses()
Description copied from interface:DomainClientGets a list of all servers known to the domain, along with their currentstatus. Servers associated with host controllers that are currently off line will not be included.- Specified by:
getServerStatusesin interfaceDomainClient- Returns:
- the servers and their current status. Will not be
null
-
startServer
public ServerStatus startServer(String hostControllerName, String serverName)
Description copied from interface:DomainClientStarts the given server. Ignored if the server is not stopped.- Specified by:
startServerin interfaceDomainClient- Parameters:
hostControllerName- the name of the host controller responsible for the serverserverName- the name of the server- Returns:
- the status of the server following the start. Will not be
null
-
stopServer
public ServerStatus stopServer(String hostControllerName, String serverName, long gracefulShutdownTimeout, TimeUnit timeUnit)
Description copied from interface:DomainClientStops the given server.- Specified by:
stopServerin interfaceDomainClient- Parameters:
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-1to shutdown immediatelytimeUnit- time unit in whichgracefulShutdownTimeoutis expressed- Returns:
- the status of the server following the stop. Will not be
null
-
restartServer
public ServerStatus restartServer(String hostControllerName, String serverName, long gracefulShutdownTimeout, TimeUnit timeUnit)
Description copied from interface:DomainClientRestarts the given server.- Specified by:
restartServerin interfaceDomainClient- Parameters:
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-1to shutdown immediatelytimeUnit- time unit in whichgracefulShutdownTimeoutis expressed- Returns:
- the status of the server following the restart. Will not be
null
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-