com.wm.app.tn.db
Class ProfileOps

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

public class ProfileOps
extends java.lang.Object

Provides database operations for retrieving partner profiles and components of profiles.

This class has no application knowledge in it. The data is not validated before committing it to the database. That is the responsibility of the caller.


Constructor Summary
ProfileOps()
           
 
Method Summary
static int getBinaryTypeCode(java.sql.Connection conn, java.lang.String binaryType)
           
static Contact getContact(java.lang.String contactID)
           
static Address getCorpAddress(java.lang.String addressID)
           
static java.util.Vector getCorporateAddresses(java.lang.String partnerID)
           
static java.util.Vector getDestinations(java.sql.Connection conn, java.lang.String partnerID, java.lang.String protocol)
          Retrieves all the connections of a specific protocol for a partner.
static java.util.Vector getDestinations(java.lang.String partnerID)
          Retrieves all the connections for a partner.
static java.util.Vector getIDs(java.lang.String partnerID)
          Retrieves all the alternate IDs for a partner.
static java.util.Vector getPartnerAllContacts(java.sql.Connection conn, java.lang.String partnerID)
          Retrieves all Contacts for the given partner on the trading network.
static byte[] getPartnerBinary(java.sql.Connection conn, java.lang.String partnerID, int binaryType)
           
static Contact getPartnerContact(java.sql.Connection conn, java.lang.String partnerID, java.lang.String contactType)
          Deprecated. use the getPatnerContacts instead
static java.util.Vector getPartnerContacts(java.sql.Connection conn, java.lang.String partnerID, java.lang.String contactType)
          Retrieves all Contacts of a given contact type for the given partner on the trading network.
static java.util.Hashtable getPollingFrequencies()
           
static Profile getProfile(java.sql.Connection conn, java.lang.String partnerID)
          Retrieves the partner's profile from the TN database.
static Profile getProfile(java.lang.String partnerID)
          Retrieves the partner's profile from the TN database.
static java.lang.String getProfileIdFromName(java.lang.String partnerName, java.lang.String orgUnitName)
          Retrieves the partner's profile ID from the TN database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileOps

public ProfileOps()
Method Detail

getProfile

public static Profile getProfile(java.lang.String partnerID)
                          throws java.sql.SQLException,
                                 ProfileStoreException
Retrieves the partner's profile from the TN database.

Parameters:
partnerID - internally assigned ID of a partner
Returns:
a Profile
Throws:
java.sql.SQLException
ProfileStoreException

getProfileIdFromName

public static java.lang.String getProfileIdFromName(java.lang.String partnerName,
                                                    java.lang.String orgUnitName)
                                             throws java.sql.SQLException,
                                                    ProfileStoreException
Retrieves the partner's profile ID from the TN database.

Parameters:
partnerName -
OrgUnitName -
Returns:
profile Id
Throws:
java.sql.SQLException
ProfileStoreException

getProfile

public static Profile getProfile(java.sql.Connection conn,
                                 java.lang.String partnerID)
                          throws java.sql.SQLException,
                                 ProfileStoreException
Retrieves the partner's profile from the TN database.

Parameters:
conn - an open connection to the Trading Networks database
partnerID - internally assigned ID of a partner
Returns:
a Profile
Throws:
java.sql.SQLException
ProfileStoreException

getDestinations

public static java.util.Vector getDestinations(java.lang.String partnerID)
                                        throws java.sql.SQLException,
                                               ProfileStoreException
Retrieves all the connections for a partner.

Returns:
a Vector of Connection objects.
Throws:
java.sql.SQLException
ProfileStoreException

getDestinations

public static java.util.Vector getDestinations(java.sql.Connection conn,
                                               java.lang.String partnerID,
                                               java.lang.String protocol)
                                        throws java.sql.SQLException,
                                               ProfileStoreException
Retrieves all the connections of a specific protocol for a partner.

Returns:
a Vector of Connection objects.
Throws:
java.sql.SQLException
ProfileStoreException

getPartnerContact

public static Contact getPartnerContact(java.sql.Connection conn,
                                        java.lang.String partnerID,
                                        java.lang.String contactType)
                                 throws java.sql.SQLException,
                                        ProfileStoreException
Deprecated. use the getPatnerContacts instead

Retrieves a Contact for a partner on the trading network.

Parameters:
conn - an open connection to the Trading Network database
partnerID - the internally assigned id for a trading partner
contactType - the type of contact to be retrieved. Value must match the Description column in a row on the ContactType table.
Returns:
the partner's internally assigned ID
Throws:
java.sql.SQLException
ProfileStoreException

getPartnerContacts

public static java.util.Vector getPartnerContacts(java.sql.Connection conn,
                                                  java.lang.String partnerID,
                                                  java.lang.String contactType)
                                           throws java.sql.SQLException,
                                                  ProfileStoreException
Retrieves all Contacts of a given contact type for the given partner on the trading network.

Parameters:
conn - an open connection to the Trading Network database
partnerID - the internally assigned id for a trading partner
contactType - the type of contact to be retrieved. Value must match the Description column in a row on the ContactType table.
Returns:
the matching contacts
Throws:
java.sql.SQLException
ProfileStoreException

getPartnerBinary

public static byte[] getPartnerBinary(java.sql.Connection conn,
                                      java.lang.String partnerID,
                                      int binaryType)
                               throws java.sql.SQLException,
                                      ProfileStoreException
Throws:
java.sql.SQLException
ProfileStoreException

getPollingFrequencies

public static java.util.Hashtable getPollingFrequencies()
                                                 throws java.sql.SQLException,
                                                        ProfileStoreException
Throws:
java.sql.SQLException
ProfileStoreException

getBinaryTypeCode

public static int getBinaryTypeCode(java.sql.Connection conn,
                                    java.lang.String binaryType)
                             throws java.sql.SQLException,
                                    ProfileStoreException
Throws:
java.sql.SQLException
ProfileStoreException

getPartnerAllContacts

public static java.util.Vector getPartnerAllContacts(java.sql.Connection conn,
                                                     java.lang.String partnerID)
                                              throws java.sql.SQLException,
                                                     ProfileStoreException
Retrieves all Contacts for the given partner on the trading network.

Parameters:
conn - an open connection to the Trading Network database
partnerID - the internally assigned id for a trading partner
Returns:
the matching contacts
Throws:
java.sql.SQLException
ProfileStoreException

getIDs

public static java.util.Vector getIDs(java.lang.String partnerID)
                               throws java.sql.SQLException,
                                      ProfileStoreException
Retrieves all the alternate IDs for a partner.

Returns:
a Vector of ID objects.
Throws:
java.sql.SQLException
ProfileStoreException

getCorporateAddresses

public static java.util.Vector getCorporateAddresses(java.lang.String partnerID)
                                              throws java.sql.SQLException,
                                                     ProfileStoreException
Throws:
java.sql.SQLException
ProfileStoreException

getContact

public static Contact getContact(java.lang.String contactID)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getCorpAddress

public static Address getCorpAddress(java.lang.String addressID)
                              throws java.sql.SQLException
Throws:
java.sql.SQLException