com.atlassian.confluence.search.lucene
Class ChangeDocumentIndexPolicy

java.lang.Object
  extended by com.atlassian.confluence.search.lucene.ChangeDocumentIndexPolicy

public class ChangeDocumentIndexPolicy
extends Object

Policy that defines what Searchables should be indexed as change documents.


Nested Class Summary
static class ChangeDocumentIndexPolicy.PolicyCheckResult
           
 
Constructor Summary
ChangeDocumentIndexPolicy()
           
 
Method Summary
static ChangeDocumentIndexPolicy.PolicyCheckResult buildFor(com.atlassian.bonnie.Searchable searchable)
          Defines the conditions which must be met before a change document will be constructed for the specified searchable.
static boolean shouldIndex(com.atlassian.bonnie.Searchable searchable)
          Returns true if this searchable should be indexed as a change, false otherwise.
static boolean shouldUnIndex(com.atlassian.bonnie.Searchable searchable)
          Whether we should unindex this searchable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeDocumentIndexPolicy

public ChangeDocumentIndexPolicy()
Method Detail

buildFor

public static ChangeDocumentIndexPolicy.PolicyCheckResult buildFor(com.atlassian.bonnie.Searchable searchable)
Defines the conditions which must be met before a change document will be constructed for the specified searchable.

These are:

Parameters:
searchable - the searchable
Returns:
the policy check result

shouldIndex

public static boolean shouldIndex(com.atlassian.bonnie.Searchable searchable)
Returns true if this searchable should be indexed as a change, false otherwise.

Parameters:
searchable - the searchable
Returns:
true if this searchable should be indexed as a change, false otherwise.

shouldUnIndex

public static boolean shouldUnIndex(com.atlassian.bonnie.Searchable searchable)
Whether we should unindex this searchable. The condition to unindex a searchable is more lenient than indexing, as our main objective here is to ensure we are queuing a list of unindex jobs that make sense. It is sufficient in this case to just check that changes are indexed for the persistent class of the searchable. (The criteria we use for indexing a searchable cannot be re-used for unindexing, since the deletion of a searchable may change its state causing it to fail this criteria. Failing our indexing criteria is no reason at all to not unindex.

Parameters:
searchable - the searchable
Returns:
true if we should unindex this searchable, false otherwise.


Copyright © 2003-2011 Atlassian. All Rights Reserved.