AbstractAuthenticationEventAuditor.java revision 24a6d0f029c661859cf14302ce4604c17b456a8d
/*
* 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.
*/
/**
* Abstract auditor for constructing and logging authentication events.
*
* @since 13.0.0
*/
public abstract class AbstractAuthenticationEventAuditor {
protected final AuditEventPublisher eventPublisher;
protected final AuditEventFactory eventFactory;
/**
* Constructor for {@link AbstractAuthenticationEventAuditor}.
*
* @param eventPublisher The publisher responsible for logging the events.
* @param eventFactory The factory that can be used to create the events.
*/
public AbstractAuthenticationEventAuditor(AuditEventPublisher eventPublisher, AuditEventFactory eventFactory) {
this.eventFactory = eventFactory;
this.eventPublisher = eventPublisher;
}
/**
* Get the universal user ID.
*
* @param principalName The principal name.
* @param realm The realm.
* @return The universal user ID or an empty string if it could not be found.
*/
return identity.getUniversalId();
}
}
return "";
}
/**
* Get the tracking ID from the login state of the event.
*
* @param loginState The login state of the event.
* @return The tracking ID or an empty string if it could not be found.
*/
}
/**
* Get the realm from the login state of the event.
*
* @param loginState The login state of the event.
* @return The realm or null if it could not be found.
*/
}
/**
* Get the realm from the {@Link SSOToken} of the event.
*
* @param token The {@Link SSOToken} of the event.
* @return The realm or null if it could not be found.
*/
try {
} catch (SSOException e) {
return NO_REALM;
}
}
}