@Override
    public boolean isAuditRequired(String eventType, String outcome) {
        // TODO: need to handle auditData

        for (Map.Entry<String, List<Map<String, Object>>> handlerMap : handlerEventsMap.entrySet()) {

            List<Map<String, Object>> handlerEventsList = handlerMap.getValue();
            if (handlerEventsList.isEmpty()) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "handlerEventsList is empty, returning true for isAuditRequired");
                }
                return true;
            }
            for (Map<String, Object> handlerEvents : handlerEventsList) {
                if (handlerEvents.isEmpty()) {
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "no events or outcomes specified, all events and outcomes are honoured");
                    }
                    return true;
                } else {
                    boolean foundMatchingEvent = false;
                    boolean foundAnOutcome = false;
                    boolean foundMatchingEventAndOutcome = false;
                    for (Entry<String, Object> entry : handlerEvents.entrySet()) {
                        if (entry.getKey().equals(AuditConstants.EVENT_NAME) && entry.getValue().equals(eventType)) {
                            foundMatchingEvent = true;
                        } else {
                            if (entry.getKey().equals(AuditConstants.OUTCOME)) {
                                foundAnOutcome = true;
                                if (entry.getValue().toString().equalsIgnoreCase(outcome)) {
                                    if (foundMatchingEvent) {
                                        foundMatchingEventAndOutcome = true;
                                    }
                                }
                            }
                        }

                    }
                    if (foundMatchingEventAndOutcome || (foundMatchingEvent && !foundAnOutcome)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
@ Override public boolean isAuditRequired ( String eventType , String outcome ) { for ( Map . Entry < String , List < Map < String , Object > > > handlerMap : handlerEventsMap . entrySet ( ) ) { List < Map < String , Object > > handlerEventsList = handlerMap . getValue ( ) ; if ( handlerEventsList . isEmpty ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handlerEventsList is empty, returning true for isAuditRequired" ) ; } return true ; } for ( Map < String , Object > handlerEvents : handlerEventsList ) { if ( handlerEvents . isEmpty ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "no events or outcomes specified, all events and outcomes are honoured" ) ; } return true ; } else { boolean foundMatchingEvent = false ; boolean foundAnOutcome = false ; boolean foundMatchingEventAndOutcome = false ; for ( Entry < String , Object > entry : handlerEvents . entrySet ( ) ) { if ( entry . getKey ( ) . equals ( AuditConstants . EVENT_NAME ) && entry . getValue ( ) . equals ( eventType ) ) { foundMatchingEvent = true ; } else { if ( entry . getKey ( ) . equals ( AuditConstants . OUTCOME ) ) { foundAnOutcome = true ; if ( entry . getValue ( ) . toString ( ) . equalsIgnoreCase ( outcome ) ) { if ( foundMatchingEvent ) { foundMatchingEventAndOutcome = true ; } } } } } if ( foundMatchingEventAndOutcome || ( foundMatchingEvent && ! foundAnOutcome ) ) { return true ; } } } } return false ; }
/*
(non-Javadoc)

@see com.ibm.wsspi.security.audit.AuditService#isAuditRequired()