2009-11-17 06:12:55 +01:00
|
|
|
/*
|
2012-06-04 22:31:44 +02:00
|
|
|
* Copyright 2012 The Netty Project
|
2009-11-17 06:12:55 +01:00
|
|
|
*
|
2011-12-09 06:18:34 +01:00
|
|
|
* The Netty Project licenses this file to you 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:
|
2009-11-17 06:12:55 +01:00
|
|
|
*
|
2012-06-04 22:31:44 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2009-11-17 06:12:55 +01:00
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
2011-12-09 06:18:34 +01:00
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
2009-11-17 06:12:55 +01:00
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
2011-12-09 04:38:59 +01:00
|
|
|
package io.netty.handler.codec.http;
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
import io.netty.buffer.Unpooled;
|
|
|
|
import io.netty.handler.codec.DecoderResult;
|
2009-11-17 06:12:55 +01:00
|
|
|
|
|
|
|
/**
|
2013-01-14 16:52:30 +01:00
|
|
|
* The last {@link HttpContent} which has trailing headers.
|
2009-11-17 06:12:55 +01:00
|
|
|
*/
|
2013-01-14 16:52:30 +01:00
|
|
|
public interface LastHttpContent extends HttpContent {
|
2009-11-17 06:12:55 +01:00
|
|
|
|
|
|
|
/**
|
2013-01-16 05:22:50 +01:00
|
|
|
* The 'end of content' marker in chunked encoding.
|
2012-01-13 09:41:18 +01:00
|
|
|
*/
|
2013-01-16 05:22:50 +01:00
|
|
|
LastHttpContent EMPTY_LAST_CONTENT = new LastHttpContent() {
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-05-01 10:04:43 +02:00
|
|
|
public ByteBuf content() {
|
2013-01-16 05:22:50 +01:00
|
|
|
return Unpooled.EMPTY_BUFFER;
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
|
|
|
public LastHttpContent copy() {
|
|
|
|
return EMPTY_LAST_CONTENT;
|
|
|
|
}
|
2010-01-08 09:29:37 +01:00
|
|
|
|
2013-07-06 21:17:51 +02:00
|
|
|
@Override
|
|
|
|
public LastHttpContent duplicate() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2016-04-14 10:31:48 +02:00
|
|
|
@Override
|
|
|
|
public LastHttpContent replace(ByteBuf content) {
|
|
|
|
return new DefaultLastHttpContent(content);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public LastHttpContent retainedDuplicate() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
|
|
|
public HttpHeaders trailingHeaders() {
|
2015-09-03 00:10:58 +02:00
|
|
|
return EmptyHttpHeaders.INSTANCE;
|
2013-01-16 05:22:50 +01:00
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2014-06-04 11:34:57 +02:00
|
|
|
public DecoderResult decoderResult() {
|
2013-01-16 05:22:50 +01:00
|
|
|
return DecoderResult.SUCCESS;
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2014-06-04 11:34:57 +02:00
|
|
|
@Override
|
2014-06-24 10:39:46 +02:00
|
|
|
@Deprecated
|
2014-06-04 11:34:57 +02:00
|
|
|
public DecoderResult getDecoderResult() {
|
|
|
|
return decoderResult();
|
|
|
|
}
|
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-01-30 07:42:18 +01:00
|
|
|
public void setDecoderResult(DecoderResult result) {
|
2013-01-16 05:22:50 +01:00
|
|
|
throw new UnsupportedOperationException("read only");
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-02-10 05:10:09 +01:00
|
|
|
public int refCnt() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2013-02-13 08:09:33 +01:00
|
|
|
public LastHttpContent retain() {
|
|
|
|
return this;
|
|
|
|
}
|
2013-02-10 05:10:09 +01:00
|
|
|
|
|
|
|
@Override
|
2013-02-13 08:09:33 +01:00
|
|
|
public LastHttpContent retain(int increment) {
|
|
|
|
return this;
|
|
|
|
}
|
2013-02-10 05:10:09 +01:00
|
|
|
|
2014-01-28 12:00:28 +01:00
|
|
|
@Override
|
|
|
|
public LastHttpContent touch() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2014-01-29 03:44:59 +01:00
|
|
|
@Override
|
|
|
|
public LastHttpContent touch(Object hint) {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2013-02-10 05:10:09 +01:00
|
|
|
@Override
|
|
|
|
public boolean release() {
|
2013-01-16 05:22:50 +01:00
|
|
|
return false;
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-02-10 05:10:09 +01:00
|
|
|
public boolean release(int decrement) {
|
|
|
|
return false;
|
2013-01-16 05:22:50 +01:00
|
|
|
}
|
2014-01-10 08:16:02 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "EmptyLastHttpContent";
|
|
|
|
}
|
2013-01-16 05:22:50 +01:00
|
|
|
};
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
HttpHeaders trailingHeaders();
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
|
|
|
LastHttpContent copy();
|
2013-02-13 08:09:33 +01:00
|
|
|
|
2016-04-14 10:31:48 +02:00
|
|
|
@Override
|
|
|
|
LastHttpContent duplicate();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
LastHttpContent retainedDuplicate();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
LastHttpContent replace(ByteBuf content);
|
|
|
|
|
2013-02-13 08:09:33 +01:00
|
|
|
@Override
|
|
|
|
LastHttpContent retain(int increment);
|
|
|
|
|
|
|
|
@Override
|
|
|
|
LastHttpContent retain();
|
2013-09-02 10:02:12 +02:00
|
|
|
|
2014-01-28 12:00:28 +01:00
|
|
|
@Override
|
|
|
|
LastHttpContent touch();
|
|
|
|
|
2014-01-29 03:44:59 +01:00
|
|
|
@Override
|
|
|
|
LastHttpContent touch(Object hint);
|
2009-11-17 06:12:55 +01:00
|
|
|
}
|