private boolean checkPolicy(Notify notify, AssertionType assertion) { log.debug("In NhinHiemNotifyWebServiceProxy.checkPolicy"); boolean policyIsValid = false; NotifyEventType policyCheckReq = new NotifyEventType(); policyCheckReq.setDirection(NhincConstants.POLICYENGINE_OUTBOUND_DIRECTION); gov.hhs.fha.nhinc.common.eventcommon.NotifyMessageType request = new gov.hhs.fha.nhinc.common.eventcommon.NotifyMessageType(); request.setAssertion(assertion); request.setNotify(notify); policyCheckReq.setMessage(request); PolicyEngineChecker policyChecker = new PolicyEngineChecker(); CheckPolicyRequestType policyReq = policyChecker.checkPolicyNotify(policyCheckReq); policyReq.setAssertion(assertion); PolicyEngineProxyObjectFactory policyEngFactory = new PolicyEngineProxyObjectFactory(); PolicyEngineProxy policyProxy = policyEngFactory.getPolicyEngineProxy(); CheckPolicyResponseType policyResp = policyProxy.checkPolicy(policyReq, assertion); if (policyResp.getResponse() != null && NullChecker.isNotNullish(policyResp.getResponse().getResult()) && policyResp.getResponse().getResult().get(0).getDecision() == DecisionType.PERMIT) { policyIsValid = true; } log.debug("Finished NhinHiemNotifyWebServiceProxy.checkPolicy - valid: " + policyIsValid); return policyIsValid; }
/** * NO-OP implementation of the checkPolicy operation returns "Permit" * * @param checkPolicyRequest The xacml request to check defined policy * @return The xacml response which contains the access denied */ public CheckPolicyResponseType checkPolicy( CheckPolicyRequestType checkPolicyRequest, AssertionType assertion) { log.debug("Begin AdapterPEPProxyNoOpImpl.checkPolicy"); CheckPolicyResponseType policyResponse = new CheckPolicyResponseType(); ResponseType response = new ResponseType(); ResultType result = new ResultType(); result.setDecision(DecisionType.PERMIT); response.getResult().add(result); policyResponse.setResponse(response); log.debug("End AdapterPEPProxyNoOpImpl.checkPolicy"); return policyResponse; }