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;
|
2016-04-14 10:31:48 +02:00
|
|
|
import io.netty.buffer.DefaultByteBufHolder;
|
2014-01-30 21:18:30 +01:00
|
|
|
import io.netty.handler.codec.DecoderResult;
|
|
|
|
|
|
|
|
/**
|
2014-06-04 09:39:50 +02:00
|
|
|
* The default {@link StompContentSubframe} implementation.
|
2014-01-30 21:18:30 +01:00
|
|
|
*/
|
2016-04-14 10:31:48 +02:00
|
|
|
public class DefaultStompContentSubframe extends DefaultByteBufHolder implements StompContentSubframe {
|
2014-06-04 11:34:57 +02:00
|
|
|
private DecoderResult decoderResult = DecoderResult.SUCCESS;
|
2014-01-30 21:18:30 +01:00
|
|
|
|
2014-06-04 09:39:50 +02:00
|
|
|
public DefaultStompContentSubframe(ByteBuf content) {
|
2016-04-14 10:31:48 +02:00
|
|
|
super(content);
|
2014-01-30 21:18:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-04-14 10:31:48 +02:00
|
|
|
public StompContentSubframe copy() {
|
|
|
|
return (StompContentSubframe) super.copy();
|
2014-01-30 21:18:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-04-14 10:31:48 +02:00
|
|
|
public StompContentSubframe duplicate() {
|
|
|
|
return (StompContentSubframe) super.duplicate();
|
2014-01-30 21:18:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-04-14 10:31:48 +02:00
|
|
|
public StompContentSubframe retainedDuplicate() {
|
|
|
|
return (StompContentSubframe) super.retainedDuplicate();
|
2014-01-30 21:18:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-04-14 10:31:48 +02:00
|
|
|
public StompContentSubframe replace(ByteBuf content) {
|
|
|
|
return new DefaultStompContentSubframe(content);
|
2014-01-30 21:18:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public StompContentSubframe retain() {
|
2016-04-14 10:31:48 +02:00
|
|
|
super.retain();
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public StompContentSubframe retain(int increment) {
|
2016-04-14 10:31:48 +02:00
|
|
|
super.retain(increment);
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public StompContentSubframe touch() {
|
2016-04-14 10:31:48 +02:00
|
|
|
super.touch();
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public StompContentSubframe touch(Object hint) {
|
2016-04-14 10:31:48 +02:00
|
|
|
super.touch(hint);
|
2014-01-30 21:18:30 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public DecoderResult decoderResult() {
|
2014-01-30 21:18:30 +01:00
|
|
|
return decoderResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-06-04 09:39:50 +02:00
|
|
|
public void setDecoderResult(DecoderResult decoderResult) {
|
|
|
|
this.decoderResult = decoderResult;
|
2014-01-30 21:18:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "DefaultStompContent{" +
|
|
|
|
"decoderResult=" + decoderResult +
|
|
|
|
'}';
|
|
|
|
}
|
|
|
|
}
|