Interface SynchronousTransformClient

All Known Implementing Classes:
LocalSynchronousTransformClient

public interface SynchronousTransformClient
Request synchronous transforms.
Author:
adavis
  • Method Details

    • isSupported

      boolean isSupported(String sourceMimetype, long sourceSizeInBytes, String contentUrl, String targetMimetype, Map<String,String> actualOptions, String transformName, NodeRef sourceNodeRef)
      Works out if it is possible to transform content of a given source mimetype and size into a target mimetype given a list of actual transform option names and values. Ideally, just call the transform method and catch the UnsupportedTransformationException to avoid extra work.
      Parameters:
      sourceMimetype - the mimetype of the source content
      sourceSizeInBytes - the size in bytes of the source content. Ignored if negative.
      contentUrl - The url of the content. Optional as it is only used in debug messages.
      targetMimetype - the mimetype of the target
      actualOptions - the actual name value pairs available that could be passed to the Transform Service.
      transformName - (optional) name for the set of options and target mimetype. If supplied is used to cache results to avoid having to work out if a given transformation is supported a second time. The sourceMimetype and sourceSizeInBytes may still change. In the case of ACS this is the rendition name.
      sourceNodeRef - (optional) NodeRef of the source content. Only used in debug messages.
      Returns:
      true if it is supported.
    • transform

      void transform(ContentReader reader, ContentWriter writer, Map<String,String> actualOptions, String transformName, NodeRef sourceNodeRef) throws UnsupportedTransformationException, ContentIOException
      Requests a synchronous transform.
      Parameters:
      reader - of the source content
      writer - to the target node's content
      actualOptions - the actual name value pairs available that could be passed to the Transform Service.
      transformName - (optional) name for the set of options and target mimetype. If supplied is used to cache results to avoid having to work out if a given transformation is supported a second time. The sourceMimetype and sourceSizeInBytes may still change. In the case of ACS this is the rendition name.
      sourceNodeRef - the source node
      Throws:
      UnsupportedTransformationException - if there is an unexpected failure to transform, normally in a pipeline, where an intermediate transform may not be performed after all because an intermediate converion is too big.
      ContentIOException - there is an unexpected communication or transformation failure.
      UnsupportedTransformationException - if isSupported has not been called and
    • getName

      String getName()
      Returns:
      type of transform (Local) for use in debug.