public class QueryMonitorPluginImpl extends Object implements QueryMonitorPlugin
Constructor and Description |
---|
QueryMonitorPluginImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
addActiveSearch(ActiveSearch activeSearch)
Adds an ActiveSearch to the
ActiveSearch Map |
Map<UUID,ActiveSearch> |
getActiveSearches()
Returns a copy of the
ActiveSearch Map |
QueryResponse |
process(QueryResponse input)
Method that is implemented for
PostFederatedQueryPlugin . |
QueryRequest |
process(Source source,
QueryRequest input)
Method that is implemented for
PreFederatedQueryPlugin . |
boolean |
removeActiveSearch(UUID uniqueID)
Removes an ActiveSearch from the
ActiveSearch Map using it's UUID as a key |
void |
setRemoveSearchAfterComplete(boolean removeSearchAfterComplete)
Sets a boolean which determines whether or not searches will be removed from the
ActiveSearch Map upon search completion. |
public static final String SEARCH_ID
public Map<UUID,ActiveSearch> getActiveSearches()
ActiveSearch
Map
getActiveSearches
in interface QueryMonitorPlugin
Map
<UUID
, ActiveSearch
> copy of the ActiveSearch
Map
public void setRemoveSearchAfterComplete(boolean removeSearchAfterComplete)
ActiveSearch
Map
upon search completion. A value of true will remove searches from the
Map
as the searches finish and a value of false will keep the searches in the Map
after they complete.setRemoveSearchAfterComplete
in interface QueryMonitorPlugin
removeSearchAfterComplete
- boolean value. A value of false will keep ActiveSearch
's in the Map
even after they finish (are no longer active). True will remove the ActiveSearches from the
Map
as the searches complete (default behavior is true)public boolean addActiveSearch(ActiveSearch activeSearch)
ActiveSearch
Map
addActiveSearch
in interface QueryMonitorPlugin
activeSearch
- ActiveSearch that will be added to the Map
ActiveSearch
was successfulpublic boolean removeActiveSearch(UUID uniqueID)
ActiveSearch
Map
using it's UUID as a keyremoveActiveSearch
in interface QueryMonitorPlugin
uniqueID
- java.util.UUID that corresponds to the ActiveSearch to be removed from the Map
Map
was successfulpublic QueryRequest process(Source source, QueryRequest input) throws PluginExecutionException, StopProcessingException
PreFederatedQueryPlugin
. Uses the given Source
and QueryRequest
information to create a new ActiveSearch
to add to the ActiveSearch
Map
.process
in interface PreFederatedQueryPlugin
source
- Source
that corresponds to source the search is queryinginput
- QueryRequest
that corresponds to request generated when a user queried the
sourceQueryRequest
that was given as a parameter with updated property information
corresponding to the ActiveSearch
's UUID
PluginExecutionException
- thrown when an error occurs while processing the QueryRequest
StopProcessingException
- thrown to halt processing when a critical issue occurs during
processing. This is intended to prevent other plugins from processing as well.public QueryResponse process(QueryResponse input) throws PluginExecutionException, StopProcessingException
PostFederatedQueryPlugin
. Uses the given QueryResponse
information to remove the ActiveSearch
from the ActiveSearch
Map
.process
in interface PostFederatedQueryPlugin
input
- QueryResponse
that corresponds to response from the source that was
queried by the user's original QueryRequest
QueryResponse
that was given as a parameterPluginExecutionException
- thrown when an error occurs while processing the QueryResponse
StopProcessingException
- thrown to halt processing when a critical issue occurs during
processing. This is intended to prevent other plugins from processing as well.This work is licensed under a Creative Commons Attribution 4.0 International License.