wt.org
Class LDAPAttributeHolder

java.lang.Object
  extended bywt.org.LDAPAttributeHolder
All Implemented Interfaces:
AttributeHolder, Evolvable, Externalizable, RemoteAccess, Serializable

public class LDAPAttributeHolder
extends Object
implements RemoteAccess, AttributeHolder, Externalizable, Evolvable

This class is an LDAP (via JNDI) implementation of the attribute holding behavior. It is a read only attribute provider. Modifications to the attributes held by the LDAP server must be made directly with the server's own access tools.

The class is implemented using the javax.naming (JNDI) package from Sun. JNDI provides a generic interface to naming services. An additional package is required to provide access to a specific type of naming service, such as LDAP. In this case, another package from Sun implements the LDAP "provider" interface.

To use this class, additions to the wt.properties file are necessary. Following are some example entries for wt.properties:

 # java.naming.factory.initial - Specifies the specific naming server

 #    provider  implementation that is to be used.  In this case, an
 #    LDAP provider package factory.
 java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
 

# wt.org.LDAPServices - A comma seperated list of tags which represent # specific LDAP servers. The tags are used to specify specific # server properties below. In the R1 release of Windchill, this # property is ignored. Support for multiple servers will occur # in a future release. In R1, the wt.org.LDAPServices.default # property will be used to specify a single LDAP server. wt.org.LDAPServices=wt

# wt.org.LDAPServices.default - A single tag which represents an LDAP # server. The tag will be used below to specify other server # properties. wt.org.LDAPServices.default=wt

# wt.org.<server tag>.javaNamingProviderURL - The URL of the LDAP # server specified by the <server tag>. wt.org.wt.javaNamingProviderURL=ldap://ldap.windchill.com/o=Windchill Technology,c=US

# wt.org.<server tag>.attributeMappings - A list of mappings between # client attribute names and LDAP server attribute # names. The first character is the seperator character. Entries # come in pairs. The first part of the pair is the client attribute # name, the second part of the pair is an LDAP attribute name. wt.org.wt.attributeMappings=:login:uid:email:mailalternateaddress:

NOTE: All instances of this class are created via the WTUser class.



Supported API: false

Extendable: false

See Also:
WTUser, StandardAttributeHolder, Serialized Form

Field Summary
private static String CLASSNAME
          Deprecated.  
private  SerialDirContext directoryContext
          Deprecated.  
private  String distinguishedNameBase
          Deprecated.  
static long EXTERNALIZATION_VERSION_UID
          Deprecated.  
private static String FC_RESOURCE
          Deprecated.  
private static String INITIAL_CONTEXT_FACTORY
          Deprecated.  
private  String javaNamingAttributeMapping
          Deprecated.  
private static String javaNamingFactoryInitial
          Deprecated. .
private  String javaNamingProviderTag
          Deprecated.  
private  String javaNamingProviderURL
          Deprecated.  
private  Hashtable namingAttributeMap
          Deprecated.  
protected static long OLD_FORMAT_VERSION_UID
          Deprecated.  
private static String RESOURCE
          Deprecated.  
(package private) static long serialVersionUID
          Deprecated.  
(package private) static boolean SERVER
          Deprecated.  
private static boolean VERBOSE
          Deprecated.  
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
LDAPAttributeHolder()
          Deprecated.  
LDAPAttributeHolder(String name, String javaNamingProviderTag)
          Deprecated.  
 
Method Summary
protected  Enumeration _getAttrNames()
          Deprecated.  
protected  Object _getSingleValue(String attr_name)
          Deprecated.  
protected  Enumeration _getValues(String attr_name)
          Deprecated.  
 void addValue(String attr_name, Object value)
          Deprecated.  
private  String getAttributeMappings()
          Deprecated. Return a string of attribute mappings from wt.properties file.
 Enumeration getAttrNames()
          Deprecated.  
 SerialDirContext getDirectoryContext()
          Deprecated.  
protected  String getDistinguishedNameBase()
          Deprecated.  
protected  String getJavaNamingAttributeMapping()
          Deprecated.  
protected  String getJavaNamingProviderTag()
          Deprecated.  
protected  String getJavaNamingProviderURL()
          Deprecated.  
protected  Hashtable getNamingAttributeMap()
          Deprecated.  
 Object getSingleValue(String attr_name)
          Deprecated.  
 Enumeration getValues(String attr_name)
          Deprecated.  
protected  SerialDirContext initDirectoryContext()
          Deprecated. Create an LDAP naming server reference.
protected  void initNamingAttributeMap()
          Deprecated. Convert a string of attribute mappings to a Hashtable representation.
protected  String mapAttributeName(String attrName)
          Deprecated. Return attrName mapping as specified in the namingAttributeMap attribute Hashtable.
static Locale newLocale(String preferredLanguage)
          Deprecated. Given preferredLanague, return the a corresponding Locale object.
 void readExternal(ObjectInput input)
          Deprecated.  
private  void readMyFields(ObjectInput input)
          Deprecated.  
private  void readMyR3Fields(ObjectInput input)
          Deprecated.  
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Deprecated. Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(LDAPAttributeHolder thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Deprecated.  
 void removeAttribute(String attr_name)
          Deprecated.  
 void removeValue(String attr_name, Object value)
          Deprecated.  
 void replaceValue(String attr_name, Object value)
          Deprecated.  
protected  void setDirectoryContext(SerialDirContext a_DirectoryContext)
          Deprecated.  
protected  void setDistinguishedNameBase(String a_DistinguishedNameBase)
          Deprecated.  
protected  void setJavaNamingAttributeMapping(String a_JavaNamingAttributeMapping)
          Deprecated.  
protected  void setJavaNamingProviderTag(String a_JavaNamingProviderTag)
          Deprecated.  
protected  void setJavaNamingProviderURL(String a_JavaNamingProviderURL)
          Deprecated.  
protected  void setNamingAttributeMap(Hashtable a_NamingAttributeMap)
          Deprecated.  
 void setValue(String attr_name, Object value)
          Deprecated.  
private  int sizeEnumeration(Enumeration e)
          Deprecated. Returns the number of elements in an Enumeration object.
 String toString()
          Deprecated.  
 void updateAttributeMappings()
          Deprecated.  
 void writeExternal(ObjectOutput output)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
Deprecated. 
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME
Deprecated. 

distinguishedNameBase

private String distinguishedNameBase
Deprecated. 

javaNamingProviderURL

private String javaNamingProviderURL
Deprecated. 

javaNamingFactoryInitial

private static final String javaNamingFactoryInitial
Deprecated. 
. The specific naming server provider implementation that is to be used. In this case, an LDAP provider package factory is expected (com.sun.jndi.ldap.LdapCtxFactory).

See Also:
Constant Field Values

javaNamingProviderTag

private String javaNamingProviderTag
Deprecated. 

javaNamingAttributeMapping

private String javaNamingAttributeMapping
Deprecated. 

namingAttributeMap

private Hashtable namingAttributeMap
Deprecated. 

directoryContext

private SerialDirContext directoryContext
Deprecated. 

SERVER

static final boolean SERVER
Deprecated. 

FC_RESOURCE

private static final String FC_RESOURCE
Deprecated. 
See Also:
Constant Field Values

serialVersionUID

static final long serialVersionUID
Deprecated. 
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
Deprecated. 
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
Deprecated. 
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE
Deprecated. 

INITIAL_CONTEXT_FACTORY

private static String INITIAL_CONTEXT_FACTORY
Deprecated. 
Constructor Detail

LDAPAttributeHolder

public LDAPAttributeHolder(String name,
                           String javaNamingProviderTag)
                    throws WTException
Deprecated.  

Constructs an LDAPAttributeHolder using information supplied in the name and javaNamingProviderTag.

Supported API: false

Parameters:
name - The user login name, which is stored in the LDAP directory as the "uid".
javaNamingProviderTag - A "nickname" for an LDAP URL, as specified in wt.properties.
Throws:
WTException

LDAPAttributeHolder

public LDAPAttributeHolder()
                    throws WTException
Deprecated.  

No arg constructor. Intended for internal use only.

Supported API: false

Throws:
WTException
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Deprecated.  

Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Deprecated.  

Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(LDAPAttributeHolder thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Deprecated.  

Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Deprecated. 
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getDistinguishedNameBase

protected String getDistinguishedNameBase()
Deprecated.  

Gets the value of the attribute: distinguishedNameBase; . This is a string representation of a single LDAP attribute value pair. This pair is used as the most specific component of an LDAP Distinguished Name. Generally, it will be a "common name" pair, for example "cn=Darryn Kozak". But, it is possible that some servers may use user ID pairs instead. In that case the value would look like "uid=darryn".

Supported API: false

Returns:
String

setDistinguishedNameBase

protected void setDistinguishedNameBase(String a_DistinguishedNameBase)
Deprecated.  

Sets the value of the attribute: distinguishedNameBase; . This is a string representation of a single LDAP attribute value pair. This pair is used as the most specific component of an LDAP Distinguished Name. Generally, it will be a "common name" pair, for example "cn=Darryn Kozak". But, it is possible that some servers may use user ID pairs instead. In that case the value would look like "uid=darryn".

Supported API: false

Parameters:
a_DistinguishedNameBase -

getJavaNamingProviderURL

protected String getJavaNamingProviderURL()
Deprecated.  

Gets the value of the attribute: javaNamingProviderURL; . The URL of the user's LDAP server.

Supported API: false

Returns:
String

setJavaNamingProviderURL

protected void setJavaNamingProviderURL(String a_JavaNamingProviderURL)
Deprecated.  

Sets the value of the attribute: javaNamingProviderURL; . The URL of the user's LDAP server.

Supported API: false

Parameters:
a_JavaNamingProviderURL -

getJavaNamingProviderTag

protected String getJavaNamingProviderTag()
Deprecated.  

Gets the value of the attribute: javaNamingProviderTag; . A "nickname" for an LDAP URL, as specified in wt.properties.

Supported API: false

Returns:
String

setJavaNamingProviderTag

protected void setJavaNamingProviderTag(String a_JavaNamingProviderTag)
Deprecated.  

Sets the value of the attribute: javaNamingProviderTag; . A "nickname" for an LDAP URL, as specified in wt.properties.

Supported API: false

Parameters:
a_JavaNamingProviderTag -

getJavaNamingAttributeMapping

protected String getJavaNamingAttributeMapping()
Deprecated.  

Gets the value of the attribute: javaNamingAttributeMapping; . Mapping used when doing read operations on attributes. First char is the seperator char. Entries come in pairs. The first part of the pair is the client attribute name which will be substituted for the second part of the pair, an LDAP attribute name. The string is read from the wt.properties file property called wt.org.<server tag>.attributeMappings.

Supported API: false

Returns:
String

setJavaNamingAttributeMapping

protected void setJavaNamingAttributeMapping(String a_JavaNamingAttributeMapping)
Deprecated.  

Sets the value of the attribute: javaNamingAttributeMapping; . Mapping used when doing read operations on attributes. First char is the seperator char. Entries come in pairs. The first part of the pair is the client attribute name which will be substituted for the second part of the pair, an LDAP attribute name. The string is read from the wt.properties file property called wt.org.<server tag>.attributeMappings.

Supported API: false

Parameters:
a_JavaNamingAttributeMapping -

getNamingAttributeMap

protected Hashtable getNamingAttributeMap()
Deprecated.  

Gets the value of the attribute: namingAttributeMap; . A Hashtable representation of the javaNamingAttributeMapping string.

Supported API: false

Returns:
Hashtable

setNamingAttributeMap

protected void setNamingAttributeMap(Hashtable a_NamingAttributeMap)
Deprecated.  

Sets the value of the attribute: namingAttributeMap; . A Hashtable representation of the javaNamingAttributeMapping string.

Supported API: false

Parameters:
a_NamingAttributeMap -

getDirectoryContext

public SerialDirContext getDirectoryContext()
Deprecated.  

Gets the object for the association that plays role: directoryContext; . The starting context for performing directory operations.

Supported API: false

Returns:
SerialDirContext

setDirectoryContext

protected void setDirectoryContext(SerialDirContext a_DirectoryContext)
Deprecated.  

Sets the object for the association that plays role: directoryContext; . The starting context for performing directory operations.

Supported API: false

Parameters:
a_DirectoryContext -

getValues

public Enumeration getValues(String attr_name)
                      throws WTException
Deprecated.  

Returns the values associated with a given attribute name. Each element of the enumeration is a possibly null Object. The object's class is the class of the attribute value.

Supported API: false

Specified by:
getValues in interface AttributeHolder
Parameters:
attr_name -
Returns:
Enumeration
Throws:
WTException

_getValues

protected Enumeration _getValues(String attr_name)
                          throws WTException
Deprecated.  

Returns the values associated with a given attribute name. Each element of the enumeration is a possibly null Object. The object's class is the class of the attribute value.

Supported API: false

Parameters:
attr_name -
Returns:
Enumeration
Throws:
WTException

getSingleValue

public Object getSingleValue(String attr_name)
                      throws WTException
Deprecated.  

Return one value associated with the attribute name. Handy method if one knows that the attribute holds just a single value. Returns null if no value is associated with the attribute.

Supported API: false

Specified by:
getSingleValue in interface AttributeHolder
Parameters:
attr_name -
Returns:
Object
Throws:
WTException

_getSingleValue

protected Object _getSingleValue(String attr_name)
                          throws WTException
Deprecated.  

Return one value associated with the attribute name. Handy method if one knows that the attribute holds just a single value. Returns null if no value is associated with the attribute.

Supported API: false

Parameters:
attr_name -
Returns:
Object
Throws:
WTException

getAttrNames

public Enumeration getAttrNames()
                         throws WTException
Deprecated.  

Returns all names of the attributes held by the object.

Each element of the enumeration is of class String.

Supported API: false

Specified by:
getAttrNames in interface AttributeHolder
Returns:
Enumeration
Throws:
WTException

_getAttrNames

protected Enumeration _getAttrNames()
                             throws WTException
Deprecated.  

Returns all names of the attributes held by the object.

Each element of the enumeration is of class String.

Supported API: false

Returns:
Enumeration
Throws:
WTException

addValue

public void addValue(String attr_name,
                     Object value)
              throws WTException
Deprecated.  

NOTE: This method is not functional for the LDAPAttributeHolder class, and if called will throw an exception.

Add a new value given the attribute name. Similar to the "set" method only that multiple values are allowed.

Supported API: false

Specified by:
addValue in interface AttributeHolder
Parameters:
attr_name -
value -
Throws:
WTException

setValue

public void setValue(String attr_name,
                     Object value)
              throws WTException
Deprecated.  

NOTE: This method is not functional for the LDAPAttributeHolder class, and if called will throw an exception.

Replace object for all the current values of the attribute.

Supported API: false

Specified by:
setValue in interface AttributeHolder
Parameters:
attr_name -
value -
Throws:
WTException

replaceValue

public void replaceValue(String attr_name,
                         Object value)
                  throws WTException
Deprecated.  

NOTE: This method is not functional for the LDAPAttributeHolder class, and if called will throw an exception.

Replace object for all the current values of the attribute.

Supported API: false

Specified by:
replaceValue in interface AttributeHolder
Parameters:
attr_name -
value -
Throws:
WTException

removeValue

public void removeValue(String attr_name,
                        Object value)
                 throws WTException
Deprecated.  

NOTE: This method is not functional for the LDAPAttributeHolder class, and if called will throw an exception.

Removes a specific value from the attribute. If the value is the last one the attribute is removed as well.

Supported API: false

Specified by:
removeValue in interface AttributeHolder
Parameters:
attr_name -
value -
Throws:
WTException

removeAttribute

public void removeAttribute(String attr_name)
                     throws WTException
Deprecated.  

NOTE: This method is not functional for the LDAPAttributeHolder class, and if called will throw an exception.

Removes an attribute from the object (with all its values).

Supported API: false

Specified by:
removeAttribute in interface AttributeHolder
Parameters:
attr_name -
Throws:
WTException

toString

public String toString()
Deprecated.  

Creates string representation of the attribute holder.

Supported API: false

Specified by:
toString in interface AttributeHolder
Returns:
String

updateAttributeMappings

public void updateAttributeMappings()
                             throws ExternalDirectoryException
Deprecated.  

Update javaNamingAttributeMapping and namingAttributeMap instance variables from wt.properties. These variables are persisted with the WTUser object at the time it is created. If the wt.properties entries change, then this method can be called to update the variables.

Supported API: false

Throws:
ExternalDirectoryException

initDirectoryContext

protected SerialDirContext initDirectoryContext()
                                         throws WTException
Deprecated. 
Create an LDAP naming server reference. Given a naming service provider specification and an LDAP server URL (both from the wt.properties file), this method returns an object which serves as a reference to an LDAP naming server.

Throws:
WTException

mapAttributeName

protected String mapAttributeName(String attrName)
Deprecated. 
Return attrName mapping as specified in the namingAttributeMap attribute Hashtable. If there is no mapping, then attrName is returned.


initNamingAttributeMap

protected void initNamingAttributeMap()
Deprecated. 
Convert a string of attribute mappings to a Hashtable representation. Gets the string from the javaNamingAttributeMapping attribute and sets namingAttributeMap attribute with the Hashtable. The string is originally read from the wt.properties file. The first character is the seperator character. Entries come in pairs. The first part of the pair is the client attribute name, the second part of the pair is an LDAP attribute name.


getAttributeMappings

private String getAttributeMappings()
                             throws ExternalDirectoryException
Deprecated. 
Return a string of attribute mappings from wt.properties file. Concatenates the wt.org.LDAPServices.default.attributeMappings and wt.org..attributeMappings properties into one string and returns that.

Throws:
ExternalDirectoryException

sizeEnumeration

private int sizeEnumeration(Enumeration e)
Deprecated. 
Returns the number of elements in an Enumeration object.


newLocale

public static Locale newLocale(String preferredLanguage)
                        throws ExternalDirectoryException
Deprecated. 
Given preferredLanague, return the a corresponding Locale object. preferredLanague is a string of the form used by LDAP. For example: en-US de-DE de-CH no-NO-B

Throws:
ExternalDirectoryException

readMyR3Fields

private void readMyR3Fields(ObjectInput input)
                     throws IOException,
                            ClassNotFoundException
Deprecated. 
Throws:
IOException
ClassNotFoundException

readMyFields

private void readMyFields(ObjectInput input)
                   throws IOException,
                          ClassNotFoundException
Deprecated. 
Throws:
IOException
ClassNotFoundException