Class VNS

  • All Implemented Interfaces:
    TransportableFactory, VinciServable

    public class VNS
    extends VinciServableAdapter
    VNS (Vinci Naming Service) provides the "directory" of all available Vinci services. VNS must be running somewhere on the network for VinciClient and VinciServer classes to function. These classes consult org.apache.vinci.transport.vns.client.VNSConfig to determine the location of the VNS service.
    • Field Detail

      • cachedResults

        private java.util.HashMap cachedResults
      • dirCmdAddService

        public static final java.lang.String dirCmdAddService
        See Also:
        Constant Field Values
      • dirCmdDelService

        public static final java.lang.String dirCmdDelService
        See Also:
        Constant Field Values
      • dirCmdUpdateService

        public static final java.lang.String dirCmdUpdateService
        See Also:
        Constant Field Values
      • ENV_PROXY

        public java.lang.String ENV_PROXY
      • configFile

        private static java.lang.String configFile
      • backupFile

        private static java.lang.String backupFile
      • workspacesFile

        private static java.lang.String workspacesFile
      • counterFile

        private static java.lang.String counterFile
      • logFile

        private static java.lang.String logFile
      • configDir

        private static java.lang.String configDir
      • backupInterval

        private static int backupInterval
      • srvPort

        private static int srvPort
      • logFlag

        private static boolean logFlag
      • bindAddress

        private static java.lang.String bindAddress
      • backlog

        private static int backlog
      • maxThreads

        private static int maxThreads
      • port

        int port
      • myLogFile

        java.lang.String myLogFile
      • backupThread

        java.lang.Thread backupThread
      • hits

        java.util.Hashtable hits
      • totalhits

        int totalhits
      • log

        java.io.Writer log
      • starttime

        java.lang.String starttime
      • quitFile

        static java.io.File quitFile
    • Constructor Detail

      • VNS

        public VNS()
      • VNS

        public VNS​(int port)
      • VNS

        public VNS​(int port,
                   java.lang.String logFile)
            throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • setConfigDir

        private static void setConfigDir​(java.lang.String path)
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • printUsage

        private static void printUsage()
      • startServing

        public static void startServing()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • loadConfig

        public boolean loadConfig​(java.lang.String cFile)
      • loadWorkspaces

        public void loadWorkspaces​(java.lang.String wFile)
      • loadCounters

        public void loadCounters​(java.lang.String cFile)
      • saveConfig

        public void saveConfig​(java.lang.String cFile)
      • saveCounters

        public void saveCounters​(java.lang.String cFile)
      • saveWorkspaces

        public void saveWorkspaces​(java.lang.String wFile)
      • eval

        public Transportable eval​(Transportable inp)
                           throws ServiceException
        Description copied from interface: VinciServable
        The eval method accepts an input document and returns an output document that is the result of performing the service.
        Specified by:
        eval in interface VinciServable
        Specified by:
        eval in class VinciServableAdapter
        Parameters:
        inp - The input document
        Returns:
        The output document
        Throws:
        ServiceException - thrown when there is an application level error that should result in the client receiving the same ServiceException on the other end.
      • cache

        private void cache​(java.lang.String s,
                           java.lang.Object o)
      • updateCache

        private void updateCache​(java.lang.String s)
      • checkCache

        private java.lang.Object checkCache​(java.lang.String s)
      • getFrame

        VinciFrame getFrame​(boolean ok,
                            java.lang.String err)
      • strip

        public static java.lang.String strip​(java.lang.String s)
      • emptyString

        public static java.lang.String emptyString​(java.lang.String s)
      • logRequest

        void logRequest​(java.lang.String type,
                        java.lang.String ip,
                        java.lang.String text)