|
Oracle Internet Directory API Reference 11g Release 1 (11.1.1) E10664-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ldap.util.Util
public class Util
Util
class provides a set of static utility methods that are used throughout the oracle.ldap.util
package. Many of these APIs are generic LDAP methods that are extremely useful in performing LDAP operations.
Field Summary | |
---|---|
static java.lang.String |
API_VERSION The API version number |
static int |
CREDTYPE_PASSWD Using userpassword to authenticate |
static java.lang.String |
DASURL_ACCOUNT_INFO DAS URL type - Account Info |
static java.lang.String |
DASURL_BASE DAS URL type - Base URL |
static java.lang.String |
DASURL_CREATE_GROUP DAS URL type - Create Group |
static java.lang.String |
DASURL_CREATE_RESOURCE DAS URL type - Create Resource |
static java.lang.String |
DASURL_CREATE_USER DAS URL type - Create User |
static java.lang.String |
DASURL_DELEGATION_CONSOLE DAS URL type - Delegation Console |
static java.lang.String |
DASURL_DELETE_GROUP DAS URL type - Delete Group |
static java.lang.String |
DASURL_DELETE_GROUP_GIVEN_GUID DAS URL type - Delete Group Given GUID |
static java.lang.String |
DASURL_DELETE_USER DAS URL type - Delete User |
static java.lang.String |
DASURL_DELETE_USER_GIVEN_GUID DAS URL type - Delete User Given GUID |
static java.lang.String |
DASURL_EDIT_GROUP DAS URL type - Edit Group |
static java.lang.String |
DASURL_EDIT_GROUP_GIVEN_GUID DAS URL type - Edit Group Given GUID |
static java.lang.String |
DASURL_EDIT_MY_PROFILE DAS URL type - Edit My Profile |
static java.lang.String |
DASURL_EDIT_USER DAS URL type - Edit User |
static java.lang.String |
DASURL_EDIT_USER_GIVEN_GUID DAS URL type - Edit User Given GUID |
static java.lang.String |
DASURL_EUS_CONSOLE DAS URL type - EUS Console |
static java.lang.String |
DASURL_GROUP_LOV DAS URL type - Group LOV |
static java.lang.String |
DASURL_GROUP_PRIVILEGE DAS URL type - Group Privilege |
static java.lang.String |
DASURL_GROUP_PRIVILEGE_GIVEN_GUID DAS URL type - Group Privilege Given GUID |
static java.lang.String |
DASURL_GROUP_SEARCH DAS URL type - Group Search |
static java.lang.String |
DASURL_PASSWORD_CHANGE DAS URL type - Password Change |
static java.lang.String |
DASURL_RESET_PASSWORD DAS URL type - Reset Password |
static java.lang.String |
DASURL_TIMEZONE DAS URL type - Time Zone |
static java.lang.String |
DASURL_USER_LOV DAS URL type - User Lov |
static java.lang.String |
DASURL_USER_PRIVILEGE DAS URL type - User Privilege |
static java.lang.String |
DASURL_USER_PRIVILEGE_GIVEN_GUID DAS URL type - User Privilege Given GUID |
static java.lang.String |
DASURL_USER_SEARCH DAS URL type - User Search |
static java.lang.String |
DASURL_VIEW_USER_PROFILE DAS URL type - View User Profile |
static int |
FILE_CREATEABLE Constant to indicate the check for the ability to create the file. |
static int |
FILE_EXISTENCE Constant to indicate the check for existence of a file. |
static int |
FILE_NOT_EMPTY Constant to indicate the check for non-emptiness of a file. |
static int |
FILE_NOT_EXISTENCE Constant to indicate the check for not existence of a file. |
static int |
FILE_READABLE Constant to indicate the check for readablity of a file. |
static int |
FILE_WRITABLE Constant to indicate the check for writability of a file. |
static int |
IDTYPE_DEFAULT Use default value |
static int |
IDTYPE_DN The id type used is a DN |
static int |
IDTYPE_FILTER The id type used is a filter |
static int |
IDTYPE_GUID The id type used is a GUID |
static int |
IDTYPE_KERB_PRINCIPAL The id type used is a Kerberos Principal |
static int |
IDTYPE_SIMPLE The id type used is a simple id |
static int |
IDTYPE_WINDOWS The id type used is a Windows user id |
static java.lang.String |
INTERFACE_VERSION The Interface version number |
static int |
PROPERTIES_DETACHED User detached properties |
static int |
PROPERTIES_ENTRY User entry properties |
static int |
PWD_VERIFIERTYPE_COMMON The Common Password Verifier |
Constructor Summary | |
---|---|
Util() |
Method Summary | |
---|---|
static void |
addUniquemember(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String memberDn) |
static void |
authenticateUser(javax.naming.directory.DirContext ctx, User curUser, int authType, java.lang.Object cred) Authenticate User using the appropriate credentials |
static void |
bulkDelete(javax.naming.directory.DirContext ctx, java.lang.String base, boolean deleteBaseDN) Deletes the entire sub-tree from the base DN. |
static boolean |
checkInterfaceVersion(java.lang.String intVersion) This method checks if the interface version given is supported with the version of the current API |
static java.lang.String |
createDN(javax.naming.directory.DirContext ctx, java.lang.String inDN) |
static boolean |
dnExists(javax.naming.directory.DirContext ctx, java.lang.String dn) Returns true if the given DN exists |
static PropertySetCollection |
dnExists(javax.naming.directory.DirContext ctx, java.lang.String dn, java.lang.String[] attrs) Returns a non-null PropertySetCollection if DN exists. |
static java.util.Hashtable |
getAllDASUrl(javax.naming.directory.DirContext ctx) Returns a Hashtable containing all the DAS URLs. |
static java.lang.String |
getAttrOfRDN(java.lang.String rdn) Returns the attribute part of the RDN For example, if rdn is "dc=acme", "dc" will be returned |
static java.lang.String |
getAttrValueOfRDN(java.lang.String rdn) Returns the value part of the RDN For example, if rdn is "dc=acme", "acme" will be retuned |
static java.lang.String |
getDASUrl(javax.naming.directory.DirContext ctx, java.lang.String urlTypeDN) Returns a particular DAS url identified by the urlTypeDN. |
static java.lang.String[] |
getDefaultSubscriber() |
static java.lang.String[] |
getDefaultSubscriber(java.util.logging.Logger lgr) |
static java.lang.String |
getDomain() |
static java.lang.String |
getDomain(java.util.logging.Logger lgr) |
static PropertySetCollection |
getEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String filter, int scope, java.lang.String[] attrList) |
static java.lang.Object |
getEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String filter, int scope, java.lang.String[] attrList, boolean convert) |
static java.lang.Object |
getEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String filter, javax.naming.directory.SearchControls ctls) getEntryDetails |
static LDIFRecord |
getEntryFromDirectory(javax.naming.directory.DirContext dirCtx, java.lang.String dn) Use this method to retrieve the a particular entry from the directory. |
static java.lang.String |
getFQHN() Returns the Fully Qualified Host Name of the local machine. |
static PropertySetCollection |
getGroupMembership(javax.naming.directory.DirContext ctx, java.lang.String dn, java.lang.String[] attrList, boolean nested) |
static PropertySetCollection |
getGroupMembership(javax.naming.directory.DirContext ctx, java.lang.String dn, java.lang.String[] attrList, boolean nested, java.lang.String memberAttribute) Returns a PropertySetCollection of groups that the dn belongs to directly or indirectly. |
static PropertySetCollection |
getGroupMembership(javax.naming.directory.DirContext ctx, User curUser, java.lang.String[] attrList, boolean nested) Return a list of groups the user belongs to directly or indirectly The groups are returned in a PropertySetCollection . |
static java.lang.String |
getIAC_DNFromFQHN() Returns a DN based on the fully qualified host name. |
static LDIFRecord |
getLDIFRecord(java.lang.String dn, javax.naming.directory.Attributes pAttrs) Use this method to convert a set of attributes and a DN into an LDIFRecord |
static LDAPObjectClass |
getObjectClass(javax.naming.directory.DirContext ctx, java.lang.String inID) Returns a LDAPObjectClass object representing the objectclass identified by inID. |
static PropertySetCollection |
getOwnership(javax.naming.directory.DirContext ctx, java.lang.String dn, java.lang.String[] attrList, boolean nested) Returns a PropertySetCollection of DNs where the input DN is an owner. |
protected static PropertySetCollection |
getOwnership(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String dn, java.lang.String[] attrList, boolean nested) |
static PropertySetCollection |
getOwnership(javax.naming.directory.DirContext ctx, User curUser, java.lang.String[] attrList, boolean nested) Returns a PropertySetCollection of DNs where the user is an owner. |
static java.lang.String |
getParameterFromFile(java.lang.String parameter, java.lang.String fileName) Returns the value of the parameter from file. |
static java.lang.String |
getParentDN(java.lang.String dn) Returns the parent DN of the given DN For example, if dn is "dc=acme,dc=com", getParentDN returns "dc=com". |
static java.lang.String |
getRDN(java.lang.String dn) Returns the RDN portion of the DN. |
static java.lang.String[] |
getSSODBInfo(javax.naming.directory.DirContext ctx) |
static java.lang.String |
getSubscriberDn(javax.naming.directory.DirContext ctx, java.lang.String subId, int subIdType) |
static java.lang.String |
getSubscriberDn(javax.naming.directory.DirContext ctx, java.lang.String subId, int subIdType, java.util.logging.Logger lgr) Deprecated. Use Subscriber.getDN(ctx) |
static java.lang.String |
getUserDn(javax.naming.directory.DirContext ctx, java.lang.String userId, int userIdType, java.lang.String subscriberDN) Returns the DN of the given user. |
protected static void |
grpErrHandler(javax.naming.NamingException ne, UtilException ue) |
static java.lang.String |
handleSpecialChars(java.lang.String originalString) handleSpecialChars for the string value after '=' of a filter If the string value should contain one of the characters of this set { '*', ')', '(', '\', NULL}, this operation adds an escape '\' character (ASCII 0x5c) followed by the two hexadecimal digits representing the ASCII value of the encoded character. |
static java.lang.String |
handleSpecialFilterChars(java.lang.String originalString) |
static void |
ldapAdd(javax.naming.directory.DirContext ctx, java.lang.String base, ModPropertySet ps) Performs ldapadd and creates a new entry specified by the base DN. |
static boolean |
ldapCompare(javax.naming.directory.DirContext ctx, java.lang.String baseDN, java.lang.String attr, java.lang.Object attrval) Performs ldapcompare on the specified baseDN comparing the attribute and its value as specified |
static void |
ldapDelete(javax.naming.directory.DirContext ctx, java.lang.String base) Performs ldapdelete of the base DN. |
static void |
ldapModify(javax.naming.directory.DirContext ctx, java.util.logging.Logger lgr, java.lang.String fileName, java.util.Vector subVector, boolean ignoreError) Performs ldapmodify using the specified LDIF file. |
static void |
ldapModify(javax.naming.directory.DirContext ctx, java.util.logging.Logger lgr, java.lang.String fileName, java.util.Vector subVector, boolean ignoreError, java.io.PrintStream pStream) Performs ldapmodify using the specified LDIF file. |
static void |
ldapModify(javax.naming.directory.DirContext ctx, java.lang.String base, ModPropertySet ps) Performs ldapmodify on the base DN using the ModPropertySet specified. |
static void |
ldapModify(javax.naming.directory.DirContext ctx, java.lang.String fileName, java.util.Vector subVector, boolean ignoreError) |
static void |
ldapModify(javax.naming.directory.DirContext ctx, java.lang.String fileName, java.util.Vector subVector, boolean ignoreError, java.io.PrintStream pStream) |
static PropertySetCollection |
ldapSearch(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String filter, int scope, java.lang.String[] attrList) Performs an ldapsearch with the specified information. |
static java.lang.String |
makeFilter(java.lang.String attr, java.lang.String value) makeFilter |
static PropertySetCollection |
multiSearchBaseSearch(javax.naming.directory.DirContext ctx, java.lang.String specifiedSearchBase, java.lang.String[] allSearchBases, java.lang.String filter, java.lang.String[] attrList, boolean returnONE) |
static java.lang.String |
normalizeDN(java.lang.String inDN) Normalizes the DN. |
static java.lang.String |
normalizeDN(java.lang.String inDN, java.lang.String[] attrList) Normalizes the DN and ensures that it only contains the attributes from the attrList. |
static void |
performLDAPOperation(javax.naming.directory.DirContext dirCtx, LDIFRecord ldifRecord) Use this method to perform an LDAP operation. |
static void |
printResults(PropertySetCollection resultSet) Prints the entries represented by the PropertySetCollecition in LDIF format to Standard Output |
static void |
removeUniquemember(javax.naming.directory.DirContext ctx, Group[] groupArr, java.lang.String memberDn) |
static void |
removeUniquemember(javax.naming.directory.DirContext ctx, Group group, java.lang.String memberDn) |
static void |
removeUniquemember(javax.naming.directory.DirContext ctx, java.lang.String[] groupDNArr, java.lang.String memberDn) |
static void |
removeUniquemember(javax.naming.directory.DirContext ctx, java.lang.String groupDN, java.lang.String memberDn) |
static java.lang.String |
resolveDuplicateDN(javax.naming.directory.DirContext ctx, java.lang.String dnString) Returns a unique DN whose value is guaranteed to be unique in the specified LDAP server. |
static void |
setEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, javax.naming.directory.ModificationItem[] mods) setEntryDetails |
static void |
setEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, ModPropertySet ps) setEntryDetails |
static void |
subAndLoadLdif(javax.naming.directory.DirContext ctx, java.lang.String filename, java.util.Vector subVector) |
static void |
subAndLoadLdif(javax.naming.directory.DirContext ctx, java.lang.String filename, java.util.Vector subVector, java.util.logging.Logger lgr) |
static void |
validateFile(java.io.File fileObj, int checkFor) |
static void |
validateFile(java.lang.String fileName, int checkFor) Use this method to validate the file properties. |
protected static java.lang.String[] |
vector2StrArray(java.util.Vector list) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String API_VERSION
public static java.lang.String INTERFACE_VERSION
public static int PWD_VERIFIERTYPE_COMMON
public static int IDTYPE_DN
public static int IDTYPE_SIMPLE
public static int IDTYPE_GUID
public static int IDTYPE_DEFAULT
public static int IDTYPE_FILTER
public static int IDTYPE_WINDOWS
public static int IDTYPE_KERB_PRINCIPAL
public static int PROPERTIES_ENTRY
public static int PROPERTIES_DETACHED
public static int CREDTYPE_PASSWD
public static java.lang.String DASURL_BASE
public static java.lang.String DASURL_CREATE_USER
public static java.lang.String DASURL_EDIT_GROUP
public static java.lang.String DASURL_EDIT_GROUP_GIVEN_GUID
public static java.lang.String DASURL_GROUP_SEARCH
public static java.lang.String DASURL_EDIT_USER
public static java.lang.String DASURL_GROUP_LOV
public static java.lang.String DASURL_DELETE_USER
public static java.lang.String DASURL_USER_PRIVILEGE
public static java.lang.String DASURL_CREATE_GROUP
public static java.lang.String DASURL_USER_SEARCH
public static java.lang.String DASURL_ACCOUNT_INFO
public static java.lang.String DASURL_EDIT_USER_GIVEN_GUID
public static java.lang.String DASURL_DELETE_USER_GIVEN_GUID
public static java.lang.String DASURL_DELETE_GROUP_GIVEN_GUID
public static java.lang.String DASURL_GROUP_PRIVILEGE
public static java.lang.String DASURL_USER_PRIVILEGE_GIVEN_GUID
public static java.lang.String DASURL_PASSWORD_CHANGE
public static java.lang.String DASURL_USER_LOV
public static java.lang.String DASURL_GROUP_PRIVILEGE_GIVEN_GUID
public static java.lang.String DASURL_DELETE_GROUP
public static java.lang.String DASURL_CREATE_RESOURCE
public static java.lang.String DASURL_EUS_CONSOLE
public static java.lang.String DASURL_DELEGATION_CONSOLE
public static java.lang.String DASURL_EDIT_MY_PROFILE
public static java.lang.String DASURL_RESET_PASSWORD
public static java.lang.String DASURL_VIEW_USER_PROFILE
public static java.lang.String DASURL_TIMEZONE
public static final int FILE_EXISTENCE
public static final int FILE_NOT_EXISTENCE
public static final int FILE_READABLE
public static final int FILE_WRITABLE
public static final int FILE_NOT_EMPTY
public static final int FILE_CREATEABLE
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static PropertySetCollection getEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String filter, int scope, java.lang.String[] attrList) throws javax.naming.NamingException
javax.naming.NamingException
public static java.lang.Object getEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String filter, int scope, java.lang.String[] attrList, boolean convert) throws javax.naming.NamingException
javax.naming.NamingException
public static java.lang.Object getEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String filter, javax.naming.directory.SearchControls ctls) throws javax.naming.NamingException
javax.naming.NamingException
public static void setEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, javax.naming.directory.ModificationItem[] mods) throws UtilException
ctx
- - a valid directory context base - base DN mods - valid list of ModificationItemUtilException
public static void setEntryDetails(javax.naming.directory.DirContext ctx, java.lang.String base, ModPropertySet ps) throws UtilException
ctx
- - a valid directory context base - base DN ps - a valid ModPropertySetUtilException
public static void authenticateUser(javax.naming.directory.DirContext ctx, User curUser, int authType, java.lang.Object cred) throws UtilException
ctx
- a valid DirContextauthType
- Util.CREDTYPE_PASSWD is the only one supported at the momentcred
- the credentials based on the authTypeUtilException
public static java.lang.String getSubscriberDn(javax.naming.directory.DirContext ctx, java.lang.String subId, int subIdType, java.util.logging.Logger lgr) throws UtilException
Subscriber.getDN(ctx)
ctx
- a valid DirContextsubId
- Subscriber IDsubIdType
- The type of subscriber id being used - use one of IDTYPE_DN, IDTYPE_SIMPLE or Util.IDTYPE_GUIDUtilException
public static java.lang.String getSubscriberDn(javax.naming.directory.DirContext ctx, java.lang.String subId, int subIdType) throws UtilException
UtilException
public static java.lang.String getUserDn(javax.naming.directory.DirContext ctx, java.lang.String userId, int userIdType, java.lang.String subscriberDN) throws UtilException
ctx
- a valid DirContextuserId
- User IDuserIdType
- The type of user id being used - use one of IDTYPE_DN, IDTYPE_SIMPLE or Util.IDTYPE_GUIDUtilException
public static PropertySetCollection getOwnership(javax.naming.directory.DirContext ctx, User curUser, java.lang.String[] attrList, boolean nested) throws UtilException
PropertySetCollection
of DNs where the user is an owner. If nested
is set to true, the method will look for nested ownership as well.ctx
- DirContextcurUser
- a valid User
objectattrList
- a set of attributes to be fetchednested
- true if nested ownership is desiredUtilException
public static PropertySetCollection getOwnership(javax.naming.directory.DirContext ctx, java.lang.String dn, java.lang.String[] attrList, boolean nested) throws UtilException
PropertySetCollection
of DNs where the input DN is an owner. If nested
is set to true, the method will look for nested ownership as well.ctx
- DirContextdn
- the DN to be looked upattrList
- a set of attributes to be fetchednested
- true if nested ownership is desiredUtilException
protected static PropertySetCollection getOwnership(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String dn, java.lang.String[] attrList, boolean nested) throws UtilException
UtilException
public static PropertySetCollection getGroupMembership(javax.naming.directory.DirContext ctx, User curUser, java.lang.String[] attrList, boolean nested) throws UtilException
PropertySetCollection
.ctx
- a valid DirContextcurUser
- a valid User objectattrList
- a String array of attributes to be retrieved from each groupnested
- Set to true to look for nested membership. Otherwise, only direct memberships are returnedUtilException
public static PropertySetCollection getGroupMembership(javax.naming.directory.DirContext ctx, java.lang.String dn, java.lang.String[] attrList, boolean nested, java.lang.String memberAttribute) throws UtilException
PropertySetCollection
. The memberAttribute
allows the choice of the uniqemember attribute or the member attribute to be used during the lookup.ctx
- a valid DirContextdn
- a valid DNattrList
- a String array of attributes to be retrieved from each groupnested
- Set to true to look for nested membership. Otherwise, only direct memberships are returnedmemberAttribute
- use "uniquemember" or "member".PropertySetCollection
UtilException
public static PropertySetCollection getGroupMembership(javax.naming.directory.DirContext ctx, java.lang.String dn, java.lang.String[] attrList, boolean nested) throws UtilException
UtilException
protected static void grpErrHandler(javax.naming.NamingException ne, UtilException ue) throws UtilException
UtilException
protected static java.lang.String[] vector2StrArray(java.util.Vector list)
public static java.lang.String normalizeDN(java.lang.String inDN, java.lang.String[] attrList)
public static java.lang.String normalizeDN(java.lang.String inDN)
inDN
- the DN to be normalizedpublic static java.lang.String createDN(javax.naming.directory.DirContext ctx, java.lang.String inDN) throws UtilException
UtilException
public static java.lang.String getDASUrl(javax.naming.directory.DirContext ctx, java.lang.String urlTypeDN) throws UtilException
ctx
- a valid DirContexturlTypeDN
- use one of Util.DASURL_* which represents a particular URL type.String
representing the URLUtilException
public static java.util.Hashtable getAllDASUrl(javax.naming.directory.DirContext ctx) throws UtilException
ctx
- a valid DirContextUtilException
public static void printResults(PropertySetCollection resultSet)
resultSet
- A valid ProperSetCollectionpublic static java.lang.String[] getDefaultSubscriber(java.util.logging.Logger lgr)
public static java.lang.String[] getDefaultSubscriber()
public static java.lang.String getDomain(java.util.logging.Logger lgr)
public static java.lang.String getDomain()
public static void subAndLoadLdif(javax.naming.directory.DirContext ctx, java.lang.String filename, java.util.Vector subVector, java.util.logging.Logger lgr) throws UtilException
UtilException
public static void subAndLoadLdif(javax.naming.directory.DirContext ctx, java.lang.String filename, java.util.Vector subVector) throws UtilException
UtilException
public static java.lang.String getFQHN()
public static java.lang.String getIAC_DNFromFQHN() throws UtilException
UtilException
public static java.lang.String getParentDN(java.lang.String dn)
dn
- a valid DNpublic static java.lang.String getRDN(java.lang.String dn)
For example, if dn is "dc=acme,dc=com", this returns "dc=acme".
dn
- a valid DNpublic static boolean dnExists(javax.naming.directory.DirContext ctx, java.lang.String dn) throws UtilException
ctx
- a valid DirContextdn
- the DN to be validatedUtilException
public static PropertySetCollection dnExists(javax.naming.directory.DirContext ctx, java.lang.String dn, java.lang.String[] attrs) throws UtilException
ctx
- a valid DirContextdn
- the DN to be validatedattrs
- an array of attributes to be returnedUtilException
public static boolean checkInterfaceVersion(java.lang.String intVersion)
String
- Interface Versionpublic static void performLDAPOperation(javax.naming.directory.DirContext dirCtx, LDIFRecord ldifRecord) throws javax.naming.NamingException
oidCtx
- the Directory contextldifRecord
- an LDIFRecord that needs to be added/changed/deleted to/from the dirctory.javax.naming.NamingException
- If a naming exception is encounteredpublic static LDIFRecord getEntryFromDirectory(javax.naming.directory.DirContext dirCtx, java.lang.String dn) throws javax.naming.NamingException
dirCtx
- directory contextdn
- DN of the entry.javax.naming.NamingException
- If a naming exception is encounteredpublic static LDIFRecord getLDIFRecord(java.lang.String dn, javax.naming.directory.Attributes pAttrs) throws javax.naming.NamingException
dn
- DN of the entry.pAttrs
- Attributes associated with the DNjavax.naming.NamingException
- If a naming exception is encounteredpublic static void validateFile(java.lang.String fileName, int checkFor) throws InvalidParameterException
for e.x // Make sure that input file is exists and it is readable // and also it is not empty try { Util.validateFile(inFileObj, Util.FILE_EXISTENCE | Util.FILE_READABLE | Util.FILE_NOT_EMPTY); } catch(InvalidParameterException ipe) { throw new MigrationException(ipe.getMessage()); }
fileName
- Name of the filecheckFor
- Can contain any one of Util.FILE_EXISTENCE Util.FILE_NOT_EXISTENCE, Util.FILE_READABLE, Util.FILE_WRITABLE, Util.FILE_DATA, Util.FILE_CREATEABLE or a combination of themInvalidParameterException
- When any of the above conditions are not met.public static void validateFile(java.io.File fileObj, int checkFor) throws InvalidParameterException
InvalidParameterException
public static void addUniquemember(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String memberDn) throws UtilException
UtilException
public static void removeUniquemember(javax.naming.directory.DirContext ctx, Group[] groupArr, java.lang.String memberDn) throws UtilException
UtilException
public static void removeUniquemember(javax.naming.directory.DirContext ctx, Group group, java.lang.String memberDn) throws UtilException
UtilException
public static void removeUniquemember(javax.naming.directory.DirContext ctx, java.lang.String[] groupDNArr, java.lang.String memberDn) throws UtilException
UtilException
public static void removeUniquemember(javax.naming.directory.DirContext ctx, java.lang.String groupDN, java.lang.String memberDn) throws UtilException
UtilException
public static void bulkDelete(javax.naming.directory.DirContext ctx, java.lang.String base, boolean deleteBaseDN) throws javax.naming.NamingException
ctx
- a valid DirContextbase
- the base DN whose subtree is to be deletedjavax.naming.NamingException
- when it is encounteredpublic static java.lang.String getAttrOfRDN(java.lang.String rdn)
rdn
- a valid RDNpublic static java.lang.String getAttrValueOfRDN(java.lang.String rdn)
rdn
- a valid RDNpublic static java.lang.String getParameterFromFile(java.lang.String parameter, java.lang.String fileName) throws java.io.IOException
parameter
- the parameter to be looked upfileName
- the name of the parameter filejava.io.IOException
public static LDAPObjectClass getObjectClass(javax.naming.directory.DirContext ctx, java.lang.String inID) throws UtilException
inID
- the OID or the NAME of the objectclassUtilException
public static PropertySetCollection ldapSearch(javax.naming.directory.DirContext ctx, java.lang.String base, java.lang.String filter, int scope, java.lang.String[] attrList) throws UtilException
ctx
- a valid DirContextbase
- a valid DN as the search basefilter
- a valid LDAP search filterscope
- one of SearchControls.SUBTREE_SCOPE, SearchControls.OBJECT_SCOPE or SearchControls.ONELEVEL_SCOPEattrList
- a String array specifying the attributes to be returnedUtilException
public static void ldapAdd(javax.naming.directory.DirContext ctx, java.lang.String base, ModPropertySet ps) throws UtilException
ctx
- a valid DirContextbase
- the DN of the entry to be addedModPropertySet
- containing all the attributes and their values including the necessary objectclassesUtilException
public static void ldapModify(javax.naming.directory.DirContext ctx, java.lang.String base, ModPropertySet ps) throws UtilException
ctx
- a valid DirContextbase
- the DN of the entry to be modifiedModPropertySet
- containing the modifications of the attributesUtilException
public static void ldapModify(javax.naming.directory.DirContext ctx, java.util.logging.Logger lgr, java.lang.String fileName, java.util.Vector subVector, boolean ignoreError) throws UtilException
Here is an example. The LDIF template has the following entry:
---------------------------- dn: dc=%s_myCompany%,dc=com changetype: replace replace: displayName displayName = %s_myDisplayName% ---------------------------- The string "%s_mycompany%" and "s_myDisplayName" will be substituted at run-time by using the substitution vector. The vector is in the form, Vector v = new Vector(); v[0] = new String("variable_name1"); v[1] = new String("variable1 value"); v[2] = new String("variable_name2"); v[3] = new String("variable2 value"); . . To substitute "s_mycompany" with "acme" and "s_myDisplayName" with "My Acme", the vector should be defined as follows: Vector v = new Vector(4); v[0] = new String("s_mycompany"); v[1] = new String("acme"); v[2] = new String("s_myDisplayName"); v[3] = new String("My Acme");If a substitution variable-value pair is defined in the vector but does not exist in the LDIF template, it will go through. If a variable exists in the LDIF but the vector does not provide the substitution value for it, a UtilException is thrown.
ctx
- a valid DirContextfileName
- the absolute path name of the LDIF file.subVector
- the substitution vector of StringsignoreError
- set to true to ignore errors and proceed with the rest of the LDIF file.UtilException
public static void ldapModify(javax.naming.directory.DirContext ctx, java.lang.String fileName, java.util.Vector subVector, boolean ignoreError) throws UtilException
UtilException
public static void ldapModify(javax.naming.directory.DirContext ctx, java.util.logging.Logger lgr, java.lang.String fileName, java.util.Vector subVector, boolean ignoreError, java.io.PrintStream pStream) throws UtilException
Util.ldapModify
. This method allows the redirection of the output to a particular PrintStream
- useful for logging.ctx
- a valid DirContextfileName
- the absolute path name of the LDIF file.subVector
- the substitution vector of StringsignoreError
- set to true to ignore errors and proceed with the rest of the LDIF file.pStream
- a PrintStream
where the output is redirectedUtilException
public static void ldapModify(javax.naming.directory.DirContext ctx, java.lang.String fileName, java.util.Vector subVector, boolean ignoreError, java.io.PrintStream pStream) throws UtilException
UtilException
public static void ldapDelete(javax.naming.directory.DirContext ctx, java.lang.String base) throws UtilException
ctx
- a valid DirContextbase
- the DN of the entry to be deletedUtilException
public static boolean ldapCompare(javax.naming.directory.DirContext ctx, java.lang.String baseDN, java.lang.String attr, java.lang.Object attrval) throws UtilException
ctx
- a valid DirContextbase
- the DN of the entry to be comparedattr
- the attribute nameattrval
- the attribute valueUtilException
public static PropertySetCollection multiSearchBaseSearch(javax.naming.directory.DirContext ctx, java.lang.String specifiedSearchBase, java.lang.String[] allSearchBases, java.lang.String filter, java.lang.String[] attrList, boolean returnONE) throws UtilException
UtilException
public static java.lang.String[] getSSODBInfo(javax.naming.directory.DirContext ctx) throws java.lang.Exception
java.lang.Exception
public static java.lang.String makeFilter(java.lang.String attr, java.lang.String value)
public static java.lang.String handleSpecialChars(java.lang.String originalString)
RFC-2254
public static java.lang.String handleSpecialFilterChars(java.lang.String originalString)
public static java.lang.String resolveDuplicateDN(javax.naming.directory.DirContext ctx, java.lang.String dnString) throws UtilException
ctx
- a valid DirContext connected to an LDAP serverdnString
- a String representing the DNUtilException
|
Oracle Internet Directory API Reference 11g Release 1 (11.1.1) E10664-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |