Examples of HandlerConfiguration


Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

   */
  public boolean checkAuthentication(Redirector redirector,
                                        String handlerName,
                                        String applicationName)
  throws IOException, ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to check: " + handlerName);
        }
        // are we already logged in?
        UserHandler handler = this.getUserHandler( handlerName );
        final boolean authenticated = ( handler != null );
        if ( !authenticated ) {
            if (redirector != null) {
                // create parameters
                SourceParameters parameters = config.getRedirectParameters();
                if (parameters == null) parameters = new SourceParameters();
                final Request request = this.getRequest();
                String resource = request.getRequestURI();
                if (request.getQueryString() != null) {
                    resource += '?' + request.getQueryString();
                }
   
                parameters.setSingleParameterValue("resource", resource);
                final String redirectURI = config.getRedirectURI();
                redirector.globalRedirect(false, SourceUtil.appendParameters(redirectURI, parameters));
            }
        } else {
            // update state
            RequestState state = new RequestState( handler, applicationName );
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

       
    return authenticated;
  }

    public String getForwardingURI(String handlerName) throws ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        SourceParameters parameters = config.getRedirectParameters();
        if (parameters == null) parameters = new SourceParameters();
        final Request request = this.getRequest();
        String resource = request.getRequestURI();
        if (request.getQueryString() != null) {
            resource += '?' + request.getQueryString();
        }
   
        parameters.setSingleParameterValue("resource", resource);
        final String redirectURI = config.getRedirectURI();
        return SourceUtil.appendParameters(redirectURI, parameters);
    }
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

  /* (non-Javadoc)
   * @see org.apache.cocoon.webapps.authentication.components.Manager#logout(java.lang.String, java.lang.String)
   */
  public void logout(String handlerName, int mode)
    throws ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to logout: " + handlerName);
        }
        // are we logged in?
        UserHandler handler = this.getUserHandler( handlerName );
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

    public void logout(UserHandler handler) {
        if (this.getLogger().isDebugEnabled() ) {
            this.getLogger().debug("logout using handler " + handler.getHandlerName());
        }
       
        final HandlerConfiguration configuration = handler.getHandlerConfiguration();
        final String logoutResourceName = configuration.getLogoutResource();
        if (logoutResourceName != null) {
            final SourceParameters parameters = configuration.getAuthenticationResourceParameters();
       
            // invoke the source
            Source source = null;
            try {
                // This allows arbitrary business logic to be called. Whatever is returned
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

     * @return The configuration or null.
     */
    private HandlerConfiguration getHandlerConfiguration(String name)
    throws ProcessingException {  
        final Map configs = this.getHandlerConfigurations();
        HandlerConfiguration c = null;
        if ( configs != null) {
            c = (HandlerConfiguration)configs.get( name );
        }
        return c;
    }
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

   */
  public UserHandler login(String handlerName,
                             String applicationName,
                             SourceParameters parameters)
    throws ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to authenticate: " + handlerName);
        }
        // are we already logged in?
        UserHandler handler = this.getUserHandler( handlerName );
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

   */
  public boolean checkAuthentication(Redirector redirector,
                                        String handlerName,
                                        String applicationName)
  throws IOException, ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to check: " + handlerName);
        }
        // are we already logged in?
        UserHandler handler = this.getUserHandler( handlerName );
        final boolean authenticated = ( handler != null );
        if ( !authenticated ) {
            // create parameters
            SourceParameters parameters = config.getRedirectParameters();
            if (parameters == null) parameters = new SourceParameters();
            final Request request = this.getRequest();
            String resource = request.getRequestURI();
            if (request.getQueryString() != null) {
                resource += '?' + request.getQueryString();
            }

            parameters.setSingleParameterValue("resource", resource);
            final String redirectURI = config.getRedirectURI();
            redirector.globalRedirect(false, SourceUtil.appendParameters(redirectURI, parameters));
        } else {
            // update state
            RequestState state = new RequestState( handler, applicationName, this.resolver );
            RequestState.setState( state );
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

  /* (non-Javadoc)
   * @see org.apache.cocoon.webapps.authentication.components.Manager#logout(java.lang.String, java.lang.String)
   */
  public void logout(String handlerName, int mode)
    throws ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to logout: " + handlerName);
        }
        // are we logged in?
        UserHandler handler = this.getUserHandler( handlerName );
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

     * @return The configuration or null.
     */
    private HandlerConfiguration getHandlerConfiguration(String name)
    throws ProcessingException {  
        final Map configs = this.getHandlerConfigurations();
        HandlerConfiguration c = null;
        if ( configs != null) {
            c = (HandlerConfiguration)configs.get( name );
        }
        return c;
    }
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

   */
  public UserHandler login(String handlerName,
                             String applicationName,
                             SourceParameters parameters)
    throws ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to authenticate: " + handlerName);
        }
        // are we already logged in?
        UserHandler handler = this.getUserHandler( handlerName );
View Full Code Here
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.