Class TransformServiceRegistryImpl
- java.lang.Object
-
- org.alfresco.transform.client.model.config.TransformServiceRegistryImpl
-
- All Implemented Interfaces:
TransformServiceRegistry,org.springframework.beans.factory.InitializingBean
public class TransformServiceRegistryImpl extends Object implements TransformServiceRegistry, org.springframework.beans.factory.InitializingBean
Used by clients to work out if a transformation is supported by the Transform Service.
-
-
Constructor Summary
Constructors Constructor Description TransformServiceRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()longgetMaxSize(String sourceMimetype, String targetMimetype, Map<String,String> actualOptions, String transformName)Returns the maximun size (in bytes) of the source content that can be transformed.booleanisSupported(String sourceMimetype, long sourceSizeInBytes, String targetMimetype, Map<String,String> actualOptions, String transformName)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.voidregister(Reader reader)voidregister(Transformer transformer)voidsetExtensionMap(ExtensionMap extensionMap)voidsetJsonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper jsonObjectMapper)
-
-
-
Method Detail
-
setJsonObjectMapper
public void setJsonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper jsonObjectMapper)
-
setExtensionMap
public void setExtensionMap(ExtensionMap extensionMap)
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
register
public void register(Transformer transformer)
-
register
public void register(Reader reader) throws IOException
- Throws:
IOException
-
isSupported
public boolean isSupported(String sourceMimetype, long sourceSizeInBytes, String targetMimetype, Map<String,String> actualOptions, String transformName)
Description copied from interface:TransformServiceRegistryWorks 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:
isSupportedin interfaceTransformServiceRegistry- Parameters:
sourceMimetype- the mimetype of the source contentsourceSizeInBytes- the size in bytes of the source content. Ignored if negative.targetMimetype- the mimetype of the targetactualOptions- 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.
-
getMaxSize
public long getMaxSize(String sourceMimetype, String targetMimetype, Map<String,String> actualOptions, String transformName)
Description copied from interface:TransformServiceRegistryReturns the maximun size (in bytes) of the source content that can be transformed.- Specified by:
getMaxSizein interfaceTransformServiceRegistry- Parameters:
sourceMimetype- the mimetype of the source contenttargetMimetype- the mimetype of the targetactualOptions- 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.- Returns:
- the maximum size (in bytes) of the source content that can be transformed. If
-1there is no limit, but if0the transform is not supported.
-
-