Interface JcrIndexQueryManager


  • public interface JcrIndexQueryManager
    The JCR index query manager is an alternative solution for the Jackrabbit implementation of javax.jcr.query.QueryManager. The disadvantage of that query manager is that it requires a Lucene index on disk, on each node in the cluster. Building the index can take up much time, half an hour to an hour on large installations. This makes it impossible to spin up a new node in a few minutes in an elastic scalable cluster. This query manager implementation does not require an index on (local) disk but stores it index in a database table instead. This index can be used by all nodes in the cluster. The implementation is much more limited (does not support XPath queries for example), but tailored to the needs of XC.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      javax.jcr.Node getNode​(javax.jcr.Session session, long siteworksId)
      Returns the node matching the specified Siteworks id.
      javax.jcr.Node getNode​(javax.jcr.Session session, String uuid)
      Returns the node with the specified uuid.
      javax.jcr.NodeIterator getNodes​(javax.jcr.Session session, String nodeType)
      Returns the nodes of the specified type or any of its subtypes.
      javax.jcr.NodeIterator getNodes​(javax.jcr.Session session, String nodeType, String name)
      Returns the nodes with the specified name and type or any of its subtypes.
      javax.jcr.NodeIterator getNodes​(javax.jcr.Session session, String nodeType, Map<String,​Object> filterValues)
      Returns the nodes of the specified type or any of its subtypes that match the Map of property / property values.
      javax.jcr.NodeIterator getNodesByLastModified​(javax.jcr.Session session, String nodeType, Date afterDate)
      Returns the nodes matching one of the specified node types and has a jcr:lastModified date property that is later then the specified date.
      javax.jcr.NodeIterator getNodesByQuery​(javax.jcr.Session session, String query)
      Returns the nodes matching the specified query.
      javax.jcr.NodeIterator getNodesBySiteworksIdRange​(javax.jcr.Session session, String nodeType, long idsAbove)
      Returns the nodes with the specified nodetype with a Siteworks id higher than the given id.
      javax.jcr.Node getNodeWithHighestSiteworksId​(javax.jcr.Session session)
      Returns the node with highest Siteworks id.
    • Method Detail

      • getNodes

        javax.jcr.NodeIterator getNodes​(javax.jcr.Session session,
                                        String nodeType)
        Returns the nodes of the specified type or any of its subtypes. The result is the same as the XPath query //element(*, nodeType)
        Parameters:
        session - the JCR session
        nodeType - the node type of the nodes to retrieve
        Returns:
        an iterator of nodes matching the specified node type
      • getNodes

        javax.jcr.NodeIterator getNodes​(javax.jcr.Session session,
                                        String nodeType,
                                        Map<String,​Object> filterValues)
        Returns the nodes of the specified type or any of its subtypes that match the Map of property / property values. The result is the same as the XPath query //element(*, nodeType)[@key1=''value1' and @key2 = 'value2' ...]
        Parameters:
        session - the JCR session
        nodeType - the node type of the nodes to retrieve
        filterValues - Map of property names and values the nodes should match. So for example if it contains a key "identifier" with Integer value 3 then only nodes are returned that have a property named "identifier" containing an integer value 3. Supported object types are the primitive types of the JCR.
        Returns:
        an iterator of nodes matching the specified node type and filter
      • getNodes

        javax.jcr.NodeIterator getNodes​(javax.jcr.Session session,
                                        String nodeType,
                                        String name)
        Returns the nodes with the specified name and type or any of its subtypes. The result is the same as the XPath query //element(name, nodeType)
        Parameters:
        session - the JCR session
        nodeType - the node type of the nodes to retrieve
        name - the name of the nodes to retrieve
        Returns:
        an iterator of nodes matching the specified node type
      • getNodesByQuery

        javax.jcr.NodeIterator getNodesByQuery​(javax.jcr.Session session,
                                               String query)
                                        throws javax.jcr.query.InvalidQueryException
        Returns the nodes matching the specified query. This query follows the standard JCR XPath syntax, but is limited to the format "//element(*, nodetype)[@property1=value1 AND @property2='value2' AND ...]". The nodetype can be omitted, but only if the query filters on wm:id, jcr:uuid or at least one of the indexed properties as defined in JcrIndexPropertyService.getIndexedProperties().
        Parameters:
        session - the JCR session
        query - the XPath query
        Returns:
        an iterator of nodes matching the specified query
        Throws:
        javax.jcr.query.InvalidQueryException - when the query syntax is invalid
        Since:
        10.31.0
      • getNodesByLastModified

        javax.jcr.NodeIterator getNodesByLastModified​(javax.jcr.Session session,
                                                      String nodeType,
                                                      Date afterDate)
        Returns the nodes matching one of the specified node types and has a jcr:lastModified date property that is later then the specified date.
        Parameters:
        session - the JCR session
        nodeType - the node type the returned nodes must match
        afterDate - the returned nodes must have a jcr:lastModified after this date
        Returns:
        the nodes matching one of the specified node types nad has a jcr:lastModified date property that is later then the specified date
      • getNode

        javax.jcr.Node getNode​(javax.jcr.Session session,
                               long siteworksId)
        Returns the node matching the specified Siteworks id. Note that this is the node of which the wm:id property macthes the specified siteworksId.
        Parameters:
        session - the JCR session
        siteworksId - Siteworks id to match
        Returns:
        node matching the specified Siteworks id
      • getNode

        javax.jcr.Node getNode​(javax.jcr.Session session,
                               String uuid)
        Returns the node with the specified uuid.
        Parameters:
        session - the JCR session
        uuid - The uuid to match
        Returns:
        the node with the specified uuid or null
      • getNodesBySiteworksIdRange

        javax.jcr.NodeIterator getNodesBySiteworksIdRange​(javax.jcr.Session session,
                                                          String nodeType,
                                                          long idsAbove)
        Returns the nodes with the specified nodetype with a Siteworks id higher than the given id. The iterator returned is sorted ascending by Siteworks id.
        Parameters:
        session - the JCR session
        nodeType - the nodetype the returned nodes must match
        idsAbove - the lower Siteworks id limit, excluding the given id itself
        Returns:
        the specified nodes
      • getNodeWithHighestSiteworksId

        javax.jcr.Node getNodeWithHighestSiteworksId​(javax.jcr.Session session)
        Returns the node with highest Siteworks id. Note that this is the node of which the wm:id property has the highest value. To prevent Siteworks IDs to be used double, this method must be called while holding a cluster wide lock if the result is used for deciding the next ID to be used. This can be done using the LockManager.
        Parameters:
        session - the JCR session
        Returns:
        node with the highest Siteworks id