com.atlassian.jira.sharing.index
Class DefaultSharedEntityIndexer

java.lang.Object
  extended by com.atlassian.jira.sharing.index.DefaultSharedEntityIndexer
All Implemented Interfaces:
SharedEntityIndexer

public class DefaultSharedEntityIndexer
extends Object
implements SharedEntityIndexer

default implementation

Since:
v3.13

Nested Class Summary
static interface DefaultSharedEntityIndexer.EntityDocument
          Holds a Document and an identifying Term so we can delete any pre-existing document.
static interface DefaultSharedEntityIndexer.EntityDocumentFactory
           
 
Constructor Summary
DefaultSharedEntityIndexer(IndexPathManager indexPathManager, ShareTypeFactory shareTypeFactory, SharedEntitySearchContextToQueryFactoryMap searchContextToQueryFactoryMap, SharedEntityAccessor.Factory accessorFactory, DirectoryFactory directoryFactory)
           
 
Method Summary
 String clear(SharedEntity.TypeDescriptor<?> type)
          Clear a particular type's index.
 Index.Result deIndex(SharedEntity entity)
          Delete a document from the index.
 Collection<String> getAllIndexPaths()
           
<S extends SharedEntity>
SharedEntitySearcher<S>
getSearcher(SharedEntity.TypeDescriptor<S> type)
          Get a SharedEntitySearcher for the specified SharedEntity.TypeDescriptor
 Index.Result index(SharedEntity entity)
          Add or update a document in the index.
 long optimize(SharedEntity.TypeDescriptor<?> type)
          Optimize a particular type's index.
 void recreate(SharedEntity.TypeDescriptor<?> type)
          Recreate the index.
 void shutdown(SharedEntity.TypeDescriptor<?> type)
          Shutdown a particular type's index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSharedEntityIndexer

public DefaultSharedEntityIndexer(IndexPathManager indexPathManager,
                                  ShareTypeFactory shareTypeFactory,
                                  SharedEntitySearchContextToQueryFactoryMap searchContextToQueryFactoryMap,
                                  SharedEntityAccessor.Factory accessorFactory,
                                  DirectoryFactory directoryFactory)
Method Detail

index

public Index.Result index(SharedEntity entity)
Description copied from interface: SharedEntityIndexer
Add or update a document in the index.

Specified by:
index in interface SharedEntityIndexer
Parameters:
entity - the entity to add to the index

deIndex

public Index.Result deIndex(SharedEntity entity)
Description copied from interface: SharedEntityIndexer
Delete a document from the index.

Specified by:
deIndex in interface SharedEntityIndexer
Parameters:
entity - the entity to remove from the index

getSearcher

public <S extends SharedEntity> SharedEntitySearcher<S> getSearcher(SharedEntity.TypeDescriptor<S> type)
Description copied from interface: SharedEntityIndexer
Get a SharedEntitySearcher for the specified SharedEntity.TypeDescriptor

Specified by:
getSearcher in interface SharedEntityIndexer
Parameters:
type - the index to use when searching
Returns:
searcher for searching

optimize

public long optimize(SharedEntity.TypeDescriptor<?> type)
Description copied from interface: SharedEntityIndexer
Optimize a particular type's index.

Specified by:
optimize in interface SharedEntityIndexer
Parameters:
type - describes the particular index
Returns:
the number of milliseconds taken to optimize

clear

public String clear(SharedEntity.TypeDescriptor<?> type)
Description copied from interface: SharedEntityIndexer
Clear a particular type's index. Return the path.

Specified by:
clear in interface SharedEntityIndexer
Parameters:
type - describes the particular index

recreate

public void recreate(SharedEntity.TypeDescriptor<?> type)
Description copied from interface: SharedEntityIndexer
Recreate the index. Clear it if it currently exists, create a new one if it doesn't.

Specified by:
recreate in interface SharedEntityIndexer

shutdown

public void shutdown(SharedEntity.TypeDescriptor<?> type)
Description copied from interface: SharedEntityIndexer
Shutdown a particular type's index.

Specified by:
shutdown in interface SharedEntityIndexer
Parameters:
type - describes the particular index

getAllIndexPaths

public Collection<String> getAllIndexPaths()
Specified by:
getAllIndexPaths in interface SharedEntityIndexer
Returns:
all the paths where the indexes are


Copyright © 2002-2012 Atlassian. All Rights Reserved.