org.sakaiproject.entitybroker.entityprovider.capabilities
Interface Resolvable

All Superinterfaces:
EntityProvider
All Known Subinterfaces:
BrowseableCollection, CollectionResolvable, CRUDable, RESTful, Saveable, Updateable

public interface Resolvable
extends EntityProvider

Allows the entities handled by this provider to be accessed directly as objects, this is also the interface for "reading" entities (this is the R in CRUD)
This is also used for resolving the type of entities
This is one of the capability extensions for the EntityProvider interface

Author:
Aaron Zeckoski (aaronz@vt.edu)

Method Summary
 Object getEntity(EntityReference ref)
          Allows this entity to be fetched based on the ref (prefix and local id), also used to determine the class type of these entities by requesting an entity without specifying an id (id = null)
WARNING: this method should not return null, throw the appropriate exception if the entity data cannot be found Note: The entity class type needs to be able to be resolved from the ClassLoader of the EntityBrokerManager (currently this means deployed into shared)

The entity object does not have to be a model object itself and may simply be something created (Map, String, EntityData, etc.) to give to anyone calling this method.
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.EntityProvider
getEntityPrefix
 

Method Detail

getEntity

Object getEntity(EntityReference ref)
Allows this entity to be fetched based on the ref (prefix and local id), also used to determine the class type of these entities by requesting an entity without specifying an id (id = null)
WARNING: this method should not return null, throw the appropriate exception if the entity data cannot be found Note: The entity class type needs to be able to be resolved from the ClassLoader of the EntityBrokerManager (currently this means deployed into shared)

The entity object does not have to be a model object itself and may simply be something created (Map, String, EntityData, etc.) to give to anyone calling this method.

Parameters:
ref - the parsed reference object which uniquely represents an entity OR only a prefix (indicating you should return a default constructed object with no properties set)
Returns:
an entity object for the prefix and id in the provided ref OR an empty entity object if only the prefix is supplied (should NOT return null), this return could be an EntityData object, Map, your own POJO, etc.
Throws:
IllegalArgumentException - if the id is invalid for this type of entity, NOTE: a null id means you should return a default constructed object)
SecurityException - if access to this entity is not allowed
IllegalStateException - for all other errors


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