com.reuters.rc.db.adb
Class AdbFactory

java.lang.Object
  |
  +--com.reuters.rc.db.adb.AdbFactory
All Implemented Interfaces:
DbFactory

public class AdbFactory
extends java.lang.Object
implements DbFactory

The factory for Adb. This class is the single source for object creation. Application clients can set/get their particular choice of DbFactory implementation through the static methods of the DbManager class.

Author:
Jawaid Hakim.

Constructor Summary
AdbFactory()
          Ctor.
 
Method Summary
 DbOpcode getDeleteOpcode()
          Get an instance of a DbOpcode object that represents a Delete operation.
 DbOpcode getInsertOpcode()
          Get an instance of a DbOpcode object that represents an Insert operation.
 DbOpcode getOpcode(int opCode)
          Get the OpCode object corresponding to an integer opcode.
 DbPubMsg getPubMsg(com.tibco.tibrv.TibrvMsg rvMsg)
          Get an instance of a PubMsg object constructed from a Tibrv message.
 DbReply getReply(com.tibco.tibrv.TibrvMsg replyMsg)
          Get an instance of a DbReply object.
 DbRequest getRequest(DbRequestStmt stmt)
          Get an instance of a DbRequest object.
 DbRequest getRequest(DbRequestStmt[] stmts)
          Get an instance of a DbRequest object.
 DbRequest getRequest(DbRequestStmt[] stmts, double timeout)
          Get an instance of a DbRequest object.
 DbRequest getRequest(DbRequestStmt[] stmts, double timeout, java.lang.Object closure)
          Get an instance of a DbRequest object.
 DbRequest getRequest(DbRequestStmt stmt, double timeout)
          Get an instance of a DbRequest object.
 DbRequest getRequest(DbRequestStmt stmt, double timeout, java.lang.Object closure)
          Get an instance of a DbRequest object.
 DbRequestBind getRequestBind(int position, java.lang.Object data)
          Get an instance of a DbRequestBind object.
 DbRequestBind getRequestBind(int position, java.lang.String column, java.lang.Object data)
          Get an instance of a DbRequestBind object.
 DbRequestBind getRequestBind(java.lang.String column, java.lang.Object data)
          Get an instance of a DbRequestBind object.
 DbRequestStmt getRequestStmt(java.lang.String sql)
          Get an instance of a DbRequestStmt object.
 DbRequestStmt getRequestStmt(java.lang.String sql, DbRequestBind bind)
          Get an instance of a DbRequestStmt object
 DbRequestStmt getRequestStmt(java.lang.String sql, DbRequestBind[] binds)
          Get an instance of a DbRequestStmt object
 DbRequestStmt getRequestStmt(java.lang.String sql, DbRequestBind[] binds, int maxRows)
          Get an instance of a DbRequestStmt object
 DbRequestStmt getRequestStmt(java.lang.String sql, DbRequestBind bind, int maxRows)
          Get an instance of a DbRequestStmt object
 DbRequestStmt getRequestStmt(java.lang.String sql, int maxRows)
          Get an instance of a DbRequestStmt object.
 DbOpcode getUnknownOpcode()
          Get an instance of a DbOpcode object that represents an Unknown operation.
 DbOpcode getUpdateOpcode()
          Get an instance of a DbOpcode object that represents an Update operation.
 DbOpcode getUpsertOpcode()
          Get an instance of a DbOpcode object that represents an Upsert operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdbFactory

public AdbFactory()
Ctor.
Method Detail

getRequest

public DbRequest getRequest(DbRequestStmt stmt)
Get an instance of a DbRequest object.
Specified by:
getRequest in interface DbFactory
Parameters:
stmt - request statement
Returns:
an instance of DbRequest object
See Also:
DbRequestStmt

getRequest

public DbRequest getRequest(DbRequestStmt stmt,
                            double timeout)
Get an instance of a DbRequest object.
Specified by:
getRequest in interface DbFactory
Parameters:
stmt - Request statement.
timeout - Maximum time interval - in seconds - for which to wait for reply in request/reply mode.
See Also:
DbRequest.sendRequest(TibrvTransport, String), DbRequest.sendRequest(String), DbRequestStmt

getRequest

public DbRequest getRequest(DbRequestStmt stmt,
                            double timeout,
                            java.lang.Object closure)
Get an instance of a DbRequest object.
Specified by:
getRequest in interface DbFactory
Parameters:
stmt - Request statement.
timeout - Maximum time interval - in seconds - for which to wait for reply in request/reply mode.
closure - Closure argument.
See Also:
DbRequest.sendRequest(TibrvTransport, String), DbRequest.sendRequest(String), DbRequestStmt

getRequest

public DbRequest getRequest(DbRequestStmt[] stmts)
Get an instance of a DbRequest object.
Specified by:
getRequest in interface DbFactory
Parameters:
stmts - Request statements.
See Also:
DbRequestStmt

getRequest

public DbRequest getRequest(DbRequestStmt[] stmts,
                            double timeout)
Get an instance of a DbRequest object.
Specified by:
getRequest in interface DbFactory
Parameters:
stmts - Request statements.
timeout - Maximum time interval - in seconds - for which to wait for reply in request/reply mode.
See Also:
DbRequest.sendRequest(TibrvTransport, String), DbRequest.sendRequest(String), DbRequestStmt

getRequest

public DbRequest getRequest(DbRequestStmt[] stmts,
                            double timeout,
                            java.lang.Object closure)
Get an instance of a DbRequest object.
Specified by:
getRequest in interface DbFactory
Parameters:
stmts - Request statements.
timeout - Maximum time interval - in seconds - for which to wait for reply in request/reply mode.
closure - Closure argument.
See Also:
DbRequest.sendRequest(TibrvTransport, String), DbRequest.sendRequest(String), DbRequestStmt

getReply

public DbReply getReply(com.tibco.tibrv.TibrvMsg replyMsg)
Get an instance of a DbReply object.
Specified by:
getReply in interface DbFactory
Parameters:
replyMsg - Reply message from ADB.

getRequestStmt

public DbRequestStmt getRequestStmt(java.lang.String sql)
Get an instance of a DbRequestStmt object.
Specified by:
getRequestStmt in interface DbFactory
Parameters:
sql - The SQL statement to execute on the ADB.

getRequestStmt

public DbRequestStmt getRequestStmt(java.lang.String sql,
                                    int maxRows)
Get an instance of a DbRequestStmt object.
Specified by:
getRequestStmt in interface DbFactory
Parameters:
sql - The SQL statement to execute on the ADB.
maxRows - Maximum number of result rows returned from request.

getRequestStmt

public DbRequestStmt getRequestStmt(java.lang.String sql,
                                    DbRequestBind bind)
Get an instance of a DbRequestStmt object
Specified by:
getRequestStmt in interface DbFactory
Parameters:
sql - The SQL statement to execute on the ADB.
bind - Bind data.
See Also:
DbRequestBind

getRequestStmt

public DbRequestStmt getRequestStmt(java.lang.String sql,
                                    DbRequestBind bind,
                                    int maxRows)
Get an instance of a DbRequestStmt object
Specified by:
getRequestStmt in interface DbFactory
Parameters:
sql - The SQL statement to execute on the ADB.
bind - Bind data.
maxRows - Maximum number of result rows returned from request.
See Also:
DbRequestBind

getRequestStmt

public DbRequestStmt getRequestStmt(java.lang.String sql,
                                    DbRequestBind[] binds)
Get an instance of a DbRequestStmt object
Specified by:
getRequestStmt in interface DbFactory
Parameters:
sql - The SQL statement to execute on the ADB.
binds - Bind data.
See Also:
DbRequestBind

getRequestStmt

public DbRequestStmt getRequestStmt(java.lang.String sql,
                                    DbRequestBind[] binds,
                                    int maxRows)
Get an instance of a DbRequestStmt object
Specified by:
getRequestStmt in interface DbFactory
Parameters:
sql - The SQL statement to execute on the ADB.
binds - Bind data.
maxRows - Maximum number of result rows returned from request.
See Also:
DbRequestBind

getRequestBind

public DbRequestBind getRequestBind(int position,
                                    java.lang.String column,
                                    java.lang.Object data)
Get an instance of a DbRequestBind object.
Specified by:
getRequestBind in interface DbFactory
Parameters:
position - Placeholder position.
column - Column name.
data - Column data.

getRequestBind

public DbRequestBind getRequestBind(java.lang.String column,
                                    java.lang.Object data)
Get an instance of a DbRequestBind object.
Specified by:
getRequestBind in interface DbFactory
Parameters:
column - Column name.
data - Column data.

getRequestBind

public DbRequestBind getRequestBind(int position,
                                    java.lang.Object data)
Get an instance of a DbRequestBind object.
Specified by:
getRequestBind in interface DbFactory
Parameters:
position - Placeholder position.
data - Column data.

getInsertOpcode

public DbOpcode getInsertOpcode()
Get an instance of a DbOpcode object that represents an Insert operation.
Specified by:
getInsertOpcode in interface DbFactory
Returns:
DbOpcode instance

getDeleteOpcode

public DbOpcode getDeleteOpcode()
Get an instance of a DbOpcode object that represents a Delete operation.
Specified by:
getDeleteOpcode in interface DbFactory
Returns:
DbOpcode instance

getUpdateOpcode

public DbOpcode getUpdateOpcode()
Get an instance of a DbOpcode object that represents an Update operation.
Specified by:
getUpdateOpcode in interface DbFactory
Returns:
DbOpcode instance

getUpsertOpcode

public DbOpcode getUpsertOpcode()
Get an instance of a DbOpcode object that represents an Upsert operation.
Specified by:
getUpsertOpcode in interface DbFactory
Returns:
DbOpcode instance

getUnknownOpcode

public DbOpcode getUnknownOpcode()
Get an instance of a DbOpcode object that represents an Unknown operation.
Specified by:
getUnknownOpcode in interface DbFactory
Returns:
DbOpcode instance

getOpcode

public DbOpcode getOpcode(int opCode)
Get the OpCode object corresponding to an integer opcode. Note that the integer values here are application specific. Subclasses are free to use any values they want.
Specified by:
getOpcode in interface DbFactory
Parameters:
opCode - an application specific opcode value as an integer
Returns:
DbOpcode instance

getPubMsg

public DbPubMsg getPubMsg(com.tibco.tibrv.TibrvMsg rvMsg)
Get an instance of a PubMsg object constructed from a Tibrv message.
Specified by:
getPubMsg in interface DbFactory
Parameters:
rvMsg - the rvMsg that is published
Returns:
PubMsg instance


Copyright © 2002-2003 Reuters. All Rights Reserved.