Class ServerConfiguration


  • public class ServerConfiguration
    extends ConfigurationBase
    This manages server configuration information.
    • Method Detail

      • getServerInfo

        public static Set getServerInfo​(SSOToken ssoToken)
                                 throws SMSException,
                                        SSOException
        Returns a set of server information where each entry in a set is a string of this format server-instance-name|serverId|siteId1|siteId2|...|siteIdn.
        Parameters:
        ssoToken - Single Sign-On Token which is used to query the service management datastore.
        Returns:
        a set of server information.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • getLBCookieValues

        public static Map getLBCookieValues​(SSOToken ssoToken)
                                     throws SMSException,
                                            SSOException,
                                            IOException
        Returns a map of server name to its load balancer cookie value.
        Parameters:
        ssoToken - Single Sign-On Token which is used to query the service management datastore.
        Returns:
        a map of server id to its load balancer cookie value.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
        IOException
      • getServers

        public static Set<String> getServers​(SSOToken ssoToken)
                                      throws SMSException,
                                             SSOException
        Returns a set of server instance name (String).
        Parameters:
        ssoToken - Single Sign-On Token which is used to query the service management datastore.
        Returns:
        a set of server instance name.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • getWarFileVersion

        public static String getWarFileVersion()
      • getDefaultProperties

        public static Map getDefaultProperties()
      • getServerConfigXML

        public static String getServerConfigXML​(SSOToken ssoToken,
                                                String instanceName)
                                         throws SMSException,
                                                SSOException
        Returns server configuration XML.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        Returns:
        server configuration XML.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • getServerInstance

        public static Properties getServerInstance​(SSOToken ssoToken,
                                                   String instanceName)
                                            throws SMSException,
                                                   SSOException,
                                                   IOException
        Returns the configuration of a server instance.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        Returns:
        the configuration of the server Instance.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
        IOException - if IO operation fails.
      • isServerInstanceExist

        public static boolean isServerInstanceExist​(SSOToken ssoToken,
                                                    String instanceName)
                                             throws SMSException,
                                                    SSOException
        Returns true if server instance exists.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        Returns:
        true if server instance exists.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • hasServerOrSiteId

        public static boolean hasServerOrSiteId​(SSOToken ssoToken,
                                                String serverId)
                                         throws SMSException,
                                                SSOException
        Returns true if server or site id exists.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        serverId - Id of the server instance.
        Returns:
        true if server id exists.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • removeServerConfiguration

        public static void removeServerConfiguration​(SSOToken ssoToken,
                                                     String instanceName,
                                                     Collection propertyNames)
                                              throws SMSException,
                                                     SSOException,
                                                     IOException
        Removes server configuration. This will result in inheriting from default server configuration.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        propertyNames - Collection of property names to be removed.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
        IOException
      • deleteServerInstance

        public static boolean deleteServerInstance​(SSOToken ssoToken,
                                                   String instanceName)
                                            throws SMSException,
                                                   SSOException
        Deletes a server instance.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • getDefaults

        public static Properties getDefaults​(SSOToken ssoToken)
        Returns the default server properties.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        Returns:
        the default server properties.
      • getProperties

        public static Properties getProperties​(String str)
                                        throws IOException
        Returns properties object.
        Parameters:
        str - String of this format key1=value1\nkey2=value2\n...keyN=valueN
        Returns:
        properties object.
        Throws:
        IOException - if str contains incorrect format.
      • getProperties

        public static Properties getProperties​(Set set)
                                        throws IOException
        Returns properties object.
        Parameters:
        set - Set of string of this format key=value.
        Returns:
        properties object.
        Throws:
        IOException - if str contains incorrect format.
      • getPropertiesSet

        public static Set getPropertiesSet​(String str)
                                    throws IOException
        Returns set of string with this format, key=value.
        Parameters:
        str - String of this format key1=value1\nkey2=value2\n...keyN=valueN
        Returns:
        set of formated string.
        Throws:
        IOException - if str contains incorrect format.
      • getServerSite

        public static String getServerSite​(SSOToken ssoToken,
                                           String instanceName)
                                    throws SMSException,
                                           SSOException
        Returns a site name of which server belongs to.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        Returns:
        a site name.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • setServerSite

        public static void setServerSite​(SSOToken ssoToken,
                                         String instanceName,
                                         String siteName)
                                  throws SMSException,
                                         SSOException
        Sets site name of which server belongs to.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        siteName - Site name.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • removeFromSite

        public static void removeFromSite​(SSOToken ssoToken,
                                          String instanceName,
                                          String siteId)
                                   throws SMSException,
                                          SSOException
        Removes server from a site.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        siteId - Identifier of the site.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • belongToSite

        public static boolean belongToSite​(SSOToken ssoToken,
                                           String instanceName,
                                           String siteId)
                                    throws SMSException,
                                           SSOException
        Returns true if a server belongs to a site.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        instanceName - Name of the server instance.
        siteId - Identifier of the site.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.