code: private Set<Result> evaluatePids(Set<String> dsids,
                                       String pid,
                                       HttpServletRequest request,
                                       DataResponseWrapper response)
              throws ServletException {
          RequestCtx[] requests = new RequestCtx[dsids.size()];
          int ix = 0;
          for (String dsid : dsids) {
              logger.debug("Checking: {}/{}", pid, dsid);
  
              Map<URI, AttributeValue> actions =
                      new HashMap<URI, AttributeValue>();
              Map<URI, AttributeValue> resAttr;
  
              try {
                  actions.put(Constants.ACTION.ID.getURI(),
                              Constants.ACTION.GET_DATASTREAM
                                      .getStringAttribute());
  
                  resAttr = ResourceAttributes.getResources(pid);
                  resAttr.put(Constants.DATASTREAM.ID.getURI(),
                              new StringAttribute(dsid));
  
                  RequestCtx req =
                          getContextHandler()
                                  .buildRequest(getSubjects(request),
                                                actions,
                                                resAttr,
                                                getEnvironment(request));
  
                  requests[ix++] = req;
              } catch (Exception e) {
                  logger.error(e.getMessage(), e);
                  throw new ServletException(e.getMessage(), e);
              }
          }
  
          ResponseCtx resCtx = null;
          try {
              if (logger.isDebugEnabled()) {
                  logger.debug("Number of requests: " + requests.length);
              }
  
              resCtx =
                      getContextHandler().evaluateBatch(requests);
  
          } catch (MelcoeXacmlException pe) {
              throw new ServletException("Error evaluating pids: "
                      + pe.getMessage(), pe);
          }
  
          @SuppressWarnings("unchecked")
          Set<Result> results = resCtx.getResults();
  
          return results;
      }
docs: Takes a given list of PID's and evaluates them.
  
  @param dsids
  the list of pids to check
  @param request
  the http servlet request
  @param response
  the http servlet resposne
  @return a set of XACML results.
  @throws ServletException