Interface IStreamingAction
-
- All Superinterfaces:
IAction
public interface IStreamingAction extends IAction
The interface for Actions that want to stream content to the caller. A "streaming" output is a special type of action definition output that will result in anOutputStream
being set on the Action. It is generally recommended that if your Action bean yields any content for user consumption, that it implementIStreamingAction
. This guarantees that your Action will have the option of:- streaming the generated content back to the user, such as an HTTP servlet response
- saving the content to a content repository
- communicating with existing BI Platform components (such as EmailComponent, which expects to find attachments in the content repository)
From the perspective of the Action Sequence itself, an output is considered a "streaming" output if the attribute "type" is set to "content", e.g.
OutputStream
will be determined by theIOutputHandler
provided during the execution of the Action Sequence by theISolutionEngine
.In the case that an output is considered "streaming", it will basically be treated similar to an input in that it will be set on the Action with a setter method. For example, if an action definition declares a streaming output called "reportContent", then the platform will attempt to call a method on the Action called "setReportContentStream(OutputStream os)". Note that the post-fix "Stream" will be added to the name of your output. Streaming outputs will not be queried once the Action has finished executing like a normal non-streaming output would.
- Since:
- 3.6
- Author:
- aphillips
- See Also:
IAction
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getMimeType(String streamPropertyName)
Requests the mimetype of the content that the Action will write to the provided stream name.void
setOutputStream(OutputStream outputStream)
-
Methods inherited from interface org.pentaho.platform.api.action.IAction
execute, isExecutionSuccessful
-
-
-
-
Method Detail
-
getMimeType
String getMimeType(String streamPropertyName)
Requests the mimetype of the content that the Action will write to the provided stream name. To use the example in the above javadoc, this streamPropertyName would be "reportContent".- Parameters:
streamPropertyName
- the action definition output name representing the streamed output, e.g. "reportContent"- Returns:
- the mimeType for the stream indicated by streamPropertyName
-
setOutputStream
void setOutputStream(OutputStream outputStream)
-
-