public class WebtopNaming extends Object
WebtopNaming
class is used to get URLs for various
services such as session, profile, logging etc. The lookup is based on the
service name and the host name. The Naming Service shall contain URLs for all
services on all servers. For instance, two machines might host session
services. The Naming Service profile may look like the following:
host1.session.URL="http://host1:8080/SessionServlet" host2.session.URL="https://host2:9090/SessionServlet"
Modifier and Type | Class and Description |
---|---|
static class |
WebtopNaming.SiteMonitor
The
SiteMonitor class is used to monitor the
health status of all the sites. |
static interface |
WebtopNaming.SiteStatusCheck
The interface
SiteStatusCheck provides
method that will be used by SiteMonitor to check each site is alive. |
Modifier and Type | Field and Description |
---|---|
protected static Debug |
debug
The debug instance.
|
static String |
NAMING_SERVICE
The unique identifier for the Naming Service.
|
static String |
NODE_SEPARATOR
The delimiter used to separate server IDs in the service attribute.
|
Constructor and Description |
---|
WebtopNaming() |
Modifier and Type | Method and Description |
---|---|
static int |
configMonitoring()
Provides the Monitoring Agent site and server related information.
|
static Collection<String> |
getAllServerIDs()
Returns all server IDs.
|
static String |
getAMServerID()
Returns the server ID.
|
static List<String> |
getBaseURLs()
The idea behind this function is to returns the base URLs of the OpenAM instances, without any of the extras
that getServiceAllURLs provides - i.e. we don't want a specific service, we just want the base URL.
|
static String |
getLBCookieValue(String serverid)
Returns the lbCookieValue corresponding to the server ID.
|
static String |
getLocalServer()
Returns local server name from naming table.
|
static String[] |
getNamingServiceURL()
Returns a list of the naming service urls.
|
static URL |
getNotificationURL()
Returns the URL of the notification service on the local
host.
|
static Set<String> |
getPlatformServerList()
Returns the platform server list.
|
static Set<String> |
getPlatformServerList(boolean update)
Returns the platform server list.
|
static String |
getSecondarySites(String serverid)
Returns the String representation of the separator delimited
secondary site list.
|
static String |
getSecondarySites(String protocol,
String host,
String port,
String uri)
Returns the String representation of the separator delimited
secondary site list.
|
static String |
getServerFromID(String serverID)
Returns the server URL based on the server ID.
|
static String |
getServerID(String protocol,
String host,
String port,
String uri)
Returns the server ID that is there in the platform server
list for a corresponding server.
|
static String |
getServerID(String protocol,
String host,
String port,
String uri,
boolean updatetbl)
Returns the server ID that is there in the platform server
list for a corresponding server.
|
static Vector |
getServiceAllURLs(String service)
Returns all the URLs of the specified service based on the
servers in platform server list.
|
static String |
getServiceClass(String service)
Returns the class of the specified service.
|
static URL |
getServiceURL(String service,
String protocol,
String host,
String port,
boolean validate)
Returns the URL of the specified service on the specified host.
|
static URL |
getServiceURL(String service,
String protocol,
String host,
String port,
String uri)
Returns the URL of the specified service on the specified
host.
|
static URL |
getServiceURL(String service,
String protocol,
String host,
String port,
String uri,
boolean validate)
Returns the URL of the specified service on the specified host.
|
static URL |
getServiceURL(String service,
URL url,
boolean validate)
Returns the URL of the specified service on the specified host.
|
static SessionIDCorrector |
getSessionIDCorrector()
When server/site configuration changes, Sessions issued against the previous configuration
will be out of date and refer to an invalid configuration.
|
static String |
getSiteID(String serverid)
Returns the unique identifier of the site which the given
server instance belongs to.
|
static String |
getSiteID(String protocol,
String host,
String port,
String uri)
Returns the unique identifier of the site which the given
server instance belongs to.
|
static String |
getSiteIdByName(String siteName) |
static String |
getSiteNameById(String siteId) |
static Set<String> |
getSiteNodes(String serverid)
Returns all the node ID for the site.
|
static String |
getURI(URL url)
Returns the uri of the specified URL.
|
static void |
initialize() |
static boolean |
isSecondarySite(String secondarySiteID)
Tells whether the provided ID belongs to a secondary site or not.
|
static boolean |
isServer(String serverID)
Tells whether the provided ID belongs to a server or not.
|
static boolean |
isServerMode()
Determines whether WebtopNaming code runs in the core server mode
or in the client SDK run-time mode.
|
static boolean |
isSite(String siteID)
Tells whether the provided ID belongs to a site or not.
|
static boolean |
isSiteEnabled(String serverid)
Determines whether Site is enabled for the given server ID.
|
static boolean |
isSiteEnabled(String protocol,
String host,
String port,
String uri)
Determines whether Site is enabled for the given server instance.
|
static String |
mapSiteToServer(SessionID sid)
Return the mapped server URL if there is a site.
|
static URL |
mapSiteToServer(String protocol,
String host,
String port,
String uri) |
static void |
removeFailedSite(String server)
Removes a server from the available site list.
|
static void |
removeFailedSite(URL url)
Removes a server from the available site list.
|
static void |
updateNamingTable()
Triggers the update of the NamingTable by examining the contents of
NamingService for the naming information. |
public static final String NAMING_SERVICE
public static final String NODE_SEPARATOR
protected static Debug debug
public static void initialize()
public static boolean isServerMode()
true
running in the core server mode,
false
otherwisepublic static boolean isServer(String serverID)
serverID
- The ID that needs to be checked.true
if the ID corresponds to a server.public static boolean isSite(String siteID)
siteID
- The ID that needs to be checked.true
if the ID corresponds to a site.public static boolean isSecondarySite(String secondarySiteID)
secondarySiteID
- The ID that needs to be checked.true
if the ID corresponds to a secondary site.public static boolean isSiteEnabled(String protocol, String host, String port, String uri) throws Exception
protocol
- protocol of the server instancehost
- host of the server instanceport
- port of the server instanceuri
- uri of the server instancetrue
if Site is enabled,
false
otherwiseException
- if server entry is not found or there is any
other run-time errorpublic static boolean isSiteEnabled(String serverid) throws Exception
serverid
- server IDtrue
if Site is enabled,
false
otherwiseException
- if the given server ID is nullpublic static String getAMServerID() throws ServerEntryNotFoundException
ServerEntryNotFoundException
- if the Naming Service
can not find that server entrypublic static URL getServiceURL(String service, String protocol, String host, String port, String uri) throws URLNotFoundException
service
- the name of the service.protocol
- the service protocolhost
- the service host nameport
- the service listening porturi
- the deployment uriURLNotFoundException
- if the Naming Service can not
find a URL for a specified servicepublic static URL getServiceURL(String service, URL url, boolean validate) throws URLNotFoundException
service
- the name of the service.url
- the deployment URI.validate
- a boolean value indicate whether or not to
validate the protocol, host and port of the serverURLNotFoundException
- if the Naming Service can not
find a URL for a specified servicepublic static URL getServiceURL(String service, String protocol, String host, String port, boolean validate) throws URLNotFoundException
service
- the name of the service.protocol
- the service protocol.host
- the service host name.port
- the ervice listening port.validate
- a boolean value indicate whether or not to
validate the protocol, host and port of the serverURLNotFoundException
- if the Naming Service can not
find a URL for a specified servicepublic static URL mapSiteToServer(String protocol, String host, String port, String uri) throws URLNotFoundException
URLNotFoundException
public static String mapSiteToServer(SessionID sid) throws URLNotFoundException
sid
- the sessionURLNotFoundException
public static URL getServiceURL(String service, String protocol, String host, String port, String uri, boolean validate) throws URLNotFoundException
service
- name of the service.protocol
- service protocol.host
- service host name.port
- service listening port.uri
- the deployment uri.validate
- a boolean value indicate whether or not to
validate the protocol, host and port of the server.URLNotFoundException
- if the Naming Service can not
find a URL for a specified servicepublic static Vector getServiceAllURLs(String service) throws URLNotFoundException
service
- the name of the service.URLNotFoundException
- if the Naming Service can not
find a URL for a specified servicepublic static List<String> getBaseURLs() throws URLNotFoundException
URLNotFoundException
- if the Naming Service cannot find a URL for a specified servicepublic static Set<String> getPlatformServerList() throws Exception
Exception
- if an error occurs when updating the naming tablepublic static Set<String> getPlatformServerList(boolean update) throws Exception
update
- a boolean flag indicating whether a refresh of the
naming profile is needed.Exception
- if an error occurs when updating the
nameing tablepublic static String getLocalServer()
public static String getServerID(String protocol, String host, String port, String uri) throws ServerEntryNotFoundException
protocol
- procotol of the server instancehost
- host of the server instanceport
- port of the server instanceuri
- uri of the server instanceServerEntryNotFoundException
- if the Naming Service
can not find that server entrypublic static String getServerID(String protocol, String host, String port, String uri, boolean updatetbl) throws ServerEntryNotFoundException
protocol
- procotol of the server instancehost
- host of the server instanceport
- port of the server instanceuri
- uri of the server instanceupdatetbl
- a boolean flag indicating whether a refresh of the
naming profile is needed.ServerEntryNotFoundException
- if the Naming Service
can not find that server entrypublic static String getServerFromID(String serverID) throws ServerEntryNotFoundException
serverID
- Server IDServerEntryNotFoundException
- if the Naming Service
can not find that server entrypublic static Collection<String> getAllServerIDs() throws Exception
Exception
- if an error occurs when updating the
nameing tablepublic static String getLBCookieValue(String serverid)
serverid
- the server idpublic static String getSiteID(String protocol, String host, String port, String uri) throws ServerEntryNotFoundException
protocol
- procotol of the server instancehost
- host of the server instanceport
- port of the server instanceuri
- uri of the server instanceServerEntryNotFoundException
- if the Naming Service
can not find that server entrypublic static String getSiteID(String serverid)
serverid
- server IDpublic static String getSecondarySites(String protocol, String host, String port, String uri) throws ServerEntryNotFoundException
protocol
- procotol of the server instancehost
- host of the server instanceport
- port of the server instanceuri
- uri of the server instanceServerEntryNotFoundException
- if the Naming Service
can not find that server entrypublic static String getSecondarySites(String serverid)
serverid
- server IDpublic static Set<String> getSiteNodes(String serverid) throws Exception
serverid
- one of server IDs within the site, it can also
be the loab balancer's IDException
- if an error occurs when updating the
nameing tablepublic static String getServiceClass(String service) throws ClassNotFoundException
service
- the name of the service.ClassNotFoundException
- if no definition for the class
with the specified name could be found.public static URL getNotificationURL() throws URLNotFoundException
URLNotFoundException
- if the Naming Service can not
find a URL for a specified servicepublic static void updateNamingTable() throws Exception
NamingService
for the naming information. Assembles this int
a table of Servers and Sites that make up the platform.Exception
- If there was an error processing naming information.public static String[] getNamingServiceURL() throws Exception
Exception
- if there is no configured url or there is an
error when trying to get the urlspublic static void removeFailedSite(String server)
server
- the String
to parse as a URL of
the server to be removed from the site listpublic static void removeFailedSite(URL url)
url
- url of the server to be removed from the site listpublic static String getURI(URL url)
url
- the URL that includes uri.URL
.public static int configMonitoring()
public static SessionIDCorrector getSessionIDCorrector()
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.