com.cosylab.epics.caj.impl.requests
Class EventAddRequest

java.lang.Object
  extended by com.cosylab.epics.caj.impl.requests.AbstractCARequest
      extended by 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
protected  CAJChannel channel
          Channel.
protected  CAJContext context
          Context.
protected  CAJMonitor monitor
          Response callback listener.
protected  byte priority
          Request send priority.
protected  int requestedDataCount
          Requested data count.
protected  int requestedDataType
          Requested data type.
protected  int subsid
          Subscription 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
EventAddRequest(CAJChannel channel, CAJMonitor monitor, Transport transport, int sid, int dataType, int dataCount, int mask)
           
 
Method Summary
 void cancel()
          Cancel response request (allways to be called to complete/destroy).
 void exception(int errorCode, String errorMessage)
          Exception response notification.
 int getIOID()
          Get I/O ID.
 byte getPriority()
          Return default priority.
 void response(int status, short dataType, int dataCount, ByteBuffer dataPayloadBuffer)
          Called everytime on monitor changed event.
 void resubscribeSubscription(Transport transport)
          Resubscribe subscription.
 void submit()
          Submit request to the corresponding transport.
 void timeout()
          Timeout notification.
 void updateSubscription()
          Update subscription.
 
Methods inherited from class com.cosylab.epics.caj.impl.requests.AbstractCARequest
alignBuffer, calculateAlignedSize, generateRequestMessage, getRequestMessage, insertCAHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected CAJContext context
Context.


subsid

protected int subsid
Subscription ID given by the context when registered.


monitor

protected CAJMonitor monitor
Response callback listener.


channel

protected 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 IOException
Update subscription. NOTE: not sync.

Throws:
IOException

submit

public void submit()
            throws IOException
Submit request to the corresponding transport. This methods checks for null transport since it is allowed.

Specified by:
submit in interface Request
Overrides:
submit in class AbstractCARequest
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: ResponseRequest
Get I/O ID.

Specified by:
getIOID in interface ResponseRequest
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:
response in interface NotifyResponseRequest
See Also:
NotifyResponseRequest.response(int, short, int, java.nio.ByteBuffer)

cancel

public void cancel()
Description copied from interface: ResponseRequest
Cancel response request (allways to be called to complete/destroy).

Specified by:
cancel in interface ResponseRequest
See Also:
ResponseRequest.cancel()

timeout

public void timeout()
Description copied from interface: ResponseRequest
Timeout notification.

Specified by:
timeout in interface ResponseRequest
See Also:
ResponseRequest.timeout()

exception

public void exception(int errorCode,
                      String errorMessage)
Description copied from interface: ResponseRequest
Exception response notification.

Specified by:
exception in interface ResponseRequest
Parameters:
errorCode - exception code.
errorMessage - received detailed message.
See Also:
ResponseRequest.exception(int, java.lang.String)

getPriority

public byte getPriority()
Description copied from class: AbstractCARequest
Return default priority.

Specified by:
getPriority in interface Request
Overrides:
getPriority in class AbstractCARequest
Returns:
request priority.
See Also:
Request.getPriority()


Copyright © 2004-2013 Cosylab. All Rights Reserved.