public class ServerInventoryImpl extends Object implements ServerInventory
Modifier and Type | Method and Description |
---|---|
void |
awaitServersState(Collection<String> serverNames,
boolean started)
Await for a group of servers to be either started or stopped.
|
boolean |
awaitServerSuspend(Set<String> waitForServers,
int timeoutInSeconds)
Suspends and waits for the given set of servers to suspend up to the timeout
|
void |
connectionFinished()
Signal the end of the PC connection, regardless of the reason.
|
void |
destroyServer(String serverName)
Destroy a stopping server process.
|
Map<String,ProcessInfo> |
determineRunningProcesses()
Gets information on all the running processes
|
Map<String,ProcessInfo> |
determineRunningProcesses(boolean serversOnly)
Gets information on all the running processes
|
ServerStatus |
determineServerStatus(String serverName)
Get the status of the server with the given name.
|
String |
getProcessServerName(String processName)
Gets the server model name for a process
|
CallbackHandler |
getServerCallbackHandler()
Gets a callback handler security services can use for handling authentication data provided by
a server attempting to connect with this host controller.
|
String |
getServerProcessName(String serverName)
Gets the process name for a server
|
void |
killServer(String serverName)
Try to kill a server process.
|
void |
operationFailed(String serverProcessName,
ProcessMessageHandler.OperationType type)
Notification that an operation failed on the process-controller.
|
void |
processInventory(Map<String,ProcessInfo> processInfos)
Notification that managed server process information is available.
|
void |
reconnectServer(String serverName,
org.jboss.dmr.ModelNode domainModel,
String authKey,
boolean running,
boolean stopping)
Re-establishes management communications with a server following a restart of the Host Controller process.
|
ServerStatus |
reloadServer(String serverName,
boolean blocking)
Reload a server with the given name.
|
ServerStatus |
restartServer(String serverName,
int gracefulTimeout,
org.jboss.dmr.ModelNode domainModel)
Restart the server with the given name.
|
ServerStatus |
restartServer(String serverName,
int gracefulTimeout,
org.jboss.dmr.ModelNode domainModel,
boolean blocking)
Restart the server with the given name.
|
void |
resumeServer(String serverName)
Resumes a server, allowing it to begin processing requests normally
|
ProxyController |
serverCommunicationRegistered(String serverProcessName,
ManagementChannelHandler channelAssociation)
Notification that a channel for communication with a managed server process has been registered.
|
void |
serverProcessAdded(String serverProcessName)
Notification that a server has been added to the process-controller.
|
void |
serverProcessRemoved(String serverProcessName)
Notification that a server has been removed from the process-controller.
|
void |
serverProcessStarted(String serverProcessName)
Notification that a server process has been started.
|
void |
serverProcessStopped(String serverProcessName)
Notification that a server has stopped.
|
boolean |
serverReconnected(String serverProcessName,
ManagementChannelHandler channelHandler)
Notification that a server has been reconnected.
|
void |
serverStarted(String serverProcessName)
Notification that the server is started.
|
void |
serverStartFailed(String serverProcessName)
Notification that the start of a server process has failed.
|
ServerStatus |
startServer(String serverName,
org.jboss.dmr.ModelNode domainModel)
Start the server with the given name.
|
ServerStatus |
startServer(String serverName,
org.jboss.dmr.ModelNode domainModel,
boolean blocking)
Start the server with the given name.
|
ServerStatus |
stopServer(String serverName,
int gracefulTimeout)
Stop the server with the given name.
|
ServerStatus |
stopServer(String serverName,
int gracefulTimeout,
boolean blocking)
Stop the server with the given name.
|
void |
stopServers(int gracefulTimeout)
Stop all servers.
|
void |
stopServers(int gracefulTimeout,
boolean blockUntilStopped)
Stop all servers.
|
void |
suspendServer(String serverName)
Suspends a server, allowing current requests to finish and blocking any new requests
from starting.
|
public String getServerProcessName(String serverName)
ServerInventory
getServerProcessName
in interface ServerInventory
serverName
- the name of a server in the modelpublic String getProcessServerName(String processName)
ServerInventory
getProcessServerName
in interface ServerInventory
processName
- the name of the server processpublic Map<String,ProcessInfo> determineRunningProcesses()
ServerInventory
determineRunningProcesses
in interface ServerInventory
public Map<String,ProcessInfo> determineRunningProcesses(boolean serversOnly)
ServerInventory
determineRunningProcesses
in interface ServerInventory
serversOnly
- true
to only return the server processespublic ServerStatus determineServerStatus(String serverName)
ServerInventory
determineServerStatus
in interface ServerInventory
serverName
- the server name. Cannot be null
null
; will return ServerStatus.STOPPED
for unknown serverspublic ServerStatus startServer(String serverName, org.jboss.dmr.ModelNode domainModel)
ServerInventory
startServer
in interface ServerInventory
serverName
- the name of the serverdomainModel
- the configuration model for the domainpublic ServerStatus startServer(String serverName, org.jboss.dmr.ModelNode domainModel, boolean blocking)
ServerInventory
startServer
in interface ServerInventory
serverName
- the name of the serverdomainModel
- the configuration model for the domainblocking
- whether to block until the server is startedpublic ServerStatus restartServer(String serverName, int gracefulTimeout, org.jboss.dmr.ModelNode domainModel)
ServerInventory
restartServer
in interface ServerInventory
serverName
- the name of the servergracefulTimeout
- time in ms the server should allow for graceful shutdown (if supported) before terminating all servicesdomainModel
- the configuration model for the domainpublic ServerStatus restartServer(String serverName, int gracefulTimeout, org.jboss.dmr.ModelNode domainModel, boolean blocking)
ServerInventory
restartServer
in interface ServerInventory
serverName
- the name of the servergracefulTimeout
- time in ms the server should allow for graceful shutdown (if supported) before terminating all servicesdomainModel
- the configuration model for the domainblocking
- whether to block until the server is restartedpublic ServerStatus stopServer(String serverName, int gracefulTimeout)
ServerInventory
stopServer
in interface ServerInventory
serverName
- the name of the servergracefulTimeout
- time in ms the server should allow for graceful shutdown (if supported) before terminating all servicespublic ServerStatus stopServer(String serverName, int gracefulTimeout, boolean blocking)
ServerInventory
stopServer
in interface ServerInventory
serverName
- the name of the servergracefulTimeout
- time in ms the server should allow for graceful shutdown (if supported) before terminating all servicesblocking
- whether to block until the server is stoppedpublic void reconnectServer(String serverName, org.jboss.dmr.ModelNode domainModel, String authKey, boolean running, boolean stopping)
ServerInventory
reconnectServer
in interface ServerInventory
serverName
- the name of the serverdomainModel
- the configuration model for the domainauthKey
- the authentication keyrunning
- whether the process was running. If false
, the existence of the server will be
recorded but no attempt to contact it will be madestopping
- whether the process is currently stoppingpublic ServerStatus reloadServer(String serverName, boolean blocking)
ServerInventory
reloadServer
in interface ServerInventory
serverName
- the name of the serverpublic void destroyServer(String serverName)
ServerInventory
destroyServer
in interface ServerInventory
serverName
- the server namepublic void killServer(String serverName)
ServerInventory
killServer
in interface ServerInventory
serverName
- the server namepublic void stopServers(int gracefulTimeout)
ServerInventory
stopServers
in interface ServerInventory
gracefulTimeout
- time in ms a server should allow for graceful shutdown (if supported) before terminating all servicespublic void stopServers(int gracefulTimeout, boolean blockUntilStopped)
ServerInventory
blockUntilStopped
is set to true
returning from this method
does not mean the servers are completely stopped;stopServers
in interface ServerInventory
gracefulTimeout
- time in ms a server should allow for graceful shutdown (if supported) before terminating all servicesblockUntilStopped
- wait until all servers are stoppedpublic void awaitServersState(Collection<String> serverNames, boolean started)
ServerInventory
awaitServersState
in interface ServerInventory
serverNames
- the server names in the groupstarted
- whether to wait for the started, or the stopped notificationpublic void suspendServer(String serverName)
ServerInventory
suspendServer
in interface ServerInventory
serverName
- The server namepublic void resumeServer(String serverName)
ServerInventory
resumeServer
in interface ServerInventory
serverName
- The server namepublic boolean awaitServerSuspend(Set<String> waitForServers, int timeoutInSeconds)
ServerInventory
awaitServerSuspend
in interface ServerInventory
waitForServers
- The servers to wait fortimeoutInSeconds
- The maximum amount of time to wait in seconds, with -1 meaning indefinitlytrue
if all the servers suspended in timepublic ProxyController serverCommunicationRegistered(String serverProcessName, ManagementChannelHandler channelAssociation)
ServerInventory
serverCommunicationRegistered
in interface ServerInventory
serverProcessName
- the name of the server processchannelAssociation
- remoting channel to use for communicating with the serverpublic boolean serverReconnected(String serverProcessName, ManagementChannelHandler channelHandler)
ServerInventory
serverReconnected
in interface ServerInventory
serverProcessName
- the name of the server processchannelHandler
- mgmt channel handler for communication with the servertrue
if the server is still in sync, false
otherwisepublic void serverProcessStopped(String serverProcessName)
ServerInventory
serverProcessStopped
in interface ServerInventory
serverProcessName
- the name of the server processpublic void connectionFinished()
ServerInventory
connectionFinished
in interface ServerInventory
public void serverStarted(String serverProcessName)
ServerInventory
serverStarted
in interface ServerInventory
serverProcessName
- the name of the server processpublic void serverStartFailed(String serverProcessName)
ServerInventory
serverStartFailed
in interface ServerInventory
serverProcessName
- the name of the server processpublic void serverProcessAdded(String serverProcessName)
ServerInventory
serverProcessAdded
in interface ServerInventory
serverProcessName
- the process namepublic void serverProcessStarted(String serverProcessName)
ServerInventory
serverProcessStarted
in interface ServerInventory
serverProcessName
- the process namepublic void serverProcessRemoved(String serverProcessName)
ServerInventory
serverProcessRemoved
in interface ServerInventory
serverProcessName
- the process namepublic void operationFailed(String serverProcessName, ProcessMessageHandler.OperationType type)
ServerInventory
operationFailed
in interface ServerInventory
serverProcessName
- the process nametype
- the operation typepublic void processInventory(Map<String,ProcessInfo> processInfos)
ServerInventory
processInventory
in interface ServerInventory
processInfos
- map of process name to information about the processpublic CallbackHandler getServerCallbackHandler()
ServerInventory
getServerCallbackHandler
in interface ServerInventory
null
Copyright © 2023 JBoss by Red Hat. All rights reserved.