Class AbstractCASResponseHandler
- java.lang.Object
-
- com.cosylab.epics.caj.impl.handlers.AbstractCAResponseHandler
-
- com.cosylab.epics.caj.cas.handlers.AbstractCASResponseHandler
-
- All Implemented Interfaces:
ResponseHandler
- Direct Known Subclasses:
BadResponse,ClearChannelResponse,CreateChannelResponse,EchoResponse,EventAddResponse,EventCancelResponse,EventsOffResponse,EventsOnResponse,HostnameResponse,NoopResponse,ReadNotifyResponse,SearchResponse,UsernameResponse,VersionResponse,WriteNotifyResponse,WriteResponse
public abstract class AbstractCASResponseHandler extends AbstractCAResponseHandler
- Version:
- $id$
- Author:
- Matej Sekoranja
-
-
Field Summary
Fields Modifier and Type Field Description protected CAJServerContextcontextContext instance.-
Fields inherited from class com.cosylab.epics.caj.impl.handlers.AbstractCAResponseHandler
command, dataCount, dataType, debug, description, parameter1, parameter2, payloadSize
-
-
Constructor Summary
Constructors Constructor Description AbstractCASResponseHandler(CAJServerContext context, String description)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DBRcreateDBRforReading(ProcessVariable processVariable)Create appropriate DBR structure for reading (of PV type).static DBRcreateDBRforReading(ProcessVariable processVariable, int dataCount)Create appropriate DBR structure for reading (of PV type).static DBRcreateDBRforReading(ProcessVariable processVariable, short dataType, int dataCount)Create appropriate DBR structure for reading (of PV type).static StringextractString(ByteBuffer buffer, int start, int maxSize, boolean setToEnd)Extract string from payload.protected voidsendException(Transport transport, int cid, CAStatus errorStatus, ByteBuffer previousHeader, String message)Send error (exception) response.-
Methods inherited from class com.cosylab.epics.caj.impl.handlers.AbstractCAResponseHandler
handleResponse, internalHandleResponse, parseHeader
-
-
-
-
Field Detail
-
context
protected CAJServerContext context
Context instance.
-
-
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 usedmaxSize- 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 benull.
-
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.
-
-