com.wm.app.tn.db
Class ProfileChecker

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

public class ProfileChecker
extends java.lang.Object

A set of methods to check if instances of the various profile components already exist in the database. All methods take a java.sql.Connection, plus one or more fields that make up the key for the table being checked. The return value from all boolean methods is true if a row already exists, false otherwise.


Field Summary
static int BINARY_TYPE
           
static int CONTACT_TYPE
           
static int ID_TYPE
           
 
Constructor Summary
ProfileChecker()
           
 
Method Summary
static boolean addrExists(java.sql.Connection conn, java.lang.String addrID)
           
static boolean anyIdExists(java.sql.Connection conn, java.lang.String internalID)
           
static boolean anyIdExists(java.lang.String internalID)
           
static boolean binaryExists(java.sql.Connection conn, java.lang.String partnerID, int binType)
           
static boolean contactAddrExists(java.sql.Connection conn, java.lang.String contactID)
           
static boolean contactExists(java.sql.Connection conn, java.lang.String partnerID, java.lang.String contactID)
           
static boolean corpAddrExists(java.sql.Connection conn, java.lang.String partnerID)
           
static boolean corpExists(java.sql.Connection conn, java.lang.String partnerID)
           
static boolean corpExists(java.lang.String partnerID)
           
static int countExistingIDs(java.sql.Connection conn, java.lang.String partnerID)
           
static int countExistingIDs(java.lang.String partnerID)
           
static boolean destExistsForProtocol(java.sql.Connection conn, java.lang.String protocol)
           
static boolean destExistsForProtocol(java.lang.String protocol)
           
static boolean destinationExists(java.sql.Connection conn, java.lang.String destinationID)
           
static boolean destinationExists(java.sql.Connection conn, java.lang.String partnerID, java.lang.String protocol, boolean primary)
           
static boolean fieldExists(java.sql.Connection conn, java.lang.String fldID)
           
static boolean fieldsExist(java.sql.Connection conn, short groupID)
           
static boolean groupExists(java.sql.Connection conn, int type)
           
static boolean idExists(java.sql.Connection conn, java.lang.String externalID, int idType)
           
static boolean idExistsAllPartnersInclSelf(java.sql.Connection conn, java.lang.String partnerIDID, java.lang.String externalID, int idType)
           
static boolean idExistsOtherPartners(java.sql.Connection conn, java.lang.String partnerID, java.lang.String externalID, int idType)
           
static boolean isLastIdForIdType(java.sql.Connection conn, java.lang.String partnerID, int idType)
           
static boolean isLastIdForIdType(java.lang.String partnerID, int idType)
           
static boolean remoteExists(java.sql.Connection conn, java.lang.String partnerID)
           
static boolean typeExists(java.sql.Connection conn, int lookupType, int id)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTACT_TYPE

public static final int CONTACT_TYPE
See Also:
Constant Field Values

ID_TYPE

public static final int ID_TYPE
See Also:
Constant Field Values

BINARY_TYPE

public static final int BINARY_TYPE
See Also:
Constant Field Values
Constructor Detail

ProfileChecker

public ProfileChecker()
Method Detail

corpExists

public static boolean corpExists(java.lang.String partnerID)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

corpExists

public static boolean corpExists(java.sql.Connection conn,
                                 java.lang.String partnerID)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

remoteExists

public static boolean remoteExists(java.sql.Connection conn,
                                   java.lang.String partnerID)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

corpAddrExists

public static boolean corpAddrExists(java.sql.Connection conn,
                                     java.lang.String partnerID)
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

contactExists

public static boolean contactExists(java.sql.Connection conn,
                                    java.lang.String partnerID,
                                    java.lang.String contactID)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

contactAddrExists

public static boolean contactAddrExists(java.sql.Connection conn,
                                        java.lang.String contactID)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

addrExists

public static boolean addrExists(java.sql.Connection conn,
                                 java.lang.String addrID)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

destinationExists

public static boolean destinationExists(java.sql.Connection conn,
                                        java.lang.String partnerID,
                                        java.lang.String protocol,
                                        boolean primary)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

destinationExists

public static boolean destinationExists(java.sql.Connection conn,
                                        java.lang.String destinationID)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

destExistsForProtocol

public static boolean destExistsForProtocol(java.lang.String protocol)
                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

destExistsForProtocol

public static boolean destExistsForProtocol(java.sql.Connection conn,
                                            java.lang.String protocol)
                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

anyIdExists

public static boolean anyIdExists(java.lang.String internalID)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

anyIdExists

public static boolean anyIdExists(java.sql.Connection conn,
                                  java.lang.String internalID)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

idExists

public static boolean idExists(java.sql.Connection conn,
                               java.lang.String externalID,
                               int idType)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

idExistsOtherPartners

public static boolean idExistsOtherPartners(java.sql.Connection conn,
                                            java.lang.String partnerID,
                                            java.lang.String externalID,
                                            int idType)
                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

idExistsAllPartnersInclSelf

public static boolean idExistsAllPartnersInclSelf(java.sql.Connection conn,
                                                  java.lang.String partnerIDID,
                                                  java.lang.String externalID,
                                                  int idType)
                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

isLastIdForIdType

public static boolean isLastIdForIdType(java.lang.String partnerID,
                                        int idType)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

isLastIdForIdType

public static boolean isLastIdForIdType(java.sql.Connection conn,
                                        java.lang.String partnerID,
                                        int idType)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

binaryExists

public static boolean binaryExists(java.sql.Connection conn,
                                   java.lang.String partnerID,
                                   int binType)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

typeExists

public static boolean typeExists(java.sql.Connection conn,
                                 int lookupType,
                                 int id)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

groupExists

public static boolean groupExists(java.sql.Connection conn,
                                  int type)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

fieldExists

public static boolean fieldExists(java.sql.Connection conn,
                                  java.lang.String fldID)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

fieldsExist

public static boolean fieldsExist(java.sql.Connection conn,
                                  short groupID)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

countExistingIDs

public static int countExistingIDs(java.lang.String partnerID)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

countExistingIDs

public static int countExistingIDs(java.sql.Connection conn,
                                   java.lang.String partnerID)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException