|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.content.transform.ContentTransformerHelper
org.alfresco.repo.content.transform.AbstractContentTransformerLimits
public abstract class AbstractContentTransformerLimits
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.
| Field Summary | |
|---|---|
protected TransformerDebug |
transformerDebug
For debug |
| Constructor Summary | |
|---|---|
AbstractContentTransformerLimits()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getBeanName()
Returns the Spring bean name - only for use in debug. |
protected TransformationOptionLimits |
getLimits()
Returns max and limit values for time, size and pages in a single operation. |
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(java.lang.String sourceMimetype,
java.lang.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()
Get the maximum number of pages read before an exception is thrown. |
protected long |
getMaxSourceSizeKBytes()
Gets the maximum source content size, to skip transformations where the source is just too large to expect it to perform. |
protected java.util.Map |
getMimetypeLimits()
Gets the max and limit values for time, size and pages per source and target mimetype combination. |
protected int |
getPageLimit()
Get the page limit before returning EOF. |
protected long |
getReadLimitKBytes()
Gets the limit in terms of the about of data read to limit transformations where only the start of the content is needed. |
protected long |
getReadLimitTimeMs()
Gets the limit in terms of the amount of data read (by time) to limit transformations where only the start of the content is needed. |
protected long |
getTimeoutMs()
Gets the timeout (ms) on the InputStream after which an IOExecption is thrown to terminate very slow transformations or a subprocess is terminated (killed). |
protected boolean |
isPageLimitSupported()
Indicates if 'page' limits are supported. |
boolean |
isTransformable(java.lang.String sourceMimetype,
long sourceSize,
java.lang.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. |
protected boolean |
isTransformableSize(java.lang.String sourceMimetype,
long sourceSize,
java.lang.String targetMimetype,
TransformationOptions options)
Indicates if this transformer is able to transform the given sourceSize. |
void |
setBeanName(java.lang.String beanName)
Sets the Spring bean name - only for use in debug. |
void |
setLimits(TransformationOptionLimits limits)
Sets max and limit values for time, size and pages in a single operation. |
void |
setMaxPages(int maxPages)
Set the number of pages read from the source before an exception is thrown. |
void |
setMaxSourceSizeKBytes(long maxSourceSizeKBytes)
Sets a maximum source content size, to skip transformations where the source is just too large to expect it to perform. |
void |
setMimetypeLimits(java.util.Map mimetypeLimits)
Sets the max and limit values for time, size and pages per source and target mimetype combination. |
void |
setPageLimit(int pageLimit)
Set the number of pages read from the source before returning EOF. |
void |
setPageLimitsSuported(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)
Sets a limit in terms of the about of data read to limit transformations where only the start of the content is needed. |
void |
setReadLimitTimeMs(long readLimitTimeMs)
Sets a limit in terms of the amount of data read (by time) to limit transformations where only the start of the content is needed. |
void |
setTimeoutMs(long timeoutMs)
Sets a timeout (ms) on the InputStream after which an IOExecption is thrown to terminate very slow transformations or to terminate (kill) a subprocess. |
void |
setTransformerDebug(TransformerDebug transformerDebug)
Helper setter of the transformer debug. |
| Methods inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper |
|---|
getMimetype, getMimetypeService, isExplicitTransformation, setExplicitTransformations, setMimetypeService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.alfresco.repo.content.transform.ContentTransformer |
|---|
getTransformationTime, isExplicitTransformation, isTransformable, transform, transform, transform |
| Field Detail |
|---|
protected TransformerDebug transformerDebug
| Constructor Detail |
|---|
public AbstractContentTransformerLimits()
| Method Detail |
|---|
protected boolean isPageLimitSupported()
public void setPageLimitsSuported(boolean pageLimitsSupported)
public void setTransformerDebug(TransformerDebug transformerDebug)
transformerDebug -
public boolean isTransformable(java.lang.String sourceMimetype,
long sourceSize,
java.lang.String targetMimetype,
TransformationOptions options)
Implementation calls the deprecated overloaded method without the sourceSize parameter
and then AbstractContentTransformerLimits.isTransformableSize(String, long, String, TransformationOptions).
isTransformable in interface ContentTransformersourceMimetype - the source mimetypesourceSize - the size (bytes) of the source. If negative it is unknown.targetMimetype - the target mimetypeoptions - the transformation options
protected boolean isTransformableSize(java.lang.String sourceMimetype,
long sourceSize,
java.lang.String targetMimetype,
TransformationOptions options)
sourceSize.
The maxSourceSizeKBytes property may indicate that only small source files
may be transformed.
sourceSize - size in bytes of the source. If negative, the source size is unknown.
true if the source is transformable.protected long getTimeoutMs()
public void setTimeoutMs(long timeoutMs)
timeoutMs - in milliseconds. If less than or equal to zero (the default)
there is no timeout.
If greater than zero the readLimitTimeMs must not be set.protected long getReadLimitTimeMs()
public void setReadLimitTimeMs(long readLimitTimeMs)
readLimitBytes - if less than or equal to zero (the default) there is no limit.
If greater than zero the timeoutMs must not be set.protected long getMaxSourceSizeKBytes()
public void setMaxSourceSizeKBytes(long maxSourceSizeKBytes)
maxSourceSizeKBytes - if less than or equal to zero (the default) there is no limit.
If greater than zero the readLimitKBytes must not be set.protected long getReadLimitKBytes()
public void setReadLimitKBytes(long readLimitKBytes)
readLimitKBytes - if less than or equal to zero (the default) there is no limit.
If greater than zero the maxSourceSizeKBytes must not be set.protected int getMaxPages()
public void setMaxPages(int maxPages)
maxPages - the number of pages to be read from the source. If less than or equal to zero
(the default) no limit is applied.protected int getPageLimit()
public void setPageLimit(int pageLimit)
pageLimit - the number of pages to be read from the source. If less
than or equal to zero (the default) no limit is applied.protected TransformationOptionLimits getLimits()
public void setLimits(TransformationOptionLimits limits)
protected java.util.Map getMimetypeLimits()
public void setMimetypeLimits(java.util.Map mimetypeLimits)
protected TransformationOptionLimits getLimits(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
protected TransformationOptionLimits getLimits(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
public void setBeanName(java.lang.String beanName)
setBeanName in interface org.springframework.beans.factory.BeanNameAwarepublic java.lang.String getBeanName()
protected void setReaderLimits(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
AbstractContentReader.
reader - passed to {@link #transform(ContentReader, ContentWriter, TransformationOptions).writer - passed to {@link #transform(ContentReader, ContentWriter, TransformationOptions).options - passed to {@link #transform(ContentReader, ContentWriter, TransformationOptions).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||