Class SiteConfiguration


  • public class SiteConfiguration
    extends ConfigurationBase
    This manages site configuration information.
    • Method Detail

      • getSiteInfo

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

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

        public static boolean validateUrl​(String siteURL)
      • getSiteID

        public static String getSiteID​(SSOToken ssoToken,
                                       String siteName)
                                throws SMSException,
                                       SSOException
        Returns the primary URL of a site.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        siteName - Name of the site.
        Returns:
        the primary URL of a site.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • getSitePrimaryURL

        public static String getSitePrimaryURL​(SSOToken ssoToken,
                                               String siteName)
                                        throws SMSException,
                                               SSOException
        Returns the primary URL of a site.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        siteName - Name of the site.
        Returns:
        the primary URL of a site.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • getSiteURLs

        public static Set getSiteURLs​(SSOToken ssoToken,
                                      String siteName)
                               throws SMSException,
                                      SSOException
        Returns the primary and secondary URLs of a site.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        siteName - Name of the site.
        Returns:
        the primary and secondary URLs of a site.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • getSiteSecondaryURLs

        public static Set getSiteSecondaryURLs​(SSOToken ssoToken,
                                               String siteName)
                                        throws SMSException,
                                               SSOException
        Returns the secondary URLs of a site.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        siteName - Name of the site.
        Returns:
        the secondary URLs of a site.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • removeSiteSecondaryURLs

        public static void removeSiteSecondaryURLs​(SSOToken ssoToken,
                                                   String siteName,
                                                   Collection secondaryURLs)
                                            throws SMSException,
                                                   SSOException
        Removes the secondary URLs from a site.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        siteName - Name of the site.
        secondaryURLs - Secondary URLs to be removed from site.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
      • addServersToSite

        public static void addServersToSite​(SSOToken ssoToken,
                                            String siteName,
                                            Collection serverInstanceNames)
                                     throws SMSException,
                                            SSOException,
                                            ConfigurationException
        Adds a set of server instances to a site.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        siteName - Name of the site.
        serverInstanceNames - Set of server instance names.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.
        ConfigurationException - if one or more server instances are not found.
      • isSiteExist

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

        public static String getSiteIdByURL​(SSOToken ssoToken,
                                            String url)
                                     throws SMSException,
                                            SSOException
        Returns site name where the given URL is either its primary or secondary URL.
        Parameters:
        ssoToken - Single Sign-On Token which is used to access to the service management datastore.
        url - Lookup URL.
        Returns:
        site name.
        Throws:
        SMSException - if errors access in the service management datastore.
        SSOException - if the ssoToken is not valid.