Class LocalSynchronousTransformClient

  • All Implemented Interfaces:
    SynchronousTransformClient, org.springframework.beans.factory.InitializingBean

    public class LocalSynchronousTransformClient
    extends java.lang.Object
    implements SynchronousTransformClient, org.springframework.beans.factory.InitializingBean
    Request synchronous transforms. Transforms take place using transforms available on the local machine (based on LocalTransform).
    Author:
    adavis
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()  
      java.lang.String getName()  
      boolean isSupported​(java.lang.String sourceMimetype, long sourceSizeInBytes, java.lang.String contentUrl, java.lang.String targetMimetype, java.util.Map<java.lang.String,​java.lang.String> actualOptions, java.lang.String transformName, org.alfresco.service.cmr.repository.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.
      void setLocalTransformServiceRegistry​(LocalTransformServiceRegistry localTransformServiceRegistry)  
      void transform​(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, java.util.Map<java.lang.String,​java.lang.String> actualOptions, java.lang.String transformName, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef)
      Requests a synchronous transform.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocalSynchronousTransformClient

        public LocalSynchronousTransformClient()
    • Method Detail

      • setLocalTransformServiceRegistry

        public void setLocalTransformServiceRegistry​(LocalTransformServiceRegistry localTransformServiceRegistry)
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • isSupported

        public boolean isSupported​(java.lang.String sourceMimetype,
                                   long sourceSizeInBytes,
                                   java.lang.String contentUrl,
                                   java.lang.String targetMimetype,
                                   java.util.Map<java.lang.String,​java.lang.String> actualOptions,
                                   java.lang.String transformName,
                                   org.alfresco.service.cmr.repository.NodeRef sourceNodeRef)
        Description copied from interface: SynchronousTransformClient
        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.
        Specified by:
        isSupported in interface SynchronousTransformClient
        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

        public void transform​(org.alfresco.service.cmr.repository.ContentReader reader,
                              org.alfresco.service.cmr.repository.ContentWriter writer,
                              java.util.Map<java.lang.String,​java.lang.String> actualOptions,
                              java.lang.String transformName,
                              org.alfresco.service.cmr.repository.NodeRef sourceNodeRef)
        Description copied from interface: SynchronousTransformClient
        Requests a synchronous transform.
        Specified by:
        transform in interface SynchronousTransformClient
        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
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface SynchronousTransformClient
        Returns:
        type of transform (Local, Legacy) for use in debug.