com.wm.app.tn.db
Class ProfileIDOps

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

public class ProfileIDOps
extends java.lang.Object

Provides database operations for retrieving various IDs to be found in the profile.


Constructor Summary
ProfileIDOps()
           
 
Method Summary
static java.lang.String getExternalID(java.sql.Connection conn, java.lang.String intID, int extIDType)
          Retrieves an external ID for a partner on the trading network.
static java.lang.String getExternalID(java.lang.String intID, int extIDType)
          Retrieves an external ID for a partner on the trading network.
static ID getExternalIDObject(java.lang.String intID, int extIDType)
          Retrieves an external ID object for a partner on the trading network.
static java.lang.String[] getExternalIDs(java.lang.String intID, int extIDType)
          Retrieves a set of external IDs for a partner on the trading network.
static java.lang.String getHostID()
           
static java.lang.String getHostID(java.sql.Connection conn)
          Retrieves the internally generated ID of the partner hosting the trading network.
static java.util.Hashtable getIDMap(int idType)
          Retrieves all external and internal IDs for a specified type as a map of external-to-internal IDs.
static int getIDTypeByPartnerIDID(java.sql.Connection conn, java.lang.String idKey)
          Retrieves external IDType from PartnerIDID, the primary key in PartnerID table.
static int getIDTypeByPartnerIDID(java.lang.String idKey)
          Retrieves external IDType from PartnerIDID, the primary key in PartnerID table.
static java.lang.String getInternalID(java.sql.Connection conn, java.lang.String extID, int extIDType)
          Retrieves the internal, TN-generated ID for a partner on the trading network.
static java.lang.String getInternalID(java.lang.String extID, int extIDType)
          Retrieves the internal, TN-generated ID for a partner on the trading network.
static java.lang.String getInternalIDByDestinationID(java.sql.Connection conn, java.lang.String destKey)
          Retrieves the internal, TN-generated ID for a parter on the trading network from supplied DestinationID, the primary key in Destination table.
static java.lang.String getInternalIDByDestinationID(java.lang.String destKey)
          Retrieves the internal, TN-generated ID for a parter on the trading network from supplied DestinationID, the primary key in Destination table.
static java.lang.String getInternalIDByPartnerIDID(java.sql.Connection conn, java.lang.String idKey)
          Retrieves the internal, TN-generated ID for a parter on the trading network from supplied PartnerIDID, the primary key in PartnerID table.
static java.lang.String getInternalIDByPartnerIDID(java.lang.String idKey)
          Retrieves the internal, TN-generated ID for a parter on the trading network from supplied PartnerIDID, the primary key in PartnerID table.
static java.lang.String[] getInternalIDsByDeleteStatus(int delStatus)
           
static java.lang.String[] getInternalIDsByGroup(java.lang.String groupID)
          Retrieves the internal, TN-generated IDs for all partners in the specified group
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileIDOps

public ProfileIDOps()
Method Detail

getHostID

public static java.lang.String getHostID()
                                  throws java.sql.SQLException,
                                         ProfileStoreException
Throws:
java.sql.SQLException
ProfileStoreException

getHostID

public static java.lang.String getHostID(java.sql.Connection conn)
                                  throws java.sql.SQLException,
                                         ProfileStoreException
Retrieves the internally generated ID of the partner hosting the trading network.

Parameters:
conn - an open connection to the Trading Networks database
Returns:
the host's ID
Throws:
ProfileStoreException - if the requested user does not exist in the database
java.sql.SQLException

getInternalID

public static java.lang.String getInternalID(java.lang.String extID,
                                             int extIDType)
                                      throws java.sql.SQLException,
                                             ProfileStoreException
Retrieves the internal, TN-generated ID for a partner on the trading network.

Parameters:
extID - an external ID for a partner
extIDType - the type of external ID
Returns:
the partner's internal, TN-generated ID
Throws:
java.sql.SQLException
ProfileStoreException

getInternalID

public static java.lang.String getInternalID(java.sql.Connection conn,
                                             java.lang.String extID,
                                             int extIDType)
                                      throws java.sql.SQLException,
                                             ProfileStoreException
Retrieves the internal, TN-generated ID for a partner on the trading network.

Parameters:
conn - an open connection to the Trading Network database
extID - an external ID for a partner
extIDType - the type of external ID (e.g. DUNS number)
Returns:
the partner's internal, TN-generated assigned ID
Throws:
java.sql.SQLException
ProfileStoreException

getExternalID

public static java.lang.String getExternalID(java.lang.String intID,
                                             int extIDType)
                                      throws java.sql.SQLException,
                                             ProfileStoreException
Retrieves an external ID for a partner on the trading network.

Parameters:
intID - the internal, TN-generated ID of the partner
extIDType - the type of external ID to retrieve. This must be a value found in the Type column of the PartnerID table
Returns:
an external ID for the partner
Throws:
java.sql.SQLException
ProfileStoreException

getExternalID

public static java.lang.String getExternalID(java.sql.Connection conn,
                                             java.lang.String intID,
                                             int extIDType)
                                      throws java.sql.SQLException,
                                             ProfileStoreException
Retrieves an external ID for a partner on the trading network.

Parameters:
conn - an open connection to the Trading Network database
intID - the internal, TN-generated ID of the partner
extIDType - the type of external ID to retrieve. This must be a value found in the Type column of the PartnerID table
Returns:
an external ID for the partner
Throws:
java.sql.SQLException
ProfileStoreException

getExternalIDs

public static java.lang.String[] getExternalIDs(java.lang.String intID,
                                                int extIDType)
                                         throws java.sql.SQLException,
                                                ProfileStoreException
Retrieves a set of external IDs for a partner on the trading network.

Parameters:
intID - the internal, TN-generated ID of the partner
extIDType - the type of external ID to retrieve. This must be a value found in the Type column of the PartnerID table
Returns:
all external IDs of the specified type for the partner
Throws:
java.sql.SQLException
ProfileStoreException

getIDMap

public static java.util.Hashtable getIDMap(int idType)
                                    throws java.sql.SQLException,
                                           ProfileStoreException
Retrieves all external and internal IDs for a specified type as a map of external-to-internal IDs.

Parameters:
conn - an open connection to the Trading Network database
idType - the type of IDs to retrieve. This must be a value found in the Type column of the PartnerID table
Returns:
a Hastable mapping external IDs to internal IDs
Throws:
java.sql.SQLException
ProfileStoreException

getInternalIDByPartnerIDID

public static java.lang.String getInternalIDByPartnerIDID(java.sql.Connection conn,
                                                          java.lang.String idKey)
                                                   throws java.sql.SQLException,
                                                          ProfileStoreException
Retrieves the internal, TN-generated ID for a parter on the trading network from supplied PartnerIDID, the primary key in PartnerID table.

Parameters:
conn - an open connection to the Trading Network database
idKey - PartnerIDID string, the primary key for the PartnerID table
Returns:
the partner's internal, TN-generated assigned ID
Throws:
java.sql.SQLException
ProfileStoreException

getInternalIDByPartnerIDID

public static java.lang.String getInternalIDByPartnerIDID(java.lang.String idKey)
                                                   throws java.sql.SQLException,
                                                          ProfileStoreException
Retrieves the internal, TN-generated ID for a parter on the trading network from supplied PartnerIDID, the primary key in PartnerID table.

Parameters:
idKey - PartnerIDID string, the primary key for the PartnerID table
Returns:
the partner's internal, TN-generated assigned ID
Throws:
java.sql.SQLException
ProfileStoreException

getInternalIDsByGroup

public static java.lang.String[] getInternalIDsByGroup(java.lang.String groupID)
                                                throws java.sql.SQLException,
                                                       ProfileStoreException
Retrieves the internal, TN-generated IDs for all partners in the specified group

Parameters:
groupID - ID of the partner Group, the primary key for the ProfileGroup table
Returns:
an array of internal, TN partner IDs
Throws:
java.sql.SQLException
ProfileStoreException

getInternalIDByDestinationID

public static java.lang.String getInternalIDByDestinationID(java.sql.Connection conn,
                                                            java.lang.String destKey)
                                                     throws java.sql.SQLException,
                                                            ProfileStoreException
Retrieves the internal, TN-generated ID for a parter on the trading network from supplied DestinationID, the primary key in Destination table.

Parameters:
conn - an open connection to the Trading Network database
destKey - DestinationID string, the primary key for the Destination table
Returns:
the partner's internal, TN-generated assigned ID
Throws:
java.sql.SQLException
ProfileStoreException

getInternalIDByDestinationID

public static java.lang.String getInternalIDByDestinationID(java.lang.String destKey)
                                                     throws java.sql.SQLException,
                                                            ProfileStoreException
Retrieves the internal, TN-generated ID for a parter on the trading network from supplied DestinationID, the primary key in Destination table.

Parameters:
destKey - DestinationID string, the primary key for the Destination table
Returns:
the partner's internal, TN-generated assigned ID
Throws:
java.sql.SQLException
ProfileStoreException

getIDTypeByPartnerIDID

public static int getIDTypeByPartnerIDID(java.sql.Connection conn,
                                         java.lang.String idKey)
                                  throws java.sql.SQLException,
                                         ProfileStoreException
Retrieves external IDType from PartnerIDID, the primary key in PartnerID table.

Parameters:
conn - an open connection to the Trading Network database
idKey - PartnerIDID string, the primary key for the PartnerID table
Returns:
int external IDType, return -1 if not found
Throws:
java.sql.SQLException
ProfileStoreException

getIDTypeByPartnerIDID

public static int getIDTypeByPartnerIDID(java.lang.String idKey)
                                  throws java.sql.SQLException,
                                         ProfileStoreException
Retrieves external IDType from PartnerIDID, the primary key in PartnerID table.

Parameters:
idKey - PartnerIDID string, the primary key for the PartnerID table
Returns:
int external IDType, return -1 if not found
Throws:
java.sql.SQLException
ProfileStoreException

getExternalIDObject

public static ID getExternalIDObject(java.lang.String intID,
                                     int extIDType)
                              throws java.sql.SQLException,
                                     ProfileStoreException
Retrieves an external ID object for a partner on the trading network.

Parameters:
intID - the internal, TN-generated ID of the partner
extIDType - the type of external ID to retrieve. This must be a value found in the Type column of the PartnerID table
Returns:
an external ID object for the partner
Throws:
java.sql.SQLException
ProfileStoreException

getInternalIDsByDeleteStatus

public static java.lang.String[] getInternalIDsByDeleteStatus(int delStatus)
                                                       throws java.sql.SQLException,
                                                              ProfileStoreException
Throws:
java.sql.SQLException
ProfileStoreException