Class ServerContextImpl

    • Field Detail

      • VERSION

        public static final Version VERSION
        Version.
      • logger

        protected Logger logger
        Context logger.
      • debugLevel

        protected int debugLevel
        Debug level.
      • beaconAddressList

        protected String beaconAddressList
        A space-separated list of broadcast address which to send beacons. Each address must be of the form: ip.number:port or host.name:port
      • ignoreAddressList

        protected String ignoreAddressList
        A space-separated list of address from which to ignore name resolution requests. Each address must be of the form: ip.number:port or host.name:port
      • autoBeaconAddressList

        protected boolean autoBeaconAddressList
        Define whether or not the network interfaces should be discovered at runtime.
      • beaconPeriod

        protected float beaconPeriod
        Period in second between two beacon signals.
      • broadcastPort

        protected int broadcastPort
        Broadcast port number to listen to.
      • serverPort

        protected int serverPort
        Port number for the server to listen to.
      • receiveBufferSize

        protected int receiveBufferSize
        Length in bytes of the maximum buffer (payload) size that may pass through PVA.
      • timer

        protected org.epics.pvdata.misc.Timer timer
        Timer.
      • broadcastTransport

        protected BlockingUDPTransport broadcastTransport
        Broadcast transport needed for channel searches.
      • localMulticastTransport

        protected BlockingUDPTransport localMulticastTransport
        Local multicast transport needed for unicast channel searches to be multicasted locally.
      • beaconEmitter

        protected BeaconEmitter beaconEmitter
        Beacon emitter.
      • acceptor

        protected BlockingTCPAcceptor acceptor
        PVAS acceptor (accepts PVA virtual circuit).
      • transportRegistry

        protected TransportRegistry transportRegistry
        PVA transport (virtual circuit) registry. This registry contains all active transports - connections to PVA servers.
      • channelProviderNames

        protected String channelProviderNames
        Channel provider name.
      • channelNameToProvider

        protected final Map<String,​ChannelProvider> channelNameToProvider
        Channel (name) to provider mapping. Used when there are more that one provider used.
      • runLock

        protected final Object runLock
        Run lock.
    • Constructor Detail

      • ServerContextImpl

        public ServerContextImpl()
        Constructor.
    • Method Detail

      • getGUID

        public byte[] getGUID()
        Returns GUID (12-byte array)
        Returns:
        GUID.
      • getVersion

        public Version getVersion()
        Description copied from interface: ServerContext
        Get context implementation version.
        Specified by:
        getVersion in interface ServerContext
        Returns:
        version of the context implementation.
      • initializeLogger

        protected void initializeLogger()
        Initialize context logger.
      • getConfiguration

        public Configuration getConfiguration()
        Get configuration instance.
        Returns:
        the configuration.
      • loadConfiguration

        protected void loadConfiguration()
        Load configuration.
      • setChannelProviderNames

        public void setChannelProviderNames​(String providerNames)
      • printInfo

        public void printInfo()
        Description copied from interface: ServerContext
        Prints detailed information about the context to the standard output stream.
        Specified by:
        printInfo in interface ServerContext
      • printInfo

        public void printInfo​(PrintStream out)
        Description copied from interface: ServerContext
        Prints detailed information about the context to the specified output stream.
        Specified by:
        printInfo in interface ServerContext
        Parameters:
        out - output stream.
      • dispose

        public void dispose()
        Description copied from interface: ServerContext
        Dispose (destroy) server context. This calls destroy() and silently handles all exceptions.
        Specified by:
        dispose in interface ServerContext
      • isInitialized

        public boolean isInitialized()
        Get initialization status.
        Returns:
        initialization status.
      • isDestroyed

        public boolean isDestroyed()
        Get destruction status.
        Returns:
        destruction status.
      • getBeaconAddressList

        public String getBeaconAddressList()
        Get beacon address list.
        Returns:
        beacon address list.
      • isAutoBeaconAddressList

        public boolean isAutoBeaconAddressList()
        Get beacon address list auto flag.
        Returns:
        beacon address list auto flag.
      • getBeaconPeriod

        public float getBeaconPeriod()
        Get beacon period (in seconds).
        Returns:
        beacon period (in seconds).
      • getDebugLevel

        public int getDebugLevel()
        Description copied from interface: Context
        Get internal debug level configuration, higher value means more, 0 means none.
        Specified by:
        getDebugLevel in interface Context
        Returns:
        debug level.
      • getReceiveBufferSize

        public int getReceiveBufferSize()
        Get receiver buffer (payload) size.
        Returns:
        max payload size.
      • getServerPort

        public int getServerPort()
        Get server port.
        Returns:
        server port.
      • setServerPort

        public void setServerPort​(int port)
        Set server port number.
        Parameters:
        port - new server port number.
      • getBroadcastPort

        public int getBroadcastPort()
        Get broadcast port.
        Returns:
        broadcast port.
      • getIgnoreAddressList

        public String getIgnoreAddressList()
        Get ignore search address list.
        Returns:
        ignore search addrresr list.
      • getBeaconServerStatusProvider

        public BeaconServerStatusProvider getBeaconServerStatusProvider()
        Get registered beacon server status provider.
        Returns:
        registered beacon server status provider.
      • getServerInetAddress

        public InetAddress getServerInetAddress()
        Get server newtwork (IP) address.
        Returns:
        server network (IP) address, null if not bounded.
      • getBroadcastTransport

        public BlockingUDPTransport getBroadcastTransport()
        Broadcast transport.
        Returns:
        broadcast transport.
      • getLocalMulticastTransport

        public BlockingUDPTransport getLocalMulticastTransport()
        Local multicast transport.
        Returns:
        multicast transport.
      • getTransportRegistry

        public TransportRegistry getTransportRegistry()
        Get PVA transport (virtual circuit) registry.
        Specified by:
        getTransportRegistry in interface Context
        Returns:
        PVA transport (virtual circuit) registry.
      • getTimer

        public org.epics.pvdata.misc.Timer getTimer()
        Get timer.
        Specified by:
        getTimer in interface Context
        Returns:
        timer.
      • getChannelProviderNames

        public String getChannelProviderNames()
        Get channel provider name.
        Returns:
        channel provider name.
      • getChannelProviders

        public List<ChannelProvider> getChannelProviders()
        Get channel providers.
        Returns:
        channel provider.
      • getChannelNameToProviderMap

        public Map<String,​ChannelProvider> getChannelNameToProviderMap()
        Retrun channel (name) to provider mapping.
        Returns:
        the map.
      • getServerResponseHandler

        public ResponseHandler getServerResponseHandler()
        Get server response handler.
        Returns:
        server response handler.
      • startPVAServer

        public static ServerContextImpl startPVAServer​(String providerNames,
                                                       int timeToRun,
                                                       boolean runInSeparateThread,
                                                       PrintStream printInfoStream)
                                                throws PVAException
        Create ServerContextImpl instance and start server.
        Parameters:
        providerNames - providers to use, null to use defaults or PVAConstants.PVA_ALL_PROVIDERS to use all providers.
        timeToRun - time (in seconds) to run, 0 until destroy() is called.
        runInSeparateThread - run in separate thread flag.
        printInfoStream - stream instance where to print context info, can be null
        Returns:
        the server context instance.
        Throws:
        PVAException - thrown on exception.