Class AbstractCASResponseHandler

    • Constructor Detail

      • AbstractCASResponseHandler

        public AbstractCASResponseHandler​(CAJServerContext context,
                                          String description)
        Parameters:
        context -
        description -
    • Method Detail

      • extractString

        public static final String extractString​(ByteBuffer buffer,
                                                 int start,
                                                 int maxSize,
                                                 boolean setToEnd)
        Extract string from payload.
        Parameters:
        buffer - buffer to use.
        start - buffer offset to use, if negative current buffer position will be used
        maxSize - maximum payload size reserved for string.
        setToEnd - set to the end of string flag (after zero char)
        Returns:
        extracted string.
      • sendException

        protected void sendException​(Transport transport,
                                     int cid,
                                     CAStatus errorStatus,
                                     ByteBuffer previousHeader,
                                     String message)
        Send error (exception) response.
        Parameters:
        transport - transport to use.
        cid - channel ID.
        errorStatus - error status.
        previousHeader - header of the request messages causing this error.
        message - string message, can be null.
      • createDBRforReading

        public static final DBR createDBRforReading​(ProcessVariable processVariable)
        Create appropriate DBR structure for reading (of PV type). Returned DBR structure will be the most complete one (CTRL usually)., PV array length.
        Parameters:
        processVariable - process variable to be read.
        Returns:
        requested DBR.
      • createDBRforReading

        public static final DBR createDBRforReading​(ProcessVariable processVariable,
                                                    int dataCount)
        Create appropriate DBR structure for reading (of PV type). Returned DBR structure will be the most complete one (CTRL usually).
        Parameters:
        processVariable - process variable to be read.
        dataCount - requested data count (returned DBR will have this count).
        Returns:
        requested DBR.
      • createDBRforReading

        public static final DBR createDBRforReading​(ProcessVariable processVariable,
                                                    short dataType,
                                                    int dataCount)
        Create appropriate DBR structure for reading (of PV type).
        Parameters:
        processVariable - process variable to be read.
        dataType - data type requested from client (not necessary equals to PV type)
        dataCount - requested data count (returned DBR will have this count).
        Returns:
        requested DBR.