public class SimpleTraversalContext extends java.lang.Object implements TraversalContext
TraversalContext
interface.
Connector developers may want to use this to implement unit tests.
By default, instances of this class accept all document sizes and content types.
Constructor and Description |
---|
SimpleTraversalContext() |
Modifier and Type | Method and Description |
---|---|
long |
maxDocumentSize()
Gets a size limit for contents passed through the connector framework.
|
int |
mimeTypeSupportLevel(java.lang.String mimeType)
Gets information about whether a mime type is supported.
|
java.lang.String |
preferredMimeType(java.util.Set<java.lang.String> mimeTypes)
Returns the most preferred mime type from the supplied set.
|
void |
setMaxDocumentSize(long maxDocumentSize) |
void |
setMimeTypeSet(java.util.Set<java.lang.String> mimeTypeSet) |
void |
setSupportsDenyAcls(boolean supportsDenyAcls) |
void |
setSupportsInheritedAcls(boolean supportsInheritedAcls) |
void |
setTraversalTimeLimitSeconds(long limit) |
boolean |
supportsDenyAcls()
Returns
true if Documents may include DENY users or
groups in an ACL. |
boolean |
supportsInheritedAcls()
Returns
true if Documents may include full ACL support,
specifically DENY users or groups, ACL inheritance, and ACL-only
Documents. |
long |
traversalTimeLimitSeconds()
Returns the time in seconds for allotted traversals to complete.
|
public void setMaxDocumentSize(long maxDocumentSize)
public void setMimeTypeSet(java.util.Set<java.lang.String> mimeTypeSet)
public void setTraversalTimeLimitSeconds(long limit)
public void setSupportsInheritedAcls(boolean supportsInheritedAcls)
public void setSupportsDenyAcls(boolean supportsDenyAcls)
public long maxDocumentSize()
TraversalContext
maxDocumentSize
in interface TraversalContext
public int mimeTypeSupportLevel(java.lang.String mimeType)
TraversalContext
Non-positive numbers mean that there is no support for this mime type. A zero value indicates the content encoding is not supported. The connector may choose to supply meta-data for the document, but the content should not be provided.
A negative value indicates the document should be skipped entirely. Neither the content, nor the meta-data should be provided.
mimeTypeSupportLevel
in interface TraversalContext
public java.lang.String preferredMimeType(java.util.Set<java.lang.String> mimeTypes)
TraversalContext
If a repository contains multiple renditions of a particular item, it may use this to select the best rendition to supply for indexing.
preferredMimeType
in interface TraversalContext
mimeTypes
- a Set
of mime typespublic long traversalTimeLimitSeconds()
TraversalContext
TraversalManager.startTraversal()
and
TraversalManager.resumeTraversal(String)
can avoid interrupts due
to timeouts by returning within this amount of time.traversalTimeLimitSeconds
in interface TraversalContext
public boolean supportsInheritedAcls()
TraversalContext
true
if Documents may include full ACL support,
specifically DENY users or groups, ACL inheritance, and ACL-only
Documents. Some earlier Search Appliance implementations do not
support these features. This method will always return false
if the feed.disable.inherited.acls
property in
applicationContext.xml
is set to true
. If this
method returns true
, then TraversalContext.supportsDenyAcls()
will
also return true
.supportsInheritedAcls
in interface TraversalContext
true
if Documents may include enhanced ACL supportSecureDocument
,
SpiConstants.AclInheritanceType
,
SpiConstants.FeedType
,
SpiConstants.PROPNAME_ACLINHERITFROM
,
SpiConstants.PROPNAME_ACLINHERITANCETYPE
,
SpiConstants.PROPNAME_ACLDENYGROUPS
,
SpiConstants.PROPNAME_ACLDENYUSERS
public boolean supportsDenyAcls()
TraversalContext
true
if Documents may include DENY users or
groups in an ACL. Some earlier Search Appliance implementations
do not support this feature. A connector that requires inheritance
in order to implement DENY should use TraversalContext.supportsInheritedAcls()
instead of this method. If this method returns false
, then
TraversalContext.supportsDenyAcls()
will also return false
.supportsDenyAcls
in interface TraversalContext
true
if Documents may include DENY users or groupsSecureDocument
,
SpiConstants.PROPNAME_ACLDENYGROUPS
,
SpiConstants.PROPNAME_ACLDENYUSERS