Package org.jasig.cas.audit.spi

Source Code of org.jasig.cas.audit.spi.CredentialsAsFirstParameterResourceResolver

/*
* Copyright 2007 The JA-SIG Collaborative. All rights reserved. See license
* distributed with this file and available online at
* http://www.uportal.org/license.html
*/
package org.jasig.cas.audit.spi;

import org.aspectj.lang.JoinPoint;
import com.github.inspektr.audit.spi.AuditResourceResolver;
import org.jasig.cas.authentication.principal.Credentials;
import org.jasig.cas.util.AopUtils;

/**
* Converts the Credentials object into a String resource identifier.
*
* @author Scott Battaglia
* @version $Revision: 1.1 $ $Date: 2005/08/19 18:27:17 $
* @since 3.1.2
*
*/
public final class CredentialsAsFirstParameterResourceResolver implements AuditResourceResolver {

    public String[] resolveFrom(final JoinPoint joinPoint, final Object retval) {
        final Credentials credentials = (Credentials) AopUtils.unWrapJoinPoint(joinPoint).getArgs()[0];
        return new String[] { "supplied credentials: " + credentials.toString() };
    }

    public String[] resolveFrom(final JoinPoint joinPoint, final Exception exception) {
        final Credentials credentials = (Credentials) AopUtils.unWrapJoinPoint(joinPoint).getArgs()[0];
        return new String[] { "supplied credentials: " + credentials.toString() };
    }
}
TOP

Related Classes of org.jasig.cas.audit.spi.CredentialsAsFirstParameterResourceResolver

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.