2014-01-30 21:18:30 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2014 The Netty Project
|
|
|
|
*
|
|
|
|
* 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:
|
|
|
|
*
|
|
|
|
* 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 io.netty.handler.codec.stomp;
|
|
|
|
|
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
import io.netty.buffer.Unpooled;
|
|
|
|
import io.netty.handler.codec.DecoderResult;
|
|
|
|
|
|
|
|
/**
|
2014-06-04 09:39:50 +02:00
|
|
|
* The last {@link StompContentSubframe} which signals the end of the content batch
|
2014-01-30 21:18:30 +01:00
|
|
|
* <p/>
|
|
|
|
* Note, even when no content is emitted by the protocol, an
|
2014-06-04 09:39:50 +02:00
|
|
|
* empty {@link LastStompContentSubframe} is issued to make the upstream parsing
|
2014-01-30 21:18:30 +01:00
|
|
|
* easier.
|
|
|
|
*/
|
2014-06-04 09:39:50 +02:00
|
|
|
public interface LastStompContentSubframe extends StompContentSubframe {
|
2014-01-30 21:18:30 +01:00
|
|
|
|
2014-06-04 09:39:50 +02:00
|
|
|
LastStompContentSubframe EMPTY_LAST_CONTENT = new LastStompContentSubframe() {
|
2014-01-30 21:18:30 +01:00
|
|
|
@Override
|
|
|
|
public ByteBuf content() {
|
|
|
|
return Unpooled.EMPTY_BUFFER;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public LastStompContentSubframe copy() {
|
2014-01-30 21:18:30 +01:00
|
|
|
return EMPTY_LAST_CONTENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public LastStompContentSubframe duplicate() {
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2016-04-14 10:31:48 +02:00
|
|
|
@Override
|
|
|
|
public LastStompContentSubframe retainedDuplicate() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public LastStompContentSubframe replace(ByteBuf content) {
|
|
|
|
return new DefaultLastStompContentSubframe(content);
|
|
|
|
}
|
|
|
|
|
2014-01-30 21:18:30 +01:00
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public LastStompContentSubframe retain() {
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public LastStompContentSubframe retain(int increment) {
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public LastStompContentSubframe touch() {
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public LastStompContentSubframe touch(Object hint) {
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int refCnt() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean release() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean release(int decrement) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public DecoderResult decoderResult() {
|
2014-01-30 21:18:30 +01:00
|
|
|
return DecoderResult.SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setDecoderResult(DecoderResult result) {
|
|
|
|
throw new UnsupportedOperationException("read only");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
LastStompContentSubframe copy();
|
2014-01-30 21:18:30 +01:00
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
LastStompContentSubframe duplicate();
|
2014-01-30 21:18:30 +01:00
|
|
|
|
2016-04-14 10:31:48 +02:00
|
|
|
@Override
|
|
|
|
LastStompContentSubframe retainedDuplicate();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
LastStompContentSubframe replace(ByteBuf content);
|
|
|
|
|
2014-01-30 21:18:30 +01:00
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
LastStompContentSubframe retain();
|
2014-01-30 21:18:30 +01:00
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
LastStompContentSubframe retain(int increment);
|
2014-01-30 21:18:30 +01:00
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
LastStompContentSubframe touch();
|
2014-01-30 21:18:30 +01:00
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
LastStompContentSubframe touch(Object hint);
|
2014-01-30 21:18:30 +01:00
|
|
|
}
|