Interface IServer
- All Superinterfaces:
IComponent
,IInitializable
Cluster server node web stack properties and cluster role assignment.
Supports write back API
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds role to the server.boolean
String[]
Returns all currently assigned roles to this serverint
int
Returns the reason (if specified) of why this cluster node is in maintenance mode.Deprecated.getRoles()
Deprecated.Deprecated.Deprecated.Returns server nameCopy of server properties loaded at startup They do not reflect any changes since then.default IServer.ServerType
getType()
boolean
Return true if the server has a given role.boolean
isActive
(boolean forceCheck) Returns whether the system things this cluster node is online.boolean
Returns whether this cluster node is in maintenance modeboolean
Returns whether this cluster node is in temporary maintenance modeboolean
removeRole
(String roleName) Removes roles from the server.void
setActive
(boolean active) void
setAssignedRoles
(String[] assignedRoles) Assigns new set of roles to this servervoid
setHttpHost
(String host) void
setHttpPort
(int port) void
setHttpsHost
(String host) void
setHttpsPort
(int port) void
setMaintenanceMode
(boolean isMaintenanceMode) This is equivalent tosetMaintenanceMode(boolean, String, boolean)
where reason is null and isTemporary is true.void
setMaintenanceMode
(boolean isMaintenanceMode, String reason, boolean isTemporary) Sets whether this cluster node is in maintenance modevoid
setServerName
(String serverName) Sets new server nameMethods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
-
Field Details
-
SERVER_TYPE_KEY
- See Also:
-
PORTAL_PFX
- See Also:
-
PROP_SERVER_NAME
- See Also:
-
PROP_ROLES
- See Also:
-
PROP_URL
- See Also:
-
LISTENER_NAME_HTTP
- See Also:
-
LISTENER_NAME_HTTPS
- See Also:
-
PROP_HOST
- See Also:
-
PROP_PORT
- See Also:
-
PROP_REMOTESERVERS
- See Also:
-
PROP_IS_MAINTENANCE_MODE
- See Also:
-
PROP_IS_MAINTENANCE_TEMPORARY
- See Also:
-
PROP_MAINTENANCE_REASON
- See Also:
-
PROP_HTTP_HOST
- See Also:
-
PROP_HTTP_PORT
- See Also:
-
PROP_HTTPS_HOST
- See Also:
-
PROP_HTTPS_PORT
- See Also:
-
-
Method Details
-
getHttpHost
String getHttpHost() -
getHttpPort
int getHttpPort() -
getHttpsHost
String getHttpsHost() -
getHttpsPort
int getHttpsPort() -
getStartupVersion
IServer getStartupVersion()Copy of server properties loaded at startup They do not reflect any changes since then. Useful for command transport since the server will still use startup properties until it is restarted -
getClusterProvider
IClusterProvider getClusterProvider() -
hasRole
Return true if the server has a given role.- Parameters:
roleName
- role to test- Returns:
-
addRole
Adds role to the server. Has no effect if the role is already assigned to this server. Returns true if the role has been added- Parameters:
roleName
- new role- Returns:
- true if added
- Throws:
PortalException
- Since:
- 7.1.1
-
removeRole
Removes roles from the server. Has no effect if the role was not assigned to this server. Returns true if the role has been removed- Parameters:
roleName
- role to remove- Returns:
- true if removed
- Throws:
PortalException
- Since:
- 7.1.1
-
getAssignedRoles
String[] getAssignedRoles()Returns all currently assigned roles to this server- Returns:
- set of role names
-
setAssignedRoles
Assigns new set of roles to this server- Parameters:
assignedRoles
- new set of roles- Throws:
PortalException
-
getServerName
String getServerName()Returns server name -
setServerName
Sets new server name- Parameters:
serverName
- new name- Throws:
PortalException
-
setHttpHost
- Throws:
PortalException
-
setHttpPort
- Throws:
PortalException
-
setHttpsHost
- Throws:
PortalException
-
setHttpsPort
- Throws:
PortalException
-
getSegments
Deprecated.Always returns 'default' segment the same asIClusterProvider.getSegment()
- Returns:
- a collection of
ISegment
-
getPrimarySegment
Deprecated.Always returns 'default' segment the same asIClusterProvider.getSegment()
- Returns:
-
getRoles
Deprecated. -
getRoles
Deprecated.Same asgetRoles()
- Parameters:
segmentName
-
-
setActive
void setActive(boolean active) -
getActive
boolean getActive() -
getType
-
isActive
boolean isActive(boolean forceCheck) Returns whether the system things this cluster node is online.- Parameters:
forceCheck
- true to bypass any cached information and re-check with a new ping- Returns:
- true if active, false otherwise
- Since:
- 9.8
-
setMaintenanceMode
This is equivalent tosetMaintenanceMode(boolean, String, boolean)
where reason is null and isTemporary is true.- Parameters:
isMaintenanceMode
- true if in maintenance mode, false otherwise- Throws:
PortalException
-
setMaintenanceMode
void setMaintenanceMode(boolean isMaintenanceMode, String reason, boolean isTemporary) throws PortalException Sets whether this cluster node is in maintenance mode- Parameters:
isMaintenanceMode
- true if in maintenance mode, false otherwisereason
- (optional) Text shown to users with the reason for the maintenance. If null, a generic message is usedisTemporary
- if true, the maintenance mode will turn off the next time MWS restarts, if false it will stay in maintenance mode after a restart.- Throws:
PortalException
-
isMaintenanceMode
boolean isMaintenanceMode()Returns whether this cluster node is in maintenance mode- Returns:
- true if in maintenance mode, false otherwise
-
getMaintenanceReason
String getMaintenanceReason()Returns the reason (if specified) of why this cluster node is in maintenance mode.- Returns:
- the maintenance reason (may be null)
-
isMaintenanceTemporary
boolean isMaintenanceTemporary()Returns whether this cluster node is in temporary maintenance mode- Returns:
- true if in temporary maintenance mode, false otherwise
-