_dictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE); _dictionaryClose.clear(); _dictionaryClose.streamId(streamId); int ret = _dictionaryClose.encode(_encodeIter); if (ret != CodecReturnCodes.SUCCESS)
@Test public void dictionaryCloseCopyTests() { DictionaryClose closeRDMMsg1 = (DictionaryClose)DictionaryMsgFactory.createMsg(); DictionaryClose closeRDMMsg2 = (DictionaryClose)DictionaryMsgFactory.createMsg(); closeRDMMsg1.rdmMsgType(DictionaryMsgType.CLOSE); closeRDMMsg2.rdmMsgType(DictionaryMsgType.CLOSE); int streamId = -5; closeRDMMsg1.streamId(streamId); System.out.println("DictionaryClose copy tests..."); // deep copy int ret = closeRDMMsg1.copy(closeRDMMsg2); assertEquals(CodecReturnCodes.SUCCESS, ret); // verify deep copy assertEquals(closeRDMMsg1.streamId(), closeRDMMsg2.streamId()); System.out.println("Done."); }
/** * The DictionaryClose to be sent to close the EnumType Dictionary stream. * This corresponds to the EnumType DictionaryRequest sent during the * connection establishment process. * * @return the dictionary close */ DictionaryClose rdmEnumDictionaryClose() { if (_enumDictionaryRequest == null) return null; if (_enumDictionaryClose == null) { _enumDictionaryClose = (DictionaryClose)DictionaryMsgFactory.createMsg(); _enumDictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE); } _enumDictionaryClose.streamId(_enumDictionaryRequest.streamId()); return _enumDictionaryClose; }
case MsgClasses.CLOSE: DictionaryClose dictionaryClose = (DictionaryClose)_dictionaryMsg; dictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE); dictionaryClose.decode(dIter, msg); break; default:
/** * Instantiates a new dictionary handler. */ public DictionaryHandler() { _dictionary = CodecFactory.createDataDictionary(); _states = new State[2]; _states[0] = CodecFactory.createState(); _states[1] = CodecFactory.createState(); _dictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg(); _dictionaryClose = (DictionaryClose)DictionaryMsgFactory.createMsg(); _dictionaryRefresh = (DictionaryRefresh)DictionaryMsgFactory.createMsg(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); _dictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE); _encIter = CodecFactory.createEncodeIterator(); }
public int copy(DictionaryClose destCloseMsg) { assert (destCloseMsg != null) : "destCloseMsg must be non-null"; destCloseMsg.streamId(streamId()); return CodecReturnCodes.SUCCESS; }
_eIter.setBufferAndRWFVersion(msgBuf, channel.majorVersion(), channel.minorVersion()); int retval = dictionaryClose.encode(_eIter); if (retval != CodecReturnCodes.SUCCESS)
/** Copies a DictionaryMsg. */ public static void copyDictionaryMsg(DictionaryMsg srcMsg, DictionaryMsg destMsg) { switch(srcMsg.rdmMsgType()) { case REQUEST: destMsg.rdmMsgType(DictionaryMsgType.REQUEST); ((DictionaryRequest)srcMsg).copy((DictionaryRequest)destMsg); break; case CLOSE: destMsg.rdmMsgType(DictionaryMsgType.CLOSE); ((DictionaryClose)srcMsg).copy((DictionaryClose)destMsg); break; case REFRESH: destMsg.rdmMsgType(DictionaryMsgType.REFRESH); ((DictionaryRefresh)srcMsg).copy((DictionaryRefresh)destMsg); break; case STATUS: destMsg.rdmMsgType(DictionaryMsgType.STATUS); ((DictionaryStatus)srcMsg).copy((DictionaryStatus)destMsg); break; default: fail("Unknown DictionaryMsgType."); break; } } }
/** * The DictionaryClose to be sent to close the Field Dictionary stream. * This corresponds to the Field DictionaryRequest sent during the * connection establishment process. * * @return the dictionary close */ DictionaryClose rdmFieldDictionaryClose() { if (_fieldDictionaryRequest == null) return null; if (_fieldDictionaryClose == null) { _fieldDictionaryClose = (DictionaryClose)DictionaryMsgFactory.createMsg(); _fieldDictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE); } _fieldDictionaryClose.streamId(_fieldDictionaryRequest.streamId()); return _fieldDictionaryClose; }
/** * Instantiates a new dictionary handler. */ public DictionaryHandler() { dictionary = CodecFactory.createDataDictionary(); states = new State[2]; states[0] = CodecFactory.createState(); states[1] = CodecFactory.createState(); dictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg(); dictionaryClose = (DictionaryClose)DictionaryMsgFactory.createMsg(); dictionaryRefresh = (DictionaryRefresh)DictionaryMsgFactory.createMsg(); dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); dictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE); encIter = CodecFactory.createEncodeIterator(); }
dictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE); dictionaryClose.clear(); dictionaryClose.streamId(streamId); int ret = dictionaryClose.encode(encodeIter); if (ret != CodecReturnCodes.SUCCESS)
@Test public void dictionaryCloseToStringTests() { DictionaryClose closeRDMMsg1 = (DictionaryClose)DictionaryMsgFactory.createMsg(); closeRDMMsg1.rdmMsgType(DictionaryMsgType.CLOSE); int streamId = -5; closeRDMMsg1.streamId(streamId); System.out.println("DictionaryClose toString coverage tests..."); assertNotNull(closeRDMMsg1.toString()); System.out.println("Done."); }
@Test public void dictionaryCloseTests() { DictionaryClose encRDMMsg = (DictionaryClose)DictionaryMsgFactory.createMsg(); DictionaryClose decRDMMsg = (DictionaryClose)DictionaryMsgFactory.createMsg(); decRDMMsg.rdmMsgType(DictionaryMsgType.CLOSE); encRDMMsg.rdmMsgType(DictionaryMsgType.CLOSE); int streamId = -5; dIter.clear(); encIter.clear(); Buffer membuf = CodecFactory.createBuffer(); membuf.data(ByteBuffer.allocate(1024)); System.out.println("DictionaryClose tests..."); encRDMMsg.clear(); encRDMMsg.streamId(streamId); encIter.setBufferAndRWFVersion(membuf, Codec.majorVersion(), Codec.minorVersion()); int ret = encRDMMsg.encode(encIter); assertEquals(CodecReturnCodes.SUCCESS, ret); dIter.setBufferAndRWFVersion(membuf, Codec.majorVersion(), Codec.minorVersion()); ret = msg.decode(dIter); assertEquals(CodecReturnCodes.SUCCESS, ret); ret = decRDMMsg.decode(dIter, msg); assertEquals(CodecReturnCodes.SUCCESS, ret); assertEquals(streamId, decRDMMsg.streamId()); System.out.println("Done."); }