Class ServerChannel


  • public class ServerChannel
    extends Object
    Server channel (client connection to process variable). This (default) implementation grants all access rights.
    Version:
    $Id: ServerChannel.java,v 1.8 2006-08-28 12:28:32 msekoranja Exp $
    Author:
    Matej Sekoranja
    • Field Detail

      • processVariable

        protected ProcessVariable processVariable
        Process variable.
      • sid

        protected int sid
        Channel SID.
      • cid

        protected int cid
        Channel CID.
      • monitors

        protected Map monitors
        Monitors.
      • destroyed

        protected boolean destroyed
        Destroy state.
    • Constructor Detail

      • ServerChannel

        public ServerChannel​(ProcessVariable processVariable,
                             int cid,
                             int sid,
                             String userName,
                             String hostName)
        Create server channel for given process variable.
        Parameters:
        processVariable - process variable.
        cid - channel CID.
        sid - channel SID.
        userName - client user name.
        hostName - client host name.
    • Method Detail

      • getProcessVariable

        public ProcessVariable getProcessVariable()
        Get process variable.
        Returns:
        process variable.
      • getCID

        public int getCID()
        Get channel CID.
        Returns:
        channel CID.
      • getSID

        public int getSID()
        Get channel SID.
        Returns:
        channel SID.
      • readAccess

        public boolean readAccess()
        Check if read access is granted.
        Returns:
        true (default) if read access is granted, false otherwise.
      • writeAccess

        public boolean writeAccess()
        Check if write access is granted.
        Returns:
        true (default) if write access is granted, false otherwise.
      • registerMonitor

        public void registerMonitor​(ServerMonitor monitor)
        Register monitor.
        Parameters:
        monitor - monitor to be registered.
      • unregisterMonitor

        public void unregisterMonitor​(ServerMonitor monitor)
        Unregister monitor.
        Parameters:
        monitor - monitor to be unregistered.
      • getMonitor

        public ServerMonitor getMonitor​(int ioid)
        Get monitor by its IOID.
        Parameters:
        ioid - monitor IOID
        Returns:
        monitor with given IOID, null if there is no monitor with such IOID.
      • destroyAllMonitors

        protected void destroyAllMonitors()
        Destroy all registered monitors.
      • destroy

        public void destroy()
        Destory server channel. This method MUST BE called if this it is overriden.
      • printInfo

        public void printInfo()
                       throws IllegalStateException
        Prints detailed information about the process variable to the standard output stream.
        Throws:
        IllegalStateException - if the context has been destroyed.
      • printInfo

        public void printInfo​(PrintStream out)
                       throws IllegalStateException
        Prints detailed information about the process variable to the specified output stream.
        Parameters:
        out - the output stream.
        Throws:
        IllegalStateException - if the context has been destroyed.