Search in sources :

Example 1 with AuthRequestRejectedEvent

use of org.forgerock.openam.radius.server.events.AuthRequestRejectedEvent in project OpenAM by OpenRock.

the class RadiusRequestHandler method postHandledEvent.

private void postHandledEvent(RadiusRequest request, RadiusResponse response, RadiusRequestContext requestContext) {
    LOG.message("Entering RadiusRequestHandler.postHandledEvent()");
    // Calculate and set the time to service the response.
    response.setTimeToServiceRequestInMilliSeconds(DateTime.now().getMillis() - request.getStartTimestampInMillis());
    Packet responsePacket = response.getResponsePacket();
    if (responsePacket != null) {
        switch(responsePacket.getType()) {
            case ACCESS_ACCEPT:
                eventBus.post(new AuthRequestAcceptedEvent(request, response, requestContext));
                break;
            case ACCESS_CHALLENGE:
                eventBus.post(new AuthRequestChallengedEvent(request, response, requestContext));
                break;
            case ACCESS_REJECT:
                eventBus.post(new AuthRequestRejectedEvent(request, response, requestContext));
                break;
            case ACCOUNTING_RESPONSE:
                break;
            default:
                LOG.warning("Unexpected type of responsePacket;", responsePacket.getType().toString());
                break;
        }
    }
    LOG.message("Leaving RadiusRequestHandler.postHandledEvent()");
}
Also used : Packet(org.forgerock.openam.radius.common.Packet) AuthRequestRejectedEvent(org.forgerock.openam.radius.server.events.AuthRequestRejectedEvent) AuthRequestAcceptedEvent(org.forgerock.openam.radius.server.events.AuthRequestAcceptedEvent) AuthRequestChallengedEvent(org.forgerock.openam.radius.server.events.AuthRequestChallengedEvent)

Aggregations

Packet (org.forgerock.openam.radius.common.Packet)1 AuthRequestAcceptedEvent (org.forgerock.openam.radius.server.events.AuthRequestAcceptedEvent)1 AuthRequestChallengedEvent (org.forgerock.openam.radius.server.events.AuthRequestChallengedEvent)1 AuthRequestRejectedEvent (org.forgerock.openam.radius.server.events.AuthRequestRejectedEvent)1