com.atlassian.jira.util.index
Class IndexLifecycleManager.Composite

java.lang.Object
  extended by com.atlassian.jira.util.index.IndexLifecycleManager.Composite
All Implemented Interfaces:
Sized, IndexLifecycleManager
Enclosing interface:
IndexLifecycleManager

public static class IndexLifecycleManager.Composite
extends Object
implements IndexLifecycleManager

Convenience class for managing known IndexManagers and calling them all.

Since:
v3.13

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.util.index.IndexLifecycleManager
IndexLifecycleManager.Composite
 
Constructor Summary
IndexLifecycleManager.Composite(IssueIndexManager issueIndexManager, SharedEntityIndexManager sharedEntityIndexManager)
           
 
Method Summary
 long activate(String indexPath, Context context)
          Activates search indexes.
 void deactivate()
          De-activates indexing (as happens from the admin page) and removes index directories.
 Collection getAllIndexPaths()
           
 boolean isIndexingEnabled()
           
 long optimize()
          Optimize the underlying indexes.
 long reIndexAll(Context context)
          Reindex everything.
 void shutdown()
          Shuts down the indexing manager and closes its resources (if any).
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexLifecycleManager.Composite

public IndexLifecycleManager.Composite(IssueIndexManager issueIndexManager,
                                       SharedEntityIndexManager sharedEntityIndexManager)
Method Detail

optimize

public long optimize()
              throws IndexException
Description copied from interface: IndexLifecycleManager
Optimize the underlying indexes. Make the subsequent searching more efficient.

Specified by:
optimize in interface IndexLifecycleManager
Returns:
the amount of time in millis this method took (because you are too lazy to time me), 0 if indexing is not enabled or -1 if we cannot obtain the index writeLock.
Throws:
IndexException - if the indexes are seriously in trouble

reIndexAll

public long reIndexAll(Context context)
                throws IndexException
Description copied from interface: IndexLifecycleManager
Reindex everything.

Specified by:
reIndexAll in interface IndexLifecycleManager
Parameters:
context - used to report progress back to the user or to the logs. Must not be null.
Returns:
Reindex time in ms.
Throws:
IndexException

shutdown

public void shutdown()
Description copied from interface: IndexLifecycleManager
Shuts down the indexing manager and closes its resources (if any).

Specified by:
shutdown in interface IndexLifecycleManager

activate

public long activate(String indexPath,
                     Context context)
              throws Exception
Description copied from interface: IndexLifecycleManager
Activates search indexes.

Specified by:
activate in interface IndexLifecycleManager
Parameters:
indexPath - Root path to the search index.
context - used to report progress back to the user or to the logs. Must not be null.
Returns:
Reindex time in ms
Throws:
Exception

deactivate

public void deactivate()
                throws Exception
Description copied from interface: IndexLifecycleManager
De-activates indexing (as happens from the admin page) and removes index directories.

Specified by:
deactivate in interface IndexLifecycleManager
Throws:
Exception

isIndexingEnabled

public boolean isIndexingEnabled()
Specified by:
isIndexingEnabled in interface IndexLifecycleManager
Returns:
whether this index is enabled or true if all sub indexes are enabled

getAllIndexPaths

public Collection getAllIndexPaths()
Specified by:
getAllIndexPaths in interface IndexLifecycleManager
Returns:
a collection of Strings that map to all paths that contain Lucene indexes. Must not be null.

size

public int size()
Specified by:
size in interface Sized
Specified by:
size in interface IndexLifecycleManager
Returns:
how many Entities will be re-indexed by IndexLifecycleManager.reIndexAll(Context)


Copyright © 2002-2008 Atlassian. All Rights Reserved.