Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.alfresco.repo.content.transform
Class AbstractContentTransformerLimits
java.lang.Object
  org.alfresco.repo.content.transform.ContentTransformerHelper
      org.alfresco.repo.content.transform.AbstractContentTransformerLimits
All Implemented Interfaces:
ContentTransformer, ContentWorker, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.Aware
Direct Known Subclasses:
AbstractContentTransformer2

@org.alfresco.api.AlfrescoPublicApi
public abstract class AbstractContentTransformerLimits
extends ContentTransformerHelper
implements ContentTransformer
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 Summary
transformerDebug
          For debug
Fields inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
transformerConfig
Constructor Summary
AbstractContentTransformerLimits()
Method Summary
getLimits()
          Deprecated. use getLimits(String, String, TransformationOptions) which allows the limits to be selected based on mimetype and use.
getLimits(ContentReader reader, ContentWriter writer, TransformationOptions options)
          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(String sourceMimetype, String targetMimetype, TransformationOptions options)
          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 int
getMaxPages()
          Deprecated. use getMaxPages() which allows the limits to be selected based on mimetype and use.
protected long
getMaxSourceSizeKBytes()
          Deprecated. use getMaxSourceSizeKBytes() which allows the limits to be selected based on mimetype and use.
long
getMaxSourceSizeKBytes(String sourceMimetype, String targetMimetype, TransformationOptions options)
          Returns the maximum source size (in KBytes) allowed given the supplied values.
protected int
getPageLimit()
          Deprecated. use getPageLimit() which allows the limits to be selected based on mimetype and use.
protected long
getReadLimitKBytes()
          Deprecated. use getReadLimitKBytes() which allows the limits to be selected based on mimetype and use.
protected long
getReadLimitTimeMs()
          Deprecated. use getReadLimitTimeMs() which allows the limits to be selected based on mimetype and use.
protected long
getTimeoutMs()
          Deprecated. use getTimeoutMs() which allows the limits to be selected based on mimetype and use.
protected boolean
isPageLimitSupported(String sourceMimetype, String targetMimetype, TransformationOptions options)
          Indicates if 'page' limits are supported.
boolean
isTransformable(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options)
          Indicates whether the provided source mimetype can be transformed into the target mimetype with the options specified by this content transformer.
boolean
isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
boolean
isTransformableMimetype(String sourceMimetype, String targetMimetype, TransformationOptions options)
          Indicates if this transformer is able to transform the given source mimetype to the target mimetype.
boolean
isTransformableSize(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options)
          Indicates if this transformer is able to transform the given sourceSize.
void
setLimits(TransformationOptionLimits limits)
          Deprecated. transformation limits are now set with global properties rather than spring configuration.
void
setMaxPages(int maxPages)
          Deprecated. transformation limits are now set with global properties rather than spring configuration.
void
setMaxSourceSizeKBytes(long maxSourceSizeKBytes)
          Deprecated. transformation limits are now set with global properties rather than spring configuration.
void
setMimetypeLimits(Map<String,Map<String,TransformationOptionLimits>> mimetypeLimits)
          Deprecated. transformation limits are now set with global properties rather than spring configuration.
void
setPageLimit(int pageLimit)
          Deprecated. transformation limits are now set with global properties rather than spring configuration.
void
setPageLimitsSupported(boolean pageLimitsSupported)
          Indicates if 'page' limits are supported.
protected void
setReaderLimits(ContentReader reader, ContentWriter writer, TransformationOptions options)
          Pass on any limits to the reader.
void
setReadLimitKBytes(long readLimitKBytes)
          Deprecated. transformation limits are now set with global properties rather than spring configuration.
void
setReadLimitTimeMs(long readLimitTimeMs)
          Deprecated. transformation limits are now set with global properties rather than spring configuration.
void
setTimeoutMs(long timeoutMs)
          Deprecated. transformation limits are now set with global properties rather than spring configuration.
void
setTransformerDebug(TransformerDebug transformerDebug)
          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
For debug
Constructor Detail
AbstractContentTransformerLimits
public AbstractContentTransformerLimits()
Method Detail
isPageLimitSupported
protected boolean isPageLimitSupported(String sourceMimetype,
                                       String targetMimetype,
                                       TransformationOptions options)
Indicates if 'page' limits are supported.
Returns:
false by default.

setPageLimitsSupported
public void setPageLimitsSupported(boolean pageLimitsSupported)
Indicates if 'page' limits are supported.

setTransformerDebug
public void setTransformerDebug(TransformerDebug transformerDebug)
Helper setter of the transformer debug.
Parameters:
transformerDebug - TransformerDebug

isTransformable
public boolean isTransformable(String sourceMimetype,
                               String targetMimetype,
                               TransformationOptions options)
Specified by:
isTransformable in interface ContentTransformer

isTransformable
public boolean isTransformable(String sourceMimetype,
                               long sourceSize,
                               String targetMimetype,
                               TransformationOptions options)
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(String sourceMimetype,
                                       String targetMimetype,
                                       TransformationOptions options)
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(String sourceMimetype,
                                   long sourceSize,
                                   String targetMimetype,
                                   TransformationOptions options)
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:
sourceMimetype - the source mimetype
sourceSize - size in bytes of the source. If negative, the source size is unknown.
targetMimetype - the target mimetype
options - the transformation options
Returns:
true if the source is transformable.

getMaxSourceSizeKBytes
public long getMaxSourceSizeKBytes(String sourceMimetype,
                                   String targetMimetype,
                                   TransformationOptions options)
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.

getLimits
protected TransformationOptionLimits getLimits()
Deprecated. use getLimits(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(Map<String,Map<String,TransformationOptionLimits>> mimetypeLimits)
Deprecated. transformation limits are now set with global properties rather than spring configuration.

getLimits
protected TransformationOptionLimits getLimits(ContentReader reader,
                                               ContentWriter writer,
                                               TransformationOptions options)
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(String sourceMimetype,
                                               String targetMimetype,
                                               TransformationOptions options)
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(ContentReader reader,
                               ContentWriter writer,
                               TransformationOptions options)
Pass on any limits to the reader. Will only do so if the reader is an AbstractContentReader.
Parameters:
reader - passed to ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions).
writer - passed to ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions).
options - passed to ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions).

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2018 Alfresco Software. All rights reserved.

Java API documentation generated with DocFlex/Javadoc 1.6.1 using JavadocPro template set.