DictionaryStatusImpl() { state = CodecFactory.createState(); streamId(1); }
@Override public int streamId() { switch (rdmMsgType()) { case REQUEST: return rdmDictionaryRequest().streamId(); case CLOSE: return rdmDictionaryClose().streamId(); case STATUS: return rdmDictionaryStatus().streamId(); case REFRESH: return rdmDictionaryRefresh().streamId(); default: assert (false); return 0; } }
@Override public void streamId(int streamId) { switch (rdmMsgType()) { case REQUEST: rdmDictionaryRequest().streamId(streamId); break; case CLOSE: rdmDictionaryClose().streamId(streamId); break; case STATUS: rdmDictionaryStatus().streamId(streamId); break; case REFRESH: rdmDictionaryRefresh().streamId(streamId); break; default: assert (false); } }
public int copy(DictionaryStatus destStatusMsg) { assert (destStatusMsg != null) : "destStatusMsg must be non-null"; destStatusMsg.streamId(streamId()); if (checkClearCache()) { destStatusMsg.applyClearCache(); } if (checkHasState()) { destStatusMsg.state().streamState(this.state.streamState()); destStatusMsg.state().dataState(this.state.dataState()); destStatusMsg.state().code(this.state.code()); if (this.state.text().length() > 0) { Buffer stateText = CodecFactory.createBuffer(); ByteBuffer byteBuffer = ByteBuffer.allocate(this.state.text().length()); this.state.text().copy(byteBuffer); stateText.data(byteBuffer); destStatusMsg.state().text(stateText); } int flags = destStatusMsg.flags(); flags |= DictionaryStatusFlags.HAS_STATE; destStatusMsg.flags(flags); } return CodecReturnCodes.SUCCESS; }
public int encode(EncodeIterator encodeIter) { statusMsg.clear(); statusMsg.streamId(streamId()); statusMsg.containerType(DataTypes.NO_DATA); statusMsg.msgClass(MsgClasses.STATUS); statusMsg.domainType(DomainTypes.DICTIONARY); if (checkClearCache()) { statusMsg.applyClearCache(); } if (checkHasState()) { statusMsg.applyHasState(); statusMsg.state().dataState(state().dataState()); statusMsg.state().streamState(state().streamState()); statusMsg.state().code(state().code()); statusMsg.state().text(state().text()); } return statusMsg.encode(encodeIter); }
public int decode(DecodeIterator dIter, Msg msg) { clear(); if (msg.msgClass() != MsgClasses.STATUS) return CodecReturnCodes.FAILURE; StatusMsg statusMsg = (StatusMsg)msg; streamId(msg.streamId()); if(statusMsg.checkHasState()) { state.code(statusMsg.state().code()); state.streamState(statusMsg.state().streamState()); state.dataState(statusMsg.state().dataState()); if (statusMsg.state().text().length() > 0) { Buffer buf = statusMsg.state().text(); this.state.text().data(buf.data(), buf.position(), buf.length()); } applyHasState(); } if (statusMsg.checkClearCache()) { applyClearCache(); } return CodecReturnCodes.SUCCESS; }