|
Oracle Internet Directory API Reference 10g(10.1.4) B15992-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ldap.util.LDAPEntry
oracle.ldap.util.Subscriber
This class represents an Identity Management Realm in the directory. It provides methods to manage many items within the realm itself. For example,
- User Lookup - User Creation * - Group Lookup - Service Lookup
Field Summary | |
static int |
COMMON_PROPERTIES Property type to retrieve the common properties of this subscriber |
static int |
ENTRY_PROPERTIES Property type to retrieve the entry properties of this subscriber |
static int |
EXTPROPTYPE_COMMON Extended Preference Type to be used with getExtendedProperties() - Common Subscriber properties |
static int |
EXTPROPTYPE_DEFAULT_RAD Extended Preference Type to be used with getExtendedProperties() - Default User Extended Properties |
static int |
EXTPROPTYPE_RESOURCE_ACCESS_TYPE Extended Preference Type to be used with getExtendedProperties() - Resource Access Type |
static java.lang.String |
USER_NAMING_ATTR_KERBEROS Property name type to retrieve the Kerberos principal attribute |
static java.lang.String |
USER_NAMING_ATTR_SIMPLE Property name type to retrieve the common user nickname attribute |
static java.lang.String |
USER_NAMING_ATTR_WINDOWS Property name type to retrieve the Windows principal attribute |
static int |
USER_NAMING_PROPERTIES Property type to retrieve user naming properties of this subscriber |
Constructor Summary | |
Subscriber(javax.naming.directory.DirContext ctx, int inSubIdType, java.lang.String inSubIdName, boolean validate) Constructs a Subscriber using an ID type and an ID name. |
Method Summary | |
Group |
createGroup(javax.naming.directory.DirContext ctx, java.lang.String createGroupBase, ModPropertySet ps, boolean useMandatoryObjectclasses) Creates a group entry under the specified create group base. |
User |
createUser(javax.naming.directory.DirContext ctx, ModPropertySet ps, boolean useMandatoryObjectclasses) Creates a user entry under the create user base. |
User |
createUser(javax.naming.directory.DirContext ctx, java.lang.String createUserBase, ModPropertySet ps, boolean useMandatoryObjectclasses) Creates a user entry under the specified create user base. |
User |
createUser(javax.naming.directory.DirContext ctx, java.lang.String newUserDN, ModPropertySet ps, boolean useMandatoryObjectclasses, boolean validateDN) Creates a user entry using a user DN. |
void |
deleteGroup(javax.naming.directory.DirContext ctx, Group inGroup) Deletes the specified group from this subscriber. |
void |
deleteUser(javax.naming.directory.DirContext ctx, User inUser) Deletes the specified user from this subscriber. |
java.lang.String |
getDn(javax.naming.directory.DirContext ctx) Deprecated. Use Subscriber.getDN(ctx) instead. |
java.lang.String |
getDN(javax.naming.directory.DirContext ctx) Returns the DN of the subscriber (resolves the name if necessary). |
PropertySetCollection |
getExtendedProperties(javax.naming.directory.DirContext ctx, int propType, java.lang.String[] attrList, java.lang.String filter) Retrieves Extended properties under the Oracle Context of this subscriber. |
Group |
getGroup(javax.naming.directory.DirContext ctx, int groupIdType, java.lang.String groupIdName, java.lang.String[] attrList) Returns a Group object using the specified information. |
Group |
getGroup(javax.naming.directory.DirContext ctx, int groupIdType, java.lang.String groupIdName, java.lang.String specifiedSearchBase, java.lang.String[] attrList) Returns a group object using the specified information under the specified group search base. |
Group[] |
getGroups(javax.naming.directory.DirContext ctx, int filterIdType, java.lang.String filter, java.lang.String specifiedSearchBase, java.lang.String[] attrList) Returns an array of Group[] objects using the specified information. |
java.lang.String[] |
getGroupSearchBase() Return the subscriber group search base |
PropertySetCollection |
getProperties(javax.naming.directory.DirContext ctx, int propType, java.lang.String[] attrList) Retrieves selected attributes associated with this subscriber |
PropertySetCollection |
getProperties(javax.naming.directory.DirContext ctx, java.lang.String[] attrList) Retrieves selected attributes associated with this subscriber |
java.lang.String |
getPwdVerifierAttributeName(javax.naming.directory.DirContext ctx, int verifierType) Returns the attribute name to be used during user authentication using the specified password verifier. |
User |
getUser(javax.naming.directory.DirContext ctx, int userIdType, java.lang.String userIdName, java.lang.String[] attrList) Returns a User object with the specified information. |
User |
getUser(javax.naming.directory.DirContext ctx, int userIdType, java.lang.String userIdName, java.lang.String userSpecifiedSearchBase, java.lang.String[] attrList) Returns a User object with the specified information. |
User |
getUser(javax.naming.directory.DirContext ctx, int userIdType, java.lang.String userIdName, java.lang.String userSpecifiedSearchBase, java.lang.String[] attrList, boolean autoProvisioningEnabled) |
User[] |
getUsers(javax.naming.directory.DirContext ctx, int filterIdType, java.lang.String filter, java.lang.String userSpecifiedSearchBase, java.lang.String[] attrList) Returns an array of User objects with the specified information. |
User[] |
getUsers(javax.naming.directory.DirContext ctx, int filterIdType, java.lang.String filter, java.lang.String userSpecifiedSearchBase, java.lang.String[] attrList, javax.naming.directory.SearchControls inSctrl) Returns an array of User objects with the specified information. |
java.lang.String[] |
getUserSearchBase() Return the subscriber search base |
java.lang.String |
getVersion(javax.naming.directory.DirContext ctx) Returns the verion of this Subscriber |
void |
refresh(javax.naming.directory.DirContext ctx) Refreshes cached elements in the Subscriber object. |
void |
resolve(javax.naming.directory.DirContext ctx) Validates the subscriber by identifying its DN |
void |
setExtendedProperties(javax.naming.directory.DirContext ctx, int propType, ModPropertySet ps) Sets the extended properties of the subscriber. |
void |
setProperties(javax.naming.directory.DirContext ctx, ModPropertySet ps) Sets Properties of the subscriber. |
Methods inherited from class oracle.ldap.util.LDAPEntry |
getProperties |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int EXTPROPTYPE_COMMON
public static int EXTPROPTYPE_RESOURCE_ACCESS_TYPE
public static int EXTPROPTYPE_DEFAULT_RAD
public static final java.lang.String USER_NAMING_ATTR_SIMPLE
public static final java.lang.String USER_NAMING_ATTR_WINDOWS
public static final java.lang.String USER_NAMING_ATTR_KERBEROS
public static final int ENTRY_PROPERTIES
public static final int COMMON_PROPERTIES
public static final int USER_NAMING_PROPERTIES
Constructor Detail |
public Subscriber(javax.naming.directory.DirContext ctx, int inSubIdType, java.lang.String inSubIdName, boolean validate) throws UtilException
DN - the DN of the subscriber SIMPLE - the simple name or the nick name of the subscriber GUID - the GUID of the subscriber DEFAULT - the default subscriber - an ID name is not required in this case
ctx
- a valid DirContextinSubIdType
- The type of subscriber id being used - use one of Util.IDTYPE_DN, Util.IDTYPE_SIMPLE or Util.IDTYPE_GUIDinSubIdName
- Subscriber ID - If this value is null and inSubIdType is Util.IDTYPE_DN, then default subscriber will be used. Otherwise, a null will cause an exceptionvalidate
- Set to true to validate the infoUtilException
Method Detail |
public PropertySetCollection getProperties(javax.naming.directory.DirContext ctx, java.lang.String[] attrList) throws UtilException
ctx
- a valid DirContextattrList
- an array of attributes to be retrievedUtilException
public void setProperties(javax.naming.directory.DirContext ctx, ModPropertySet ps) throws UtilException
ModPropertySet
for the modification. See the documentation on ModPropertySet
for more details.setProperties
in class LDAPEntry
ctx
- a valid DirContextps
- a valid PropertySet containing the items to be modifiedUtilException
public void setExtendedProperties(javax.naming.directory.DirContext ctx, int propType, ModPropertySet ps) throws UtilException
ModPropertySet
for the modification. See the documentation on ModPropertySet
for more details.ctx
- a valid DirContextpropType
- currently only supports Subscriber.EXTPROPTYPE_COMMONps
- a valid PropertySet containing the items to be modifiedUtilException
public PropertySetCollection getExtendedProperties(javax.naming.directory.DirContext ctx, int propType, java.lang.String[] attrList, java.lang.String filter) throws UtilException
ctx
- a valid DirContextpropType
- Use one of EXTPROPTYPE_COMMON, EXTPROPTYPE_RESOURCE_ACCESS_TYPE or EXTPROPTYPE_DEFAULT_RADattrList
- an array of attributes to be retrievedfilter
- a search filter to narrow search criteria. For eg. use "(orclResourceTypeName=OracleDB)" with EXTPROPTYPE_RESOURCE_ACCESS_TYPE to get only those properties of OracleDBPropertySetCollection
UtilException
public void resolve(javax.naming.directory.DirContext ctx) throws UtilException
resolve
in class LDAPEntry
ctx
- a valid DirContextUtilException
public void refresh(javax.naming.directory.DirContext ctx) throws UtilException
ctx
- a valid DirContextUtilException
public java.lang.String getDN(javax.naming.directory.DirContext ctx) throws UtilException
getDN
in class LDAPEntry
ctx
- a valid DirContextUtilException
public java.lang.String getDn(javax.naming.directory.DirContext ctx) throws UtilException
Subscriber.getDN(ctx)
instead.UtilException
public User getUser(javax.naming.directory.DirContext ctx, int userIdType, java.lang.String userIdName, java.lang.String userSpecifiedSearchBase, java.lang.String[] attrList, boolean autoProvisioningEnabled) throws UtilException
UtilException
public User getUser(javax.naming.directory.DirContext ctx, int userIdType, java.lang.String userIdName, java.lang.String[] attrList) throws UtilException
User
object with the specified information. The userIDType specifies the type of userIdName used - GUID, DN or simple name. The attrList specifies the attributes to be retrieved from the user entry when the DN is being resolved. The returned values are cached in the User object for later usage.ctx
- a valid DirContextuserIdType
- one of Util.IDTYPE_GUID, Util.IDTYPE_DN, Util.IDTYPE_SIMPLEuserIdName
- the user identifier based on userIdTypeattrList
- an array of attributes to returned while resolving the user DNUser
objectUtilException
public User getUser(javax.naming.directory.DirContext ctx, int userIdType, java.lang.String userIdName, java.lang.String userSpecifiedSearchBase, java.lang.String[] attrList) throws UtilException
User
object with the specified information. The userIDType specifies the type of userIdName used - GUID, DN or simple name. The attrList specifies the attributes to be retrieved from the user entry when the DN is being resolved. The returned values are cached in the User object for later usage. If the user search base is specified, the search is narrowed to within the specified search base. If null is specified, the search will go through all search bases.ctx
- a valid DirContextuserIdType
- one of Util.IDTYPE_GUID, Util.IDTYPE_DN, Util.IDTYPE_SIMPLEuserIdName
- the user identifier based on userIdTypeuserSpecifiedSearchBase
- the search base under which the the user is to be looked up. If null is specified, the search will go through all the search basesattrList
- an array of attributes to returned while resolving the user DNUtilException
public User[] getUsers(javax.naming.directory.DirContext ctx, int filterIdType, java.lang.String filter, java.lang.String userSpecifiedSearchBase, java.lang.String[] attrList) throws UtilException
User
objects with the specified information.
The filterIdType specifies the type of filter used. This is essentially a filtered search. If filterIdType is Util.IDTYPE_SIMPLE, the filter will be created using the nick name attribute.
For example, if you want to search for all the users whose nick name begins with "John", the filter should be set to "John*".
If the filterIdType is Util.IDTYPE_FILTER, then a proper LDAP filter is expected.
For example, "(&(cn=John*)(sn=John*))".
The returned attribute values, specified in attrList are cached in each individual User
object for later usage.
A user search base can also be specified. If null, then all the search bases will be used.
ctx
- a valid DirContextfilterIdType
- one of Util.IDTYPE_SIMPLE or Util.IDTYPE_FILTER.filter
- the user identifier based on userIdType.userSpecifiedSearchBase
- the search base under which the the user is to be looked up. If null is specified, the search will go through all the search basesattrList
- an array of attributes to returned while resolving the user DNUser[]
UtilException
public User[] getUsers(javax.naming.directory.DirContext ctx, int filterIdType, java.lang.String filter, java.lang.String userSpecifiedSearchBase, java.lang.String[] attrList, javax.naming.directory.SearchControls inSctrl) throws UtilException
User
objects with the specified information.
Functionality is the same as the other Subscribe.getUsers()
. This method allows the setting of the SearchControls
parameter to control the count limit and the time limit of the search.
ctx
- a valid DirContextfilterIdType
- one of Util.IDTYPE_SIMPLE or Util.IDTYPE_FILTER.filter
- the user identifier based on userIdType.userSpecifiedSearchBase
- the search base under which the the user is to be looked up. If null is specified, the search will go through all the search basesattrList
- an array of attributes to returned while resolving the user DN * getUsersinSctrl
- user specified search controls for this search Currently, only CountLimit and TimeLimit are used from the specified search controls.User[]
UtilException
public User createUser(javax.naming.directory.DirContext ctx, ModPropertySet ps, boolean useMandatoryObjectclasses) throws UtilException
Creates a user entry under the create user base. It assumes that there is only one create user base.
If multiple create user bases exist, the method returns a UtilException
.
If useMandatoryAttr is set to true, the DAS-specific required attributes will be mandatory on top of what the objectclasses enforce. Otherwise, only the mandatory attributes from the objectclasses are required.
Objectclasses are automatically picked up and do not need to be included in ModPropertySet.
Here is an example on how to use this code to create a user "John": // sub is a valid Subscriber // ctx is a valid DirContext // Create ModPropertySet with user information ModPropertySet mps = new ModPropertySet(); mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"cn", "John"); mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"sn", "John"); mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"uid", "John"); // Create the user User newUser = sub.createUser( ctx, mps, false ); System.out.println("New User DN: " + newUser.getDN( ctx ) );
ctx
- a valid DirContextps
- a ModPropertySet defining the user attributesuseMandatoryObjectclasses
- set to true if required to use the mandatory objectclasses specified by DASUser
object of the newly created userUtilException
- thrown when creation can not be completed.public User createUser(javax.naming.directory.DirContext ctx, java.lang.String createUserBase, ModPropertySet ps, boolean useMandatoryObjectclasses) throws UtilException
ctx
- a valid DirContextcreateUserBase
- a valid create user baseps
- a ModPropertySet defining the user attributesuseMandatoryObjectclasses
- set to true if required to use the mandatory objectclasses specified by DASUtilException
- thrown when creation can not be completed.public User createUser(javax.naming.directory.DirContext ctx, java.lang.String newUserDN, ModPropertySet ps, boolean useMandatoryObjectclasses, boolean validateDN) throws UtilException
ctx
- a valid DirContextnewUserDN
- the DN of the user to be createdps
- a ModPropertySet defining the user attributes including objectclasses.useMandatoryObjectclasses
- set to true if required to use the mandatory objectclasses specified by DASvalidateDN
- set to true if DN is to be validatedUtilException
public void deleteUser(javax.naming.directory.DirContext ctx, User inUser) throws UtilException
ctx
- a valid DirContextinUser
- a valid user objectUtilException
public void deleteGroup(javax.naming.directory.DirContext ctx, Group inGroup) throws UtilException
ctx
- a valid DirContextinGroup
- a valid group objectUtilException
public Group createGroup(javax.naming.directory.DirContext ctx, java.lang.String createGroupBase, ModPropertySet ps, boolean useMandatoryObjectclasses) throws UtilException
ctx
- a valid DirContextcreateGroupBase
- a valid create group baseps
- a ModPropertySet defining the group attributesuseMandatoryObjectclasses
- set to true if required to use the mandatory objectclasses specified by DASUtilException
- thrown when creation can not be completed.public Group getGroup(javax.naming.directory.DirContext ctx, int groupIdType, java.lang.String groupIdName, java.lang.String[] attrList) throws UtilException
Group
object using the specified information. The groupIdType
specifies the type of groupIdName used - GUID, DN or simple name.
When a simple name is used, the search will go through all the group search bases.
The attrList specifies the attributes to be retrieved from the group entry when the DN is being resolved. The returned values are cached in the group object for later usage.
ctx
- a valid DirContextgroupIdType
- one of Util.IDTYPE_GUID, Util.IDTYPE_DN, or Util.IDTYPE_SIMPLEgroupIdName
- the group identifier based on groupIdTypeattrList
- a set of attributes to be fetchedGroup
objectUtilException
public Group getGroup(javax.naming.directory.DirContext ctx, int groupIdType, java.lang.String groupIdName, java.lang.String specifiedSearchBase, java.lang.String[] attrList) throws UtilException
ctx
- a valid DirContextgroupIdType
- one of Util.IDTYPE_GUID, Util.IDTYPE_DN, or Util.IDTYPE_SIMPLEgroupIdName
- the group identifier based on groupIdTypespecifiedSearchBase
- the group search base DNattrList
- a set of attributes to be fetchedGroup
objectUtilException
public Group[] getGroups(javax.naming.directory.DirContext ctx, int filterIdType, java.lang.String filter, java.lang.String specifiedSearchBase, java.lang.String[] attrList) throws UtilException
Group[]
objects using the specified information.
The filterIdType specifies the type of filter used. This is essentially a filtered search. If filterIdType is Util.IDTYPE_SIMPLE, the filter will be created using the nick name attribute ("cn" by default) *
For example, if you want to search for all the groups whose nick name begins with "admin", the filter should be set to "admin*". If filterIdType is Util.IDTYPE_FILTER, then a proper LDAP filter is expected
For example, "(&(cn=admin*)(uniquemember=John*))".
The returned attribute values, specified in attrList are cached in each individual User object for later usage.
A group search base can also be specified. If null, then all the search bases will be used during the search.
ctx
- a valid DirContextfilterIdType
- one of Util.IDTYPE_SIMPLE or Util.IDTYPE_FILTER.filter
- the user identifier based on userIdType.specifiedSearchBase
- the search base under which the the group is to be looked up. If null is specified, the search will go through all the search basesattrList
- an array of attributes to returned while resolving the user DNGroup[]
UtilException
public java.lang.String getPwdVerifierAttributeName(javax.naming.directory.DirContext ctx, int verifierType) throws UtilException
ctx
- a valid DirContextverifierType
- currently only Util.PWDVERIFIERTYPE_COMMON is supportedUtilException
public java.lang.String getVersion(javax.naming.directory.DirContext ctx) throws UtilException
ctx
- a valid DirContextUtilException
public PropertySetCollection getProperties(javax.naming.directory.DirContext ctx, int propType, java.lang.String[] attrList) throws UtilException
ctx
- a valid DirContextpropType
- Property Type Legal inputs: Subscriber.ENTRY_PROPERTIES : entry properties Subscriber.COMMON_PROPERTIES: common properties Subscriber.USER_NAMING_PROPERTIES: user naming propsattrList
- an array of attributes to be retrieved.PropertySetCollection
UtilException
public java.lang.String[] getUserSearchBase()
public java.lang.String[] getGroupSearchBase()
|
Oracle Internet Directory API Reference 10g(10.1.4) B15992-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |