Class TransformServiceRegistryImpl
- java.lang.Object
-
- org.alfresco.transform.client.model.config.TransformServiceRegistryImpl
-
- All Implemented Interfaces:
TransformServiceRegistry,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
LocalTransformServiceRegistry
public abstract class TransformServiceRegistryImpl extends java.lang.Object implements TransformServiceRegistry, org.springframework.beans.factory.InitializingBean
Used by clients to work out if a transformation is supported by the Transform Service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTransformServiceRegistryImpl.Datastatic classTransformServiceRegistryImpl.TransformServiceRegistryJob
-
Field Summary
Fields Modifier and Type Field Description protected TransformServiceRegistryImpl.Datadataprotected booleanenabled
-
Constructor Summary
Constructors Constructor Description TransformServiceRegistryImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected TransformServiceRegistryImpl.DatacreateData()protected java.lang.StringgetCounts()org.quartz.CronExpressiongetCronExpression()protected TransformServiceRegistryImpl.DatagetData()protected booleangetFirstTime()org.quartz.CronExpressiongetInitialAndOnErrorCronExpression()protected abstract org.apache.commons.logging.LoggetLog()longgetMaxSize(java.lang.String sourceMimetype, java.lang.String targetMimetype, java.util.Map<java.lang.String,java.lang.String> actualOptions, java.lang.String renditionName)Returns the maximun size (in bytes) of the source content that can be transformed.org.quartz.SchedulergetScheduler()protected java.lang.StringgetTransformerName(java.lang.String sourceMimetype, long sourceSizeInBytes, java.lang.String targetMimetype, java.util.Map<java.lang.String,java.lang.String> actualOptions, java.lang.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.booleanisSupported(java.lang.String sourceMimetype, long sourceSizeInBytes, java.lang.String targetMimetype, java.util.Map<java.lang.String,java.lang.String> actualOptions, java.lang.String renditionName)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.protected abstract TransformServiceRegistryImpl.DatareadConfig()protected voidreadConfigAndReplace()voidregister(TransformServiceRegistryImpl.Data data, java.io.Reader reader, java.lang.String readFrom)protected voidregister(TransformServiceRegistryImpl.Data data, Transformer transformer, java.lang.String baseUrl, java.lang.String readFrom)voidsetCronExpression(org.quartz.CronExpression cronExpression)voidsetEnabled(boolean enabled)protected voidsetFirstTime(boolean firstTime)voidsetInitialAndOnErrorCronExpression(org.quartz.CronExpression initialAndOnErrorCronExpression)voidsetJsonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper jsonObjectMapper)voidsetScheduler(org.quartz.Scheduler scheduler)protected voidsetSuccessReadingRemoteConfig(TransformServiceRegistryImpl.Data data, boolean successReadingRemoteConfig)
-
-
-
Field Detail
-
enabled
protected boolean enabled
-
data
protected TransformServiceRegistryImpl.Data data
-
-
Method Detail
-
setJsonObjectMapper
public void setJsonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper jsonObjectMapper)
-
getScheduler
public org.quartz.Scheduler getScheduler()
-
setScheduler
public void setScheduler(org.quartz.Scheduler scheduler)
-
getCronExpression
public org.quartz.CronExpression getCronExpression()
-
setCronExpression
public void setCronExpression(org.quartz.CronExpression cronExpression)
-
getInitialAndOnErrorCronExpression
public org.quartz.CronExpression getInitialAndOnErrorCronExpression()
-
setInitialAndOnErrorCronExpression
public void setInitialAndOnErrorCronExpression(org.quartz.CronExpression initialAndOnErrorCronExpression)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
readConfigAndReplace
protected void readConfigAndReplace()
-
readConfig
protected abstract TransformServiceRegistryImpl.Data readConfig() throws java.io.IOException
- Throws:
java.io.IOException
-
getData
protected TransformServiceRegistryImpl.Data getData()
-
createData
protected TransformServiceRegistryImpl.Data createData()
-
setSuccessReadingRemoteConfig
protected void setSuccessReadingRemoteConfig(TransformServiceRegistryImpl.Data data, boolean successReadingRemoteConfig)
-
setEnabled
public void setEnabled(boolean enabled)
-
setFirstTime
protected void setFirstTime(boolean firstTime)
-
getFirstTime
protected boolean getFirstTime()
-
getLog
protected abstract org.apache.commons.logging.Log getLog()
-
register
public void register(TransformServiceRegistryImpl.Data data, java.io.Reader reader, java.lang.String readFrom) throws java.io.IOException
- Throws:
java.io.IOException
-
register
protected void register(TransformServiceRegistryImpl.Data data, Transformer transformer, java.lang.String baseUrl, java.lang.String readFrom)
-
getCounts
protected java.lang.String getCounts()
-
isSupported
public boolean isSupported(java.lang.String sourceMimetype, long sourceSizeInBytes, java.lang.String targetMimetype, java.util.Map<java.lang.String,java.lang.String> actualOptions, java.lang.String renditionName)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.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 java.lang.String getTransformerName(java.lang.String sourceMimetype, long sourceSizeInBytes, java.lang.String targetMimetype, java.util.Map<java.lang.String,java.lang.String> actualOptions, java.lang.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 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.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(java.lang.String sourceMimetype, java.lang.String targetMimetype, java.util.Map<java.lang.String,java.lang.String> actualOptions, java.lang.String renditionName)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.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
-1there is no limit, but if0the transform is not supported.
-
-