// Path: netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/FrameworkHttpRequest.java
// public interface FrameworkHttpRequest {
// 
//     /**
//      * Returns the method of this request.
//      */
//     HttpMethod getMethod();
//     
//     /**
//      * Returns the URI (or path) of this request.
//      */
//     String getUri();
//     
//     /**
//      * Sets the URI (or path) of this request.
//      */
//     void setUri(String uri);
//     
//     /**
//      * Returns the header value with the specified header name.  If there are
//      * more than one header value for the specified header name, the first
//      * value is returned.
//      *
//      * @return the header value or {@code null} if there is no such header
//      */
//     String getHeader(String name);
//     
//     /**
//      * Returns {@code true} if and only if there is a header with the specified
//      * header name.
//      */
//     boolean containsHeader(String name);
//     
//     /**
//      * Adds a new header with the specified name and value.
//      */
//     void addHeader(String name, Object value);
//     
//     /**
//      * Returns the all header names and values that this message contains.
//      *
//      * @return the {@link List} of the header name-value pairs.  An empty list
//      *         if there is no header in this message.
//      */
//     List<Map.Entry<String, String>> getHeaders();
//     
// }
// 
// Path: netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/HttpRequestHandlerFactory.java
// public interface HttpRequestHandlerFactory {
// 
//     HttpRequestHandler getInstance(String tag, com.netflix.zuul.proxy.framework.api.Interrupts interrupts);
// 
// }
// 
// Path: netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/Interrupts.java
// public interface Interrupts {
// 
//     void movedPermanently (String location);
//     void temporaryRedirect (String location);
//     
// }


import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest;
import com.netflix.zuul.proxy.framework.api.HttpRequestHandler;
import com.netflix.zuul.proxy.framework.api.HttpRequestHandlerFactory;
import com.netflix.zuul.proxy.framework.api.Interrupts;
package com.netflix.zuul.proxy.framework.plugins;


public class GlobalRewriteRequestHandler implements HttpRequestHandler {

    @Override
    public void requestReceived(FrameworkHttpRequest request) {
        switch (request.getUri()) {
            case "/foo":
                request.setUri(String.format("/bar"));
        }
    }

// Path: netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/FrameworkHttpRequest.java
// public interface FrameworkHttpRequest {
// 
//     /**
//      * Returns the method of this request.
//      */
//     HttpMethod getMethod();
//     
//     /**
//      * Returns the URI (or path) of this request.
//      */
//     String getUri();
//     
//     /**
//      * Sets the URI (or path) of this request.
//      */
//     void setUri(String uri);
//     
//     /**
//      * Returns the header value with the specified header name.  If there are
//      * more than one header value for the specified header name, the first
//      * value is returned.
//      *
//      * @return the header value or {@code null} if there is no such header
//      */
//     String getHeader(String name);
//     
//     /**
//      * Returns {@code true} if and only if there is a header with the specified
//      * header name.
//      */
//     boolean containsHeader(String name);
//     
//     /**
//      * Adds a new header with the specified name and value.
//      */
//     void addHeader(String name, Object value);
//     
//     /**
//      * Returns the all header names and values that this message contains.
//      *
//      * @return the {@link List} of the header name-value pairs.  An empty list
//      *         if there is no header in this message.
//      */
//     List<Map.Entry<String, String>> getHeaders();
//     
// }
// 
// Path: netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/HttpRequestHandlerFactory.java
// public interface HttpRequestHandlerFactory {
// 
//     HttpRequestHandler getInstance(String tag, com.netflix.zuul.proxy.framework.api.Interrupts interrupts);
// 
// }
// 
// Path: netty-framework-api/src/main/java/com/netflix/zuul/proxy/framework/api/Interrupts.java
// public interface Interrupts {
// 
//     void movedPermanently (String location);
//     void temporaryRedirect (String location);
//     
// }


// Path: netty-framework-plugins/src/main/java/com/netflix/zuul/proxy/framework/plugins/GlobalRewriteRequestHandler.java
import com.netflix.zuul.proxy.framework.api.FrameworkHttpRequest;
import com.netflix.zuul.proxy.framework.api.HttpRequestHandler;
import com.netflix.zuul.proxy.framework.api.HttpRequestHandlerFactory;
import com.netflix.zuul.proxy.framework.api.Interrupts;

package com.netflix.zuul.proxy.framework.plugins;


public class GlobalRewriteRequestHandler implements HttpRequestHandler {

    @Override
    public void requestReceived(FrameworkHttpRequest request) {
        switch (request.getUri()) {
            case "/foo":
                request.setUri(String.format("/bar"));
        }
    }

    public static final HttpRequestHandlerFactory FACTORY = new HttpRequestHandlerFactory() {