@Override public PDPResponseCollection request(final PDPRequestCollection reqCol) throws DecisionProcessingException { PDPRequestCollection openRequests = reqCol; Map<PDPRequest, PDPResponse> allResponses = new LinkedHashMap<PDPRequest, PDPResponse>(); PDPResponseCollection lastResponse = null; for (Iterator<DecisionService> serviceIt = m_decisionServices.iterator(); serviceIt.hasNext() && !openRequests.isEmpty(); openRequests = findOpenRequests(lastResponse, allResponses)) { DecisionService decisionService = serviceIt.next(); lastResponse = decisionService.request(openRequests); } // little optimization if (m_decisionServices.size() == 1 && lastResponse != null) { return lastResponse; } PDPResponseCollection response = new PDPResponseCollection(); for (Iterator<PDPRequest> requests = reqCol.iterator(); requests.hasNext();) { PDPResponse resp = allResponses.get(requests.next()); response.add(resp); } return response; }
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
PDPRequestCollection openRequests = findNonCachedRequests(reqCol, allRequestsLookup); if (!openRequests.isEmpty()) { lastResponse = getDelegate().request(openRequests); putInCache(lastResponse, allRequestsLookup);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
reqCollection.add(request); PDPResponseCollection resCollection = getDecisionService().request(reqCollection); Iterator<PDPResponse> resIterator = resCollection.iterator(); while (resIterator.hasNext()) {
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection); Set<String> notAllowedFeatures = new HashSet<String>(); Iterator resIterator = resCollection.iterator();
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
resCollection = getDecisionService().request(reqCollection); } catch (DecisionProcessingException e) { throw new InterceptorException("Exception during policy decision request", e);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
reqCollection.add(request); PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
resCollection = getDecisionService().request(reqCollection); } catch (DecisionProcessingException e) { throw new InterceptorException("Error during pdp request", e);
PDPResponseCollection resCollection = getDecisionService().request(reqCollection);
public SecuredServiceRequest doRequest(Subject subject, InterceptorRequest request) throws InterceptorException, EnforcementServiceException { LOG.debug("intercepting request"); SecuredServiceRequest req = request.getRequest(); PDPRequestCollection reqCollection = new PDPRequestCollection(); Target tTarget = new Target(subject, request.getRequest().getForward().getServiceEndpoint(), "*", "target:service"); PDPRequest pdprequest = new PDPRequest(tTarget); reqCollection.add(pdprequest); // Query PDP PDPResponseCollection resCollection = null; try { resCollection = getDecisionService().request(reqCollection); } catch (DecisionProcessingException e) { throw new InterceptorException("Error during pdp request:", e); } // Process PDP response and cut off every layer that is not allowed to // be accessed by GetMap Iterator resIterator = resCollection.iterator(); while (resIterator.hasNext()) { PDPResponse response = (PDPResponse) resIterator.next(); if (!response.isPermit()) { // Improve ExceptionHandling ! throw new EnforcementServiceException("Access to service denied"); } } return req; }