org.sakaiproject.entitybroker.providers
Class UserEntityProvider

java.lang.Object
  extended by org.sakaiproject.entitybroker.util.AbstractEntityProvider
      extended by org.sakaiproject.entitybroker.providers.UserEntityProvider
All Implemented Interfaces:
ActionsExecutable, CollectionResolvable, Createable, CRUDable, Deleteable, Describeable, Inputable, Outputable, Redirectable, Resolvable, RESTful, Sampleable, Saveable, Updateable, CoreEntityProvider, EntityProvider, Formats, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class UserEntityProvider
extends AbstractEntityProvider
implements CoreEntityProvider, RESTful, Describeable

Entity Provider for users

Author:
Aaron Zeckoski (azeckoski @ gmail.com)

Field Summary
static String PREFIX
           
 
Fields inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.CollectionResolvable
SEARCH_LOCATION_REFERENCE, SEARCH_TAGS, SEARCH_USER_REFERENCE
 
Fields inherited from interface org.sakaiproject.entitybroker.entityprovider.extension.Formats
ALL_KNOWN_FORMATS, ATOM, ATOM_EXTENSIONS, ATOM_MIME_TYPE, FORM, FORM_EXTENSIONS, FORM_MIME_TYPE, HTML, HTML_EXTENSIONS, HTML_MIME_TYPE, JSON, JSON_EXTENSIONS, JSON_MIME_TYPE, JSONP, JSONP_EXTENSIONS, JSONP_MIME_TYPE, RSS, RSS_EXTENSIONS, RSS_MIME_TYPE, TXT, TXT_EXTENSIONS, TXT_MIME_TYPE, UTF_8, XML, XML_EXTENSIONS, XML_MIME_TYPE
 
Fields inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.ActionsExecutable
ACTION_METHOD_SUFFIX
 
Constructor Summary
UserEntityProvider()
           
 
Method Summary
 boolean checkUserExists(EntityView view)
           
 EntityUser convertUser(org.sakaiproject.user.api.User user)
           
 String createEntity(EntityReference ref, Object entity, Map<String,Object> params)
           
 void deleteEntity(EntityReference ref, Map<String,Object> params)
           
 boolean entityExists(String id)
           
 String findAndCheckUserId(String currentUserId, String currentUserEid)
          Will check that a userId/eid is valid and will produce a valid userId from the check
 EntityUser findUserFromSearchValue(String userSearchValue)
           
 EntityUser getCurrentUser(EntityView view)
           
 List<?> getEntities(EntityReference ref, Search search)
          WARNING: The search results may be drawn from different populations depending on the search parameters specified.
 Object getEntity(EntityReference ref)
           
 String getEntityPrefix()
           
 String[] getHandledInputFormats()
           
 String[] getHandledOutputFormats()
           
 Object getSampleEntity()
           
 EntityUser getUserById(String userId)
          Allows for easy retrieval of the user object
 void setDeveloperHelperService(DeveloperHelperService developerHelperService)
           
 void setServerConfigurationService(org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)
           
 void setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService userDirectoryService)
           
 void updateEntity(EntityReference ref, Object entity, Map<String,Object> params)
           
 
Methods inherited from class org.sakaiproject.entitybroker.util.AbstractEntityProvider
afterPropertiesSet, destroy, setEntityProviderManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX

public static String PREFIX
Constructor Detail

UserEntityProvider

public UserEntityProvider()
Method Detail

setUserDirectoryService

public void setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService userDirectoryService)

setDeveloperHelperService

public void setDeveloperHelperService(DeveloperHelperService developerHelperService)
Overrides:
setDeveloperHelperService in class AbstractEntityProvider

setServerConfigurationService

public void setServerConfigurationService(org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)

getEntityPrefix

public String getEntityPrefix()
Specified by:
getEntityPrefix in interface EntityProvider

getCurrentUser

public EntityUser getCurrentUser(EntityView view)

checkUserExists

public boolean checkUserExists(EntityView view)

entityExists

public boolean entityExists(String id)
Specified by:
entityExists in interface CoreEntityProvider

createEntity

public String createEntity(EntityReference ref,
                           Object entity,
                           Map<String,Object> params)
Specified by:
createEntity in interface Createable

getSampleEntity

public Object getSampleEntity()
Specified by:
getSampleEntity in interface Sampleable

updateEntity

public void updateEntity(EntityReference ref,
                         Object entity,
                         Map<String,Object> params)
Specified by:
updateEntity in interface Updateable

deleteEntity

public void deleteEntity(EntityReference ref,
                         Map<String,Object> params)
Specified by:
deleteEntity in interface Deleteable

getEntity

public Object getEntity(EntityReference ref)
Specified by:
getEntity in interface Resolvable

getEntities

public List<?> getEntities(EntityReference ref,
                           Search search)
WARNING: The search results may be drawn from different populations depending on the search parameters specified. A straight listing with no filtering, or a search on "search" or "criteria", will only retrieve matches from the Sakai-maintained user records. A search on "email" may also check the records maintained by the user directory provider.

Specified by:
getEntities in interface CollectionResolvable

getHandledInputFormats

public String[] getHandledInputFormats()
Specified by:
getHandledInputFormats in interface Inputable

getHandledOutputFormats

public String[] getHandledOutputFormats()
Specified by:
getHandledOutputFormats in interface Outputable

getUserById

public EntityUser getUserById(String userId)
Allows for easy retrieval of the user object

Parameters:
userId - a user ID (must be internal ID only and not EID)
Returns:
the user object
Throws:
IllegalArgumentException - if the user Id is invalid

findAndCheckUserId

public String findAndCheckUserId(String currentUserId,
                                 String currentUserEid)
Will check that a userId/eid is valid and will produce a valid userId from the check

Parameters:
currentUserId - user id (can be eid)
currentUserEid - user eid (can be id)
Returns:
a valid user id OR null if not valid

findUserFromSearchValue

public EntityUser findUserFromSearchValue(String userSearchValue)
Parameters:
userSearchValue - either a user ID, a user EID, or a user email address
Returns:
the first matching user, or null if no search method worked

convertUser

public EntityUser convertUser(org.sakaiproject.user.api.User user)


Copyright © 2007-2012 Sakai Project. All Rights Reserved.