Package org.exist.dom

Examples of org.exist.dom.DocumentSet


     *  Note however, that the actual response can be influenced, through tests in the query,
     *  by documents more recent. */
    public static void addLastModifiedHeader(Sequence result,
      XQueryContext context) {
    try {
      final DocumentSet documentSet = result.getDocumentSet();
      long mostRecentDocumentTime = 0;
      for (final Iterator<DocumentImpl> i = documentSet.getDocumentIterator(); i.hasNext(); ) {
        final DocumentImpl doc = i.next();
        if (doc != null) {
          mostRecentDocumentTime = Math.max(doc.getMetadata().getLastModified(),
              mostRecentDocumentTime);
//          LOG.debug("getFileName: " + doc.getFileName() + ", "
View Full Code Here


      pool.release(broker);
    }
  }
  private PolicyFinderResult findPolicy(DBBroker broker, EvaluationCtx context) throws PermissionDeniedException
  {
    final DocumentSet mainPolicyDocs = XACMLUtil.getPolicyDocuments(broker, false);
    if(mainPolicyDocs == null)
      {return new PolicyFinderResult();}

    AbstractPolicy matchedPolicy = null;
    AbstractPolicy policy;
    MatchResult match;
    int result;
    try
    {
      final XACMLUtil util = pdp.getUtil();
      for(final Iterator<DocumentImpl> it = mainPolicyDocs.getDocumentIterator(); it.hasNext();)
      {
        policy = util.getPolicyDocument(it.next());
        match = policy.match(context);
        result = match.getResult();
        if(result == MatchResult.INDETERMINATE)
View Full Code Here

  * @throws XPathException if there is an error performing
  *  the index lookup
  */
  public DocumentImpl getPolicyDocument(DBBroker broker, QName attributeQName, URI attributeValue) throws ProcessingException, XPathException, PermissionDeniedException
  {
    final DocumentSet documentSet = getPolicyDocuments(broker, attributeQName, attributeValue);
    final int documentCount = (documentSet == null) ? 0 : documentSet.getDocumentCount();
    if(documentCount == 0)
    {
      LOG.warn("Could not find " + attributeQName.getLocalName() + " '" +  attributeValue + "'", null);
      return null;
    }

    if(documentCount > 1)
    {
      throw new ProcessingException("Too many applicable policies for " + attributeQName.getLocalName() + " '" +  attributeValue + "'");
    }

    return (DocumentImpl)documentSet.getDocumentIterator().next();
  }
View Full Code Here

      {return null;}
    if(attributeValue == null)
      {return null;}
    final AtomicValue comparison = new AnyURIValue(attributeValue);

    final DocumentSet documentSet = getPolicyDocuments(broker, true);
    final NodeSet nodeSet = documentSet.docsToNodeSet();

        final NativeValueIndex valueIndex = broker.getValueIndex();
        final Sequence results = valueIndex.find(null, Constants.EQ, documentSet, null, NodeSet.ANCESTOR, attributeQName, comparison);
//        Sequence results = index.findByQName(attributeQName, comparison, nodeSet);
    //TODO : should we honour (# exist:force-index-use #) ?
View Full Code Here

TOP

Related Classes of org.exist.dom.DocumentSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.