Class 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 for ContentTransformer implementations.

    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 TransformationOptions provided for a specific transform.

    Author:
    Alan Davis
    • Field Detail

      • transformerDebug

        protected TransformerDebug transformerDebug
        Deprecated.
        For debug
    • Constructor Detail

      • AbstractContentTransformerLimits

        public AbstractContentTransformerLimits()
        Deprecated.
    • 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,
                                       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:
        isTransformable in interface ContentTransformer
        Parameters:
        sourceMimetype - the source mimetype
        sourceSize - the size (bytes) of the source. If negative it is unknown.
        targetMimetype - the target mimetype
        options - 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 overriding ContentTransformerHelper.getComments(boolean).
        Specified by:
        isTransformableMimetype in interface ContentTransformer
        Parameters:
        sourceMimetype - the source mimetype
        targetMimetype - the target mimetype
        options - 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 given sourceSize. The maxSourceSizeKBytes property may indicate that only small source files may be transformed.
        Specified by:
        isTransformableSize in interface ContentTransformer
        Parameters:
        sourceSize - size in bytes of the source. If negative, the source size is unknown.
        sourceMimetype - the source mimetype
        targetMimetype - the target mimetype
        options - the transformation options
        Returns:
        true if 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:
        getMaxSourceSizeKBytes in interface ContentTransformer
        Returns:
        0 if the the transformation is disabled, -1 if there is no limit, otherwise the size in KBytes.
      • getTimeoutMs

        protected long getTimeoutMs()
        Deprecated.
        use getTimeoutMs() 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.
        use getReadLimitTimeMs() 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.
        use getMaxSourceSizeKBytes() 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.
        use getReadLimitKBytes() 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.
        use getMaxPages() 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.
        use getPageLimit() 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.
      • 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.