Class SiteConfiguration
- java.lang.Object
-
- com.sun.identity.common.configuration.ConfigurationBase
-
- com.sun.identity.common.configuration.SiteConfiguration
-
public class SiteConfiguration extends ConfigurationBase
This manages site configuration information.
-
-
Field Summary
-
Fields inherited from class com.sun.identity.common.configuration.ConfigurationBase
ATTR_PRIMARY_SITE_ID, ATTR_PRIMARY_SITE_URL, ATTR_SEC_ID, ATTR_SERVER_ID, CONFIG_SERVERS, CONFIG_SITES, OLD_ATTR_SERVER_LIST, OLD_ATTR_SITE_LIST, SUBCONFIG_ACCESS_URL, SUBCONFIG_SEC_URLS, SUBSCHEMA_SERVER, SUBSCHEMA_SITE
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addServersToSite(SSOToken ssoToken, String siteName, Collection serverInstanceNames)
Adds a set of server instances to a site.static void
addSiteSecondaryURLs(SSOToken ssoToken, String siteName, Collection secondaryURLs)
Adds the secondary URLs of a site.static boolean
createSite(SSOToken ssoToken, String siteName, String siteURL, Collection secondaryURLs)
Creates a site.static boolean
deleteSite(SSOToken ssoToken, String siteName)
Deletes a site.static String
getSiteID(SSOToken ssoToken, String siteName)
Returns the primary URL of a site.static String
getSiteIdByURL(SSOToken ssoToken, String url)
Returns site name where the given URL is either its primary or secondary URL.static Set
getSiteInfo(SSOToken ssoToken)
Returns a set of site information where each entry in a set is a string of this formatsite-instance-name|siteId
.static String
getSitePrimaryURL(SSOToken ssoToken, String siteName)
Returns the primary URL of a site.static Set<String>
getSites(SSOToken ssoToken)
Returns a set of site instance name (String).static Set
getSiteSecondaryURLs(SSOToken ssoToken, String siteName)
Returns the secondary URLs of a site.static Set
getSiteURLs(SSOToken ssoToken, String siteName)
Returns the primary and secondary URLs of a site.static boolean
isSiteExist(SSOToken ssoToken, String siteName)
Returnstrue
if site exists.static Set<String>
listServers(SSOToken ssoToken, String siteName)
Returns the server instance names that belong to a site.static void
removeServersFromSite(SSOToken ssoToken, String siteName, Collection serverInstanceNames)
Removes a set of server instances from a site.static void
removeSiteSecondaryURLs(SSOToken ssoToken, String siteName, Collection secondaryURLs)
Removes the secondary URLs from a site.static void
setSiteID(SSOToken ssoToken, String siteName, String siteID)
Sets the ID of a site.static void
setSitePrimaryURL(SSOToken ssoToken, String siteName, String siteURL)
Sets the primary URL of a site.static void
setSiteSecondaryURLs(SSOToken ssoToken, String siteName, Collection secondaryURLs)
Sets the secondary URLs of a site.static boolean
validateUrl(String siteURL)
-
Methods inherited from class com.sun.identity.common.configuration.ConfigurationBase
getNextId, getNextId, getRootServerConfig, getRootServerConfigWithRetry, getRootSiteConfig, getServerConfig, getServerConfigurationId, getSiteConfigurationId, getSiteConfigurationIds, updateOrganizationAlias
-
-
-
-
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 formatsite-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 thessoToken
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 thessoToken
is not valid.
-
deleteSite
public static boolean deleteSite(SSOToken ssoToken, String siteName) throws SMSException, SSOException, ConfigurationException
Deletes a site.- Parameters:
ssoToken
- Single Sign-On Token which is used to access to the service management datastore.siteName
- Name of the site.- Throws:
SMSException
- if errors access in the service management datastore.SSOException
- if thessoToken
is not valid.ConfigurationException
-
createSite
public static boolean createSite(SSOToken ssoToken, String siteName, String siteURL, Collection secondaryURLs) throws SMSException, SSOException, ConfigurationException
Creates a site.- Parameters:
ssoToken
- Single Sign-On Token which is used to access to the service management datastore.siteName
- Name of the site.siteURL
- primary URL of the site.secondaryURLs
- secondary URLs of the site.- Throws:
SMSException
- if errors access in the service management datastore.SSOException
- if thessoToken
is not valid.ConfigurationException
- if site url is invalid.
-
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 thessoToken
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 thessoToken
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 thessoToken
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 thessoToken
is not valid.
-
setSitePrimaryURL
public static void setSitePrimaryURL(SSOToken ssoToken, String siteName, String siteURL) throws SMSException, SSOException, ConfigurationException
Sets 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.siteURL
- Primary URL of a site.- Throws:
SMSException
- if errors access in the service management datastore.SSOException
- if thessoToken
is not valid.ConfigurationException
-
setSiteID
public static void setSiteID(SSOToken ssoToken, String siteName, String siteID) throws SMSException, SSOException, ConfigurationException
Sets the ID of a site.- Parameters:
ssoToken
- Single Sign-On Token which is used to access to the service management datastore.siteName
- Name of the site.siteID
- The new id of the site.- Throws:
SMSException
- if errors access in the service management datastore.SSOException
- if thessoToken
is not valid.ConfigurationException
-
setSiteSecondaryURLs
public static void setSiteSecondaryURLs(SSOToken ssoToken, String siteName, Collection secondaryURLs) throws SMSException, SSOException, ConfigurationException
Sets 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.secondaryURLs
- secondary URLs of a site.- Throws:
SMSException
- if errors access in the service management datastore.SSOException
- if thessoToken
is not valid.ConfigurationException
-
addSiteSecondaryURLs
public static void addSiteSecondaryURLs(SSOToken ssoToken, String siteName, Collection secondaryURLs) throws SMSException, SSOException, ConfigurationException
Adds 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.secondaryURLs
- Secondary URLs to be added to site.- Throws:
SMSException
- if errors access in the service management datastore.SSOException
- if thessoToken
is not valid.ConfigurationException
-
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 thessoToken
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 thessoToken
is not valid.ConfigurationException
- if one or more server instances are not found.
-
removeServersFromSite
public static void removeServersFromSite(SSOToken ssoToken, String siteName, Collection serverInstanceNames) throws SMSException, SSOException, ConfigurationException
Removes a set of server instances from 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 thessoToken
is not valid.ConfigurationException
-
listServers
public static Set<String> listServers(SSOToken ssoToken, String siteName) throws SMSException, SSOException, ConfigurationException
Returns the server instance names that belong to 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 server instance names that belong to a site.
- Throws:
SMSException
- if errors access in the service management datastore.SSOException
- if thessoToken
is not valid.ConfigurationException
-
isSiteExist
public static boolean isSiteExist(SSOToken ssoToken, String siteName) throws SMSException, SSOException
Returnstrue
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 thessoToken
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 thessoToken
is not valid.
-
-