com.atlassian.confluence.search.lucene.tasks
Class BaseContentIndexTask

java.lang.Object
  extended bycom.atlassian.confluence.search.lucene.tasks.BaseContentIndexTask
All Implemented Interfaces:
ContentIndexTask, IndexTask
Direct Known Subclasses:
AddDocumentIndexTask, DeleteDocumentIndexTask, UnIndexSpaceIndexTask, UpdateDocumentIndexTask

public abstract class BaseContentIndexTask
extends Object
implements ContentIndexTask

A base implementation of a ContentIndexTask, that maintains a handle to the searchable target.


Field Summary
protected  AnyTypeObjectDao anyTypeObjectDao
          Required resource.
protected  DocumentBuilder documentBuilder
          Required resource.
protected  Handle handle
          The handle that identifies the searchable instance being indexed.
protected  String spaceKey
          The spacekey (if any) of the instance being indexed
protected  Searchable target
          The searchable subject of this index task.
 
Constructor Summary
protected BaseContentIndexTask()
           
  BaseContentIndexTask(Searchable target)
          Create a new index task.
protected BaseContentIndexTask(String handle)
           
 
Method Summary
protected  Handle createHandle(Searchable target)
           
protected  Handle createHandle(String handle)
          The default create handle implementation creates a handle that can be used to retrieve the searchable target from the persistent store via the
 boolean equals(Object other)
          Two content index tasks are considered equal if they are of the same type and contain the same handle.
 Handle getHandle()
           
 Searchable getTarget()
           
 int hashCode()
           
 void setAnyTypeObjectDao(AnyTypeObjectDao anyTypeObjectDao)
          Required resource for converting handles into searchable instances so that the content to be indexed can be retrieved.
 void setDocumentBuilder(DocumentBuilder documentBuilder)
          Required resource for converting searchable instances into documents to be indexed.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.search.lucene.IndexTask
getDescription
 

Field Detail

documentBuilder

protected DocumentBuilder documentBuilder
Required resource. The document builder is used to create a lucene document from a searchable instance.


anyTypeObjectDao

protected AnyTypeObjectDao anyTypeObjectDao
Required resource. The any type object dao is used to resolve hibernate handles into objects.


handle

protected Handle handle
The handle that identifies the searchable instance being indexed.


spaceKey

protected String spaceKey
The spacekey (if any) of the instance being indexed


target

protected transient Searchable target
The searchable subject of this index task.

Constructor Detail

BaseContentIndexTask

protected BaseContentIndexTask()

BaseContentIndexTask

public BaseContentIndexTask(Searchable target)
Create a new index task.

Parameters:
target -
Throws:
IllegalArgumentException - if the searchable target is not indexible, as defined by the isIndexable call.

BaseContentIndexTask

protected BaseContentIndexTask(String handle)
                        throws ParseException
Method Detail

createHandle

protected Handle createHandle(String handle)
                       throws ParseException
The default create handle implementation creates a handle that can be used to retrieve the searchable target from the persistent store via the
AnyTypeObjectDao.findByHandle(handle);

Parameters:
handle -
Returns:
Throws:
ParseException

getTarget

public Searchable getTarget()

getHandle

public Handle getHandle()
Specified by:
getHandle in interface ContentIndexTask

equals

public boolean equals(Object other)
Two content index tasks are considered equal if they are of the same type and contain the same handle. Equal tasks will have the same effect on the search index.

Parameters:
other -
Returns:
true if this object and the other are considered equal.

hashCode

public int hashCode()

createHandle

protected Handle createHandle(Searchable target)

setDocumentBuilder

public void setDocumentBuilder(DocumentBuilder documentBuilder)
Required resource for converting searchable instances into documents to be indexed.

Parameters:
documentBuilder -

setAnyTypeObjectDao

public void setAnyTypeObjectDao(AnyTypeObjectDao anyTypeObjectDao)
Required resource for converting handles into searchable instances so that the content to be indexed can be retrieved.

Parameters:
anyTypeObjectDao -

toString

public String toString()


Confluence is developed by Atlassian.