public class DirUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected com.novell.emframe.fw.authenticator.DirAuthenticator |
m_dirAuth |
protected AdminNamespace |
m_ns |
protected ObjectEntry |
treeOE |
| Constructor and Description |
|---|
DirUtils() |
| Modifier and Type | Method and Description |
|---|---|
void |
addASXMLFilterInfoToRM(FilterResultModifier rm,
java.lang.String[] typeNames,
java.lang.String filterXML,
MContext context)
Parses filterXML produced by Advanced Selection (AS) widget and adds filters to
a FilterResultModifier.
|
void |
addASXMLFilterInfoToRM(FilterResultModifier rm,
java.lang.String filterXML,
MContext context)
Parses filterXML (produced by AdvancedSelection widget) and adds a filter to FilterResultModifier
for each type of the types specified in the filterXML.
|
void |
addASXMLFilterInfoToRM(FilterResultModifier rm,
java.lang.String typeName,
java.lang.String filterXML,
MContext context)
Parses filterXML produced by Advanced Selection (AS) widget and adds a filter to
a FilterResultModifier.
|
static java.lang.String[] |
attributeReader(ObjectEntry oe,
java.lang.String[] attr)
Reads attribute values of an eDirectory object.
|
static void |
attributeWriter(ObjectEntry oe,
java.lang.String[] attr,
java.lang.String[] attrVal)
Sets attributes of an eDirectory object.
|
static NSObject |
createObject(ObjectEntry parentEntry,
java.lang.String objectName,
java.lang.String className,
java.lang.String namingAttr)
Simple API for creating eDirectory objects.
|
void |
createSortedTypeArrays(java.util.ArrayList types,
java.util.ArrayList localizedTypes,
MContext context)
Takes a list of ds types (classes) and returns a sorted list of localized types.
|
static NSObject |
createUser(java.lang.String className,
ObjectEntry parentEntry,
java.lang.String userStr,
java.lang.String surname)
Simple API for creating user objects.
|
static AdminNamespace |
getAdminNamespace(MContext context) |
java.util.ArrayList |
getAllSubClasses(java.lang.String[] superTypes)
Inspects the eDirectory schema and finds all sub classes (not just direct children).
|
static java.util.ArrayList |
getAllValues(MContext context,
java.lang.Object theObj,
TargetObjects targetObjs,
java.lang.String attrName) |
java.lang.String |
getAttributeDisplayName(java.lang.String attributeName,
MContext context)
Used for getting localized display name for an attributeName.
|
static java.util.ArrayList |
getCommonValues(MContext context,
java.lang.Object theObj,
TargetObjects targetObjs,
java.lang.String attrName)
Gets the values of the attribute attrName common to all the objects contained in targetObjects
|
java.lang.String[] |
getContainerTypes()
Returns a list of all container object classes in the tree.
|
static int |
getCount(ObjectEntryEnumeration oee)
Returns the could of an ObjectEntryEnumeration.
|
static java.lang.String |
getLeftMostName(AdminNamespace ns,
java.lang.String objectName)
Gets the left most part of a DN name.
|
static java.lang.String |
getLeftMostName(java.lang.String objectName)
Gets the left most part of a NDAP DN name.
|
MappingObject |
getMappingObject()
Table that maps ldap and ndap attribute names.
|
java.lang.String |
getObjectEntryImageName(ObjectEntry oe)
Returns a relative path to an icon matching the objectEntry.
|
java.lang.String |
getObjectTypeDisplayName(java.lang.String objectTypeName,
MContext context)
Used for getting localized display name for an objectTypeName.
|
java.lang.String |
getObjectTypeDisplayNameBody(java.lang.String objectTypeName,
MContext context)
Used for getting localized display name for an objectTypeName for the body of success message.
|
java.lang.String |
getObjectTypeImageName(java.lang.String typeName)
Returns a relative path to an icon matching the objectEntry.
|
java.lang.String |
getRealName(java.lang.String strSafeName)
Returns the real object name from a typename which contains no alpha-numeric characters.
|
static java.lang.String[] |
getRights(ObjectEntry targetOE,
ObjectEntry trusteeOE,
java.lang.String[] attrib)
Reads eDirectory rights.
|
java.lang.String |
getSafeName(java.lang.String typeName)
Returns typename which contains no alpha-numeric characters.
|
java.lang.String[] |
getSelectableContainerTypes()
Returns a list of the selectable container types.
|
java.lang.String[] |
getSelectableContainerTypes(java.util.HashSet excludeTypes)
Returns a list of the selectable container types except for the excluded list passed in.
|
java.lang.String[] |
getSelectableLeafTypes()
Returns a list of selectable leaf object types.
|
java.lang.String[] |
getSelectableLeafTypes(java.util.HashSet excludeTypes)
Returns a list of selectable leaf object types except for the excluded list passed in.
|
java.lang.String[] |
getSelectableTypes()
Returns a list of all selectable object types.
|
java.lang.String[] |
getSelectableTypes(java.util.HashSet excludeTypes)
Returns a list of all selectable object types except for the excluded list passed in.
|
java.lang.String[] |
getSortedAttributeDisplayNames(MContext context)
Returns a sorted list of attribute display names.
|
java.lang.String[] |
getSortedAttrs()
Returns a sorted list of attributes.
|
java.lang.String[] |
getSortedClasses()
Returns a sorted list of class names.
|
java.lang.String[] |
getSubClasses(java.lang.String strName)
Inspects schema and finds direct and indirect children sub classes (supports inheritance).
|
java.lang.String[] |
getSuperClasses(java.lang.String strName)
Inspects the eDirectory schema and finds all super classes (not just direct parents).
|
static java.lang.String |
getTree(MContext context)
Gets the tree name for eDir or the IP Address for NVDS
|
boolean |
getUniversalPwdState(java.lang.String containerStr)
Returns whether Universal Passwords are set for a specific container.
|
static java.lang.String |
getUserCN(MContext context)
Gets the CN attribute of the current User
|
boolean |
isAuxClass(java.lang.String typeName)
Determines whether a specified type/class is an auxiliary class.
|
boolean |
isContainer(java.lang.String objectType)
Returns whether an object type is a container.
|
static boolean |
isNVDS(MContext context)
Returns whether the directory in use is NVDS or not.
|
static boolean |
isObjectInThisTree(ObjectEntry oeTree,
java.lang.String objectFullName)
Tests if the DN has the tree name represnted by the ObjectEntry at the end of the DN.
|
boolean |
isOfAuxClass(ObjectEntry oe,
java.lang.String auxClass)
Determines whether a specified ObjectEntry has been extended with a specific auxClass.
|
static boolean |
isOfType(ObjectType type,
java.lang.String strKnownType,
boolean bDerivedOK)
Determines whether a given object type is of a known type or, optionally, whether it is derived from a known type.
|
static boolean |
MoveObject(ObjectEntry objectEntry,
ObjectEntry destObjectEntry,
boolean createAliasFlag)
Simple API for moving eDirectory object to a new container.
|
static java.lang.String |
readAttributeXML(MContext context,
java.lang.Object theObj,
java.lang.String attrName)
API for reading attributes and receiving values as XML; Used by EDAS.
|
void |
reinitialize()
Reinitializes the object.
|
static java.lang.String |
removeRightMostName(java.lang.String objectName)
Removed the right most part of a NDAP DN name.
|
static java.lang.String |
removeTreeFromFullName(ObjectEntry oeTree,
java.lang.String objectFullName)
Removes the tree name from a full DN (admin.novell.baggins_tree => admin.novell).
|
void |
reReadSchema(ObjectEntry treeOE) |
void |
resetInternalSchemaCache()
Clears out member variables.
|
void |
setSimplePassword(java.lang.String treeName,
java.lang.String userName,
java.lang.String newPassword,
boolean doDelay)
Sets the eDirectory simple password.
|
static void |
updateAndSyncBackLinks(NSObject nsobj)
Given an NSObject that with changes made to the Group Membership, Members, Secuirty Equals, etc
This method will update backlinks to other objects.
|
static void |
writeAttributeXML(MContext context,
java.lang.Object theObj,
java.lang.String attrName,
java.lang.String value)
API for writing values to NSObject or MOOManager thought XML; Used by EDAS.
|
protected com.novell.emframe.fw.authenticator.DirAuthenticator m_dirAuth
protected AdminNamespace m_ns
protected ObjectEntry treeOE
public static AdminNamespace getAdminNamespace(MContext context)
public java.lang.String[] getContainerTypes()
public java.lang.String[] getSelectableContainerTypes()
public java.lang.String[] getSelectableContainerTypes(java.util.HashSet excludeTypes)
excludeTypes - HashSet of object class names to not include in the list of selectable container typespublic java.lang.String[] getSelectableLeafTypes()
public java.lang.String[] getSelectableLeafTypes(java.util.HashSet excludeTypes)
excludeTypes - HashSet of object class names to not include in the list of selectable leaf typespublic java.lang.String[] getSelectableTypes()
public java.lang.String[] getSelectableTypes(java.util.HashSet excludeTypes)
excludeTypes - HashSet of object class names to not include in the list of selectable typespublic boolean isContainer(java.lang.String objectType)
objectType - String containing the object typepublic java.lang.String getObjectTypeDisplayName(java.lang.String objectTypeName,
MContext context)
objectTypeName - String containing the object type namecontext - MContext of the plug-inpublic java.lang.String getObjectTypeDisplayNameBody(java.lang.String objectTypeName,
MContext context)
objectTypeName - String containing the object type namecontext - MContext of the plug-inpublic java.lang.String getAttributeDisplayName(java.lang.String attributeName,
MContext context)
attributeName - String containing the attribute type namecontext - MContext of the plug-inpublic java.lang.String getObjectEntryImageName(ObjectEntry oe)
oe - ObjectEntry for which an icon is requestedpublic java.lang.String getObjectTypeImageName(java.lang.String typeName)
typeName - object class for which an icon is requestedpublic java.lang.String getSafeName(java.lang.String typeName)
typeName - String containing the typen namepublic static final java.lang.String readAttributeXML(MContext context, java.lang.Object theObj, java.lang.String attrName) throws eDirAccessServiceException
context - MContext of the plug-intheObj - Object must be NSObject or MOOManager to read data fromattrName - String containing the attribute to readeDirAccessServiceExceptionwriteAttributeXML(com.novell.emframe.dev.MContext, java.lang.Object, java.lang.String, java.lang.String)public static java.util.ArrayList getCommonValues(MContext context, java.lang.Object theObj, TargetObjects targetObjs, java.lang.String attrName)
context - MContext of the plug-intheObj - Object must be NSObject or MOOManager to read data fromtargetObjects - the set of multiple objects selectedattrName - String containing the attribute to readpublic static java.util.ArrayList getAllValues(MContext context, java.lang.Object theObj, TargetObjects targetObjs, java.lang.String attrName)
public static void writeAttributeXML(MContext context, java.lang.Object theObj, java.lang.String attrName, java.lang.String value) throws eDirAccessServiceException
context - MContext of the plug-intheObj - Object must be NSObject or MOOManagerattrName - String containing the name of attribute to setvalue - String containing the attribute value to seteDirAccessServiceExceptionreadAttributeXML(com.novell.emframe.dev.MContext, java.lang.Object, java.lang.String)public void reReadSchema(ObjectEntry treeOE)
public void reinitialize()
public void resetInternalSchemaCache()
public java.lang.String[] getSortedClasses()
public java.lang.String[] getSortedAttrs()
getSortedAttributeDisplayNames(com.novell.emframe.dev.MContext)public java.lang.String[] getSortedAttributeDisplayNames(MContext context)
context - MContext of the plug-ingetSortedAttrs()public java.lang.String[] getSuperClasses(java.lang.String strName)
throws NamespaceException
strName - String containing the name of objectClassNamespaceExceptionpublic java.util.ArrayList getAllSubClasses(java.lang.String[] superTypes)
superTypes - String array containing names of typespublic java.lang.String[] getSubClasses(java.lang.String strName)
strName - String containing name of object classpublic java.lang.String getRealName(java.lang.String strSafeName)
DirUtils.getSafeName.strSafeName - String containing safe name for class or attributegetSafeName(java.lang.String)public MappingObject getMappingObject()
public void addASXMLFilterInfoToRM(FilterResultModifier rm, java.lang.String filterXML, MContext context)
rm - FilterResultModifier filter to be used with get children callfilterXML - XML String produced by AdvancedSelection widgetcontext - MContext of the plug-inpublic void addASXMLFilterInfoToRM(FilterResultModifier rm, java.lang.String[] typeNames, java.lang.String filterXML, MContext context)
rm - FilterResultModifier filter to be used with get children calltypeNames - String[] representing the ds class names the xml filter will be applied to.filterXML - XML String produced by AdvancedSelection widgetcontext - MContext of the plug-inpublic void addASXMLFilterInfoToRM(FilterResultModifier rm, java.lang.String typeName, java.lang.String filterXML, MContext context)
rm - FilterResultModifier filter to be used with get children calltypeName - String representing the ds class the xml filter will be applied to.filterXML - XML String produced by AdvancedSelection widgetcontext - MContext of the plug-inpublic static NSObject createUser(java.lang.String className, ObjectEntry parentEntry, java.lang.String userStr, java.lang.String surname) throws NamespaceException, SPIException, SnapinVetoException
className - String containing class name of the user object to createparentEntry - ObjectEntry of the parent entry of the objectuserStr - String containing the user's name (mandatory attribute)surname - String containing the user's surname/last name (mandatory attribute)NamespaceException - thrown from the eMFrame NamespaceSPIException - thrown by the Java layerSnapinVetoException - thrown by the eMFrame shellpublic static NSObject createObject(ObjectEntry parentEntry, java.lang.String objectName, java.lang.String className, java.lang.String namingAttr) throws NamespaceException, SPIException, SnapinVetoException
parentEntry - ObjectEntry containing the parent entry of the objectobjectName - String containing the name of the object to be createdclassName - String containing the class name of the object to be creatednamingAttr - String containing the naming attribute for the object to be created (mandatory attribute)NamespaceException - thrown from the eMFrame NamespaceSPIException - thrown by the Java layerSnapinVetoException - thrown by the eMFrame shellpublic static void attributeWriter(ObjectEntry oe, java.lang.String[] attr, java.lang.String[] attrVal) throws NamespaceException, SPIException, SnapinVetoException, ComponentCreationException
This is a simple helper routine for easier setting of eDirectory attributes. This API does not support setting multi values for attributes. This API supports a limited set of attribute syntaxes (any syntax whose strategy can convert a String to an appriate value).
Supports Strings syntaxes like: Case Exact String, Case Ignore String, Email Address, etc Supports Boolean: values should be "true" or "false" Doesn't support many other syntaxes: Network Address, OctectList, Hold, etc For specific syntaxes view the javadoc for the appropriate Strategy (com.novell.admin.ns.nds package).
NOTE: this API is not recommend for use. While it is more simplistic, its current implemention is expensive (especially if only one or two attributes are being read).
oe - ObjectEntry representing the object to write toattr - String array that contains the names attributes to be writtenattrVal - String array that contains the values of attribute to writeNamespaceException - thrown from the eMFrame NamespaceSPIException - thrown by the Java layerSnapinVetoException - thrown by the eMFrame shellComponentCreationExceptionattributeReader(com.novell.application.console.snapin.ObjectEntry, java.lang.String[])public static java.lang.String[] attributeReader(ObjectEntry oe, java.lang.String[] attr) throws SPIException
This is a simple helper routine for easier reading of eDirectory attributes. This API does not support setting multi values for attributes. This API supports a limited set of attribute syntaxes (any syntax whose strategy can convert a attribute value to a String).
Supports Strings syntaxes like: Case Exact String, Case Ignore String, Email Address, etc Supports Boolean: values should be "true" or "false" Doesn't support many other syntaxes: Network Address, OctectList, Hold, etc For specific syntaxes view the javadoc for the appropriate Strategy (com.novell.admin.ns.nds package).
NOTE: this API is not recommend for use. While it is more simplistic, its current implemention is expensive (especially if only one or two attributes are being read).
oe - ObjectEntry for the object where the attribute residesattr - String array containing the attributes to be readSPIException - thrown by the Java layerattributeWriter(com.novell.application.console.snapin.ObjectEntry, java.lang.String[], java.lang.String[])public static boolean MoveObject(ObjectEntry objectEntry, ObjectEntry destObjectEntry, boolean createAliasFlag) throws NamespaceException, SPIException, SnapinVetoException
objectEntry - ObjectEntry of the source objectdestObjectEntry - ObjectEntry of the destination objectcreateAliasFlag - boolean indicates whether an alias should be created for the moved objectNamespaceException - thrown from the eMFrame NamespaceSPIException - thrown by the Java layerSnapinVetoException - thrown by the eMFrame shellpublic static boolean isObjectInThisTree(ObjectEntry oeTree, java.lang.String objectFullName)
oeTree - ObjectEntry containing the treeobjectFullName - String containing full DN including the tree name (ex. admin.novell.baggins_tree)public static java.lang.String removeTreeFromFullName(ObjectEntry oeTree, java.lang.String objectFullName)
oeTree - ObjectEntry containing the treeobjectFullName - String containing full DN including the tree name (ex. admin.novell.baggins_tree)public static java.lang.String removeRightMostName(java.lang.String objectName)
objectName - String containing the NDAP DN namepublic static java.lang.String getLeftMostName(java.lang.String objectName)
objectName - String containing the NDAP DN namepublic static java.lang.String getLeftMostName(AdminNamespace ns, java.lang.String objectName)
ns - AdminNamespaceobjectName - String containing the DN namepublic static boolean isOfType(ObjectType type, java.lang.String strKnownType, boolean bDerivedOK)
type - ObjectType to be checkedstrKnownType - String containing the name of the type to look forbDerivedOK - boolean set to true if the object type can be derived from the known type,
otherwise set to falsetrue if the object type is of the known type, false if otherwisepublic boolean isAuxClass(java.lang.String typeName)
typeName - String containing the object typetrue if the object type is an auxiliary class, false if otherwisepublic boolean isOfAuxClass(ObjectEntry oe, java.lang.String auxClass)
oe - ObjectEntry in questionauxClass - String containing the auxClass to be checked for.true if the object type has been extended with the auxiliary class,
false if otherwisepublic static int getCount(ObjectEntryEnumeration oee)
oee - ObjectEntryEnumeration to countpublic void createSortedTypeArrays(java.util.ArrayList types,
java.util.ArrayList localizedTypes,
MContext context)
types - ArrayList containing a list of ds types. Will be reordered to match the order in the localized
types array.localizedTypes - ArrayList that is empty where sorted localizated ds types (classes) will be placed.context - MContext of the plug-inpublic static final java.lang.String[] getRights(ObjectEntry targetOE, ObjectEntry trusteeOE, java.lang.String[] attrib) throws PageException
The possible return values are:
targetOE - ObjectEntry of the targettrusteeOE - ObjectEntry of the trusteeattrib - String array containing attribute namesPageExceptionpublic void setSimplePassword(java.lang.String treeName,
java.lang.String userName,
java.lang.String newPassword,
boolean doDelay)
throws PluginException
treeName - String containing the treename. This parameter is not used by the called routines but may not
be null.userName - String representing the user name in "." format without the tree name.
For example: "admin.provo.novell".newPassword - String containing the new password (extented characters should be fine)doDelay - boolean - if doing a create the object may not have been replicated to the partition
the LDAP extension is talking to. If true, this will wait and retry if a -601 occurs.PluginException - if there is a problem setting the passworld.public boolean getUniversalPwdState(java.lang.String containerStr)
throws PluginException
containerStr - String containing a "." formated string representing the container where to
begin checking if universal password is enabledPluginException - if an error occurs trying to determine if Univeral Password is enabledpublic static void updateAndSyncBackLinks(NSObject nsobj) throws PluginException
nsobj - PluginExceptionpublic static boolean isNVDS(MContext context)
context - public static java.lang.String getUserCN(MContext context) throws AuthNotAuthenticatedException
context - AuthNotAuthenticatedExceptionpublic static java.lang.String getTree(MContext context)
context -
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 ${TODAY} ${TSTAMP}.