com.atlassian.jira.issue.index
Class DefaultIndexManager

java.lang.Object
  extended by com.atlassian.jira.issue.index.DefaultIndexManager
All Implemented Interfaces:
IssueIndexManager
Direct Known Subclasses:
BulkOnlyIndexManager, MemoryIndexManager

public class DefaultIndexManager
extends java.lang.Object
implements IssueIndexManager


Field Summary
static org.apache.lucene.analysis.Analyzer ANALYZER
           
static java.lang.String COMMENTS_SUBDIR
           
static java.lang.String ISSUES_SUBDIR
           
 
Constructor Summary
DefaultIndexManager()
           
DefaultIndexManager(ApplicationProperties applicationProperties)
           
 
Method Summary
 long activate(java.lang.String indexPath, com.atlassian.johnson.event.Event appEvent)
          Activate indexes
 void deactivate()
          Deactivate indexes
 void deIndex(org.ofbiz.core.entity.GenericValue entity)
           
 org.apache.lucene.store.Directory getCommentDirectory()
           
 java.lang.String getCommentPath()
          The specific path of the comments index
protected  java.lang.String getFilePath()
          Return the path beneath which the different index directories are stored
protected  org.apache.lucene.index.IndexReader getIndexReader(java.lang.String path)
          Obtain an IndexReader
protected  org.apache.lucene.index.IndexWriter getIndexWriter(java.lang.String path, boolean create)
          Obtain an IndexWriter for and optionally create.
 org.apache.lucene.store.Directory getIssueDirectory()
           
 java.lang.String getIssuePath()
          The specific path of the issue index
 boolean isBusy()
           
 void reIndex(org.ofbiz.core.entity.GenericValue entity)
           
 long reIndexAll()
           
 long reIndexAll(com.atlassian.johnson.event.Event event)
           
 long reIndexIssues(java.util.Collection issues)
           
protected  long reIndexIssues(java.util.Collection issues, boolean recreateIndex, com.atlassian.johnson.event.Event event)
           
protected  void removeDirectory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANALYZER

public static final org.apache.lucene.analysis.Analyzer ANALYZER

COMMENTS_SUBDIR

public static final java.lang.String COMMENTS_SUBDIR
See Also:
Constant Field Values

ISSUES_SUBDIR

public static final java.lang.String ISSUES_SUBDIR
See Also:
Constant Field Values
Constructor Detail

DefaultIndexManager

public DefaultIndexManager()

DefaultIndexManager

public DefaultIndexManager(ApplicationProperties applicationProperties)
Method Detail

isBusy

public boolean isBusy()
Specified by:
isBusy in interface IssueIndexManager

deactivate

public void deactivate()
                throws java.lang.Exception
Description copied from interface: IssueIndexManager
Deactivate indexes

Specified by:
deactivate in interface IssueIndexManager
Throws:
java.lang.Exception

removeDirectory

protected void removeDirectory()

activate

public long activate(java.lang.String indexPath,
                     com.atlassian.johnson.event.Event appEvent)
              throws java.lang.Exception
Description copied from interface: IssueIndexManager
Activate indexes

Specified by:
activate in interface IssueIndexManager
Throws:
java.lang.Exception

reIndexAll

public long reIndexAll()
                throws IndexException
Specified by:
reIndexAll in interface IssueIndexManager
Returns:
The number of milliseconds taken to reindex everything, or -1 if not indexing
Throws:
IndexException

reIndexAll

public long reIndexAll(com.atlassian.johnson.event.Event event)
                throws IndexException
Specified by:
reIndexAll in interface IssueIndexManager
Throws:
IndexException

reIndexIssues

public long reIndexIssues(java.util.Collection issues)
                   throws IndexException
Specified by:
reIndexIssues in interface IssueIndexManager
Throws:
IndexException

reIndexIssues

protected long reIndexIssues(java.util.Collection issues,
                             boolean recreateIndex,
                             com.atlassian.johnson.event.Event event)
                      throws IndexException
Returns:
The number of milliseconds taken to reindex all issues, or -1 if not indexing
Throws:
IndexException

reIndex

public void reIndex(org.ofbiz.core.entity.GenericValue entity)
             throws IndexException
Specified by:
reIndex in interface IssueIndexManager
Throws:
IndexException

deIndex

public void deIndex(org.ofbiz.core.entity.GenericValue entity)
             throws IndexException
Specified by:
deIndex in interface IssueIndexManager
Throws:
IndexException

getIssuePath

public java.lang.String getIssuePath()
The specific path of the issue index

Specified by:
getIssuePath in interface IssueIndexManager

getCommentPath

public java.lang.String getCommentPath()
The specific path of the comments index

Specified by:
getCommentPath in interface IssueIndexManager

getIssueDirectory

public org.apache.lucene.store.Directory getIssueDirectory()
Specified by:
getIssueDirectory in interface IssueIndexManager

getCommentDirectory

public org.apache.lucene.store.Directory getCommentDirectory()
Specified by:
getCommentDirectory in interface IssueIndexManager

getFilePath

protected java.lang.String getFilePath()
Return the path beneath which the different index directories are stored


getIndexReader

protected org.apache.lucene.index.IndexReader getIndexReader(java.lang.String path)
                                                      throws IndexException
Obtain an IndexReader

Throws:
IndexException

getIndexWriter

protected org.apache.lucene.index.IndexWriter getIndexWriter(java.lang.String path,
                                                             boolean create)
                                                      throws IndexException
Obtain an IndexWriter for and optionally create.

Throws:
IndexException


Copyright © 2002-2006 Atlassian. All Rights Reserved.