// Path: src/main/java/ch/mimo/netty/handler/codec/icap/IcapRequestEncoder.java
// public class IcapRequestEncoder extends IcapMessageEncoder {
// 
// 	public IcapRequestEncoder() {
// 		super();
// 	}
// 	
// 	@Override
// 	protected int encodeInitialLine(ChannelBuffer buffer, IcapMessage message) throws Exception {
// 		IcapRequest request = (IcapRequest) message;
// 		int index = buffer.readableBytes();
//         buffer.writeBytes(request.getMethod().toString().getBytes(IcapCodecUtil.ASCII_CHARSET));
//         buffer.writeByte(IcapCodecUtil.SPACE);
//         buffer.writeBytes(request.getUri().getBytes(IcapCodecUtil.ASCII_CHARSET));
//         buffer.writeByte(IcapCodecUtil.SPACE);
//         buffer.writeBytes(request.getProtocolVersion().toString().getBytes(IcapCodecUtil.ASCII_CHARSET));
//         buffer.writeBytes(IcapCodecUtil.CRLF);
//         return buffer.readableBytes() - index;
// 	}
// 
// }
// 
// Path: src/main/java/ch/mimo/netty/handler/codec/icap/IcapResponseDecoder.java
// public class IcapResponseDecoder extends IcapMessageDecoder {
// 
// 	public IcapResponseDecoder() {
// 		super();
// 	}
// 
// 	/**
// 	 * @see IcapMessageDecoder IcapMessageDecoder constructor for more details.
// 	 * 
// 	 * @param maxInitialLineLength
// 	 * @param maxIcapHeaderSize
// 	 * @param maxHttpHeaderSize
// 	 * @param maxChunkSize
// 	 */
// 	public IcapResponseDecoder (int maxInitialLineLength, int maxIcapHeaderSize, int maxHttpHeaderSize, int maxChunkSize) {
// 		super(maxInitialLineLength, maxIcapHeaderSize, maxHttpHeaderSize, maxChunkSize);
// 	}
// 	
// 	@Override
// 	protected IcapMessage createMessage(String[] initialLine) {
// 		return new DefaultIcapResponse(IcapVersion.valueOf(initialLine[0]),IcapResponseStatus.fromCode(initialLine[1]));
// 	}
// 
// 	@Override
// 	public boolean isDecodingResponse() {
// 		return true;
// 	}
// }


import static org.jboss.netty.channel.Channels.pipeline;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import ch.mimo.netty.handler.codec.icap.IcapRequestEncoder;
import ch.mimo.netty.handler.codec.icap.IcapResponseDecoder;
/*******************************************************************************
 * Copyright 2012 Michael Mimo Moratti
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package ch.mimo.netty.example.icap.preview;




public class IcapClientChannelPipeline implements ChannelPipelineFactory {
	
	@Override
	public ChannelPipeline getPipeline() throws Exception {
		ChannelPipeline pipeline = pipeline();
    	pipeline.addLast("encoder",new IcapRequestEncoder());
// Path: src/main/java/ch/mimo/netty/handler/codec/icap/IcapRequestEncoder.java
// public class IcapRequestEncoder extends IcapMessageEncoder {
// 
// 	public IcapRequestEncoder() {
// 		super();
// 	}
// 	
// 	@Override
// 	protected int encodeInitialLine(ChannelBuffer buffer, IcapMessage message) throws Exception {
// 		IcapRequest request = (IcapRequest) message;
// 		int index = buffer.readableBytes();
//         buffer.writeBytes(request.getMethod().toString().getBytes(IcapCodecUtil.ASCII_CHARSET));
//         buffer.writeByte(IcapCodecUtil.SPACE);
//         buffer.writeBytes(request.getUri().getBytes(IcapCodecUtil.ASCII_CHARSET));
//         buffer.writeByte(IcapCodecUtil.SPACE);
//         buffer.writeBytes(request.getProtocolVersion().toString().getBytes(IcapCodecUtil.ASCII_CHARSET));
//         buffer.writeBytes(IcapCodecUtil.CRLF);
//         return buffer.readableBytes() - index;
// 	}
// 
// }
// 
// Path: src/main/java/ch/mimo/netty/handler/codec/icap/IcapResponseDecoder.java
// public class IcapResponseDecoder extends IcapMessageDecoder {
// 
// 	public IcapResponseDecoder() {
// 		super();
// 	}
// 
// 	/**
// 	 * @see IcapMessageDecoder IcapMessageDecoder constructor for more details.
// 	 * 
// 	 * @param maxInitialLineLength
// 	 * @param maxIcapHeaderSize
// 	 * @param maxHttpHeaderSize
// 	 * @param maxChunkSize
// 	 */
// 	public IcapResponseDecoder (int maxInitialLineLength, int maxIcapHeaderSize, int maxHttpHeaderSize, int maxChunkSize) {
// 		super(maxInitialLineLength, maxIcapHeaderSize, maxHttpHeaderSize, maxChunkSize);
// 	}
// 	
// 	@Override
// 	protected IcapMessage createMessage(String[] initialLine) {
// 		return new DefaultIcapResponse(IcapVersion.valueOf(initialLine[0]),IcapResponseStatus.fromCode(initialLine[1]));
// 	}
// 
// 	@Override
// 	public boolean isDecodingResponse() {
// 		return true;
// 	}
// }


// Path: src/main/java/ch/mimo/netty/example/icap/preview/IcapClientChannelPipeline.java
import static org.jboss.netty.channel.Channels.pipeline;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import ch.mimo.netty.handler.codec.icap.IcapRequestEncoder;
import ch.mimo.netty.handler.codec.icap.IcapResponseDecoder;

/*******************************************************************************
 * Copyright 2012 Michael Mimo Moratti
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package ch.mimo.netty.example.icap.preview;




public class IcapClientChannelPipeline implements ChannelPipelineFactory {
	
	@Override
	public ChannelPipeline getPipeline() throws Exception {
		ChannelPipeline pipeline = pipeline();
    	pipeline.addLast("encoder",new IcapRequestEncoder());
      	pipeline.addLast("decoder",new IcapResponseDecoder());