1 /******************************************************************************* 2 * Copyright (c) 2011 Michael Mimo Moratti. 3 * 4 * Michael Mimo Moratti licenses this file to you under the Apache License, version 2.0 5 * (the "License"); you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at: 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * Unless required by applicable law or agreed to in writing, software 9 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 * License for the specific language governing permissions and limitations 12 * under the License. 13 *******************************************************************************/ 14 package ch.mimo.netty.handler.codec.icap; 15 16 /** 17 * ICAP Response decoder which creates an @see {@link IcapResponse} instance. 18 * 19 * @author Michael Mimo Moratti (mimo@mimo.ch) 20 * 21 */ 22 public class IcapResponseDecoder extends IcapMessageDecoder { 23 24 public IcapResponseDecoder() { 25 super(); 26 } 27 28 /** 29 * @see IcapMessageDecoder IcapMessageDecoder constructor for more details. 30 * 31 * @param maxInitialLineLength 32 * @param maxIcapHeaderSize 33 * @param maxHttpHeaderSize 34 * @param maxChunkSize 35 */ 36 public IcapResponseDecoder (int maxInitialLineLength, int maxIcapHeaderSize, int maxHttpHeaderSize, int maxChunkSize) { 37 super(maxInitialLineLength, maxIcapHeaderSize, maxHttpHeaderSize, maxChunkSize); 38 } 39 40 @Override 41 protected IcapMessage createMessage(String[] initialLine) { 42 return new DefaultIcapResponse(IcapVersion.valueOf(initialLine[0]),IcapResponseStatus.fromCode(initialLine[1])); 43 } 44 45 @Override 46 public boolean isDecodingResponse() { 47 return true; 48 } 49 }