@AlfrescoPublicApi public abstract class AbstractContentTransformerLimits extends ContentTransformerHelper implements ContentTransformer
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.
Modifier and Type | Field and Description |
---|---|
protected TransformerDebug |
transformerDebug
For debug
|
transformerConfig
Constructor and Description |
---|
AbstractContentTransformerLimits() |
Modifier and Type | Method and Description |
---|---|
protected TransformationOptionLimits |
getLimits()
Deprecated.
use
getLimits(String, String, TransformationOptions) which allows the
limits to be selected based on mimetype and use. |
protected TransformationOptionLimits |
getLimits(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.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.
|
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.
|
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(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.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.
|
deprecatedSetter, equals, getBeanName, getComments, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments, getName, getTransformationTime, getTransformationTime, isExplicitTransformation, transform, transform, transform
protected TransformerDebug transformerDebug
protected boolean isPageLimitSupported(String sourceMimetype, String targetMimetype, TransformationOptions options)
public void setPageLimitsSupported(boolean pageLimitsSupported)
public void setTransformerDebug(TransformerDebug transformerDebug)
transformerDebug
- TransformerDebugpublic boolean isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
isTransformable
in interface ContentTransformer
public boolean isTransformable(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options)
Implementation calls the deprecated overloaded method without the sourceSize parameter
and then isTransformableSize(String, long, String, TransformationOptions)
.
isTransformable
in interface ContentTransformer
sourceMimetype
- the source mimetypesourceSize
- the size (bytes) of the source. If negative it is unknown.targetMimetype
- the target mimetypeoptions
- the transformation optionspublic boolean isTransformableMimetype(String sourceMimetype, String targetMimetype, TransformationOptions options)
ContentTransformerHelper.getComments(boolean)
.isTransformableMimetype
in interface ContentTransformer
sourceMimetype
- the source mimetypetargetMimetype
- the target mimetypeoptions
- the transformation optionspublic boolean isTransformableSize(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options)
sourceSize
.
The maxSourceSizeKBytes
property may indicate that only small source files
may be transformed.isTransformableSize
in interface ContentTransformer
sourceSize
- size in bytes of the source. If negative, the source size is unknown.sourceMimetype
- the source mimetypetargetMimetype
- the target mimetypeoptions
- the transformation optionstrue
if the source is transformable.public long getMaxSourceSizeKBytes(String sourceMimetype, String targetMimetype, TransformationOptions options)
getMaxSourceSizeKBytes
in interface ContentTransformer
protected long getTimeoutMs()
getTimeoutMs()
which allows the limits to be selected based on mimetype and use.public void setTimeoutMs(long timeoutMs)
protected long getReadLimitTimeMs()
getReadLimitTimeMs()
which allows the limits to be selected based on mimetype and use.public void setReadLimitTimeMs(long readLimitTimeMs)
protected long getMaxSourceSizeKBytes()
getMaxSourceSizeKBytes()
which allows the limits to be selected based on mimetype and use.public void setMaxSourceSizeKBytes(long maxSourceSizeKBytes)
protected long getReadLimitKBytes()
getReadLimitKBytes()
which allows the limits to be selected based on mimetype and use.public void setReadLimitKBytes(long readLimitKBytes)
protected int getMaxPages()
getMaxPages()
which allows the limits to be selected based on mimetype and use.public void setMaxPages(int maxPages)
protected int getPageLimit()
getPageLimit()
which allows the limits to be selected based on mimetype and use.public void setPageLimit(int pageLimit)
protected TransformationOptionLimits getLimits()
getLimits(String, String, TransformationOptions)
which allows the
limits to be selected based on mimetype and use.public void setLimits(TransformationOptionLimits limits)
public void setMimetypeLimits(Map<String,Map<String,TransformationOptionLimits>> mimetypeLimits)
protected TransformationOptionLimits getLimits(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)
protected TransformationOptionLimits getLimits(String sourceMimetype, String targetMimetype, TransformationOptions options)
protected void setReaderLimits(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)
AbstractContentReader
.reader
- passed to ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions)
.writer
- passed to ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions)
.options
- passed to ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions)
.Copyright © 2005–2017 Alfresco Software. All rights reserved.