All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.plexus.security.summit.AbstractSessionValidatorValve Maven / Gradle / Ivy

There is a newer version: 1.0-alpha-3
Show newest version
package org.codehaus.plexus.security.summit;

import java.io.IOException;

import org.codehaus.plexus.summit.pipeline.valve.AbstractValve;
import org.codehaus.plexus.summit.pipeline.valve.ValveInvocationException;
import org.codehaus.plexus.summit.rundata.RunData;

/**
 * 

* Validates that there is a user in the session. If there isn't one an * anonymous user is retrieved from the User Authenticator. *

* This must be placed before the resolver valve. *

* @author Dan Diephouse * @since Feb 28, 2003 * * @todo How do I cancel execution of an action? */ public abstract class AbstractSessionValidatorValve extends AbstractValve { /** * @see org.codehaus.plexus.summit.pipeline.valve.AbstractValve#invoke(org.codehaus.plexus.summit.rundata.RunData, org.codehaus.plexus.summit.pipeline.valve.ValveContext) */ public void invoke(RunData data) throws IOException, ValveInvocationException { SecureRunData secData = (SecureRunData) data; if ( ( secData.getUser() == null || !secData.getUser().isLoggedIn() ) && !isAllowedGuest() ) { data.setTarget( getLoginTarget() ); } } public String getLoginTarget() { return "Login.vm"; } protected abstract boolean isAllowedGuest(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy