Class Server
- java.lang.Object
-
- org.jboss.hal.dmr.ModelNode
-
- org.jboss.hal.dmr.NamedNode
-
- org.jboss.hal.core.runtime.server.Server
-
- All Implemented Interfaces:
Cloneable,NamedObject
public class Server extends NamedNode
Combination of the two resourcesserver-configandserver. Make sure to checkisStarted()before reading server related attributes.
-
-
Field Summary
Fields Modifier and Type Field Description static ServerSTANDALONE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddServerAttributes(ModelNode modelNode)Adds theserverrelated attributes to this instance.StringgetHost()StringgetId()Unique server identifier containing the host and server name.VersiongetManagementVersion()RunningModegetRunningMode()ResourceAddressgetServerAddress()ResourceAddressgetServerConfigAddress()ServerConfigStatusgetServerConfigStatus()StringgetServerGroup()RunningStategetServerState()SuspendStategetSuspendState()booleanhasBootErrors()booleanhasOperationFailure()booleanisAdminMode()booleanisFailed()booleanisRunning()booleanisStandalone()booleanisStarted()If this method returnstrueit's safe to read the server related attributes like "host", "server-state" or "suspend-state".booleanisStarting()booleanisStopped()booleanisSuspended()booleanneedsReload()booleanneedsRestart()voidsetBootErrors(boolean bootErrors)voidsetOperationFailure(String operationFailure)-
Methods inherited from class org.jboss.hal.dmr.NamedNode
asModelNode, equals, getName, hashCode, setName, toString, update
-
Methods inherited from class org.jboss.hal.dmr.ModelNode
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addEmptyList, addEmptyObject, addExpression, as, asBigDecimal, asBigInteger, asBoolean, asBoolean, asBytes, asDouble, asDouble, asInt, asInt, asList, asLong, asLong, asObject, asProperty, asPropertyList, asString, asType, clear, clone, equals, fromBase64, get, get, get, getFailureDescription, getType, has, has, hasDefined, hasDefined, isDefined, isFailure, keys, protect, remove, require, require, resolve, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setEmptyList, setEmptyObject, setExpression, setExpression, toBase64String, toJSONString, toJSONString, writeExternal
-
-
-
-
Field Detail
-
STANDALONE
public static final Server STANDALONE
-
-
Method Detail
-
getId
public String getId()
Unique server identifier containing the host and server name.
-
isStandalone
public boolean isStandalone()
-
getManagementVersion
public Version getManagementVersion()
-
hasBootErrors
public boolean hasBootErrors()
-
setBootErrors
public void setBootErrors(boolean bootErrors)
-
hasOperationFailure
public boolean hasOperationFailure()
-
setOperationFailure
public void setOperationFailure(String operationFailure)
-
getServerGroup
public String getServerGroup()
-
getHost
public String getHost()
-
getServerConfigStatus
public ServerConfigStatus getServerConfigStatus()
- Returns:
- the status as defined by
server-config.status
-
getServerState
public RunningState getServerState()
- Returns:
- the state as defined by
server.server-status
-
getSuspendState
public SuspendState getSuspendState()
- Returns:
- the state as defined by
server.suspend-state
-
getRunningMode
public RunningMode getRunningMode()
- Returns:
- the state as defined by
server.running-mode
-
isStarted
public boolean isStarted()
If this method returnstrueit's safe to read the server related attributes like "host", "server-state" or "suspend-state".
-
isStarting
public boolean isStarting()
-
isRunning
public boolean isRunning()
- Returns:
trueif the server is running,falseif not or ifneedsReload()orneedsRestart()istrue.
-
isAdminMode
public boolean isAdminMode()
-
isSuspended
public boolean isSuspended()
-
isStopped
public boolean isStopped()
-
isFailed
public boolean isFailed()
- Returns:
trueif thegetServerConfigStatus()==ServerConfigStatus.FAILED,falseotherwise. Does not takehasBootErrors()into account!
-
needsRestart
public boolean needsRestart()
-
needsReload
public boolean needsReload()
-
getServerConfigAddress
public ResourceAddress getServerConfigAddress()
- Returns:
- the
/host=<host>/server-config=<server>address orResourceAddress.root()if either host or server-config is undefined.
-
getServerAddress
public ResourceAddress getServerAddress()
- Returns:
- the
/host=<host>/server=<server>address orResourceAddress.root()if either host or server is undefined.
-
addServerAttributes
public void addServerAttributes(ModelNode modelNode)
Adds theserverrelated attributes to this instance. Existing attributes will be overwritten.
-
-