Class EventAddRequest
- java.lang.Object
-
- com.cosylab.epics.caj.impl.requests.AbstractCARequest
-
- com.cosylab.epics.caj.impl.requests.EventAddRequest
-
- All Implemented Interfaces:
NotifyResponseRequest,Request,ResponseRequest
public class EventAddRequest extends AbstractCARequest implements NotifyResponseRequest
CA event add request (creates a monitor on channel).- Version:
- $id$
- Author:
- Matej Sekoranja
-
-
Field Summary
Fields Modifier and Type Field Description protected CAJChannelchannelChannel.protected CAJContextcontextContext.protected CAJMonitormonitorResponse callback listener.protected bytepriorityRequest send priority.protected intrequestedDataCountRequested data count.protected intrequestedDataTypeRequested data type.protected intsubsidSubscription ID given by the context when registered.-
Fields inherited from class com.cosylab.epics.caj.impl.requests.AbstractCARequest
requestMessage, transport
-
Fields inherited from interface com.cosylab.epics.caj.impl.Request
DEFAULT_USER_PRIORITY, MAX_USER_PRIORITY, MIN_USER_PRIORITY, SEND_IMMEDIATELY_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description EventAddRequest(CAJChannel channel, CAJMonitor monitor, Transport transport, int sid, int dataType, int dataCount, int mask)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancel response request (allways to be called to complete/destroy).voidexception(int errorCode, String errorMessage)Exception response notification.intgetIOID()Get I/O ID.bytegetPriority()Return default priority.voidresponse(int status, short dataType, int dataCount, ByteBuffer dataPayloadBuffer)Called everytime on monitor changed event.voidresubscribeSubscription(Transport transport)Resubscribe subscription.voidsubmit()Submit request to the corresponding transport.voidtimeout()Timeout notification.voidupdateSubscription()Update subscription.-
Methods inherited from class com.cosylab.epics.caj.impl.requests.AbstractCARequest
alignBuffer, calculateAlignedSize, generateRequestMessage, getRequestMessage, insertCAHeader
-
-
-
-
Field Detail
-
context
protected final CAJContext context
Context.
-
subsid
protected final int subsid
Subscription ID given by the context when registered.
-
monitor
protected final CAJMonitor monitor
Response callback listener.
-
channel
protected final CAJChannel channel
Channel.
-
priority
protected byte priority
Request send priority.
-
requestedDataType
protected int requestedDataType
Requested data type.
-
requestedDataCount
protected int requestedDataCount
Requested data count.
-
-
Constructor Detail
-
EventAddRequest
public EventAddRequest(CAJChannel channel, CAJMonitor monitor, Transport transport, int sid, int dataType, int dataCount, int mask)
- Parameters:
channel-monitor-transport-sid-dataType-dataCount-mask-
-
-
Method Detail
-
updateSubscription
public void updateSubscription() throws IOExceptionUpdate subscription. NOTE: not sync.- Throws:
IOException
-
submit
public void submit() throws IOExceptionSubmit request to the corresponding transport. This methods checks fornulltransport since it is allowed.- Specified by:
submitin interfaceRequest- Overrides:
submitin classAbstractCARequest- Throws:
IOException- See Also:
AbstractCARequest.submit()
-
resubscribeSubscription
public void resubscribeSubscription(Transport transport) throws IOException
Resubscribe subscription. NOTE: not sync.- Parameters:
transport- transport to be used.- Throws:
IOException
-
getIOID
public int getIOID()
Description copied from interface:ResponseRequestGet I/O ID.- Specified by:
getIOIDin interfaceResponseRequest- Returns:
- ioid
- See Also:
ResponseRequest.getIOID()
-
response
public void response(int status, short dataType, int dataCount, ByteBuffer dataPayloadBuffer)Called everytime on monitor changed event.- Specified by:
responsein interfaceNotifyResponseRequest- See Also:
NotifyResponseRequest.response(int, short, int, java.nio.ByteBuffer)
-
cancel
public void cancel()
Description copied from interface:ResponseRequestCancel response request (allways to be called to complete/destroy).- Specified by:
cancelin interfaceResponseRequest- See Also:
ResponseRequest.cancel()
-
timeout
public void timeout()
Description copied from interface:ResponseRequestTimeout notification.- Specified by:
timeoutin interfaceResponseRequest- See Also:
ResponseRequest.timeout()
-
exception
public void exception(int errorCode, String errorMessage)Description copied from interface:ResponseRequestException response notification.- Specified by:
exceptionin interfaceResponseRequest- Parameters:
errorCode- exception code.errorMessage- received detailed message.- See Also:
ResponseRequest.exception(int, java.lang.String)
-
getPriority
public byte getPriority()
Description copied from class:AbstractCARequestReturn default priority.- Specified by:
getPriorityin interfaceRequest- Overrides:
getPriorityin classAbstractCARequest- Returns:
- request priority.
- See Also:
Request.getPriority()
-
-