com.novell.emframe.dev
Class MappingObject

java.lang.Object
  extended bycom.novell.emframe.dev.MappingObject

public class MappingObject
extends java.lang.Object

Class to map LDAP classes and attributes to NDAP classes and attributes and vice-versa.


Constructor Summary
MappingObject(ObjectEntry ncpServerOE, java.lang.String inipAddress, java.lang.String[] allNDSClassNames, java.lang.String[] allNDSAttrNames)
          Constructs a Mapping Object.
 
Method Summary
 int getLDAPClearPort()
          Get the clear TCP port associated with the LDAP server used to create the mapping tables.
 java.lang.String getLDAPIpAddress()
          Get the LDAP ip address that was used to create mapping tables.
 int getLDAPSSLPort()
          Get the SSL port associated with the LDAP server used to create the mapping tables.
 java.lang.String LDAPAttributeToNDS(java.lang.String LDAPAttributeName)
          Given the name of an LDAP attribute, return the corresponding NDS attribute.
 java.lang.String LDAPClassToNDS(java.lang.String LDAPClassName)
          Given the name of an LDAP class, return the corresponding NDS class.
static java.lang.String LDAPNameToNDSName(java.lang.String ldapDN_s)
          A static method to parse and convert a ldap name to a ndap name.
 java.lang.String LDAPNameToNDSName(java.lang.String ldapDN_s, boolean typed, boolean addTreeName)
          Given the LDAP name, return the corresponding NDS name in simple dot format.
 java.lang.String[] NDSAttributeToLDAP(java.lang.String NDSAttributeName)
          Given the name of an NDS attribute, return the corresponding LDAP attribute or attributes.
 java.lang.String[] NDSClassToLDAP(java.lang.String NDSClassName)
          Given the name of an NDS class, return the corresponding LDAP class or classes.
 java.lang.String NDSNameToLDAPName(ObjectEntry ndsOE)
          Given an ObjectEntry, return the corresponding LDAP name as a string.
 java.lang.String NDSNameToLDAPName(java.lang.String NDSName_s)
          Given the fully typed NDS, return the corresponding LDAP name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingObject

public MappingObject(ObjectEntry ncpServerOE,
                     java.lang.String inipAddress,
                     java.lang.String[] allNDSClassNames,
                     java.lang.String[] allNDSAttrNames)
              throws NamespaceException,
                     SPIException
Constructs a Mapping Object.

Parameters:
ncpServerOE - ObjectEntry to the NCP server which is used to get the LDAP server object and LDAP group object where the actual mapping attributes are stored.
inipAddress - String containing the ip address associated with this NCP server object. This value may be null if not known. Then null will be returned if it ever asked for.
allNDSClassNames - String array containing all NDS classes. This is to help so full mapping tables can be built. The NDS Mapping attribute on the LDAP group object is not complete. We use an algorithm to convert NDS class/attr names to LDAP names and put the "unmapped" names in the table.
allNDSAttrNames - - String array containing all NDS attributes. This is to help so full mapping tables can be built.
Throws:
NamespaceException
SPIException
Method Detail

getLDAPClearPort

public int getLDAPClearPort()
Get the clear TCP port associated with the LDAP server used to create the mapping tables. Default clear port is 389.

Returns:
int containing the LDAP port

getLDAPIpAddress

public java.lang.String getLDAPIpAddress()
Get the LDAP ip address that was used to create mapping tables.

Returns:
String containing the LDAP ip address

getLDAPSSLPort

public int getLDAPSSLPort()
Get the SSL port associated with the LDAP server used to create the mapping tables. Default SSL port is 636.

Returns:
int containing the LDAP SSL port

LDAPAttributeToNDS

public java.lang.String LDAPAttributeToNDS(java.lang.String LDAPAttributeName)
Given the name of an LDAP attribute, return the corresponding NDS attribute. If the LDAP name does not exist in the mapping tables, a null is returned. There is only one NDS name for each LDAP name. This is a case-insensitive lookup of the key name.

Parameters:
LDAPAttributeName - String containing the LDAP attribute name
Returns:
String containing the NDS attribute name or null

LDAPClassToNDS

public java.lang.String LDAPClassToNDS(java.lang.String LDAPClassName)
Given the name of an LDAP class, return the corresponding NDS class. If the LDAP name does not exist in the mapping tables, a null is returned. There is only one NDS name for each LDAP name. This is a case-insensitive lookup of the key name.

Parameters:
LDAPClassName - String containing the LDAP class name
Returns:
String containing the NDS class name or null

LDAPNameToNDSName

public static java.lang.String LDAPNameToNDSName(java.lang.String ldapDN_s)
A static method to parse and convert a ldap name to a ndap name. The NDAP name will come back on typless dot format. For Example "cn=admin,ou=provo,o=novell" will return "admin.provo.novell".

Parameters:
ldapDN_s - String containing the full LDAP DN to convert to a NDAP DN in "." only format
Returns:
String containing the NDS dn NDAP format with "." and without types

LDAPNameToNDSName

public java.lang.String LDAPNameToNDSName(java.lang.String ldapDN_s,
                                          boolean typed,
                                          boolean addTreeName)
Given the LDAP name, return the corresponding NDS name in simple dot format.

Parameters:
ldapDN_s - String containing a full LDAP DN to convert to an NDAP DN
typed - boolean: if true the method adds NDAP types to the returned NDAP name, false means no types
addTreeName - boolean: if true adds the tree name to the beginning, false does not
Returns:
String containing the NDS name

NDSAttributeToLDAP

public java.lang.String[] NDSAttributeToLDAP(java.lang.String NDSAttributeName)
Given the name of an NDS attribute, return the corresponding LDAP attribute or attributes. If the NDS name does not exist in the mapping tables, null is returned. Since it is possible to have multiple LDAP names that map to this NDS name, a string array is returned containing all of the mappings. The [0] element of the array should be considered the default mapping. If there is only one mapping it will be returned in the [0] element of the array. This is a case-insensitive lookup of the key name.

Parameters:
NDSAttributeName - String containing the NDS attribute name
Returns:
String array containing the matching LDAP attribute names with the [0] element of the array being the default

NDSClassToLDAP

public java.lang.String[] NDSClassToLDAP(java.lang.String NDSClassName)
Given the name of an NDS class, return the corresponding LDAP class or classes. If the NDS name does not exist in the mapping tables, null is returned. Since it is possible to have multiple LDAP names that map to this NDS name, a string array is returned containing all of the mappings. The [0] element of the array should be considered the default mapping. If there is only one mapping it will be returned in the [0] element of the array. This is a case-insensitive lookup of the key name.

Parameters:
NDSClassName - String containing the NDS class name
Returns:
String array containing the matching LDAP class names with the [0] element of the array being the default

NDSNameToLDAPName

public java.lang.String NDSNameToLDAPName(ObjectEntry ndsOE)
Given an ObjectEntry, return the corresponding LDAP name as a string. If more than 1 mapping exists for the class names, the default class name is used.

Parameters:
ndsOE - ObjectEntry containing a valid object in NDS
Returns:
String containing the LDAP name

NDSNameToLDAPName

public java.lang.String NDSNameToLDAPName(java.lang.String NDSName_s)
Given the fully typed NDS, return the corresponding LDAP name. If more than 1 mapping exists for the class names, the default class name is used.

Parameters:
NDSName_s - String containing a fully typed NDS name in "." format. It does not include the treeName as part of the name. Example: "CN=admin.OU=provo.O=novell"
Returns:
String containing the LDAP name


API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated September 2 2004 0111.