|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sakaiproject.entitybroker.entityprovider.extension.ActionReturn
public class ActionReturn
A special object used to return specialized results from a custom action execution, includes fields to allow for handling of encoded binary data and to indicate that entity action processing should continue as it would have if there had been no custom action call (rather than exiting the standard chain)
| Nested Class Summary | |
|---|---|
static class |
ActionReturn.Header
|
| Field Summary | |
|---|---|
String |
encoding
The encoding to use for the output when it is returned |
List<EntityData> |
entitiesList
A List of entities to return, leave as null if not used |
EntityData |
entityData
An entity object to return, leave as null if not used |
String |
format
Indicates the format (from Formats) to return the entity data in if there is any,
if using an outputstream, use encoding and mimetype |
Map<String,String> |
headers
Optional headers to include in the response (can use the header constants if desired: ActionReturn.Header),
Example: headers.put(Header.EXPIRES.toString(), "12378389233737"); headers.put("myHeaderKey", "my Value to put in the header"); |
String |
mimeType
The MIME type to use for the output when it is returned |
OutputStream |
output
the data to output (should use a provided OutputStream), can be binary, leave this null if not used |
String |
outputString
the output data in string form, leave this null if not used |
int |
responseCode
The response code to send back from the processing of this action, the default which also indicates the response code as determined by the system should be used is -1 |
| Constructor Summary | |
|---|---|
ActionReturn(EntityData entityData,
String format)
Create a return that is appropriate for sending back an entity |
|
ActionReturn(List<EntityData> entitiesList,
String format)
Create a return that is appropriate for sending back a list of entities |
|
ActionReturn(Object data)
Special constructor which will ensure the data is output exactly as is without adding in the entity meta data |
|
ActionReturn(Object data,
Map<String,String> headers)
Special constructor which will ensure the data is output exactly as is without adding in the entity meta data |
|
ActionReturn(Object data,
Map<String,String> headers,
String format)
Special constructor which will ensure the data is output exactly as is without adding in the entity meta data |
|
ActionReturn(OutputStream output)
Set the OutputStream to indicate it was used, uses default encoding UTF-8 and type of text/xml |
|
ActionReturn(String outputString)
Set a string of data to return, uses default encoding UTF-8 and type of text/xml |
|
ActionReturn(String encoding,
String mimeType,
OutputStream output)
Create a return that is appropriate for sending binary data or a large chunk of text |
|
ActionReturn(String encoding,
String mimeType,
String outputString)
Create a return that is appropriate for sending back a string |
|
| Method Summary | |
|---|---|
String |
getEncoding()
|
List<EntityData> |
getEntitiesList()
|
EntityData |
getEntityData()
|
String |
getFormat()
|
Map<String,String> |
getHeaders()
|
String |
getMimeType()
|
OutputStream |
getOutput()
|
String |
getOutputString()
|
int |
getResponseCode()
|
void |
setFormat(String format)
Indicates the format (from Formats) to return the entity data in if there is any,
if using an outputstream, use encoding and mimetype |
void |
setHeaders(Map<String,String> headers)
Set the optional headers to include in the response (can use the header constants if desired: ActionReturn.Header),
Example: headers.put(Header.EXPIRES.toString(), "12378389233737"); headers.put("myHeaderKey", "my Value to put in the header"); |
void |
setResponseCode(int responseCode)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public String encoding
public String mimeType
public OutputStream output
public String outputString
public EntityData entityData
public List<EntityData> entitiesList
public String format
Formats) to return the entity data in if there is any,
if using an outputstream, use encoding and mimetype
public Map<String,String> headers
ActionReturn.Header),
Example:
public int responseCode
| Constructor Detail |
|---|
public ActionReturn(OutputStream output)
output - an OutputStream of data to send as ispublic ActionReturn(String outputString)
outputString - a string to send as is
public ActionReturn(String encoding,
String mimeType,
OutputStream output)
encoding - the encoding to use for the binary datamimeType - the mime type to use for the binary dataoutput - the stream of binary data
public ActionReturn(String encoding,
String mimeType,
String outputString)
encoding - the encoding to use for the binary datamimeType - the mime type to use for the binary dataoutputString - the string valuepublic ActionReturn(Object data)
data - the data to encode (any java objects including collections, POJOs, maps, etc.)
public ActionReturn(Object data,
Map<String,String> headers)
data - the data to encode (any java objects including collections, POJOs, maps, etc.)headers - (optional) headers to include in the response (can use the header constants if desired: ActionReturn.Header)
public ActionReturn(Object data,
Map<String,String> headers,
String format)
data - the data to encode (any java objects including collections, POJOs, maps, etc.)headers - (optional) headers to include in the response (can use the header constants if desired: ActionReturn.Header)format - (optional) the format to return this data in (from Formats), e.g. Formats.XML
public ActionReturn(EntityData entityData,
String format)
entityData - an entity object (EntityData object)format - (optional) the format to return this data in (from Formats), e.g. Formats.XML
public ActionReturn(List<EntityData> entitiesList,
String format)
entityData - a List of entities (EntityData) (can be empty)format - (optional) the format to return this data in (from Formats), e.g. Formats.XML| Method Detail |
|---|
public void setFormat(String format)
Formats) to return the entity data in if there is any,
if using an outputstream, use encoding and mimetype
public void setHeaders(Map<String,String> headers)
ActionReturn.Header),
Example:
public void setResponseCode(int responseCode)
responseCode - the response code to send back from the processing of this action,
the default which also indicates the response code as determined by the system should be used is -1public String toString()
toString in class Objectpublic String getEncoding()
public String getMimeType()
public OutputStream getOutput()
public String getOutputString()
public EntityData getEntityData()
public List<EntityData> getEntitiesList()
public String getFormat()
public Map<String,String> getHeaders()
public int getResponseCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||