Package org.alfresco.query
Class AbstractCannedQueryFactory<R>
- java.lang.Object
-
- org.alfresco.query.AbstractCannedQueryFactory<R>
-
- All Implemented Interfaces:
CannedQueryFactory<R>
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AbstractCachingCannedQueryFactory
public abstract class AbstractCannedQueryFactory<R> extends Object implements CannedQueryFactory<R>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware
Basic services forCannedQueryFactory
implementations.- Since:
- 4.0
- Author:
- Derek Hulley
-
-
Constructor Summary
Constructors Constructor Description AbstractCannedQueryFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Registers the instanceCannedQuery<R>
getCannedQuery(Object parameterBean, int skipResults, int pageSize, String queryExecutionId)
Retrieve an instance of aCannedQuery
based on limited parameters.protected String
getQueryExecutionId(CannedQueryParameters parameters)
Helper method to construct a unique query execution ID based on the instance of the factory and the parameters provided.void
setBeanName(String name)
Set the name with which toregister
void
setRegistry(NamedObjectRegistry<CannedQueryFactory> registry)
Set the registry with which to register-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.query.CannedQueryFactory
getCannedQuery
-
-
-
-
Method Detail
-
setBeanName
public void setBeanName(String name)
Set the name with which toregister
- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
- Parameters:
name
- the name of the bean
-
setRegistry
public void setRegistry(NamedObjectRegistry<CannedQueryFactory> registry)
Set the registry with which to register
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
Registers the instance- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
getQueryExecutionId
protected String getQueryExecutionId(CannedQueryParameters parameters)
Helper method to construct a unique query execution ID based on the instance of the factory and the parameters provided.- Parameters:
parameters
- the query parameters- Returns:
- a unique query instance ID
-
getCannedQuery
public CannedQuery<R> getCannedQuery(Object parameterBean, int skipResults, int pageSize, String queryExecutionId)
Retrieve an instance of aCannedQuery
based on limited parameters.- Specified by:
getCannedQuery
in interfaceCannedQueryFactory<R>
- Parameters:
parameterBean
- the values that the query will be based on or null if not relevant to the queryskipResults
- results to skip before pagepageSize
- the size of page - ie. max items (if skipResults = 0)queryExecutionId
- ID of a previously-executed query to be used during follow-up page requests - null if not available- Returns:
- an implementation that will execute the query
-
-