@Override public void doAudit(T auditDataset) { XdsAuditStrategy<T> strategy = (XdsAuditStrategy<T>) getAuditStrategy(); if (strategy != null) { strategy.doAudit(auditDataset); } }
@Override public boolean enrichAuditDatasetFromResponse(T auditDataset, Object response) { XdsAuditStrategy<T> strategy = (XdsAuditStrategy<T>) getAuditStrategy(); if (strategy != null) { return strategy.enrichAuditDatasetFromResponse(auditDataset, response); } return false; }
@Override public T enrichAuditDatasetFromRequest( T auditDataset, Object request, Map<String, Object> parameters) { XdsAuditStrategy<T> strategy = (XdsAuditStrategy<T>) getAuditStrategy(); if (strategy != null) { return strategy.enrichAuditDatasetFromRequest(auditDataset, request, parameters); } return null; }
private XdsAuditStrategy<? extends XdsAuditDataset> getAuditStrategy() { MessageContext messageContext = new WebServiceContextImpl().getMessageContext(); if ("GET".equals(messageContext.get(MessageContext.HTTP_REQUEST_METHOD))) { return null; } if (!messageContext.containsKey(MessageContext.WSDL_OPERATION)) { return null; } QName operationName = (QName) messageContext.get(MessageContext.WSDL_OPERATION); XdsAuditStrategy<? extends XdsAuditDataset> auditStrategy = map.get(operationName); if (auditStrategy == null) { log.debug("No strategy could be found for operation {}", operationName); } else { log.debug( "Found strategy {} for operation {}", auditStrategy.getClass().getCanonicalName(), operationName); } return auditStrategy; }
@Override public RFC3881EventCodes.RFC3881EventOutcomeCodes getEventOutcomeCode(Object response) { XdsAuditStrategy<? extends XdsAuditDataset> strategy = getAuditStrategy(); return (strategy != null) ? strategy.getEventOutcomeCode(response) : null; }
@Override public T createAuditDataset() { XdsAuditStrategy<? extends XdsAuditDataset> strategy = getAuditStrategy(); return (strategy != null) ? (T) strategy.createAuditDataset() : null; }