public interface DirectoryServiceProvider
Defines the public interface that a directory service
needs to implement. The end target repository is a directory server.
A DirectoryServiceProvider
object can communicate with the directory server
via LDAP or some other form of API.
This is a singleton object. For a given type of directory server, the Content Engine makes sure that only one instance of the implementation class is created.
Modifier and Type | Method and Description |
---|---|
GroupInfo |
getGroupByDN(java.lang.String groupDN,
java.lang.String[] requestedProperties)
For Internal Use Only.
|
GroupInfo |
getGroupByShortName(java.lang.String groupShortName,
java.lang.String[] requestedProperties)
For Internal Use Only.
|
GroupInfo |
getGroupByUniqueId(byte[] uid,
java.lang.String[] requestedProperties)
For Internal Use Only.
|
GroupInfo |
getGroupByUPN(java.lang.String groupUPN,
java.lang.String[] requestedProperties)
For Internal Use Only.
|
java.lang.String |
getRealmByUniqueId(byte[] principalUid)
For Internal Use Only.
|
RealmInfo[] |
getRealmInfos()
For Internal Use Only.
|
UserInfo |
getUserByDN(java.lang.String userDN,
java.lang.String[] requestedProperties)
For Internal Use Only.
|
UserInfo |
getUserByShortName(java.lang.String userShortName,
java.lang.String[] requestedProperties)
For Internal Use Only.
|
UserInfo |
getUserByUniqueId(byte[] uid,
java.lang.String[] requestedProperties)
For Internal Use Only.
|
UserInfo |
getUserByUPN(java.lang.String userUPN,
java.lang.String[] requestedProperties)
For Internal Use Only.
|
void |
initialize(DirectoryInfo[] dirInfos)
For Internal Use Only.
|
PrincipalInfoSet |
searchGroups(java.lang.String realmDN,
java.lang.String searchPattern,
PrincipalSearchAttribute searchProperty,
PrincipalSearchSortType sort,
int pageSize,
java.lang.String[] requestedProperties,
java.lang.String continueFrom)
For Internal Use Only.
|
PrincipalInfoSet |
searchUsers(java.lang.String realmDN,
java.lang.String searchPattern,
PrincipalSearchAttribute searchProperty,
PrincipalSearchSortType sort,
int pageSize,
java.lang.String[] requestedProperties,
java.lang.String continueFrom)
For Internal Use Only.
|
void initialize(DirectoryInfo[] dirInfos)
DirectoryServiceProvider
object.
Can be called only once.
This method takes an array of DirectoryInfo
instances, and resolves each
instance to one or multiple RealmInfo
instances.
dirInfos
- An array of DirectoryInfo
instances.RealmInfo[] getRealmInfos()
RealmInfo
objects that
this directory service provider resolves to. This directory service provider
should also keep this info for later use, such as resolving group membership
across multiple realms.RealmInfo
objects. There must be at least one
element returned in the array.java.lang.String getRealmByUniqueId(byte[] principalUid) throws javax.naming.NamingException
principalUid
- Unique id of a security principal (user or group).javax.naming.NamingException
UserInfo getUserByDN(java.lang.String userDN, java.lang.String[] requestedProperties) throws javax.naming.NamingException
userDN
- User name in DN format (for example,
cn=user1,ou=people,dc=myDomain,dc=com).requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.UserInfo
object which contains the requested user properties. If
not found, returns null
.javax.naming.NamingException
UserInfo getUserByUPN(java.lang.String userUPN, java.lang.String[] requestedProperties) throws javax.naming.NamingException
userUPN
- User name in UPN format (for example, user1@myDomain.com)requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.UserInfo
object which contains the requested user properties. If
not found, returns null
.javax.naming.NamingException
UserInfo getUserByShortName(java.lang.String userShortName, java.lang.String[] requestedProperties) throws javax.naming.NamingException
Note:You must ensure that the short name is unique across all realms under this provider.
userShortName
- User short name (for example, user1).requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.UserInfo
object which contains user properties asked for. If
not found, returns null
.javax.naming.NamingException
UserInfo getUserByUniqueId(byte[] uid, java.lang.String[] requestedProperties) throws javax.naming.NamingException
uid
- in binary format.requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.UserInfo
object which contains the requested user properties. If
not found, returns null
.javax.naming.NamingException
GroupInfo getGroupByDN(java.lang.String groupDN, java.lang.String[] requestedProperties) throws javax.naming.NamingException
groupDN
- Group name in DN format (for example,
cn=group1,ou=groups,dc=myDomain,dc=com).requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.GroupInfo
object which contains the requested group properties. If
not found, returns null
.javax.naming.NamingException
GroupInfo getGroupByUPN(java.lang.String groupUPN, java.lang.String[] requestedProperties) throws javax.naming.NamingException
groupUPN
- Group name in UPN format (for example, group1@myDomain.com)requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.GroupInfo
object which contains group properties asked for. If
not found, returns null
.javax.naming.NamingException
GroupInfo getGroupByShortName(java.lang.String groupShortName, java.lang.String[] requestedProperties) throws javax.naming.NamingException
Note: You must ensure that the short name is unique across all realms under this provider.
groupShortName
- Group short name (for example, group1).requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.GroupInfo
object which contains the requested group properties. If
not found, returns null
.javax.naming.NamingException
GroupInfo getGroupByUniqueId(byte[] uid, java.lang.String[] requestedProperties) throws javax.naming.NamingException
uid
- in binary format.requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.GroupInfo
object which contains the requested group properties. If
not found, returns null
.javax.naming.NamingException
PrincipalInfoSet searchUsers(java.lang.String realmDN, java.lang.String searchPattern, PrincipalSearchAttribute searchProperty, PrincipalSearchSortType sort, int pageSize, java.lang.String[] requestedProperties, java.lang.String continueFrom) throws javax.naming.NamingException
Also need to support the following features:
a) Sorting: ascending or descending.
b) Paging: this method always returns users page by page.
c) Search continuation, for which the logic is as follows:
null
value through its continueFrom
argument,
it returns the first page of the search result. By calling
PrincipalInfoSet.setContinueFrom()
, this method also returns the start
position for the next page.continueFrom
argument, it
retrieves a new page starting from this argument value.null
for the
continuation string by calling PrincipalInfoSet.setContinueFrom(null)
.
When the Content Engine receives this null
value, it stops the continuation of
this search.realmDN
- Realm name in DN format.searchPattern
- Search pattern, such as "*", for the specified
searchProperty
parameter.searchProperty
- The property to be used for search.sort
- Sorting type, which can be ascending, descending, or none.pageSize
- Page size for the returned result. If zero is passed in,
defaults to 50.requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.continueFrom
- The value to start from for the new page.PrincipalInfoSet
instance that contains a set of UserInfo
objects. The number of objects in the set is <= pageSize
.javax.naming.NamingException
PrincipalInfoSet searchGroups(java.lang.String realmDN, java.lang.String searchPattern, PrincipalSearchAttribute searchProperty, PrincipalSearchSortType sort, int pageSize, java.lang.String[] requestedProperties, java.lang.String continueFrom) throws javax.naming.NamingException
Also need to support the following features:
a) Sorting: ascending or descending.
b) Paging: this method always returns groups page by page.
c) Search continuation, for which the logic is as follows:
null
value through its continueFrom
argument,
it returns the first page of the search result. By calling
PrincipalInfoSet.setContinueFrom()
, this method also returns the start
position for the next page.continueFrom
argument, it
retrieves a new page starting from this argument value.null
for the
continuation string by calling PrincipalInfoSet.setContinueFrom(null)
.
When the Content Engine receives this null
value, it stops the continuation of
this search.realmDN
- Realm name in DN format.searchPattern
- Search pattern, such as "*", for the specified
searchProperty
parameter.searchProperty
- The property to be used for the search.sort
- Sorting type, which can be ascending, descending, or none.pageSize
- Page size for returned result. If zero is passed in,
defaults to 50.requestedProperties
- Requested property names. Needs to be
converted to directory service attributes inside the method.continueFrom
- The value to start from for the new page.PrincipalInfoSet
instance that contains a set of GroupInfo
objects. The number of objects in the set is <= pageSize
.javax.naming.NamingException
© Copyright IBM Corporation 2006, 2015. All rights reserved.