org.sakaiproject.service.legacy.realm
Interface RealmProvider

All Known Implementing Classes:
SampleRealmProvider

public interface RealmProvider

RealmProvider provides Role for Users in a Realm, as defined "elsewhere" in some way.

Version:
$Revision: 1.2 $
Author:
University of Michigan, Sakai Software Development Team

Method Summary
 java.util.Map getRealmRolesForUser(java.lang.String userId)
          Access the external realm id - Role name map for this users in all external realms.
 java.lang.String getRole(java.lang.String id, java.lang.String user)
          Access the Role name for this particular user in the external realm.
 java.util.Map getUserRolesForRealm(java.lang.String id)
          Access the userId - Role name map for all users in the external realm.
 java.lang.String[] unpackId(java.lang.String id)
          Unpack a possibly compound id into it's component ids, returning at least the id unchanged if not compound.
 

Method Detail

getRole

public java.lang.String getRole(java.lang.String id,
                                java.lang.String user)
Access the Role name for this particular user in the external realm.

Parameters:
id - The external realm id.
Returns:
the Role name for this particular user in the external realm, or null if none.

getUserRolesForRealm

public java.util.Map getUserRolesForRealm(java.lang.String id)
Access the userId - Role name map for all users in the external realm.

Parameters:
id - The external realm id.
Returns:
the userId - Role name map for all users in the external realm (may be empty).

getRealmRolesForUser

public java.util.Map getRealmRolesForUser(java.lang.String userId)
Access the external realm id - Role name map for this users in all external realms. If the provider supports compound external ids, the get() of this Map needs to accept a compount external id and return the single role (if any) resolved from any individual external realm ids in the map.

Parameters:
userId - The user id.
Returns:
the the external realm id - Role name map for this users in all external realms. (may be empty).

unpackId

public java.lang.String[] unpackId(java.lang.String id)
Unpack a possibly compound id into it's component ids, returning at least the id unchanged if not compound.

Parameters:
id - The external realm id.
Returns:
a String array of one or more ids upacked from this possibly compound id.