public class FailoverContentTransformer extends AbstractContentTransformer2 implements org.springframework.beans.factory.InitializingBean
transformerDebug| Constructor and Description |
|---|
FailoverContentTransformer() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Ensures that required properties have been set
|
boolean |
isExplicitTransformation(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Default implementation, override if need to extend logic
|
boolean |
isTransformable(java.lang.String sourceMimetype,
long sourceSize,
java.lang.String targetMimetype,
TransformationOptions options)
Overrides super class method to avoid calling
FailoverContentTransformer.isTransformableMimetype(String, String, TransformationOptions)
twice on each transformer in the list, as
FailoverContentTransformer.isTransformableSize(String, long, String, TransformationOptions)
in this class must check the mimetype too. |
boolean |
isTransformableMimetype(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Indicates if this transformer is able to transform the given source mimetype
to the target mimetype.
|
boolean |
isTransformableSize(java.lang.String sourceMimetype,
long sourceSize,
java.lang.String targetMimetype,
TransformationOptions options)
Indicates if this transformer is able to transform the given
sourceSize. |
void |
setTransformers(java.util.List transformers)
The list of transformers to use.
|
void |
transformInternal(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
Method to be implemented by subclasses wishing to make use of the common infrastructural code
provided by this class.
|
checkTransformable, getTransformationTime, recordTime, register, setProperties, setRegistry, toString, transform, transform, transformgetBeanName, getLimits, getLimits, getLimits, getMaxPages, getMaxSourceSizeKBytes, getMaxSourceSizeKBytes, getMimetypeLimits, getPageLimit, getReadLimitKBytes, getReadLimitTimeMs, getTimeoutMs, isPageLimitSupported, isTransformable, setBeanName, setLimits, setMaxPages, setMaxSourceSizeKBytes, setMimetypeLimits, setPageLimit, setPageLimitsSuported, setReaderLimits, setReadLimitKBytes, setReadLimitTimeMs, setTimeoutMs, setTransformerDebuggetMimetype, getMimetypeService, isSupportedTransformation, setExplicitTransformations, setMimetypeService, setSupportedTransformationspublic void setTransformers(java.util.List transformers)
transformers - list of transformers.public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic boolean isTransformable(java.lang.String sourceMimetype,
long sourceSize,
java.lang.String targetMimetype,
TransformationOptions options)
FailoverContentTransformer.isTransformableMimetype(String, String, TransformationOptions)
twice on each transformer in the list, as
FailoverContentTransformer.isTransformableSize(String, long, String, TransformationOptions)
in this class must check the mimetype too.isTransformable in interface ContentTransformerisTransformable in class AbstractContentTransformerLimitssourceMimetype - the source mimetypesourceSize - the size (bytes) of the source. If negative it is unknown.targetMimetype - the target mimetypeoptions - the transformation optionspublic boolean isTransformableMimetype(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
AbstractContentTransformerLimitsisTransformableMimetype in interface ContentTransformerisTransformableMimetype in class AbstractContentTransformerLimitssourceMimetype - the source mimetypetargetMimetype - the target mimetypeoptions - the transformation optionspublic boolean isTransformableSize(java.lang.String sourceMimetype,
long sourceSize,
java.lang.String targetMimetype,
TransformationOptions options)
AbstractContentTransformerLimitssourceSize.
The maxSourceSizeKBytes property may indicate that only small source files
may be transformed.isTransformableSize in interface ContentTransformerisTransformableSize in class AbstractContentTransformerLimitssourceMimetype - the source mimetypesourceSize - size in bytes of the source. If negative, the source size is unknown.targetMimetype - the target mimetypeoptions - the transformation optionstrue if the source is transformable.public boolean isExplicitTransformation(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
ContentTransformerHelperisExplicitTransformation in interface ContentTransformerisExplicitTransformation in class ContentTransformerHelpersourceMimetype - the source mimetypetargetMimetype - the target mimetypeoptions - the transformation optionsContentTransformer.isExplicitTransformation(java.lang.String,
java.lang.String, org.alfresco.service.cmr.repository.TransformationOptions)public void transformInternal(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
throws java.lang.Exception
AbstractContentTransformer2transformInternal in class AbstractContentTransformer2reader - the source of the content to transformwriter - the target to which to write the transformed contentoptions - a map of options to use when performing the transformation. The map
will never be null.java.lang.Exception - exceptions will be handled by this class - subclasses can throw anythingAbstractContentTransformer2.transformInternal(org.alfresco.service.cmr.repository.ContentReader, org.alfresco.service.cmr.repository.ContentWriter, org.alfresco.service.cmr.repository.TransformationOptions)Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.