refreshRDMMsg1.rdmMsgType(DictionaryMsgType.REFRESH); DictionaryRefresh refreshRDMMsg2 = (DictionaryRefresh)DictionaryMsgFactory.createMsg(); refreshRDMMsg2.rdmMsgType(DictionaryMsgType.REFRESH); refreshRDMMsg1.streamId(streamId); refreshRDMMsg1.serviceId(serviceId); refreshRDMMsg1.verbosity(verbosity); refreshRDMMsg1.applyClearCache(); refreshRDMMsg1.applyRefreshComplete(); refreshRDMMsg1.applySolicited(); refreshRDMMsg1.dictionaryName().data(dictionaryName); refreshRDMMsg1.flags(DictionaryRefreshFlags.CLEAR_CACHE | DictionaryRefreshFlags.HAS_INFO | DictionaryRefreshFlags.HAS_SEQ_NUM | DictionaryRefreshFlags.IS_COMPLETE | DictionaryRefreshFlags.IS_COMPLETE | DictionaryRefreshFlags.SOLICITED); int ret = refreshRDMMsg1.copy(refreshRDMMsg2); assertEquals(CodecReturnCodes.SUCCESS, ret); assertTrue(refreshRDMMsg1.dictionaryName() != refreshRDMMsg2.dictionaryName()); assertEquals(dictionaryName, refreshRDMMsg2.dictionaryName().toString()); assertEquals(refreshRDMMsg1.flags(), refreshRDMMsg2.flags()); assertEquals(refreshRDMMsg1.checkClearCache(), refreshRDMMsg2.checkClearCache()); assertEquals(refreshRDMMsg1.checkRefreshComplete(), refreshRDMMsg2.checkRefreshComplete()); assertEquals(refreshRDMMsg1.checkSolicited(), refreshRDMMsg2.checkSolicited()); assertEquals(refreshRDMMsg1.serviceId(), refreshRDMMsg2.serviceId()); assertEquals(refreshRDMMsg1.streamId(), refreshRDMMsg2.streamId()); assertEquals(refreshRDMMsg1.verbosity(), refreshRDMMsg2.verbosity());
private int sendFieldDictionaryResponse(Channel chnl, DictionaryRequestInfo dictionaryReqInfo, Error error) _dictionaryRefresh.clear(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryRefresh.streamId(dictionaryReqInfo.dictionaryRequest.streamId()); _dictionaryRefresh.dictionaryType(Dictionary.Types.FIELD_DEFINITIONS); _dictionaryRefresh.dictionary(_dictionary); _dictionaryRefresh.state().streamState(StreamStates.OPEN); _dictionaryRefresh.state().dataState(DataStates.OK); _dictionaryRefresh.state().code(StateCodes.NONE); _dictionaryRefresh.verbosity(dictionaryReqInfo.dictionaryRequest.verbosity()); _dictionaryRefresh.serviceId(dictionaryReqInfo.dictionaryRequest.serviceId()); _dictionaryRefresh.dictionaryName().data(dictionaryReqInfo.dictionaryRequest.dictionaryName().data()); _dictionaryRefresh.applySolicited(); return CodecReturnCodes.FAILURE; _dictionaryRefresh.state().text().data("Field Dictionary Refresh (starting fid " + _dictionaryRefresh.startFid() + ")"); _dictionaryRefresh.applyClearCache(); firstMultiPart = false; _dictionaryRefresh.flags( DictionaryRefreshFlags.SOLICITED ); ret = _dictionaryRefresh.encode(_encodeIter); if (ret < CodecReturnCodes.SUCCESS)
int ret = _dictionaryRefresh.decode(dIter, msg); if (ret != CodecReturnCodes.SUCCESS) if (_dictionaryRefresh.checkHasInfo()) switch (_dictionaryRefresh.dictionaryType()) _fieldDictionaryStreamId = _dictionaryRefresh.streamId(); break; case Dictionary.Types.ENUM_TABLES: _enumDictionaryStreamId = _dictionaryRefresh.streamId(); break; default: System.out.println(_dictionaryRefresh.toString()); if (_dictionaryRefresh.streamId() == _fieldDictionaryStreamId) if (_dictionaryRefresh.checkRefreshComplete()) else if (_dictionaryRefresh.streamId() == _enumDictionaryStreamId) if (_dictionaryRefresh.checkRefreshComplete())
@Test public void dictionaryRefreshToStringTests() { DictionaryRefresh refreshRDMMsg1 = (DictionaryRefresh)DictionaryMsgFactory.createMsg(); refreshRDMMsg1.rdmMsgType(DictionaryMsgType.REFRESH); /* Parameters to test with */ int streamId = -5; int serviceId = 273; int verbosity = Dictionary.VerbosityValues.VERBOSE | Dictionary.VerbosityValues.NORMAL | Dictionary.VerbosityValues.MINIMAL | Dictionary.VerbosityValues.INFO; Buffer dictionaryName = CodecFactory.createBuffer(); dictionaryName.data("RWFFld"); System.out.println("DictionaryRefresh toString tests..."); refreshRDMMsg1.streamId(streamId); refreshRDMMsg1.serviceId(serviceId); refreshRDMMsg1.verbosity(verbosity); refreshRDMMsg1.dictionaryType(Dictionary.Types.FIELD_DEFINITIONS); refreshRDMMsg1.flags(DictionaryRefreshFlags.CLEAR_CACHE | DictionaryRefreshFlags.HAS_INFO | DictionaryRefreshFlags.HAS_SEQ_NUM | DictionaryRefreshFlags.IS_COMPLETE | DictionaryRefreshFlags.SOLICITED); refreshRDMMsg1.toString(); System.out.println("Done."); }
DictionaryRefresh encRDMMsg = (DictionaryRefresh)DictionaryMsgFactory.createMsg(); DictionaryRefresh decRDMMsg = (DictionaryRefresh)DictionaryMsgFactory.createMsg(); decRDMMsg.rdmMsgType(DictionaryMsgType.REFRESH); encRDMMsg.rdmMsgType(DictionaryMsgType.REFRESH); int streamId = -5; long sequenceNumber = 11152011; encRDMMsg.clear(); encRDMMsg.flags(flagsList[i]); encRDMMsg.streamId(streamId); encRDMMsg.state().code(state.code()); encRDMMsg.state().dataState(state.dataState()); encRDMMsg.state().text().data("state"); encRDMMsg.state().streamState(state.streamState()); encRDMMsg.dictionary(encDictionary); encRDMMsg.dictionaryName().data(enumDictName); encRDMMsg.dictionaryType((int)enumDictType.toLong()); if (encRDMMsg.checkHasSequenceNumber()) encRDMMsg.sequenceNumber(sequenceNumber); int ret = encRDMMsg.encode(encIter); assertEquals(CodecReturnCodes.SUCCESS, ret); ret = msg.decode(dIter); assertEquals(CodecReturnCodes.SUCCESS, ret); ret = decRDMMsg.decode(dIter, msg);
_dictionaryRefresh.clear(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryRefresh.streamId(_dictionaryRequest.streamId()); _dictionaryRefresh.applySolicited(); _dictionaryRefresh.dictionaryType(Dictionary.Types.ENUM_TABLES); _dictionaryRefresh.dictionary(_dictionary); _dictionaryRefresh.verbosity(_dictionaryRequest.verbosity()); _dictionaryRefresh.dictionaryName().data(_dictionaryRequest.dictionaryName().data(), _dictionaryRequest.dictionaryName().position(), _dictionaryRequest.dictionaryName().length()); _dictionaryRefresh.applyRefreshComplete(); ret = _dictionaryRefresh.encode(_encodeIter); if (ret < CodecReturnCodes.SUCCESS)
destRefreshMsg.streamId(streamId()); destRefreshMsg.serviceId(serviceId()); destRefreshMsg.verbosity(verbosity()); destRefreshMsg.streamId(streamId()); destRefreshMsg.serviceId(serviceId()); destRefreshMsg.dictionaryType(dictionaryType()); destRefreshMsg.startFid(startFid()); destRefreshMsg.startEnumTableCount(startEnumTableCount()); destRefreshMsg.flags(flags); destRefreshMsg.dictionaryName().data(byteBuffer); destRefreshMsg.dataBody().data(byteBuffer); destRefreshMsg.state().streamState(this.state.streamState()); destRefreshMsg.state().dataState(this.state.dataState()); destRefreshMsg.state().code(this.state.code()); destRefreshMsg.state().text().data(byteBuffer);
if (dictionaryRefresh.checkHasInfo()) switch(dictionaryRefresh.dictionaryType()) chnlInfo.fieldDictionaryStreamId = dictionaryRefresh.streamId(); break; case Dictionary.Types.ENUM_TABLES: chnlInfo.enumDictionaryStreamId = dictionaryRefresh.streamId(); break; default: System.out.println("Unknown dictionary type " + dictionaryRefresh.dictionaryType() + " from message on stream " + dictionaryRefresh.streamId()); chnlInfo.reactorChannel.close(errorInfo); return ReactorCallbackReturnCodes.SUCCESS; chnlInfo.dIter.setBufferAndRWFVersion(dictionaryRefresh.dataBody(), event.reactorChannel().majorVersion(), event.reactorChannel().minorVersion()); System.out.println("Received Dictionary Response: " + dictionaryRefresh.dictionaryName()); if (dictionaryRefresh.streamId() == chnlInfo.fieldDictionaryStreamId) if (dictionaryRefresh.checkRefreshComplete()) else if (dictionaryRefresh.streamId() == chnlInfo.enumDictionaryStreamId) if (dictionaryRefresh.checkRefreshComplete()) System.out.println("Received unexpected dictionary message on stream " + dictionaryRefresh.streamId());
if (rsslRefresh.checkHasInfo()) switch (rsslRefresh.dictionaryType()) .append("Dictionary type ").append(rsslRefresh.dictionaryType()); rsslError)) if (rsslRefresh.checkRefreshComplete()) .append("dictionary name ").append(rsslRefresh.dictionaryName().toString()).append(OmmLoggerClient.CR) .append("streamId ").append(rsslMsg.streamId()); com.thomsonreuters.upa.rdm.Dictionary.VerbosityValues.VERBOSE, rsslError)) if (rsslRefresh.checkRefreshComplete()) .append("dictionary name ").append(rsslRefresh.dictionaryName().toString()).append(OmmLoggerClient.CR) .append("streamId ").append(rsslMsg.streamId());
case MsgClasses.REFRESH: dictionaryRefresh = (DictionaryRefresh)_dictionaryMsg; dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); dictionaryRefresh.decode(dIter, msg); break; case MsgClasses.STATUS: dictionaryRefresh != null && dictionaryRefresh.checkRefreshComplete()) dictionaryRefresh != null && dictionaryRefresh.checkRefreshComplete())
DictionaryHandler(OmmServerBaseImpl ommServerBaseImpl) { _ommServerBaseImpl = ommServerBaseImpl; _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryStatus.rdmMsgType(DictionaryMsgType.STATUS); }
_dictionaryRefresh.clear(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryRefresh.streamId(_dictionaryRequest.streamId()); _dictionaryRefresh.applySolicited(); _dictionaryRefresh.dictionaryType(Dictionary.Types.ENUM_TABLES); _dictionaryRefresh.dictionary(_dictionary); _dictionaryRefresh.verbosity(_dictionaryRequest.verbosity()); _dictionaryRefresh.dictionaryName().data(_dictionaryRequest.dictionaryName().data(), _dictionaryRequest.dictionaryName().position(), _dictionaryRequest.dictionaryName().length()); _dictionaryRefresh.applyRefreshComplete(); ret = _dictionaryRefresh.encode(_encodeIter); if (ret < CodecReturnCodes.SUCCESS)
int ret = dictionaryRefresh.decode(dIter, msg); if (ret != CodecReturnCodes.SUCCESS) if (dictionaryRefresh.checkHasInfo()) switch (dictionaryRefresh.dictionaryType()) fieldDictionaryStreamId = dictionaryRefresh.streamId(); break; case Dictionary.Types.ENUM_TABLES: enumDictionaryStreamId = dictionaryRefresh.streamId(); break; default: System.out.println(dictionaryRefresh.toString()); if (dictionaryRefresh.streamId() == fieldDictionaryStreamId) if (dictionaryRefresh.checkRefreshComplete()) else if (dictionaryRefresh.streamId() == enumDictionaryStreamId) if (dictionaryRefresh.checkRefreshComplete())
if (dictionaryRefresh.checkHasInfo()) switch(dictionaryRefresh.dictionaryType()) chnlInfo.fieldDictionaryStreamId = dictionaryRefresh.streamId(); break; case Dictionary.Types.ENUM_TABLES: enumDictionaryLoaded = false; chnlInfo.enumDictionaryStreamId = dictionaryRefresh.streamId(); break; default: System.out.println("Unknown dictionary type " + dictionaryRefresh.dictionaryType() + " from message on stream " + dictionaryRefresh.streamId()); chnlInfo.reactorChannel.close(errorInfo); return ReactorCallbackReturnCodes.SUCCESS; chnlInfo.dIter.setBufferAndRWFVersion(dictionaryRefresh.dataBody(), event.reactorChannel().majorVersion(), event.reactorChannel().minorVersion()); System.out.println("Received Dictionary Response: " + dictionaryRefresh.dictionaryName()); if (dictionaryRefresh.streamId() == chnlInfo.fieldDictionaryStreamId) if (dictionaryRefresh.checkRefreshComplete()) else if (dictionaryRefresh.streamId() == chnlInfo.enumDictionaryStreamId) if (dictionaryRefresh.checkRefreshComplete())
/** * Instantiates a new NI provider dictionary handler. */ public NIProviderDictionaryHandler() { dictionary = CodecFactory.createDataDictionary(); dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); states = new State[2]; states[0] = CodecFactory.createState(); states[1] = CodecFactory.createState(); }
private int sendEnumTypeDictionaryResponse(Channel chnl, DictionaryRequestInfo dictionaryReqInfo, Error error) _dictionaryRefresh.clear(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryRefresh.streamId(dictionaryReqInfo.dictionaryRequest.streamId()); _dictionaryRefresh.dictionaryType(Dictionary.Types.ENUM_TABLES); _dictionaryRefresh.dictionary(_dictionary); _dictionaryRefresh.serviceId(dictionaryReqInfo.dictionaryRequest.serviceId()); _dictionaryRefresh.verbosity(dictionaryReqInfo.dictionaryRequest.verbosity()); _dictionaryRefresh.applySolicited(); _dictionaryRefresh.state().streamState(StreamStates.OPEN); _dictionaryRefresh.state().dataState(DataStates.OK); _dictionaryRefresh.state().code(StateCodes.NONE); _dictionaryRefresh.state().text().data("Enum Type Dictionary Refresh"); _dictionaryRefresh.dictionaryName().data(dictionaryReqInfo.dictionaryRequest.dictionaryName().data()); _dictionaryRefresh.state().text().data("Enum Type Dictionary Refresh (starting enum " + _dictionaryRefresh.startEnumTableCount() + ")"); _dictionaryRefresh.applyClearCache(); firstMultiPart = false; _dictionaryRefresh.flags( DictionaryRefreshFlags.SOLICITED ); ret = _dictionaryRefresh.encode(_encodeIter); if (ret < CodecReturnCodes.SUCCESS)
int processRefresh(Msg msg, DecodeIterator dIter, Error error) int ret = dictionaryRefresh.decode(dIter, msg); if (ret != CodecReturnCodes.SUCCESS) if (dictionaryRefresh.checkHasInfo()) switch (dictionaryRefresh.dictionaryType()) if ( dictionaryRefresh.streamId() == FIELD_DICTIONARY_STREAM_ID ) if (dictionaryRefresh.checkRefreshComplete()) else if ( dictionaryRefresh.streamId() == ENUM_TYPE_DICTIONARY_STREAM_ID ) if (dictionaryRefresh.checkRefreshComplete())
DictionaryHandler() { _dictionary = CodecFactory.createDataDictionary(); _dictionaryRequestInfoList = new DictionaryRequestInfoList(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryStatus.rdmMsgType(DictionaryMsgType.STATUS); _dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); }
int sendFieldDictionaryResponse(ReactorChannel chnl, DictionaryRequest dictionaryRequest, ReactorErrorInfo errorInfo) _dictionaryRefresh.clear(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryRefresh.streamId(dictionaryRequest.streamId()); _dictionaryRefresh.dictionaryType(Dictionary.Types.FIELD_DEFINITIONS); _dictionaryRefresh.dictionary(_dictionary); _dictionaryRefresh.state().streamState(StreamStates.OPEN); _dictionaryRefresh.state().dataState(DataStates.OK); _dictionaryRefresh.state().code(StateCodes.NONE); _dictionaryRefresh.verbosity(dictionaryRequest.verbosity()); _dictionaryRefresh.serviceId(dictionaryRequest.serviceId()); _dictionaryRefresh.dictionaryName().data(dictionaryRequest.dictionaryName().data(), dictionaryRequest.dictionaryName().position(), dictionaryRequest.dictionaryName().length()); _dictionaryRefresh.applySolicited(); return CodecReturnCodes.FAILURE; _dictionaryRefresh.state().text().data("Field Dictionary Refresh (starting fid " + _dictionaryRefresh.startFid() + ")"); _dictionaryRefresh.applyClearCache(); firstMultiPart = false; _dictionaryRefresh.flags( DictionaryRefreshFlags.SOLICITED ); ret = _dictionaryRefresh.encode(_encodeIter); if (ret < CodecReturnCodes.SUCCESS)
int processRefresh(Msg msg, DecodeIterator dIter, com.thomsonreuters.upa.transport.Error error) int ret = _dictionaryRefresh.decode(dIter, msg); if (ret != CodecReturnCodes.SUCCESS) if (_dictionaryRefresh.checkHasInfo()) switch (_dictionaryRefresh.dictionaryType()) if ( _dictionaryRefresh.streamId() == FIELD_DICTIONARY_STREAM_ID ) if (_dictionaryRefresh.checkRefreshComplete()) else if ( _dictionaryRefresh.streamId() == ENUM_TYPE_DICTIONARY_STREAM_ID ) if (_dictionaryRefresh.checkRefreshComplete())