com.sun.im.provider
Interface Realm


public interface Realm

Abstact class to get list of users/groups and authenticate them. Implementations of this could be text file, LDAP, NIS, NT Domains..............


Field Summary
static int MAIL_ATTRIBUTE
           
static int NAME_ATTRIBUTE
           
static int UID_ATTRIBUTE
           
 
Method Summary
 CollaborationPrincipal authenticate(java.lang.String uid, java.lang.String pass)
          autheticate a user
 boolean changeUserPassword(java.lang.String uid, java.lang.String password)
          changes a user's password
 CollaborationPrincipal createUser(java.lang.String uid, java.lang.String password, java.util.Map attributes)
          adds a new user to the realm
 CollaborationPrincipal[] expandGroup(CollaborationPrincipal principal, CollaborationGroup g)
          expand the contents of a group
 ConferenceStorageProvider getConferenceStorageProvider()
          returns a handle to a conference storage provider
 java.lang.String getDomainName(java.lang.String searchBase)
          returns a domain name associated with a scope For instance in the case of an LDAP realm, it would be the domain name associated with an organization.
 CollaborationGroup getGroup(CollaborationPrincipal principal, java.lang.String gid)
          retrieve a group based on its unique identifier
 NewsStorageProvider getNewsStorageProvider()
          returns a handle to a conference storage provider
 PolicyProvider getPolicyProvider()
          returns a handle to a policy provider associated with this Realm.
 CollaborationPrincipal getPrincipal(CollaborationPrincipal principal, java.lang.String uid)
          get a CollaborationPrincipal from the uid
 CollaborationPrincipal getPrincipal(java.lang.String searchBase, java.lang.String uid)
           
 java.lang.String getSearchBase(java.lang.String domainName)
          returns a search base or scope associated with a DNS domain identifier.
 java.lang.String getUserPassword(CollaborationPrincipal principal)
          Retrieve a user password.
 UserSettingsStorageProvider getUserSettingsStorageProvider()
          returns a handle to a user settings storage provider
 boolean ignoreDomains()
          get the ignoredomains value
 boolean isMemberOfGroup(CollaborationPrincipal p, CollaborationGroup g)
          returns true if a principal is member of a group
 void removeUser(java.lang.String uid)
          removes a user from the realm
 RealmSearchResults search(CollaborationPrincipal principal, java.lang.String pattern, int attributeType, java.lang.String filter)
          search for users
 RealmSearchResults search(java.lang.String searchFilter, java.lang.String scope)
          search for users
 RealmSearchResults search(java.lang.String base, java.lang.String pattern, int attributeType, java.lang.String filter)
          search for users
 void stop()
          stop the realm
 

Field Detail

NAME_ATTRIBUTE

public static final int NAME_ATTRIBUTE
See Also:
Constant Field Values

UID_ATTRIBUTE

public static final int UID_ATTRIBUTE
See Also:
Constant Field Values

MAIL_ATTRIBUTE

public static final int MAIL_ATTRIBUTE
See Also:
Constant Field Values
Method Detail

stop

public void stop()
stop the realm


getPrincipal

public CollaborationPrincipal getPrincipal(CollaborationPrincipal principal,
                                           java.lang.String uid)
                                    throws RealmException
get a CollaborationPrincipal from the uid

Parameters:
uid -
principal - principal making the request
Throws:
com.iplanet.im.server.RealmException
RealmException

getPrincipal

public CollaborationPrincipal getPrincipal(java.lang.String searchBase,
                                           java.lang.String uid)
                                    throws RealmException
Throws:
RealmException

createUser

public CollaborationPrincipal createUser(java.lang.String uid,
                                         java.lang.String password,
                                         java.util.Map attributes)
                                  throws RealmException
adds a new user to the realm

Parameters:
uid - user ID (fully-quaslified)
password - user password
attributes - user attributes.
Throws:
RealmException

removeUser

public void removeUser(java.lang.String uid)
                throws RealmException
removes a user from the realm

Parameters:
uid - user ID (fully-quaslified)
Throws:
RealmException

changeUserPassword

public boolean changeUserPassword(java.lang.String uid,
                                  java.lang.String password)
                           throws RealmException
changes a user's password

Parameters:
uid - user ID (fully-qualified)
password - new user password
Returns:
true if password was changed successfully
Throws:
RealmException

getUserPassword

public java.lang.String getUserPassword(CollaborationPrincipal principal)
Retrieve a user password. This is used for DIGEST authentication

Returns:
password

getGroup

public CollaborationGroup getGroup(CollaborationPrincipal principal,
                                   java.lang.String gid)
                            throws RealmException
retrieve a group based on its unique identifier

Parameters:
gid - group identifier
principal - principal making the request
Returns:
group
Throws:
com.iplanet.im.server.RealmException
RealmException

expandGroup

public CollaborationPrincipal[] expandGroup(CollaborationPrincipal principal,
                                            CollaborationGroup g)
                                     throws RealmException
expand the contents of a group

Parameters:
g -
principal - principal making the request
Throws:
com.iplanet.im.server.RealmException
RealmException

search

public RealmSearchResults search(CollaborationPrincipal principal,
                                 java.lang.String pattern,
                                 int attributeType,
                                 java.lang.String filter)
                          throws RealmException
search for users

Parameters:
principal - principal making the request
pattern - search pattern
filter - search filter
attributeType - one of NAME_ATTRIBUTE, UID_ATTRIBUTE, or MAIL_ATTRIBUTE
Returns:
search results handle
Throws:
RealmException

search

public RealmSearchResults search(java.lang.String base,
                                 java.lang.String pattern,
                                 int attributeType,
                                 java.lang.String filter)
                          throws RealmException
search for users

Parameters:
base - search base
pattern - search pattern
filter - search filter
attributeType - one of NAME_ATTRIBUTE, UID_ATTRIBUTE, or MAIL_ATTRIBUTE
Returns:
search results handle
Throws:
RealmException

search

public RealmSearchResults search(java.lang.String searchFilter,
                                 java.lang.String scope)
                          throws RealmException
search for users

Parameters:
scope - search base
Returns:
vector of CollaborationPrincipal
Throws:
RealmException

authenticate

public CollaborationPrincipal authenticate(java.lang.String uid,
                                           java.lang.String pass)
                                    throws RealmException
autheticate a user

Parameters:
uid - login id
pass - password
Throws:
RealmException

isMemberOfGroup

public boolean isMemberOfGroup(CollaborationPrincipal p,
                               CollaborationGroup g)
                        throws RealmException
returns true if a principal is member of a group

Parameters:
p - principal to locate in the group
g - group object
Returns:
true if principal is a member of g
Throws:
RealmException

getSearchBase

public java.lang.String getSearchBase(java.lang.String domainName)
                               throws RealmException
returns a search base or scope associated with a DNS domain identifier. For instance in the case of an LDAP realm, it would be the dn of the organization associated with the domain name. This search base is then used by the server to perform user/group searches.

Parameters:
domainName - DNS domain name
Returns:
search base.
Throws:
RealmException

getDomainName

public java.lang.String getDomainName(java.lang.String searchBase)
                               throws RealmException
returns a domain name associated with a scope For instance in the case of an LDAP realm, it would be the domain name associated with an organization. This domain name is then used to construct the fquid of the user

Returns:
domain name.
Throws:
RealmException

getUserSettingsStorageProvider

public UserSettingsStorageProvider getUserSettingsStorageProvider()
returns a handle to a user settings storage provider

Returns:
UserSettingsStorageProvider object associated with this Realm
See Also:
UserSettingsStorageProvider

getConferenceStorageProvider

public ConferenceStorageProvider getConferenceStorageProvider()
returns a handle to a conference storage provider

Returns:
ConferenceStorageProvider object associated with this Realm
See Also:
ConferenceStorageProvider

getNewsStorageProvider

public NewsStorageProvider getNewsStorageProvider()
returns a handle to a conference storage provider

Returns:
NewsStorageProvider object associated with this Realm
See Also:
NewsStorageProvider

getPolicyProvider

public PolicyProvider getPolicyProvider()
returns a handle to a policy provider associated with this Realm.

Returns:
NewsStorageProvider object associated with this Realm
See Also:
NewsStorageProvider

ignoreDomains

public boolean ignoreDomains()
get the ignoredomains value