Class ResolveResult

  • All Implemented Interfaces:
    Transportable

    public class ResolveResult
    extends Frame
    Specialized document (Frame) for representing the result of resolving a service name to host/port through VNS. Also provides utility methods for manipulating qualified/unqualified service names. This class is used by VinciClient to locate the physical location of the requested service from its logical service name.
    • Constructor Detail

      • ResolveResult

        public ResolveResult()
    • Method Detail

      • unqualifiedName

        public static String unqualifiedName​(String service_name)
        Strip the qualifications from this qualified service name.
        Parameters:
        service_name - -
        Returns:
        -
      • isQualified

        public static boolean isQualified​(String service_name)
        Check whether a service_name has qualifications (that is, any or all of level, host, instance are explicitly specified.)
        Parameters:
        service_name - -
        Returns:
        -
      • composeQuery

        public static Frame composeQuery​(String service_name)
        Create a document representing the VNS resolve query for the specified service. This method accepts either qualified or unqualified service names.
        Parameters:
        service_name - -
        Returns:
        -
      • composeQuery

        public static Frame composeQuery​(String service_name,
                                         int mypriority)
        Create a document representing the VNS resolve query for the highest priority service(s) whose priority is strictly below the specified priority. This method accepts either qualified or unqualified service names.
        Parameters:
        service_name - -
        mypriority - -
        Returns:
        -
      • initializeIterator

        public void initializeIterator()
        Initialize the service listing iterator. This initializes to a random spot to implement simple load balancing across multiple equivalent service instances.
      • hasMore

        public boolean hasMore()
        Determine if there are more service listing to be fetched.
        Returns:
        -
      • add

        public void add​(String key,
                        FrameComponent val)
        Implement the frame add() callback.
        Overrides:
        add in class Frame
        Parameters:
        key - The tag name with which to associate the value.
        val - The (Frame | FrameLeaf) value to associate with the tag.
      • createSubFrame

        public Frame createSubFrame​(String key,
                                    int capacity)
        Override the Frame createSubFrame method to create a ServiceLocator.
        Overrides:
        createSubFrame in class Frame
        Parameters:
        key - -
        capacity - -
        Returns:
        the created sub-frame.