com.atlassian.jira.bc.issue.search
Class QueryCacheImpl

java.lang.Object
  extended by com.atlassian.jira.bc.issue.search.QueryCacheImpl
All Implemented Interfaces:
QueryCache

public class QueryCacheImpl
extends Object
implements QueryCache

The default implementation for the QueryCache The cache is stored in a common request cache, so caches are shared amongst instances.

Since:
v4.0

Constructor Summary
QueryCacheImpl()
           
 
Method Summary
 Collection<ClauseHandler> getClauseHandlers(com.atlassian.crowd.embedded.api.User searcher, String jqlClauseName)
          Retrieve the collection of ClauseHandlers registered for the User jqlClauseName pair.
 Boolean getDoesQueryFitFilterFormCache(com.atlassian.crowd.embedded.api.User searcher, Query query)
          Retrieve the result of the last doesQueryFitFiterForm operation in the current thread.
 QueryContext getQueryContextCache(com.atlassian.crowd.embedded.api.User searcher, Query query)
          Retrieve the result of the last getQueryContext operation in the current thread for the User Query pair.
 QueryContext getSimpleQueryContextCache(com.atlassian.crowd.embedded.api.User searcher, Query query)
          Retrieve the result of the last getSimpleQueryContext operation in the current thread for the User Query pair.
 List<QueryLiteral> getValues(QueryCreationContext context, Operand operand, TerminalClause jqlClause)
          Retrieve the list of QueryLiterals registered for the QueryCreationContext Operand jqlClause triplet.
 void setClauseHandlers(com.atlassian.crowd.embedded.api.User searcher, String jqlClauseName, Collection<ClauseHandler> clauseHandlers)
          Set the cached result of a getSimpleQueryContext operation on the User Query pair.
 void setDoesQueryFitFilterFormCache(com.atlassian.crowd.embedded.api.User searcher, Query query, boolean doesItFit)
          Set the cached result of a doesQueryFitFiterForm operation on the User Query pair.
 void setQueryContextCache(com.atlassian.crowd.embedded.api.User searcher, Query query, QueryContext queryContext)
          Set the cached result of a getQueryContext operation on the User Query pair.
 void setSimpleQueryContextCache(com.atlassian.crowd.embedded.api.User searcher, Query query, QueryContext queryContext)
          Set the cached result of a getSimpleQueryContext operation on the User Query pair.
 void setValues(QueryCreationContext context, Operand operand, TerminalClause jqlClause, List<QueryLiteral> values)
          Set the cached result of a getValues operation on the for the QueryCreationContext Operand jqlClause triplet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryCacheImpl

public QueryCacheImpl()
Method Detail

getDoesQueryFitFilterFormCache

public Boolean getDoesQueryFitFilterFormCache(com.atlassian.crowd.embedded.api.User searcher,
                                              Query query)
Description copied from interface: QueryCache
Retrieve the result of the last doesQueryFitFiterForm operation in the current thread. for the User Query pair.

Specified by:
getDoesQueryFitFilterFormCache in interface QueryCache
Parameters:
searcher - the user who is performing the search
query - the query for which to find the result for; cannot be null.
Returns:
the last result of the doesQueryFitFiterForm operation for the User Query pair in the current thread, or null if the operation has yet to be performed.

setDoesQueryFitFilterFormCache

public void setDoesQueryFitFilterFormCache(com.atlassian.crowd.embedded.api.User searcher,
                                           Query query,
                                           boolean doesItFit)
Description copied from interface: QueryCache
Set the cached result of a doesQueryFitFiterForm operation on the User Query pair. The cache result is only held for the current thread.

Specified by:
setDoesQueryFitFilterFormCache in interface QueryCache
Parameters:
searcher - the user who is performing the search
query - the query for which to store the result under; cannot be null
doesItFit - the result of a doesSearchRequestFitNavigator operation for the. User Query

getQueryContextCache

public QueryContext getQueryContextCache(com.atlassian.crowd.embedded.api.User searcher,
                                         Query query)
Description copied from interface: QueryCache
Retrieve the result of the last getQueryContext operation in the current thread for the User Query pair.

Specified by:
getQueryContextCache in interface QueryCache
Parameters:
searcher - the user who is performing the search
query - the query for which to find the result for; cannot be null.
Returns:
the last result of the getQueryContext operation for the User Query pair in the current thread, or null if the operation has yet to be performed.

setQueryContextCache

public void setQueryContextCache(com.atlassian.crowd.embedded.api.User searcher,
                                 Query query,
                                 QueryContext queryContext)
Description copied from interface: QueryCache
Set the cached result of a getQueryContext operation on the User Query pair. The cache result is only held for the current thread.

Specified by:
setQueryContextCache in interface QueryCache
Parameters:
searcher - the user who is performing the search
query - the query for which to store the result under; cannot be null.
queryContext - the queryContext result to store User Query

getSimpleQueryContextCache

public QueryContext getSimpleQueryContextCache(com.atlassian.crowd.embedded.api.User searcher,
                                               Query query)
Description copied from interface: QueryCache
Retrieve the result of the last getSimpleQueryContext operation in the current thread for the User Query pair.

Specified by:
getSimpleQueryContextCache in interface QueryCache
Parameters:
searcher - the user who is performing the search
query - the query for which to find the result for; cannot be null.
Returns:
the last result of the getSimpleQueryContext operation for the User Query pair in the current thread, or null if the operation has yet to be performed.

setSimpleQueryContextCache

public void setSimpleQueryContextCache(com.atlassian.crowd.embedded.api.User searcher,
                                       Query query,
                                       QueryContext queryContext)
Description copied from interface: QueryCache
Set the cached result of a getSimpleQueryContext operation on the User Query pair. The cache result is only held for the current thread.

Specified by:
setSimpleQueryContextCache in interface QueryCache
Parameters:
searcher - the user who is performing the search
query - the query for which to store the result under; cannot be null.
queryContext - the querySimpleContext result to store User Query

getClauseHandlers

public Collection<ClauseHandler> getClauseHandlers(com.atlassian.crowd.embedded.api.User searcher,
                                                   String jqlClauseName)
Description copied from interface: QueryCache
Retrieve the collection of ClauseHandlers registered for the User jqlClauseName pair.

Specified by:
getClauseHandlers in interface QueryCache
Parameters:
searcher - the user who is performing the search
jqlClauseName - the jQLClauseName for which to find the result for; cannot be null.
Returns:
the collection of ClauseHandlers registered for the User jqlClauseName pair.

setClauseHandlers

public void setClauseHandlers(com.atlassian.crowd.embedded.api.User searcher,
                              String jqlClauseName,
                              Collection<ClauseHandler> clauseHandlers)
Description copied from interface: QueryCache
Set the cached result of a getSimpleQueryContext operation on the User Query pair. The cache result is only held for the current thread.

Specified by:
setClauseHandlers in interface QueryCache
Parameters:
searcher - the user who is performing the search
jqlClauseName - the jQLClauseName for which to store the result under; cannot be null.
clauseHandlers - the collection of ClauseHandlers User ClauseHandler

getValues

public List<QueryLiteral> getValues(QueryCreationContext context,
                                    Operand operand,
                                    TerminalClause jqlClause)
Description copied from interface: QueryCache
Retrieve the list of QueryLiterals registered for the QueryCreationContext Operand jqlClause triplet.

Specified by:
getValues in interface QueryCache
Parameters:
context - the query context of the search, which cannot be null.
operand - the Operand which cannot be null
jqlClause - the jQLClause for which to find the result for; cannot be null.
Returns:
the list of QueryLiterals registered for the QueryCreationContext jqlClause pair.

setValues

public void setValues(QueryCreationContext context,
                      Operand operand,
                      TerminalClause jqlClause,
                      List<QueryLiteral> values)
Description copied from interface: QueryCache
Set the cached result of a getValues operation on the for the QueryCreationContext Operand jqlClause triplet. The cache result is only held for the current thread.

Specified by:
setValues in interface QueryCache
Parameters:
context - the query context the search is being performed in
operand - the Operand which cannot be null
jqlClause - the jQLClause for which to store the result under; cannot be null.
values - the collection of QueryLiterals


Copyright © 2002-2012 Atlassian. All Rights Reserved.