Class FailoverContentTransformer
- java.lang.Object
-
- org.alfresco.repo.content.transform.ContentTransformerHelper
-
- org.alfresco.repo.content.transform.AbstractContentTransformerLimits
-
- org.alfresco.repo.content.transform.AbstractContentTransformer2
-
- org.alfresco.repo.content.transform.FailoverContentTransformer
-
- All Implemented Interfaces:
ContentWorker,ContentTransformer,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
@Deprecated @AlfrescoPublicApi public class FailoverContentTransformer extends AbstractContentTransformer2 implements org.springframework.beans.factory.InitializingBean
Deprecated.The transformations code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.This class is a transformer which contains a fixed sequence of delegate transformers. Requests to transform a document will be passed to the first transformer in the sequence. If that transformer successfully transforms the document then the process is complete. However should it fail, the transformation will be passed on to the next transformer in the sequence and so on. Transformers are considered to have failed of they throw an exception.- Author:
- Neil McErlean
-
-
Field Summary
-
Fields inherited from class org.alfresco.repo.content.transform.AbstractContentTransformerLimits
transformerDebug
-
Fields inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
transformerConfig
-
-
Constructor Summary
Constructors Constructor Description FailoverContentTransformer()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()Deprecated.Ensures that required properties have been setjava.lang.StringgetComments(boolean available)Deprecated.Returns the transformer properties predefined (hard coded or implied) by this transformer.booleanisExplicitTransformation(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.booleanisTransformable(java.lang.String sourceMimetype, long sourceSize, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Overrides super class method to avoid callingisTransformableMimetype(String, String, TransformationOptions)twice on each transformer in the list, asisTransformableSize(String, long, String, TransformationOptions)in this class must check the mimetype too.booleanisTransformableMimetype(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Indicates if this transformer is able to transform the given source mimetype to the target mimetype.booleanisTransformableSize(java.lang.String sourceMimetype, long sourceSize, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Indicates if this transformer is able to transform the givensourceSize.voidsetTransformers(java.util.List<ContentTransformer> transformers)Deprecated.The list of transformers to use.voidtransformInternal(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)Deprecated.Method to be implemented by subclasses wishing to make use of the common infrastructural code provided by this class.-
Methods inherited from class org.alfresco.repo.content.transform.AbstractContentTransformer2
checkTransformable, getExecutorService, getRetryTransformOnDifferentMimeType, getStrictMimeTypeCheck, getTransformationTime, getTransformationTime, isTransformationLimitedInternally, recordError, recordTime, recordTime, register, setAdditionalThreadTimout, setExecutorService, setRegisterTransformer, setRegistry, setRetryTransformOnDifferentMimeType, setStrictMimeTypeCheck, setUseTimeoutThread, toString, transform, transform, transform
-
Methods inherited from class org.alfresco.repo.content.transform.AbstractContentTransformerLimits
getLimits, getLimits, getLimits, getMaxPages, getMaxSourceSizeKBytes, getMaxSourceSizeKBytes, getPageLimit, getReadLimitKBytes, getReadLimitTimeMs, getTimeoutMs, isPageLimitSupported, isTransformable, setLimits, setMaxPages, setMaxSourceSizeKBytes, setMimetypeLimits, setPageLimit, setPageLimitsSupported, setReaderLimits, setReadLimitKBytes, setReadLimitTimeMs, setTimeoutMs, setTransformerDebug
-
Methods inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isSupportedTransformation, onlySupports, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.content.transform.ContentTransformer
getName
-
-
-
-
Method Detail
-
setTransformers
public void setTransformers(java.util.List<ContentTransformer> transformers)
Deprecated.The list of transformers to use. There must be at least one, but for failover behaviour to work there should be at least two.- Parameters:
transformers- list of transformers.
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.ExceptionDeprecated.Ensures that required properties have been set- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
isTransformable
public boolean isTransformable(java.lang.String sourceMimetype, long sourceSize, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Overrides super class method to avoid callingisTransformableMimetype(String, String, TransformationOptions)twice on each transformer in the list, asisTransformableSize(String, long, String, TransformationOptions)in this class must check the mimetype too.- Specified by:
isTransformablein interfaceContentTransformer- Overrides:
isTransformablein classAbstractContentTransformerLimits- Parameters:
sourceMimetype- the source mimetypesourceSize- the size (bytes) of the source. If negative it is unknown.targetMimetype- the target mimetypeoptions- the transformation options- Returns:
- boolean true if this content transformer can satify the mimetypes and options specified, false otherwise
-
isTransformableMimetype
public boolean isTransformableMimetype(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Description copied from class:AbstractContentTransformerLimitsIndicates if this transformer is able to transform the given source mimetype to the target mimetype. If overridden, consider also overridingContentTransformerHelper.getComments(boolean).- Specified by:
isTransformableMimetypein interfaceContentTransformer- Overrides:
isTransformableMimetypein classAbstractContentTransformerLimits- Parameters:
sourceMimetype- the source mimetypetargetMimetype- the target mimetypeoptions- the transformation options- Returns:
- boolean true if this content transformer can satify the mimetypes, false otherwise
-
isTransformableSize
public boolean isTransformableSize(java.lang.String sourceMimetype, long sourceSize, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Description copied from class:AbstractContentTransformerLimitsIndicates if this transformer is able to transform the givensourceSize. ThemaxSourceSizeKBytesproperty may indicate that only small source files may be transformed.- Specified by:
isTransformableSizein interfaceContentTransformer- Overrides:
isTransformableSizein classAbstractContentTransformerLimits- Parameters:
sourceMimetype- the source mimetypesourceSize- size in bytes of the source. If negative, the source size is unknown.targetMimetype- the target mimetypeoptions- the transformation options- Returns:
trueif the source is transformable.
-
isExplicitTransformation
public boolean isExplicitTransformation(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.- Specified by:
isExplicitTransformationin interfaceContentTransformer- Overrides:
isExplicitTransformationin classContentTransformerHelper- Parameters:
sourceMimetype- the source mimetypetargetMimetype- the target mimetypeoptions- the transformation options- Returns:
- boolean true if it is an explicit transformation, false otherwise
- See Also:
ContentTransformer.isExplicitTransformation(java.lang.String, java.lang.String, org.alfresco.service.cmr.repository.TransformationOptions)
-
transformInternal
public void transformInternal(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options) throws java.lang.ExceptionDeprecated.Description copied from class:AbstractContentTransformer2Method to be implemented by subclasses wishing to make use of the common infrastructural code provided by this class.- Specified by:
transformInternalin classAbstractContentTransformer2- Parameters:
reader- 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.- Throws:
java.lang.Exception- exceptions will be handled by this class - subclasses can throw anything- See Also:
AbstractContentTransformer2.transformInternal(org.alfresco.service.cmr.repository.ContentReader, org.alfresco.service.cmr.repository.ContentWriter, org.alfresco.service.cmr.repository.TransformationOptions)
-
getComments
public java.lang.String getComments(boolean available)
Deprecated.Returns the transformer properties predefined (hard coded or implied) by this transformer.- Specified by:
getCommentsin interfaceContentTransformer- Overrides:
getCommentsin classContentTransformerHelper- Parameters:
available- indicates if the transformer has been registered and is available to be selected.falseindicates that the transformer is only available as a component of a complex transformer.- Returns:
- one line per property. The simple transformer name is returned by default as a comment.
-
-