org.sakaiproject.entitybroker.entityprovider.capabilities
Interface InputTranslatable

All Superinterfaces:
EntityProvider, Formats, Inputable, Sampleable

public interface InputTranslatable
extends Inputable

Allows this entity to define the way to translate data for a reference into an entity object depending on the format requested, if you just want to use the internal methods to handle formatting the input into an entity then simply use Inputable
NOTE: throwing FormatUnsupportedException will pass control over to the internal handlers for formatting, if you want to stop the request for this format type entirely then throw an IllegalStateException and the processing will be halted

Author:
Aaron Zeckoski (aaron@caret.cam.ac.uk)

Field Summary
 
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
 
Method Summary
 Object translateFormattedData(EntityReference ref, String format, InputStream input, Map<String,Object> params)
          Translates the input data stream in the supplied format into an entity object for this reference
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Inputable
getHandledInputFormats
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Sampleable
getSampleEntity
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.EntityProvider
getEntityPrefix
 

Method Detail

translateFormattedData

Object translateFormattedData(EntityReference ref,
                              String format,
                              InputStream input,
                              Map<String,Object> params)
Translates the input data stream in the supplied format into an entity object for this reference

Parameters:
ref - the parsed reference object which uniquely represents this entity
format - a string constant indicating the extension format (from Formats) of the input, (example: Formats.XML)
input - an stream which contains the data to make up this entity, you may assume this is UTF-8 encoded if you don't know anything else about it
params - (optional) incoming set of parameters which may be used to send data specific to this request, may be null
Returns:
an entity object of the type used for these entities
Throws:
FormatUnsupportedException - if you do not handle this format type (passes control to the internal handlers)
EntityEncodingException - if you cannot encode the received data into an entity
IllegalArgumentException - if any of the arguments are invalid
IllegalStateException - for all other failures


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