use of org.forgerock.openam.radius.common.PacketType in project OpenAM by OpenRock.
the class RadiusAuditLoggerEventBus method setRequestDetails.
private void setRequestDetails(AMAccessAuditEventBuilder builder, AcceptedRadiusEvent accessRequestEvent) {
LOG.message("Entering RadiusAuditLoggerEventBus.setRequestDetails()");
RadiusRequest request = accessRequestEvent.getRequest();
if (request != null) {
Packet packet = request.getRequestPacket();
if (packet != null) {
PacketType packetType = packet.getType();
Short packetId = packet.getIdentifier();
if (packetType != null && packetId != null) {
String operationName = packetType.toString();
JsonValue requestId = json(object(field("radiusId", packetId)));
builder.request("RADIUS", operationName, requestId);
}
}
}
LOG.message("Leaving RadiusAuditLoggerEventBus.setRequestDetails()");
}
use of org.forgerock.openam.radius.common.PacketType 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()");
}
Aggregations