com.wm.app.tn.db
Class TPAOps

java.lang.Object
  extended by com.wm.app.tn.db.TPAOps

public class TPAOps
extends java.lang.Object


Field Summary
static java.lang.String AGREEMENTID
           
static java.lang.String CONTROLNUMBER
           
static java.lang.String CREATED
           
static java.lang.String DATASCHEMA
           
static java.lang.String DATASTATUS
           
static java.lang.String DESCRIPTION
           
static java.lang.String EXPORTSERVICE
           
static java.lang.String INITSERVICE
           
static java.lang.String LASTMODIFIED
           
static java.lang.String RECEIVERID
           
static java.lang.String SENDERID
           
static java.lang.String STATUS
           
static java.lang.String TPADATA
           
static java.lang.String TPAID
           
static java.lang.String VALIDATIONSERVICE
           
static java.lang.String VERSION
           
 
Constructor Summary
TPAOps()
           
 
Method Summary
static void addTPA(com.wm.app.tn.tpa.TPA tpa)
          Add TPA operation
static void changeStatus(java.lang.String[] tpaID, java.lang.String newStatus)
          Change status by tpaID.
static void changeStatus(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID, java.lang.String newStatus)
          Change status Throw TPAException if the TPA does not exist.
static void deleteTPA(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID)
          Delete a TPA.
static void deleteTPAByID(java.lang.String tpaID)
           
static com.wm.app.tn.tpa.TPA[] getAllTPAs(boolean all)
          Return all TPAs - used by export facility
static void getConNumAndTPAData(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID, com.wm.app.tn.tpa.TPA tpa)
          Retrieve the latest controlNumber and tpaData Throw TPAException if none matches senderID, receiverID and agreementID
static void getConNumAndTPAData(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID, com.wm.app.tn.tpa.TPA tpa, boolean lock)
          Retrieve the latest controlNumber and tpaData Throw TPAException if none matches senderID, receiverID and agreementID
static java.lang.String getControlNumber(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID)
          Retrieve the latest controlNumber and tpaData Throw TPAException if none matches senderID, receiverID and agreementID
static void getControlNumber(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID, com.wm.app.tn.tpa.TPA tpa)
          Retrieve the latest controlNumber Throw TPAException if none matches senderID, receiverID and agreementID
static void getControlNumber(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID, com.wm.app.tn.tpa.TPA tpa, boolean lock)
          Retrieve the latest controlNumber Throw TPAException if none matches senderID, receiverID and agreementID
static java.lang.String getNextControlNumber(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID)
          Get the next controlNumber Throw TPAException if the TPA doesn't exist
static com.wm.app.tn.tpa.TPA getTPA(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID)
          Retrieve a TPA
static com.wm.app.tn.tpa.TPA getTPAByID(java.lang.String tpaID)
          Retrieve a TPA for a TPAID
static com.wm.app.tn.tpa.TPALock getTPALock(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID)
          Return a JDBC connection return null if the TPA is not found.
static void importTPA(com.wm.app.tn.tpa.TPA tpa, boolean force)
          Import a TPA - used by import facility Note: all other DB op should stop
static com.wm.data.IData query(TPAQuery query, int pageSize, int maxRowCount, int queryTimeout, int threshold, java.lang.String queryId)
          Query service
static java.util.Vector<com.wm.app.tn.tpa.TPA> queryTPA(java.lang.String regexAgreementID)
           
static void releaseTPALock(com.wm.app.tn.tpa.TPALock tpaLock)
          Release a TPA lock
static void updateControlNumber(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID, java.lang.String newValue)
          Update controlNumber and return the oldValue Throw TPAException if the TPA doesn't exist
static void updateControlNumber(com.wm.app.tn.tpa.TPALock tpaLock, java.lang.String newValue)
           
static void updateTPA(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID, com.wm.app.tn.tpa.TPA tpa)
          Atomic update the selected fields
static void updateTPAData(java.lang.String senderID, java.lang.String receiverID, java.lang.String agreementID, com.wm.data.IData newValue)
          Update tpaData and return the oldValue Throw TPAException if the TPA doesn't exist
static void updateTPAData(com.wm.app.tn.tpa.TPALock tpaLock, com.wm.data.IData newValue)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TPAID

public static final java.lang.String TPAID
See Also:
Constant Field Values

SENDERID

public static final java.lang.String SENDERID
See Also:
Constant Field Values

RECEIVERID

public static final java.lang.String RECEIVERID
See Also:
Constant Field Values

AGREEMENTID

public static final java.lang.String AGREEMENTID
See Also:
Constant Field Values

CREATED

public static final java.lang.String CREATED
See Also:
Constant Field Values

LASTMODIFIED

public static final java.lang.String LASTMODIFIED
See Also:
Constant Field Values

CONTROLNUMBER

public static final java.lang.String CONTROLNUMBER
See Also:
Constant Field Values

STATUS

public static final java.lang.String STATUS
See Also:
Constant Field Values

EXPORTSERVICE

public static final java.lang.String EXPORTSERVICE
See Also:
Constant Field Values

INITSERVICE

public static final java.lang.String INITSERVICE
See Also:
Constant Field Values

VALIDATIONSERVICE

public static final java.lang.String VALIDATIONSERVICE
See Also:
Constant Field Values

DATASCHEMA

public static final java.lang.String DATASCHEMA
See Also:
Constant Field Values

DATASTATUS

public static final java.lang.String DATASTATUS
See Also:
Constant Field Values

TPADATA

public static final java.lang.String TPADATA
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

DESCRIPTION

public static final java.lang.String DESCRIPTION
See Also:
Constant Field Values
Constructor Detail

TPAOps

public TPAOps()
Method Detail

addTPA

public static void addTPA(com.wm.app.tn.tpa.TPA tpa)
                   throws java.sql.SQLException,
                          com.wm.app.tn.tpa.TPAException
Add TPA operation

Throws:
java.sql.SQLException
com.wm.app.tn.tpa.TPAException

getTPAByID

public static com.wm.app.tn.tpa.TPA getTPAByID(java.lang.String tpaID)
                                        throws com.wm.app.tn.tpa.TPAException,
                                               java.sql.SQLException
Retrieve a TPA for a TPAID

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

getTPA

public static com.wm.app.tn.tpa.TPA getTPA(java.lang.String senderID,
                                           java.lang.String receiverID,
                                           java.lang.String agreementID)
                                    throws com.wm.app.tn.tpa.TPAException,
                                           java.sql.SQLException
Retrieve a TPA

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

updateTPA

public static void updateTPA(java.lang.String senderID,
                             java.lang.String receiverID,
                             java.lang.String agreementID,
                             com.wm.app.tn.tpa.TPA tpa)
                      throws com.wm.app.tn.tpa.TPAException,
                             java.sql.SQLException
Atomic update the selected fields

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

getControlNumber

public static java.lang.String getControlNumber(java.lang.String senderID,
                                                java.lang.String receiverID,
                                                java.lang.String agreementID)
                                         throws com.wm.app.tn.tpa.TPAException,
                                                java.sql.SQLException
Retrieve the latest controlNumber and tpaData Throw TPAException if none matches senderID, receiverID and agreementID

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

getControlNumber

public static void getControlNumber(java.lang.String senderID,
                                    java.lang.String receiverID,
                                    java.lang.String agreementID,
                                    com.wm.app.tn.tpa.TPA tpa)
                             throws com.wm.app.tn.tpa.TPAException,
                                    java.sql.SQLException
Retrieve the latest controlNumber Throw TPAException if none matches senderID, receiverID and agreementID

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

getControlNumber

public static void getControlNumber(java.lang.String senderID,
                                    java.lang.String receiverID,
                                    java.lang.String agreementID,
                                    com.wm.app.tn.tpa.TPA tpa,
                                    boolean lock)
                             throws com.wm.app.tn.tpa.TPAException,
                                    java.sql.SQLException
Retrieve the latest controlNumber Throw TPAException if none matches senderID, receiverID and agreementID

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

getConNumAndTPAData

public static void getConNumAndTPAData(java.lang.String senderID,
                                       java.lang.String receiverID,
                                       java.lang.String agreementID,
                                       com.wm.app.tn.tpa.TPA tpa)
                                throws com.wm.app.tn.tpa.TPAException,
                                       java.sql.SQLException
Retrieve the latest controlNumber and tpaData Throw TPAException if none matches senderID, receiverID and agreementID

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

getConNumAndTPAData

public static void getConNumAndTPAData(java.lang.String senderID,
                                       java.lang.String receiverID,
                                       java.lang.String agreementID,
                                       com.wm.app.tn.tpa.TPA tpa,
                                       boolean lock)
                                throws com.wm.app.tn.tpa.TPAException,
                                       java.sql.SQLException
Retrieve the latest controlNumber and tpaData Throw TPAException if none matches senderID, receiverID and agreementID

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

updateControlNumber

public static void updateControlNumber(java.lang.String senderID,
                                       java.lang.String receiverID,
                                       java.lang.String agreementID,
                                       java.lang.String newValue)
                                throws com.wm.app.tn.tpa.TPAException,
                                       java.sql.SQLException
Update controlNumber and return the oldValue Throw TPAException if the TPA doesn't exist

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

updateControlNumber

public static void updateControlNumber(com.wm.app.tn.tpa.TPALock tpaLock,
                                       java.lang.String newValue)
                                throws com.wm.app.tn.tpa.TPAException,
                                       java.sql.SQLException
Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

updateTPAData

public static void updateTPAData(java.lang.String senderID,
                                 java.lang.String receiverID,
                                 java.lang.String agreementID,
                                 com.wm.data.IData newValue)
                          throws com.wm.app.tn.tpa.TPAException,
                                 java.sql.SQLException
Update tpaData and return the oldValue Throw TPAException if the TPA doesn't exist

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

updateTPAData

public static void updateTPAData(com.wm.app.tn.tpa.TPALock tpaLock,
                                 com.wm.data.IData newValue)
                          throws com.wm.app.tn.tpa.TPAException,
                                 java.sql.SQLException
Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

getNextControlNumber

public static java.lang.String getNextControlNumber(java.lang.String senderID,
                                                    java.lang.String receiverID,
                                                    java.lang.String agreementID)
                                             throws com.wm.app.tn.tpa.TPAException,
                                                    java.sql.SQLException
Get the next controlNumber Throw TPAException if the TPA doesn't exist

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

deleteTPAByID

public static void deleteTPAByID(java.lang.String tpaID)
                          throws com.wm.app.tn.tpa.TPAException,
                                 java.sql.SQLException
Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

deleteTPA

public static void deleteTPA(java.lang.String senderID,
                             java.lang.String receiverID,
                             java.lang.String agreementID)
                      throws com.wm.app.tn.tpa.TPAException,
                             java.sql.SQLException
Delete a TPA. Throw TPAException if the TPA doesn't exist or more than one TPA is deleted.

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

changeStatus

public static void changeStatus(java.lang.String senderID,
                                java.lang.String receiverID,
                                java.lang.String agreementID,
                                java.lang.String newStatus)
                         throws com.wm.app.tn.tpa.TPAException,
                                java.sql.SQLException
Change status Throw TPAException if the TPA does not exist.

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

changeStatus

public static void changeStatus(java.lang.String[] tpaID,
                                java.lang.String newStatus)
                         throws com.wm.app.tn.tpa.TPAException,
                                java.sql.SQLException
Change status by tpaID. Throw TPAException if the TPA does not exist.

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

getTPALock

public static com.wm.app.tn.tpa.TPALock getTPALock(java.lang.String senderID,
                                                   java.lang.String receiverID,
                                                   java.lang.String agreementID)
                                            throws com.wm.app.tn.tpa.TPAException,
                                                   java.sql.SQLException
Return a JDBC connection return null if the TPA is not found.

Throws:
com.wm.app.tn.tpa.TPAException
java.sql.SQLException

releaseTPALock

public static void releaseTPALock(com.wm.app.tn.tpa.TPALock tpaLock)
Release a TPA lock

Parameters:
tpaLock - a TPALock object

query

public static com.wm.data.IData query(TPAQuery query,
                                      int pageSize,
                                      int maxRowCount,
                                      int queryTimeout,
                                      int threshold,
                                      java.lang.String queryId)
                               throws java.sql.SQLException,
                                      java.io.IOException,
                                      com.wm.app.repo.RepositoryException,
                                      com.wm.app.b2b.server.ServiceException
Query service

Throws:
java.sql.SQLException
java.io.IOException
com.wm.app.repo.RepositoryException
com.wm.app.b2b.server.ServiceException

getAllTPAs

public static com.wm.app.tn.tpa.TPA[] getAllTPAs(boolean all)
                                          throws java.sql.SQLException,
                                                 com.wm.app.tn.tpa.TPAException
Return all TPAs - used by export facility

Throws:
java.sql.SQLException
com.wm.app.tn.tpa.TPAException

importTPA

public static void importTPA(com.wm.app.tn.tpa.TPA tpa,
                             boolean force)
                      throws java.sql.SQLException,
                             com.wm.app.tn.tpa.TPAException
Import a TPA - used by import facility Note: all other DB op should stop

Throws:
java.sql.SQLException
com.wm.app.tn.tpa.TPAException

queryTPA

public static java.util.Vector<com.wm.app.tn.tpa.TPA> queryTPA(java.lang.String regexAgreementID)
                                                        throws com.wm.app.b2b.server.ServiceException,
                                                               java.sql.SQLException,
                                                               java.io.IOException,
                                                               com.wm.app.tn.tpa.TPAException
Throws:
com.wm.app.b2b.server.ServiceException
java.sql.SQLException
java.io.IOException
com.wm.app.tn.tpa.TPAException