Search in sources :

Example 1 with ResponseStatus

use of org.forgerock.audit.events.AccessAuditEventBuilder.ResponseStatus in project OpenAM by OpenRock.

the class RadiusAuditLoggerEventBus method setResponseDetails.

/**
     * Sets the response details of the builder, using the details provided in the <code>RadiusResponse</code>.
     *
     * @param builder
     * @param response
     */
private void setResponseDetails(AMAccessAuditEventBuilder builder, RadiusResponse response) {
    LOG.message("Entering RadiusAuditLoggerEventBus.setResponseDetails()");
    ResponseStatus responseStatus = null;
    PacketType packetType = response.getResponsePacket().getType();
    if ((packetType == PacketType.ACCESS_ACCEPT) || (packetType == PacketType.ACCESS_CHALLENGE)) {
        responseStatus = ResponseStatus.SUCCESSFUL;
    } else if (packetType == PacketType.ACCESS_REJECT) {
        responseStatus = ResponseStatus.FAILED;
    } else {
        LOG.warning("Unexpected packet type in RadiusAuditLoggerEventBus.setResponseDetails()");
    }
    builder.response(responseStatus, packetType.toString(), response.getTimeToServiceRequestInMilliSeconds(), TimeUnit.MILLISECONDS);
    LOG.message("Leaving RadiusAuditLoggerEventBus.setResponseDetails()");
}
Also used : ResponseStatus(org.forgerock.audit.events.AccessAuditEventBuilder.ResponseStatus) PacketType(org.forgerock.openam.radius.common.PacketType)

Aggregations

ResponseStatus (org.forgerock.audit.events.AccessAuditEventBuilder.ResponseStatus)1 PacketType (org.forgerock.openam.radius.common.PacketType)1