com.reuters.rc.db
Interface DbRequest

All Known Implementing Classes:
AdbRequest

public interface DbRequest

The DB request interface that abstracts out a clients interaction with any ADB-like server.

Author:
Jawaid Hakim, Cavit Aydin (converted to an interface)

Method Summary
 java.lang.Object getClosure()
          Get the closure argument.
 DbRequestStmt[] getRequest()
          Get the requests statement(s) associated with this request.
 double getTimeout()
          Get the maximum time interval for which to wait for reply.
 void send(java.lang.String sendSubject)
          Request.
 void send(java.lang.String sendSubject, java.lang.String replySubject)
          Request.Send the request to ADB using the default transport.
 void send(com.tibco.tibrv.TibrvTransport rvTrans, java.lang.String sendSubject)
          Request.
 void send(com.tibco.tibrv.TibrvTransport rvTrans, java.lang.String sendSubject, java.lang.String replySubject)
          Request.Send the request to ADB.
 DbReply sendRequest(java.lang.String sendSubject)
          Request/Reply.
 void sendRequest(java.lang.String sendSubject, DbRequestCallback adbCb, java.lang.String replySubject)
          Async.
 DbReply sendRequest(com.tibco.tibrv.TibrvTransport rvTrans, java.lang.String sendSubject)
          Request/Reply.
 void sendRequest(com.tibco.tibrv.TibrvTransport rvTrans, java.lang.String sendSubject, com.tibco.tibrv.TibrvQueue rvQueue, DbRequestCallback adbCb, java.lang.String replySubject)
          Async.
 void setReplySize(int size)
          Set the number of resultset rows in a DbReply object.
 void setTimeout(double timeout)
          Set the maximum time interval for which to wait for reply.
 java.lang.String toPrettyPrintString()
          Pretty Print the request message.
 

Method Detail

getClosure

public java.lang.Object getClosure()
Get the closure argument.
Returns:
Closure argument
See Also:
sendRequest(TibrvTransport, String)

getTimeout

public double getTimeout()
Get the maximum time interval for which to wait for reply.
Returns:
Maximum timeout interval - in seconds.
See Also:
sendRequest(TibrvTransport, String)

setTimeout

public void setTimeout(double timeout)
Set the maximum time interval for which to wait for reply.
Parameters:
timeout - Maximum time interval - in seconds - for which to wait for reply.
See Also:
sendRequest(TibrvTransport, String)

setReplySize

public void setReplySize(int size)
Set the number of resultset rows in a DbReply object. If a non-zero (positive) value is set then the DbReply objects will contain at most that many resultset rows. Any other value will simply result in all the resultset rows grouped into one DbReply object. Note that the (ADB-like) server may not support this parameter, in which case it will just be ignored.

This parameter will only affect the send() and asynch sendRequest() methods. The synchronous sendRequest() call will always return all the resultset rows in one DbReply object. In the case of send() (where there is no callback and therefore no DbReply object), this parameter will affect the TibrvMsg object fired by the ADB-like server.

Parameters:
size - the return batch size

getRequest

public DbRequestStmt[] getRequest()
Get the requests statement(s) associated with this request.
Returns:
Request statement(s) associated with this request. A reference to the request statements is returned so be careful about modifying the data.

sendRequest

public DbReply sendRequest(com.tibco.tibrv.TibrvTransport rvTrans,
                           java.lang.String sendSubject)
                    throws DbBusinessException,
                           DbSystemException
Request/Reply. Send the request to ADB, wait for the reply until timeout period expires, and return the reply. If timeout occurs then an exception is thrown.
Parameters:
rvTrans - Transport used to send the request.
sendSubject - Send subject.
Returns:
Reply from ADB.
See Also:
setTimeout(double), DbReply, sendRequest(String)

sendRequest

public DbReply sendRequest(java.lang.String sendSubject)
                    throws DbBusinessException,
                           DbSystemException
Request/Reply. Send the request to ADB, wait for the reply until timeout period expires, and return the reply. The default transport is used to send the request.
Parameters:
sendSubject - Send subject.
Returns:
Reply from ADB.
See Also:
#setDefault(TibrvTransport), #setDefault(TibrvTransport, TibrvQueue), setTimeout(double), DbReply, sendRequest(TibrvTransport, String)

send

public void send(com.tibco.tibrv.TibrvTransport rvTrans,
                 java.lang.String sendSubject)
          throws DbBusinessException,
                 DbSystemException
Request. Send the request to ADB.
Parameters:
rvTrans - Transport used to send the request.
sendSubject - Send subject.
See Also:
send(String)

send

public void send(java.lang.String sendSubject)
          throws DbBusinessException,
                 DbSystemException
Request. Send the request to ADB using the default transport.
Parameters:
sendSubject - Send subject.
See Also:
#setDefault(TibrvTransport), #setDefault(TibrvTransport, TibrvQueue), send(TibrvTransport, String)

send

public void send(com.tibco.tibrv.TibrvTransport rvTrans,
                 java.lang.String sendSubject,
                 java.lang.String replySubject)
          throws DbBusinessException,
                 DbSystemException
Request.Send the request to ADB.
Parameters:
rvTrans - Transport.
sendSubject - Send subject.
replySubject - Reply subject.
See Also:
send(String, String)

send

public void send(java.lang.String sendSubject,
                 java.lang.String replySubject)
          throws DbBusinessException,
                 DbSystemException
Request.Send the request to ADB using the default transport.
Parameters:
sendSubject - Send subject.
replySubject - Reply subject.
See Also:
#setDefault(TibrvTransport), #setDefault(TibrvTransport, TibrvQueue), send(TibrvTransport, String, String)

sendRequest

public void sendRequest(com.tibco.tibrv.TibrvTransport rvTrans,
                        java.lang.String sendSubject,
                        com.tibco.tibrv.TibrvQueue rvQueue,
                        DbRequestCallback adbCb,
                        java.lang.String replySubject)
                 throws DbBusinessException,
                        DbSystemException
Async. Request/Reply. Send the request to ADB, get the reply asynchronously, and return the reply to callback. The application callback should destroy the TibrvListsner if it wishes to close the subscription.
Parameters:
rvTrans - Transport used to send the request.
sendSubject - Send subject.
rvQueue - Queue on which the reply is received. Caller must dispatch from this queue.
adbCb - Callback function.
replySubject - Listen for reply from ADB on this subject.
See Also:
DbReply, DbRequestCallback, sendRequest(String, DbRequestCallback, String)

sendRequest

public void sendRequest(java.lang.String sendSubject,
                        DbRequestCallback adbCb,
                        java.lang.String replySubject)
                 throws DbBusinessException,
                        DbSystemException
Async. Request/Reply. Send the request to ADB, get the reply asynchronously, and return the reply to callback. The application callback should destroy the TibrvListsner if it wishes to close the subscription.
Parameters:
sendSubject - Send subject.
adbCb - Callback function.
replySubject - Listen for reply from ADB on this subject.
See Also:
DbReply, DbRequestCallback, sendRequest(TibrvTransport, String, TibrvQueue, DbRequestCallback, String)

toPrettyPrintString

public java.lang.String toPrettyPrintString()
Pretty Print the request message.
Returns:
Pretty Printed value.


Copyright © 2002-2003 Reuters. All Rights Reserved.