Novell exteNd
Director 5.2 API

com.sssw.fw.directory.api
Interface EbiRealm

All Known Subinterfaces:
EbiDirectoryManager, EbiSilverServerRealm, EbiUserManagerRealm, EbiWeblogicRealm, EbiWebsphereRealm, EbiWriteableRealm

public interface EbiRealm

Interface that custom realms need to implement if they wish to provide read only directory services. The directory manager loads instances of realms that implement this interface as well as the sub-interface EbiWriteableRealm.


Method Summary
 Principal authUserPassword(EbiContext context, String user, String password)
          Authenticates a user using password authentication
 Principal getAnonymous()
          Returns the "anonymous" principal
 Principal getAuthenticatedUser(EbiContext context)
          Returns the authenticated user from the session or request
 Collection getChildGroups(EbiContext context, EbiRealmGroup groupPrinc)
          Gets a collection of child groups for a specified group.
 Principal getEbiRealmUserByUniqueID(EbiContext context, String uniqueID, String userType)
          Retrieves a Principal based on unique ID.
 Collection getEbiRealmUsersByUniqueIDs(EbiContext context, String[] uniqueIDs, String userType)
          Retrieves a Collection of Principals based on unique IDs.
 Group getGroup(EbiContext context, String name)
          Return the specified group
 Collection getGroupMembershipList(EbiContext context, Principal userPrinc)
          Returns a collection of Groups that have the specified principal as a member.
 Collection getGroups(EbiContext context)
          Returns a collection of Groups from the realms configured in the directory service..
 Collection getGroups(EbiContext context, EbiDirectoryGroupsQuery query)
          Returns a collection of Groups from a specified realm or all configured realms.
 Collection getParentGroups(EbiContext context, EbiRealmGroup groupPrinc)
          Gets a collection of parent groups for a specified group.
 Collection getRealmGroups(EbiContext context)
          Gets the groups from a specified realm that do not have parent groups.
 String getRealmName()
          Returns the name of the realm
 Principal getUser(EbiContext context, String name)
          Return the specified user
 Collection getUsers(EbiContext context)
          Returns a collection of user principals from realms specified in the directory service.
 Collection getUsers(EbiContext context, EbiDirectoryUsersQuery query)
          Returns a collection of user principals from a specified realm or all configured realms.
 boolean isAnonymous(Principal princ)
          Checks to see if a principal is "anonymous".
 boolean isContainerSupported()
          Checks to see if directory containers are supported by the specified realm.
 boolean isDynamicGroupSupported()
          Returns true if the realm supports dynamic groups, false otherwise.
 boolean isGroupQuerySupported()
          Returns true if the realm supports group queries, false otherwise.
 boolean isNestedGroupSupported()
          Returns true if the realm supports nested groups, false otherwise.
 boolean isUserQuerySupported()
          Returns true if the realm supports user queries, false otherwise.
 boolean isValidUserID(String userID)
          Checks to see if the specified user ID contains invalid characters.
 void logoff(EbiContext context)
          Logs off the current user from the session
 

Method Detail

getRealmName

public String getRealmName()
Returns the name of the realm
Returns:
a string representing the realm name

getUsers

public Collection getUsers(EbiContext context)
                    throws EboException
Returns a collection of user principals from realms specified in the directory service.
Parameters:
context - an EbiContext object.
Returns:
a collection of user principals of type EbiRealmUser from configured realms.

getUser

public Principal getUser(EbiContext context,
                         String name)
                  throws EboException
Return the specified user
Parameters:
context - an EbiContext object
name - the user id to retrieve
Returns:
a Principal or null if not found

getGroups

public Collection getGroups(EbiContext context)
                     throws EboException
Returns a collection of Groups from the realms configured in the directory service..
Parameters:
context - an EbiContext object.
Returns:
a collection of groups of type EbiRealmGroup from the configured realms.

getGroup

public Group getGroup(EbiContext context,
                      String name)
               throws EboException
Return the specified group
Parameters:
context - an EbiContext object
name - the group name to retrieve
Returns:
the specified group or null if it doesn't exist

getGroupMembershipList

public Collection getGroupMembershipList(EbiContext context,
                                         Principal userPrinc)
                                  throws EboException
Returns a collection of Groups that have the specified principal as a member.
Parameters:
context - an EbiContext object.
userPrinc - a user principal.
Returns:
a collection of groups of type EbiRealmGroup for the specified user principal.

authUserPassword

public Principal authUserPassword(EbiContext context,
                                  String user,
                                  String password)
                           throws EboUnrecoverableSystemException,
                                  EboSecurityException
Authenticates a user using password authentication
Parameters:
user - the user name to authenticate
password - the password used as the credentials
Returns:
a Principal that represents the authenticated user

getEbiRealmUserByUniqueID

public Principal getEbiRealmUserByUniqueID(EbiContext context,
                                           String uniqueID,
                                           String userType)
                                    throws EboException
Retrieves a Principal based on unique ID.
Parameters:
context - an EbiContext object
uniqueID - the unique ID to use to locate the user/group
userType - either a user or group as defined in com.sssw.fw.api.EbiConstants
Returns:
the principal associated with the uniqueID or null if it doesn't exist
See Also:
com.sssw.fw.api.EbiConstants.FW_PRINCIPAL_GROUP, com.sssw.fw.api.EbiConstants.FW_PRINCIPAL_USER

getEbiRealmUsersByUniqueIDs

public Collection getEbiRealmUsersByUniqueIDs(EbiContext context,
                                              String[] uniqueIDs,
                                              String userType)
                                       throws EboException
Retrieves a Collection of Principals based on unique IDs.
Parameters:
context - an EbiContext object
uniqueIDs - an array of unique IDs to use to locate the users/groups
userType - either a user or group as defined in com.sssw.fw.api.EbiConstants
Returns:
a collection of principals of type Principal associated with the uniqueID or null if none are found
See Also:
com.sssw.fw.api.EbiConstants.FW_PRINCIPAL_GROUP, com.sssw.fw.api.EbiConstants.FW_PRINCIPAL_USER

isAnonymous

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

getAnonymous

public Principal getAnonymous()
Returns the "anonymous" principal
Returns:
the principal object that represent an "anonymous" user

getRealmGroups

public Collection getRealmGroups(EbiContext context)
                          throws EboException
Gets the groups from a specified realm that do not have parent groups.
Parameters:
context - an EbiContext object.
Returns:
a collection of groups of type EbiRealmGroup that do not have parent groups. If the specified realm doesn't support nested groups, the returned collection will contain all groups managed by the realm.

getParentGroups

public Collection getParentGroups(EbiContext context,
                                  EbiRealmGroup groupPrinc)
                           throws EboException
Gets a collection of parent groups for a specified group. Returns null if no parent groups exist.
Parameters:
groupPrinc - a group principal.
Returns:
the parent group principals of type EbiRealmGroup if there are any.

getChildGroups

public Collection getChildGroups(EbiContext context,
                                 EbiRealmGroup groupPrinc)
                          throws EboException
Gets a collection of child groups for a specified group. Returns null if no child groups exist.
Parameters:
groupPrinc - a group principal.
Returns:
the child group principals of type EbiRealmGroup if there are any.

isNestedGroupSupported

public boolean isNestedGroupSupported()
Returns true if the realm supports nested groups, false otherwise.

isGroupQuerySupported

public boolean isGroupQuerySupported()
Returns true if the realm supports group queries, false otherwise. Group queries provide for retrieval of selected groups.

isUserQuerySupported

public boolean isUserQuerySupported()
Returns true if the realm supports user queries, false otherwise. User queries provide for retrieval of selected users.

logoff

public void logoff(EbiContext context)
            throws EboException
Logs off the current user from the session
Parameters:
context - an EbiContext

getAuthenticatedUser

public Principal getAuthenticatedUser(EbiContext context)
Returns the authenticated user from the session or request
Parameters:
context - an EbiContext

getUsers

public Collection getUsers(EbiContext context,
                           EbiDirectoryUsersQuery query)
                    throws EboException
Returns a collection of user principals from a specified realm or all configured realms. A query object is used to filter the user list.
Parameters:
context - an EbiContext object.
query - an EbiDirectoryUsersQuery object.
Returns:
a collection of user principals of type EbiRealmUser from configured realms.

getGroups

public Collection getGroups(EbiContext context,
                            EbiDirectoryGroupsQuery query)
                     throws EboException
Returns a collection of Groups from a specified realm or all configured realms. A query object is used to filter the group list.
Parameters:
context - an EbiContext object.
query - an EbiDirectoryGroupsQuery object.
Returns:
a collection of groups of type EbiRealmGroup from the configured realms.

isDynamicGroupSupported

public boolean isDynamicGroupSupported()
Returns true if the realm supports dynamic groups, false otherwise. Dynamic groups utilize queries to determine membership.

isContainerSupported

public boolean isContainerSupported()
Checks to see if directory containers are supported by the specified realm.
Returns:
true if the realm supports containers, false otherwise.

isValidUserID

public boolean isValidUserID(String userID)
Checks to see if the specified user ID contains invalid characters.
Returns:
true if the user ID contains valid characters, false otherwise.

Note that a double quote is a valid character for a user ID in LDAP. For example: cn="Ernie",o="Novell"

See Also:
EbiUserDelegate.isValidUserID(EbiContext context, String userID)

Novell exteNd
Director 5.2 API