Class WebtopNamingSiteUtils


  • public class WebtopNamingSiteUtils
    extends Object
    Responsible for providing supporting functions for the WebtopNaming service. In particular translating concepts that are based on users Sessions into those which WebtopNaming operates in.
    • Constructor Detail

      • WebtopNamingSiteUtils

        @Inject
        public WebtopNamingSiteUtils​(@Named("amSession")
                                     Debug debug,
                                     WebtopNamingQuery query)
        Guice initialised default constructor.
        Parameters:
        debug - Required for debugging.
        query - Required for performing WebtopNaming operations.
    • Method Detail

      • getSiteNodes

        public Set<String> getSiteNodes​(Session session)
        Determines if the Session is associated with a Server that is part of a Site. If this is the case then the function will determine the other Servers in the cluster.
        Parameters:
        session - A non null Session which must be associated with a Server ID.
        Returns:
        A set of the nodes that make up the cluster or Site. If the server is not part of a Site then just the Server ID will be returned in the Set.
        Throws:
        IllegalStateException - If WebtopNaming was unable to find the IDs for Servers in the Site. Unlikely as at this point it has indicated that the Server in question is part of a Site.
      • getSiteNodeURLs

        public Set<URL> getSiteNodeURLs​(Session session)
        Determines the Site (if any) that the Session is based in, and then calculates the Servers that make up that Site.
        Parameters:
        session - Non null Session to use for query.
        Returns:
        The URLs for each node in the Site that the Session belongs to. If the Session comes from a Server that is not part of a Site, then just the URL for that Server will be returned. Never null.
        Throws:
        IllegalStateException - Thrown if WebtopNaming returned an invalid URL.