Interface IServer

All Superinterfaces:
IComponent, IInitializable

public interface IServer extends IComponent
Cluster server node web stack properties and cluster role assignment. Supports write back API
  • Field Details

  • 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

      boolean hasRole(String roleName)
      Return true if the server has a given role.
      Parameters:
      roleName - role to test
      Returns:
    • addRole

      boolean addRole(String roleName) throws PortalException
      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

      boolean removeRole(String roleName) throws PortalException
      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

      void setAssignedRoles(String[] assignedRoles) throws PortalException
      Assigns new set of roles to this server
      Parameters:
      assignedRoles - new set of roles
      Throws:
      PortalException
    • getServerName

      String getServerName()
      Returns server name
    • setServerName

      void setServerName(String serverName) throws PortalException
      Sets new server name
      Parameters:
      serverName - new name
      Throws:
      PortalException
    • setHttpHost

      void setHttpHost(String host) throws PortalException
      Throws:
      PortalException
    • setHttpPort

      void setHttpPort(int port) throws PortalException
      Throws:
      PortalException
    • setHttpsHost

      void setHttpsHost(String host) throws PortalException
      Throws:
      PortalException
    • setHttpsPort

      void setHttpsPort(int port) throws PortalException
      Throws:
      PortalException
    • getSegments

      Deprecated.
      Always returns 'default' segment the same as IClusterProvider.getSegment()
      Returns:
      a collection of ISegment
    • getPrimarySegment

      @Deprecated ISegment getPrimarySegment()
      Deprecated.
      Always returns 'default' segment the same as IClusterProvider.getSegment()
      Returns:
    • getRoles

      Deprecated.
    • getRoles

      @Deprecated Collection<IClusterRole> getRoles(String segmentName)
      Deprecated.
      Same as getRoles()
      Parameters:
      segmentName -
    • setActive

      void setActive(boolean active)
    • getActive

      boolean getActive()
    • getType

      default IServer.ServerType 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

      void setMaintenanceMode(boolean isMaintenanceMode) throws PortalException
      This is equivalent to setMaintenanceMode(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 otherwise
      reason - (optional) Text shown to users with the reason for the maintenance. If null, a generic message is used
      isTemporary - 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