001/* 002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * slacoin 011 */ 012package org.nuxeo.ecm.automation.client.jaxrs.spi; 013 014import org.nuxeo.ecm.automation.client.jaxrs.spi.auth.BasicAuthInterceptor; 015import org.nuxeo.ecm.automation.client.jaxrs.spi.auth.PortalSSOAuthInterceptor; 016 017import com.sun.jersey.api.client.ClientHandlerException; 018import com.sun.jersey.api.client.ClientRequest; 019import com.sun.jersey.api.client.ClientResponse; 020import com.sun.jersey.api.client.filter.ClientFilter; 021 022/** 023 * Provide a way of intercepting requests before they are sent server side. Authentication headers are injected this 024 * way. 025 * 026 * @see BasicAuthInterceptor 027 * @see PortalSSOAuthInterceptor 028 */ 029public abstract class RequestInterceptor extends ClientFilter { 030 031 public abstract void processRequest(Request request, Connector connector); 032 033 @Override 034 public ClientResponse handle(ClientRequest cr) throws ClientHandlerException { 035 return getNext().handle(cr); 036 } 037}