Class VNSQuery


  • public class VNSQuery
    extends Object
    Connects to and querries a given VNS server for a list a services bound to a given name.
    • Constructor Detail

      • VNSQuery

        public VNSQuery​(String aVnsHost,
                        int aVnsPort)
                 throws Exception
        Connects to a VNS server identified by host and port
        Parameters:
        aVnsHost - - VNS host name
        aVnsPort - - VNS port number
        Throws:
        Exception - - when unable to connect to VNS
    • Method Detail

      • getServices

        public ArrayList getServices​(String aName)
                              throws Exception
        Returns a list of services registered in the VNS and bound to a given name.
        Parameters:
        aName - - name of the service
        Returns:
        - ArrayList of VinciServiceInfo instances
        Throws:
        Exception - - unable to get a list
      • getUnassignedServices

        public ArrayList getUnassignedServices​(String aName,
                                               ArrayList assignedServices)
                                        throws Exception
        Returns a list of services that have not yet been assigned to any CPM proxy. It diffs the current list and a new list as returned from the VNS.
        Parameters:
        aName - - name of the service
        assignedServices - - a list of services currently in use
        Returns:
        - ArrayList of VinciServiceInfo instances
        Throws:
        Exception - - unable to get a list
      • findUnassigned

        public static int findUnassigned​(ArrayList oldList,
                                         ArrayList newList)
        Diffs two lists of services and returns those that have not yet been assigned
        Parameters:
        oldList - - current (in-use) list of services
        newList - - new list of services
        Returns:
        - number of un-assigned services
      • main

        public static void main​(String[] args)