com.atlassian.jira.sharing.index
Class MockSharedEntityIndexer

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

public class MockSharedEntityIndexer
extends Object
implements SharedEntityIndexer

Since:
v3.13

Constructor Summary
MockSharedEntityIndexer()
           
 
Method Summary
 String clear(SharedEntity.TypeDescriptor<?> type)
          Clear a particular type's index.
 Index.Result deIndex(Set<SharedEntity> sharedEntities, boolean updateReplicatedIndex)
          Delete multiple documents in the 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(Set<SharedEntity> sharedEntities, boolean updateReplicatedIndex)
          Add or update multiple documents in the index
 Index.Result index(SharedEntity entity)
          Add or update a document in the index.
 Index.Result index(SharedEntity entity, boolean updateReplicatedIndex)
          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

MockSharedEntityIndexer

public MockSharedEntityIndexer()
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

index

public Index.Result index(SharedEntity entity,
                          boolean updateReplicatedIndex)
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
updateReplicatedIndex - whether to update the replicated index or not

index

public Index.Result index(Set<SharedEntity> sharedEntities,
                          boolean updateReplicatedIndex)
Description copied from interface: SharedEntityIndexer
Add or update multiple documents in the index

Specified by:
index in interface SharedEntityIndexer
Parameters:
sharedEntities - a Set of entities to add to the index
updateReplicatedIndex - whether to update the replicated index or not

deIndex

public Index.Result deIndex(Set<SharedEntity> sharedEntities,
                            boolean updateReplicatedIndex)
Description copied from interface: SharedEntityIndexer
Delete multiple documents in the index

Specified by:
deIndex in interface SharedEntityIndexer
Parameters:
sharedEntities - a Set of entities to remove from the index
updateReplicatedIndex - whether to update the replicated index or not

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

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

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


Copyright © 2002-2014 Atlassian. All Rights Reserved.