gov.lanl.Database
Class JNDIConfig

java.lang.Object
  |
  +--gov.lanl.Database.JNDIConfig

public class JNDIConfig
extends java.lang.Object

Class declaration

 

Constructor Summary
JNDIConfig()
           
 
Method Summary
static java.lang.String escapeDistinguishedName(java.lang.String dn)
          Given a Distinguished Name, check for any '/' characters and escape them
static java.util.Vector getContainers(java.lang.Object obj)
          Given a class object, get its containers
static java.lang.String getDistinguishedName(java.lang.Object obj)
          Given a class object, get its JNDI Distinguished Name
static java.lang.String getDistinguishedName(java.lang.Object obj, java.lang.String attribute_name, java.lang.String ClassInstanceName)
          Given a class object template, attribute name, and a class instance name, get the JNDI Distinguished Name Return null if it does not have enough information or if the attribute name is not the distinguished name attribute
static java.lang.String getDNAttributeName(java.lang.Object obj)
          Given a class object, get the attribute name for the Distinguished Name attribute.
static java.lang.String getJNDIClassObjectClassName(java.lang.Object obj)
          Given a class object, get its Database Objectclass name
static java.lang.String getJNDIName(java.lang.Object obj)
          Given a class object, get its JNDI name
static java.lang.String getJNDINameSuffix()
          Get the name suffix for this database
static java.lang.String getJNDIObjectClassName()
          Get the name objectclass name for this database
static java.lang.String getJNDIObjectTypeAttributeName()
          Get the name object type attribute name for this database
static java.lang.String getJNDIUtilityObjectClassName()
          Get the name of the PIDS Utility Object Class
static java.lang.Object getObjectAttribute(java.lang.Object obj, java.lang.String attribute_name)
          Given a class object and an attribute name for that object, get the attribute value from the object.
static gov.lanl.Database.ObjectFactory getObjectFactory()
          Get the ObjectFactory for this database
static java.lang.String getUtilityEntryDN()
          Get the utility entry for this database
static void readConfigFile(java.lang.String ConfigFilename, int debug_level)
          Read the config file and store its information
static void setObjectAttribute(java.lang.Object obj, java.lang.String attribute_name, java.lang.Object new_value)
          Given a class object and an attribute name for that object, set the attribute of the object
static java.lang.String translateAttributeName(java.lang.String object_classname, java.lang.String attribute_name)
          Translate a class attribute name to an JNDI name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNDIConfig

public JNDIConfig()
Method Detail

readConfigFile

public static void readConfigFile(java.lang.String ConfigFilename,
                                  int debug_level)
                           throws java.io.IOException
Read the config file and store its information

java.io.IOException
Parameters:
ConfigFilename - a string containing the name of the config file

getJNDINameSuffix

public static java.lang.String getJNDINameSuffix()
Get the name suffix for this database


getJNDIObjectClassName

public static java.lang.String getJNDIObjectClassName()
Get the name objectclass name for this database


getJNDIObjectTypeAttributeName

public static java.lang.String getJNDIObjectTypeAttributeName()
Get the name object type attribute name for this database


getUtilityEntryDN

public static java.lang.String getUtilityEntryDN()
Get the utility entry for this database


getJNDIUtilityObjectClassName

public static java.lang.String getJNDIUtilityObjectClassName()
Get the name of the PIDS Utility Object Class


getObjectFactory

public static gov.lanl.Database.ObjectFactory getObjectFactory()
Get the ObjectFactory for this database


getJNDIName

public static java.lang.String getJNDIName(java.lang.Object obj)
Given a class object, get its JNDI name

Parameters:
obj - The object to be named
Returns:
The JNDI name for this object

getJNDIClassObjectClassName

public static java.lang.String getJNDIClassObjectClassName(java.lang.Object obj)
Given a class object, get its Database Objectclass name

Parameters:
obj - The object to be named
Returns:
The database objectclass name for this object

getDNAttributeName

public static java.lang.String getDNAttributeName(java.lang.Object obj)
Given a class object, get the attribute name for the Distinguished Name attribute.

Parameters:
obj - The object to be named
Returns:
The attribute holding the Distinguished Name for this object

getDistinguishedName

public static java.lang.String getDistinguishedName(java.lang.Object obj,
                                                    java.lang.String attribute_name,
                                                    java.lang.String ClassInstanceName)
Given a class object template, attribute name, and a class instance name, get the JNDI Distinguished Name Return null if it does not have enough information or if the attribute name is not the distinguished name attribute

Parameters:
obj - The object class template or object
attribute_name - The name of the attribute containing the name
ClassInstanceName - The name of the instance of this attribute
Returns:
The Distinguished Name for this object

getDistinguishedName

public static java.lang.String getDistinguishedName(java.lang.Object obj)
Given a class object, get its JNDI Distinguished Name

Parameters:
obj - The object to be named
Returns:
The Distinguished Name of the object

getContainers

public static java.util.Vector getContainers(java.lang.Object obj)
Given a class object, get its containers

Parameters:
obj - The object holding the containers
Returns:
A vector of strings, each string has three values separated by semicolons: type of container, objects contained, and attribute name

getObjectAttribute

public static java.lang.Object getObjectAttribute(java.lang.Object obj,
                                                  java.lang.String attribute_name)
Given a class object and an attribute name for that object, get the attribute value from the object.

Parameters:
obj - The object containing the attribute
attribute_name - The name of the attribute to be read
Returns:
The value of the attribute in the object

setObjectAttribute

public static void setObjectAttribute(java.lang.Object obj,
                                      java.lang.String attribute_name,
                                      java.lang.Object new_value)
Given a class object and an attribute name for that object, set the attribute of the object

Parameters:
obj - The object containing the attribute
attribute_name - The name of the attribute to be set

translateAttributeName

public static java.lang.String translateAttributeName(java.lang.String object_classname,
                                                      java.lang.String attribute_name)
Translate a class attribute name to an JNDI name

Parameters:
object_classname - The name of the class containing this attribute
attribute_name - The name of the attribute that is to be translated
Returns:
The translated attribute name for JNDI

escapeDistinguishedName

public static java.lang.String escapeDistinguishedName(java.lang.String dn)
Given a Distinguished Name, check for any '/' characters and escape them

Parameters:
dn - The Distinguished Name that is to be checked
Returns:
The Distinguished Name with '/' characters escaped