com.wm.app.tn.db
Class Lookup

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

public class Lookup
extends java.lang.Object

Provides access to lookup tables in the trading networks database.


Field Summary
static int BINARYTYPE
           
static int CONTACTTYPE
           
static int GROUPID
           
static int IDTYPE
           
 
Constructor Summary
Lookup()
           
 
Method Summary
static short addGroup(short id, java.lang.String desc)
          Adds a new field group with specified ID.
static short addGroup(java.lang.String desc)
          Adds a new field group.
static int addLookupType(int lookupTbl, java.lang.Integer type, java.lang.String desc)
           
static java.lang.String addProfileGroup(java.lang.String profileGroupId, java.lang.String profileGroupName)
          Add a new row into ProfileGroup table.
static java.lang.String addProfileGroup(java.lang.String profileGroupId, java.lang.String profileGroupName, java.lang.String description)
          Add a new row into ProfileGroup table.
static boolean changeGroup(short id, java.lang.String desc)
          Changes an existing field group.
static void changeLookupType(int lookupTbl, java.lang.Integer type, java.lang.String desc)
           
static int changeProfileGroup(java.lang.String profileGroupId, java.lang.String profileGroupName)
          Update a row in ProfileGroup table.
static int changeProfileGroupDescription(java.lang.String profileGroupId, java.lang.String description)
           
static boolean deleteGroup(short id)
          Deletes a field group.
static int deleteProfileGroup(java.lang.String profileGroupId)
          Delete a row in ProfileGroup table.
static java.util.Hashtable getAllProfileGroups()
           
static java.util.Hashtable getBinaryTypes()
           
static java.util.Hashtable getBinaryTypes(java.sql.Connection conn)
           
static java.util.Hashtable getContactTypes()
           
static java.util.Hashtable getGroups()
           
static java.util.Hashtable getGroupsByName(java.lang.String name)
           
static java.lang.String getIDTypeDescription(int idType)
           
static java.util.Hashtable getIDTypeDescriptionHash()
           
static java.util.Hashtable getIDTypes()
           
static java.util.Hashtable getLookupHashByName(int lookupTbl, java.lang.String name)
           
static java.util.HashMap getProfileGroup(java.lang.String groupID)
           
static java.util.Hashtable getProfileGroups()
           
static byte[] getStoredQueries(int type, java.lang.String profileID)
           
static boolean isProfileGroupIdInUse(java.lang.String profileGroupId)
          Check if this profile group has any members.
static java.util.Hashtable queryProfileGroupbyName(java.lang.String profileGroupName)
           
static void removeLookupType(int lookupTbl, java.lang.Integer type)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTACTTYPE

public static final int CONTACTTYPE
See Also:
Constant Field Values

IDTYPE

public static final int IDTYPE
See Also:
Constant Field Values

BINARYTYPE

public static final int BINARYTYPE
See Also:
Constant Field Values

GROUPID

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

Lookup

public Lookup()
Method Detail

getContactTypes

public static java.util.Hashtable getContactTypes()
                                           throws java.sql.SQLException
Returns:
a Hashtable of all rows from the ContactType table. The hashtable keys are Contact Description and the values are the Contact Type codes.
Throws:
java.sql.SQLException

getIDTypes

public static java.util.Hashtable getIDTypes()
                                      throws java.sql.SQLException
Returns:
a Hashtable of all rows from the IDType table. The hashtable keys are ID Description and the values are the ID Type codes.
Throws:
java.sql.SQLException

getIDTypeDescription

public static java.lang.String getIDTypeDescription(int idType)
                                             throws java.sql.SQLException
Returns:
the String description associated with the supplied ID Type code
Throws:
java.sql.SQLException

getStoredQueries

public static byte[] getStoredQueries(int type,
                                      java.lang.String profileID)
                               throws java.sql.SQLException
Throws:
java.sql.SQLException

getIDTypeDescriptionHash

public static java.util.Hashtable getIDTypeDescriptionHash()
                                                    throws java.sql.SQLException
Returns:
a Hashtable of all rows from the IDType table. The Hashtable keys are the IDType codes and the values are the IDType Descriptions. Note that these key/values are the reverse of those returned by the getIDTypes method.
Throws:
java.sql.SQLException

getBinaryTypes

public static java.util.Hashtable getBinaryTypes()
                                          throws java.sql.SQLException
Returns:
a Hashtable of all rows from the BinaryType table. The hashtable keys are Contact Description and the values are the Contact Type codes.
Throws:
java.sql.SQLException

getBinaryTypes

public static java.util.Hashtable getBinaryTypes(java.sql.Connection conn)
                                          throws java.sql.SQLException
Returns:
a Hashtable of all rows from the BinaryType table. The hashtable keys are Contact Description and the values are the Contact Type codes.
Throws:
java.sql.SQLException

addLookupType

public static int addLookupType(int lookupTbl,
                                java.lang.Integer type,
                                java.lang.String desc)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

changeLookupType

public static void changeLookupType(int lookupTbl,
                                    java.lang.Integer type,
                                    java.lang.String desc)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

removeLookupType

public static void removeLookupType(int lookupTbl,
                                    java.lang.Integer type)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getGroups

public static java.util.Hashtable getGroups()
                                     throws java.sql.SQLException
Returns:
a Hashtable of all rows from the GroupID table. The hashtable keys are Group Descriptions and the values are the Group codes (datatype is Short).
Throws:
java.sql.SQLException

getGroupsByName

public static java.util.Hashtable getGroupsByName(java.lang.String name)
                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

addGroup

public static short addGroup(java.lang.String desc)
                      throws java.sql.SQLException
Adds a new field group.

Returns:
the ID of the new group
Throws:
java.sql.SQLException

addGroup

public static short addGroup(short id,
                             java.lang.String desc)
                      throws java.sql.SQLException
Adds a new field group with specified ID. For use by tnimport utlity.

Returns:
the ID of the new group
Throws:
java.sql.SQLException

changeGroup

public static boolean changeGroup(short id,
                                  java.lang.String desc)
                           throws java.sql.SQLException
Changes an existing field group.

Throws:
java.sql.SQLException

deleteGroup

public static boolean deleteGroup(short id)
                           throws java.sql.SQLException
Deletes a field group. If passed the ID of a field group that has associated fields an exception will be thrown.

Throws:
java.sql.SQLException

getLookupHashByName

public static java.util.Hashtable getLookupHashByName(int lookupTbl,
                                                      java.lang.String name)
                                               throws java.sql.SQLException
Throws:
java.sql.SQLException

getProfileGroups

public static java.util.Hashtable getProfileGroups()
                                            throws java.sql.SQLException
Returns:
a Hashtable of all rows from the ProfileGroup table. The hashtable keys are group names and the values are the group ids.
Throws:
java.sql.SQLException

getAllProfileGroups

public static java.util.Hashtable getAllProfileGroups()
                                               throws java.sql.SQLException
Throws:
java.sql.SQLException

getProfileGroup

public static java.util.HashMap getProfileGroup(java.lang.String groupID)
                                         throws java.sql.SQLException
Throws:
java.sql.SQLException

queryProfileGroupbyName

public static java.util.Hashtable queryProfileGroupbyName(java.lang.String profileGroupName)
                                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

addProfileGroup

public static java.lang.String addProfileGroup(java.lang.String profileGroupId,
                                               java.lang.String profileGroupName)
                                        throws java.sql.SQLException
Add a new row into ProfileGroup table.

Throws:
java.sql.SQLException

addProfileGroup

public static java.lang.String addProfileGroup(java.lang.String profileGroupId,
                                               java.lang.String profileGroupName,
                                               java.lang.String description)
                                        throws java.sql.SQLException
Add a new row into ProfileGroup table.

Throws:
java.sql.SQLException

changeProfileGroup

public static int changeProfileGroup(java.lang.String profileGroupId,
                                     java.lang.String profileGroupName)
                              throws java.sql.SQLException
Update a row in ProfileGroup table. Replace old group name with new group name.

Throws:
java.sql.SQLException

changeProfileGroupDescription

public static int changeProfileGroupDescription(java.lang.String profileGroupId,
                                                java.lang.String description)
                                         throws java.sql.SQLException
Throws:
java.sql.SQLException

deleteProfileGroup

public static int deleteProfileGroup(java.lang.String profileGroupId)
                              throws java.sql.SQLException
Delete a row in ProfileGroup table. ProflieStoreException thrown if that group is still in use in PartnerProfileGroup table.

Throws:
java.sql.SQLException

isProfileGroupIdInUse

public static boolean isProfileGroupIdInUse(java.lang.String profileGroupId)
                                     throws java.sql.SQLException
Check if this profile group has any members.

Throws:
java.sql.SQLException