public abstract class AbstractTransformer extends java.lang.Object implements Transformer
Constructor and Description |
---|
AbstractTransformer() |
Modifier and Type | Method and Description |
---|---|
java.io.File |
getAsyncTransformedContent(java.lang.String ticket,
java.lang.String fileId)
Returns the asynchronously transformed content with the given File ID.
|
boolean |
isTransformable(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Checks if the transformer is capable of transforming the requested source mimetype to the requested
target mimetype given the additional
TransformationOptions . |
void |
setSupportedSourceMimetypes(java.util.List<java.lang.String> supportedSourceMimetypes) |
void |
setSupportedTargetMimetypes(java.util.List<java.lang.String> supportedTargetMimetypes) |
abstract boolean |
supportsAsynchronous()
Returns true if the transformer is capible of performing its transformations in an aysnchronous manner, false if the
transformer is synchronous.
|
abstract java.lang.String |
transformAsync(java.lang.String ticket,
java.io.InputStream content,
java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Transform the content of the byte[] passed in with the sourceMimeType into the targetMimeType.
|
abstract void |
transformSync(java.lang.String ticket,
java.io.InputStream content,
java.io.OutputStream output,
java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Transforms the given byte[] of content (with the given 'sourceMimeType') into the targetMimeType with the given arguments.
|
public abstract java.lang.String transformAsync(java.lang.String ticket, java.io.InputStream content, java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
Transformer
ITransformation#transform(String, byte[], String, String, TransformationOptions)
method. For proper functionality an asynchronous transformer must be configured for use. Callers of this method are responsible for
pulling the content from this URL on their own, as nothing is done with the content.transformAsync
in interface Transformer
public abstract void transformSync(java.lang.String ticket, java.io.InputStream content, java.io.OutputStream output, java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
Transformer
transformSync
in interface Transformer
ticket
- A valid OC ticket.content
- A byte[] containing the content to transform.sourceMimetype
- The mimetype of the content that is being transformed.targetMimetype
- The mimetype that the transformed content should be.options
- The TransformationOptions
to use for transforming the content.public abstract boolean supportsAsynchronous()
Transformer
supportsAsynchronous
in interface Transformer
public java.io.File getAsyncTransformedContent(java.lang.String ticket, java.lang.String fileId)
Transformer
getAsyncTransformedContent
in interface Transformer
public boolean isTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
Transformer
TransformationOptions
.isTransformable
in interface Transformer
sourceMimetype
- The mimetype of the content that is being transformed.targetMimetype
- The mimetype that the transformed content should be.options
- The TransformationOptions
to use for transforming the content.public void setSupportedSourceMimetypes(java.util.List<java.lang.String> supportedSourceMimetypes)
public void setSupportedTargetMimetypes(java.util.List<java.lang.String> supportedTargetMimetypes)