Class AbstractContentTransformerLimits
- java.lang.Object
-
- org.alfresco.repo.content.transform.ContentTransformerHelper
-
- org.alfresco.repo.content.transform.AbstractContentTransformerLimits
-
- All Implemented Interfaces:
ContentWorker,ContentTransformer,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
AbstractContentTransformer2
@Deprecated @AlfrescoPublicApi public abstract class AbstractContentTransformerLimits extends ContentTransformerHelper implements ContentTransformer
Deprecated.The transformations code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.Provides transformation limits forContentTransformerimplementations.This class maintains the limits and provides methods that combine limits: a) for the transformer as a whole b) for specific combinations if source and target mimetypes c) for the
TransformationOptionsprovided for a specific transform.- Author:
- Alan Davis
-
-
Field Summary
Fields Modifier and Type Field Description protected TransformerDebugtransformerDebugDeprecated.For debug-
Fields inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
transformerConfig
-
-
Constructor Summary
Constructors Constructor Description AbstractContentTransformerLimits()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected TransformationOptionLimitsgetLimits()Deprecated.usegetLimits(String, String, TransformationOptions)which allows the limits to be selected based on mimetype and use.protected TransformationOptionLimitsgetLimits(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Returns max and limit values for time, size and pages for a specified source and target mimetypes, combined with this Transformer's general limits and optionally the supplied transformation option's limits.protected TransformationOptionLimitsgetLimits(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)Deprecated.Returns max and limit values for time, size and pages for a specified source and target mimetypes, combined with this Transformer's general limits and optionally the supplied transformation option's limits.protected intgetMaxPages()Deprecated.usegetMaxPages()which allows the limits to be selected based on mimetype and use.protected longgetMaxSourceSizeKBytes()Deprecated.usegetMaxSourceSizeKBytes()which allows the limits to be selected based on mimetype and use.longgetMaxSourceSizeKBytes(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Returns the maximum source size (in KBytes) allowed given the supplied values.protected intgetPageLimit()Deprecated.usegetPageLimit()which allows the limits to be selected based on mimetype and use.protected longgetReadLimitKBytes()Deprecated.usegetReadLimitKBytes()which allows the limits to be selected based on mimetype and use.protected longgetReadLimitTimeMs()Deprecated.usegetReadLimitTimeMs()which allows the limits to be selected based on mimetype and use.protected longgetTimeoutMs()Deprecated.usegetTimeoutMs()which allows the limits to be selected based on mimetype and use.protected booleanisPageLimitSupported(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Indicates if 'page' limits are supported.booleanisTransformable(java.lang.String sourceMimetype, long sourceSize, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Indicates whether the provided source mimetype can be transformed into the target mimetype with the options specified by this content transformer.booleanisTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.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.voidsetLimits(TransformationOptionLimits limits)Deprecated.transformation limits are now set with global properties rather than spring configuration.voidsetMaxPages(int maxPages)Deprecated.transformation limits are now set with global properties rather than spring configuration.voidsetMaxSourceSizeKBytes(long maxSourceSizeKBytes)Deprecated.transformation limits are now set with global properties rather than spring configuration.voidsetMimetypeLimits(java.util.Map<java.lang.String,java.util.Map<java.lang.String,TransformationOptionLimits>> mimetypeLimits)Deprecated.transformation limits are now set with global properties rather than spring configuration.voidsetPageLimit(int pageLimit)Deprecated.transformation limits are now set with global properties rather than spring configuration.voidsetPageLimitsSupported(boolean pageLimitsSupported)Deprecated.Indicates if 'page' limits are supported.protected voidsetReaderLimits(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)Deprecated.Pass on any limits to the reader.voidsetReadLimitKBytes(long readLimitKBytes)Deprecated.transformation limits are now set with global properties rather than spring configuration.voidsetReadLimitTimeMs(long readLimitTimeMs)Deprecated.transformation limits are now set with global properties rather than spring configuration.voidsetTimeoutMs(long timeoutMs)Deprecated.transformation limits are now set with global properties rather than spring configuration.voidsetTransformerDebug(TransformerDebug transformerDebug)Deprecated.Helper setter of the transformer debug.-
Methods inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
deprecatedSetter, equals, getBeanName, getComments, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations, toString
-
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
getComments, getName, getTransformationTime, getTransformationTime, isExplicitTransformation, transform, transform, transform
-
-
-
-
Field Detail
-
transformerDebug
protected TransformerDebug transformerDebug
Deprecated.For debug
-
-
Method Detail
-
isPageLimitSupported
protected boolean isPageLimitSupported(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Indicates if 'page' limits are supported.- Returns:
- false by default.
-
setPageLimitsSupported
public void setPageLimitsSupported(boolean pageLimitsSupported)
Deprecated.Indicates if 'page' limits are supported.
-
setTransformerDebug
public void setTransformerDebug(TransformerDebug transformerDebug)
Deprecated.Helper setter of the transformer debug.- Parameters:
transformerDebug- TransformerDebug
-
isTransformable
public boolean isTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.- Specified by:
isTransformablein interfaceContentTransformer
-
isTransformable
public boolean isTransformable(java.lang.String sourceMimetype, long sourceSize, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Indicates whether the provided source mimetype can be transformed into the target mimetype with the options specified by this content transformer.Implementation calls the deprecated overloaded method without the sourceSize parameter and then
isTransformableSize(String, long, String, TransformationOptions).- Specified by:
isTransformablein interfaceContentTransformer- 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.Indicates 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- 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.Indicates if this transformer is able to transform the givensourceSize. ThemaxSourceSizeKBytesproperty may indicate that only small source files may be transformed.- Specified by:
isTransformableSizein interfaceContentTransformer- Parameters:
sourceSize- size in bytes of the source. If negative, the source size is unknown.sourceMimetype- the source mimetypetargetMimetype- the target mimetypeoptions- the transformation options- Returns:
trueif the source is transformable.
-
getMaxSourceSizeKBytes
public long getMaxSourceSizeKBytes(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.Returns the maximum source size (in KBytes) allowed given the supplied values.- Specified by:
getMaxSourceSizeKBytesin interfaceContentTransformer- Returns:
- 0 if the the transformation is disabled, -1 if there is no limit, otherwise the size in KBytes.
-
getTimeoutMs
protected long getTimeoutMs()
Deprecated.usegetTimeoutMs()which allows the limits to be selected based on mimetype and use.
-
setTimeoutMs
public void setTimeoutMs(long timeoutMs)
Deprecated.transformation limits are now set with global properties rather than spring configuration.
-
getReadLimitTimeMs
protected long getReadLimitTimeMs()
Deprecated.usegetReadLimitTimeMs()which allows the limits to be selected based on mimetype and use.
-
setReadLimitTimeMs
public void setReadLimitTimeMs(long readLimitTimeMs)
Deprecated.transformation limits are now set with global properties rather than spring configuration.
-
getMaxSourceSizeKBytes
protected long getMaxSourceSizeKBytes()
Deprecated.usegetMaxSourceSizeKBytes()which allows the limits to be selected based on mimetype and use.
-
setMaxSourceSizeKBytes
public void setMaxSourceSizeKBytes(long maxSourceSizeKBytes)
Deprecated.transformation limits are now set with global properties rather than spring configuration.
-
getReadLimitKBytes
protected long getReadLimitKBytes()
Deprecated.usegetReadLimitKBytes()which allows the limits to be selected based on mimetype and use.
-
setReadLimitKBytes
public void setReadLimitKBytes(long readLimitKBytes)
Deprecated.transformation limits are now set with global properties rather than spring configuration.
-
getMaxPages
protected int getMaxPages()
Deprecated.usegetMaxPages()which allows the limits to be selected based on mimetype and use.
-
setMaxPages
public void setMaxPages(int maxPages)
Deprecated.transformation limits are now set with global properties rather than spring configuration.
-
getPageLimit
protected int getPageLimit()
Deprecated.usegetPageLimit()which allows the limits to be selected based on mimetype and use.
-
setPageLimit
public void setPageLimit(int pageLimit)
Deprecated.transformation limits are now set with global properties rather than spring configuration.
-
getLimits
protected TransformationOptionLimits getLimits()
Deprecated.usegetLimits(String, String, TransformationOptions)which allows the limits to be selected based on mimetype and use.
-
setLimits
public void setLimits(TransformationOptionLimits limits)
Deprecated.transformation limits are now set with global properties rather than spring configuration.
-
setMimetypeLimits
public void setMimetypeLimits(java.util.Map<java.lang.String,java.util.Map<java.lang.String,TransformationOptionLimits>> mimetypeLimits)
Deprecated.transformation limits are now set with global properties rather than spring configuration.
-
getLimits
protected TransformationOptionLimits getLimits(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)
Deprecated.Returns max and limit values for time, size and pages for a specified source and target mimetypes, combined with this Transformer's general limits and optionally the supplied transformation option's limits.
-
getLimits
protected TransformationOptionLimits getLimits(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
Deprecated.Returns max and limit values for time, size and pages for a specified source and target mimetypes, combined with this Transformer's general limits and optionally the supplied transformation option's limits.
-
setReaderLimits
protected void setReaderLimits(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)Deprecated.Pass on any limits to the reader. Will only do so if the reader is anAbstractContentReader.- Parameters:
reader- passed toContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions).writer- passed toContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions).options- passed toContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions).
-
-