Class TransformServiceRegistryImpl

    • Constructor Detail

      • TransformServiceRegistryImpl

        public TransformServiceRegistryImpl()
    • Method Detail

      • setJsonObjectMapper

        public void setJsonObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper jsonObjectMapper)
      • afterPropertiesSet

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

        protected abstract org.apache.commons.logging.Log getLog()
      • register

        public void register​(Transformer transformer)
      • isSupported

        public boolean isSupported​(String sourceMimetype,
                                   long sourceSizeInBytes,
                                   String targetMimetype,
                                   Map<String,​String> actualOptions,
                                   String renditionName)
        Description copied from interface: TransformServiceRegistry
        Works out if the Transform Server should be able to transform content of a given source mimetype and size into a target mimetype given a list of actual transform option names and values (Strings) plus the data contained in the objects registered with this class.
        Specified by:
        isSupported in interface TransformServiceRegistry
        Parameters:
        sourceMimetype - the mimetype of the source content
        sourceSizeInBytes - the size in bytes of the source content. Ignored if negative.
        targetMimetype - the mimetype of the target
        actualOptions - the actual name value pairs available that could be passed to the Transform Service.
        renditionName - (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.
      • getTransformerName

        protected String getTransformerName​(String sourceMimetype,
                                            long sourceSizeInBytes,
                                            String targetMimetype,
                                            Map<String,​String> actualOptions,
                                            String renditionName)
        Works out the name of the transformer (might not map to an actual transformer) that will be used to transform content of a given source mimetype and size into a target mimetype given a list of actual transform option names and values (Strings) plus the data contained in the objects registered with this class.
        Parameters:
        sourceMimetype - the mimetype of the source content
        sourceSizeInBytes - the size in bytes of the source content. Ignored if negative.
        targetMimetype - the mimetype of the target
        actualOptions - the actual name value pairs available that could be passed to the Transform Service.
        renditionName - (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.
      • getMaxSize

        public long getMaxSize​(String sourceMimetype,
                               String targetMimetype,
                               Map<String,​String> actualOptions,
                               String renditionName)
        Description copied from interface: TransformServiceRegistry
        Returns the maximun size (in bytes) of the source content that can be transformed.
        Specified by:
        getMaxSize in interface TransformServiceRegistry
        Parameters:
        sourceMimetype - the mimetype of the source content
        targetMimetype - the mimetype of the target
        actualOptions - the actual name value pairs available that could be passed to the Transform Service.
        renditionName - (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.
        Returns:
        the maximum size (in bytes) of the source content that can be transformed. If -1 there is no limit, but if 0 the transform is not supported.