AbstractHttpAccessAuditFilter.java revision a6fc9ae6bd096a653649fdf8e4189f102dd4cdf2
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
*/
/**
* Responsible for logging access audit events for CHF requests.
*
* @since 13.0.0
*/
public abstract class AbstractHttpAccessAuditFilter implements Filter {
private final AuditEventPublisher auditEventPublisher;
private final AuditEventFactory auditEventFactory;
/**
* Create a new filter for the given component and handler.
*
* @param component The component for which events will be logged.
* @param auditEventPublisher The publisher responsible for logging the events.
* @param auditEventFactory The factory that can be used to create the events.
*/
this.auditEventFactory = auditEventFactory;
}
public Promise<Response, NeverThrowsException> filter(final Context context, final Request request, Handler next) {
try {
} catch (AuditException e) {
}
return next.handle(context, request).then(new Function<Response, Response, NeverThrowsException>() {
} else {
}
return response;
}
});
}
}
}
}
}
}
}
/**
* Retrieve the user ID for an access attempt.
*
* @param request the restlet request
* @return the user ID
*/
}
/**
* Retrieve the context IDs for an access attempt.
*
* @param request the restlet request
* @return the context IDs
*/
return getAllAvailableContexts();
}
/**
* Retrieve the user ID for an access outcome.
*
* @param response the restlet response
* @return the user ID
*/
}
/**
* Retrieve the Context IDs for an access outcome.
*
* @param response the restlet response
* @return the context IDs
*/
return getAllAvailableContexts();
}
}