it.sistematica.isharedoc.opencmis.indatabase.query
Class InDatabaseQueryProcessor

java.lang.Object
  extended by it.sistematica.isharedoc.opencmis.indatabase.query.InDatabaseQueryProcessor

public class InDatabaseQueryProcessor
extends java.lang.Object

A processor for a CMIS query for the In-Database server. During tree traversal conditions are checked against the data contained in the central hash map with all objects. In a first pass one time setup is performed, in a custom walk across the query expression tree an object is checked if it matches. In case of a match it is appended to a list of matching objects.


Nested Class Summary
 class InDatabaseQueryProcessor.InMemoryWhereClauseWalker
           
 
Constructor Summary
InDatabaseQueryProcessor(it.neverworks.data.EntityManager entities, ObjectStoreImpl objStore)
           
 
Method Summary
 org.apache.chemistry.opencmis.commons.data.ObjectList buildResultList(org.apache.chemistry.opencmis.server.support.TypeManager tm, java.lang.String user, java.lang.Boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, java.lang.String renditionFilter, java.math.BigInteger maxItems, java.math.BigInteger skipCount)
           
protected  int compareTo(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> td, java.lang.Object lValue, java.lang.Object rVal)
           
(package private)  boolean evalWhereNode(StoredObject so, java.lang.String user, org.antlr.runtime.tree.Tree node)
          For each object check if it matches and append it to match-list if it does.
 void processQueryAndCatchExc(java.lang.String statement, org.apache.chemistry.opencmis.server.support.TypeManager tm)
           
 org.apache.chemistry.opencmis.commons.data.ObjectList query(org.apache.chemistry.opencmis.server.support.TypeManager tm, ObjectStore objectStore, java.lang.String user, java.lang.String repositoryId, java.lang.String statement, java.lang.Boolean searchAllVersions, java.lang.Boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, java.lang.String renditionFilter, java.math.BigInteger maxItems, java.math.BigInteger skipCount)
          Main entry function to process a query from discovery service
static java.lang.String translatePattern(java.lang.String wildcardString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InDatabaseQueryProcessor

public InDatabaseQueryProcessor(it.neverworks.data.EntityManager entities,
                                ObjectStoreImpl objStore)
Method Detail

query

public org.apache.chemistry.opencmis.commons.data.ObjectList query(org.apache.chemistry.opencmis.server.support.TypeManager tm,
                                                                   ObjectStore objectStore,
                                                                   java.lang.String user,
                                                                   java.lang.String repositoryId,
                                                                   java.lang.String statement,
                                                                   java.lang.Boolean searchAllVersions,
                                                                   java.lang.Boolean includeAllowableActions,
                                                                   org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships,
                                                                   java.lang.String renditionFilter,
                                                                   java.math.BigInteger maxItems,
                                                                   java.math.BigInteger skipCount)
Main entry function to process a query from discovery service


processQueryAndCatchExc

public void processQueryAndCatchExc(java.lang.String statement,
                                    org.apache.chemistry.opencmis.server.support.TypeManager tm)

buildResultList

public org.apache.chemistry.opencmis.commons.data.ObjectList buildResultList(org.apache.chemistry.opencmis.server.support.TypeManager tm,
                                                                             java.lang.String user,
                                                                             java.lang.Boolean includeAllowableActions,
                                                                             org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships,
                                                                             java.lang.String renditionFilter,
                                                                             java.math.BigInteger maxItems,
                                                                             java.math.BigInteger skipCount)

evalWhereNode

boolean evalWhereNode(StoredObject so,
                      java.lang.String user,
                      org.antlr.runtime.tree.Tree node)
For each object check if it matches and append it to match-list if it does. We do here our own walking mechanism so that we can pass additional parameters and define the return types.

Parameters:
node - node in where clause
Returns:
true if it matches, false if it not matches

compareTo

protected int compareTo(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> td,
                        java.lang.Object lValue,
                        java.lang.Object rVal)

translatePattern

public static java.lang.String translatePattern(java.lang.String wildcardString)