Novell
exteNd Director 4.1

com.sssw.fw.directory.api
Interface EbiDirectoryManager

All Superinterfaces:
EbiRealm, EbiWriteableRealm

public interface EbiDirectoryManager
extends EbiWriteableRealm

The directory manager provides access to user and group repositories, as well as authentication functionality. The directory manager manages a realm that provides read access to a user and group repository


Method Summary
 Principal authUserPassword(EbiContext context, String realm, String user, String password)
          Authenticates a user with specified userid, password, and realm name.
 EbiRealmUser convertPrincipal(EbiContext context, Principal princ)
          Converts an app server principal to EbiRealmUser/EbiRealmGroup.
 void flushCache(EbiContext context, String realm)
          Flushes both group and user caches in the directory service.
 void flushGroupCache(EbiContext context, String realm)
          Flushes the group caches.
 void flushUserCache(EbiContext context, String realm)
          Flushes the user caches.
 Principal getAnonymous(String realm)
          Returns the "anonymous" principal from the specified realm
 Principal getAuthenticatedUser(EbiContext context, String realm)
          Returns the authenticated user from the session or request using the specified realm
 Collection getConfiguredRealms()
          Retrieves a Collection of realm names from the DirectoryService.
 EbiRealmUser getEbiRealmUser(EbiContext context, String username, String uniqueID, String userType)
          Creates an EbiRealmUser/EbiRealmGroup principal.
 Group getGroup(EbiContext context, String realm, String name)
          Returns a group principal for the specified group principal name from the specified realm.
 Collection getGroupMembershipList(EbiContext context, String realm, Principal userPrinc)
          Returns a collection of groups for the specified user principal from the specified realm.
 Collection getGroupMembershipList(EbiContext context, String realm, String user)
          Returns a collection of groups for the specified user from the specified realm.
 Collection getGroups(EbiContext context, String realm)
          Returns a collection of groups from the specified realm.
 String getManagerName()
          Returns the manager name.
 String getPrimaryRealmName()
          Gets the name of the primary realm.
 Collection getRealmGroups(EbiContext context, String realm)
          Gets the groups from a specified realm that do not have parent groups.
 int getTotalGroups(EbiContext context)
          Returns the total number of groups from the configured realms.
 int getTotalGroups(EbiContext context, String realm)
          Returns the total number of groups from the specified realm.
 int getTotalUsers(EbiContext context)
          Returns the total number of users from the configured realms.
 int getTotalUsers(EbiContext context, String realm)
          Returns the total number of users from the specified realm.
 Principal getUser(EbiContext context, String realm, String name)
          Returns a user principal for the specified principal name from the specified realm.
 Collection getUsers(EbiContext context, String realm)
          Returns a collection of user principals from the specified realm.
 boolean isAnonymous(Principal princ, String realm)
          Checks to see if a principal is "anonymous" in the specified realm.
 boolean isNestedGroupSupported(String realm)
          Checks to see if the realm supports nested groups.
 boolean isWriteableRealm(String realm)
          Tests to see if the realm specified by a realm name is configured as the writeable realm
 void logoff(EbiContext context, String realm)
          Logs off the current user from the session
 
Methods implemented from interface com.sssw.fw.directory.api.EbiWriteableRealm
addGroup, addUser, removeGroup, removeUser
 
Methods implemented from interface com.sssw.fw.directory.api.EbiRealm
authUserPassword, getAnonymous, getAuthenticatedUser, getChildGroups, getEbiRealmUserByUniqueID, getEbiRealmUsersByUniqueIDs, getGroup, getGroupMembershipList, getGroups, getParentGroups, getRealmGroups, getRealmName, getUser, getUsers, isAnonymous, isNestedGroupSupported, logoff
 

Method Detail

getUsers

public Collection getUsers(EbiContext context,
                           String realm)
                    throws EboException
Returns a collection of user principals from the specified realm.
Parameters:
context - an EbiContext object.
realm - a name of the specified realm.
Returns:
a collection of user principals from the specified realm.

getUser

public Principal getUser(EbiContext context,
                         String realm,
                         String name)
                  throws EboException
Returns a user principal for the specified principal name from the specified realm.
Parameters:
context - an EbiContext object.
realm - a name of the specified realm.
name - a principal name.
Returns:
a Principal from the specified realm and principal name.

getGroups

public Collection getGroups(EbiContext context,
                            String realm)
                     throws EboException
Returns a collection of groups from the specified realm.
Parameters:
context - an EbiContext object.
realm - a name of the specified realm.
Returns:
a collection of groups for the specified realm.

getTotalGroups

public int getTotalGroups(EbiContext context,
                          String realm)
                   throws EboException
Returns the total number of groups from the specified realm.
Parameters:
context - an EbiContext object.
realm - a name of the specified realm.
Returns:
an integer representing the total number of groups for the specified realm.

getTotalGroups

public int getTotalGroups(EbiContext context)
                   throws EboException
Returns the total number of groups from the configured realms.
Parameters:
context - an EbiContext object.
Returns:
an integer representing the total number of groups for the configured realms.

getTotalUsers

public int getTotalUsers(EbiContext context,
                         String realm)
                  throws EboException
Returns the total number of users from the specified realm.
Parameters:
context - an EbiContext object.
realm - a name of the specified realm.
Returns:
an integer representing the total number of users for the specified realm.

getTotalUsers

public int getTotalUsers(EbiContext context)
                  throws EboException
Returns the total number of users from the configured realms.
Parameters:
context - an EbiContext object.
Returns:
an integer representing the total number of users for the configured realms.

getGroup

public Group getGroup(EbiContext context,
                      String realm,
                      String name)
               throws EboException
Returns a group principal for the specified group principal name from the specified realm.
Parameters:
context - an EbiContext object.
realm - a name of the specified realm.
name - a group principal name.
Returns:
a group principal for the specified group principal name from the specified realm.

getGroupMembershipList

public Collection getGroupMembershipList(EbiContext context,
                                         String realm,
                                         Principal userPrinc)
                                  throws EboException
Returns a collection of groups for the specified user principal from the specified realm.
Parameters:
context - an EbiContext object.
realm - a name of the specified realm.
userPrinc - a user principal.
Returns:
a collection of groups for the specified user principal from the specified realm.

getGroupMembershipList

public Collection getGroupMembershipList(EbiContext context,
                                         String realm,
                                         String user)
                                  throws EboException
Returns a collection of groups for the specified user from the specified realm.
Parameters:
context - an EbiContext object.
realm - a name of the specified realm.
user - a user name.
Returns:
a collection of groups for the specified user principal from the specified realm.

authUserPassword

public Principal authUserPassword(EbiContext context,
                                  String realm,
                                  String user,
                                  String password)
                           throws EboUnrecoverableSystemException,
                                  EboSecurityException
Authenticates a user with specified userid, password, and realm name.
Parameters:
context - an EbiContext object.
realm - a name for the specified realm.
user - an user identifier.
password - a user password.
Returns:
a user Principal if authentication succeeded, else return null.

convertPrincipal

public EbiRealmUser convertPrincipal(EbiContext context,
                                     Principal princ)
                              throws EboException
Converts an app server principal to EbiRealmUser/EbiRealmGroup.
Parameters:
context - an EbiContext object.
princ - an app server principal.
Returns:
an EbiRealmUser/EbiRealmGroup principal.

getEbiRealmUser

public EbiRealmUser getEbiRealmUser(EbiContext context,
                                    String username,
                                    String uniqueID,
                                    String userType)
Creates an EbiRealmUser/EbiRealmGroup principal.
Parameters:
context - an EbiContext object.
username - a principal name.
uniqueID - a unique identifier for the principal.
userType - whether it is a user or group principal.
Returns:
an EbiRealmUser/EbiReamGroup principal.

getManagerName

public String getManagerName()
Returns the manager name.
Returns:
the manager name.

getConfiguredRealms

public Collection getConfiguredRealms()
Retrieves a Collection of realm names from the DirectoryService. Currently the DirectoryService allows at most two realms to exist, a readable realm and a writeable realm
Returns:
a collection of realm names.

isWriteableRealm

public boolean isWriteableRealm(String realm)
Tests to see if the realm specified by a realm name is configured as the writeable realm
Parameters:
realm - the name of a realm to be checked
Returns:
true if the realm is configured as the writeable realm, false otherwise

getPrimaryRealmName

public String getPrimaryRealmName()
Gets the name of the primary realm.
Returns:
the name of the primary realm.

isAnonymous

public boolean isAnonymous(Principal princ,
                           String realm)
                    throws EboException
Checks to see if a principal is "anonymous" in the specified realm.
Parameters:
princ - the principal to check
realm - the realm name for the specified realm to check
Returns:
true if the specified principal is "anonymous" in the specified realm, false otherwise

getAnonymous

public Principal getAnonymous(String realm)
                       throws EboException
Returns the "anonymous" principal from the specified realm
Returns:
the principal object that represent an "anonymous" user in the specified realm

getRealmGroups

public Collection getRealmGroups(EbiContext context,
                                 String realm)
                          throws EboException
Gets the groups from a specified realm that do not have parent groups.
Parameters:
context - an EbiContext object.
realm - name of the specified realm, if null, primary realm is used.
Returns:
a collection of groups that do not have parent groups. If the specified realm do not support nested groups, the returned collection will contain all groups managed by the realm.

isNestedGroupSupported

public boolean isNestedGroupSupported(String realm)
Checks to see if the realm supports nested groups.
Returns:
true if the realm supports nested groups, false otherwise.

flushCache

public void flushCache(EbiContext context,
                       String realm)
                throws EboException
Flushes both group and user caches in the directory service. If realm provided is null, it flushes caches in all realms configured in the directory service.
Parameters:
context - an EbiContext object.
realm - name of the specified realm.

flushGroupCache

public void flushGroupCache(EbiContext context,
                            String realm)
                     throws EboException
Flushes the group caches. If realm provided is null, it flushes the user caches for all realms configured in the directory service.
Parameters:
context - an EbiContext object.
realm - name of the specified realm.

flushUserCache

public void flushUserCache(EbiContext context,
                           String realm)
                    throws EboException
Flushes the user caches. If realm provided is null, it flushes the user caches for all realms configured in the directory service.
Parameters:
context - an EbiContext object.
realm - name of the specified realm.

logoff

public void logoff(EbiContext context,
                   String realm)
            throws EboException
Logs off the current user from the session
Parameters:
context - an EbiContext
realm - name of the specified realm

getAuthenticatedUser

public Principal getAuthenticatedUser(EbiContext context,
                                      String realm)
                               throws EboException
Returns the authenticated user from the session or request using the specified realm
Parameters:
context - an EbiContext
realm - name of the realm

Novell
exteNd Director 4.1