public DictionaryRequestInfo() { dictionaryRequest = (DictionaryRequest) DictionaryMsgFactory.createMsg(); dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); channel = null; isInUse = false; }
/** * 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(); }
/** * 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(); }
/** * 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; }
/** * 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; }
/** * Send dictionary requests. * * @param chnl the chnl * @param error the error * @param serviceId the service id * @return the int */ public int sendDictionaryRequests(ChannelSession chnl, Error error, int serviceId) { if( dictionaryRequest == null ) { dictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg(); dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); } int requestStatus = requestDictionary(chnl,error,serviceId,FIELD_DICTIONARY_STREAM_ID,FIELD_DICTIONARY_DOWNLOAD_NAME); if( requestStatus == CodecReturnCodes.SUCCESS) { requestStatus = requestDictionary(chnl,error,serviceId,ENUM_TYPE_DICTIONARY_STREAM_ID,ENUM_TYPE_DOWNLOAD_NAME); } return requestStatus; }
/** * Instantiates a new dictionary provider. */ public DictionaryProvider() { _encodeIter = CodecFactory.createEncodeIterator(); _dictionary = CodecFactory.createDataDictionary(); _dictionaryRefresh = (DictionaryRefresh)DictionaryMsgFactory.createMsg(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg(); _dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); _dictionaryStatus = (DictionaryStatus)DictionaryMsgFactory.createMsg(); _dictionaryStatus.rdmMsgType(DictionaryMsgType.STATUS); _chnlInfo = TransportFactory.createChannelInfo(); _errorInfo = ReactorFactory.createReactorErrorInfo(); _reactorSubmitOptions = ReactorFactory.createReactorSubmitOptions(); _reactorSubmitOptions.clear(); _reactorSubmitOptions.writeArgs().priority(WritePriorities.HIGH); _reactorChnlInfo = ReactorFactory.createReactorChannelInfo(); }
@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."); }
/** * Send dictionary requests. * * @param chnl the chnl * @param error the error * @param serviceId the service id * @return the int */ public int sendDictionaryRequests(Channel chnl, Error error, int serviceId) { if( _dictionaryRequest == null ) { _dictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg(); _dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); } int sendStatus = requestDictionary(chnl,error,serviceId,FIELD_DICTIONARY_STREAM_ID,FIELD_DICTIONARY_DOWNLOAD_NAME.toString()); if( sendStatus == CodecReturnCodes.SUCCESS) { sendStatus = requestDictionary(chnl,error,serviceId,ENUM_TYPE_DICTIONARY_STREAM_ID,ENUM_TYPE_DOWNLOAD_NAME.toString()); } return sendStatus; }
@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."); }
@Test public void dictionaryRequestToStringTests() { DictionaryRequest reqRDMMsg1 = (DictionaryRequest)DictionaryMsgFactory.createMsg(); reqRDMMsg1.rdmMsgType(DictionaryMsgType.REQUEST); /* Parameters to test with */ int streamId = -5; int serviceId = 273; int verbosity = Dictionary.VerbosityValues.VERBOSE | Dictionary.VerbosityValues.NORMAL | Dictionary.VerbosityValues.MINIMAL | Dictionary.VerbosityValues.INFO; String dictionaryName = "RWFFld"; System.out.println("DictionaryRequest toString tests..."); reqRDMMsg1.streamId(streamId); reqRDMMsg1.serviceId(serviceId); reqRDMMsg1.verbosity(verbosity); reqRDMMsg1.dictionaryName().data(dictionaryName); reqRDMMsg1.applyStreaming(); assertNotNull(reqRDMMsg1.toString()); System.out.println("Done."); }
@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."); }
@Override public int rdmDictionaryMsgCallback(RDMDictionaryMsgEvent event) { System.out.println("DEBUG: ReactorCallbackHandler.rdmDictionaryMsgCallback: entered. dictionaryMsgEventCount=" + ++_dictionaryMsgEventCount + " event=" + event.toString()); _lastDictionaryMsgEvent = new RDMDictionaryMsgEvent(); TestUtil.copyMsgEvent(event, _lastDictionaryMsgEvent); if (event.rdmDictionaryMsg() != null) { _lastDictionaryMsgEvent.rdmDictionaryMsg(DictionaryMsgFactory.createMsg()); TestUtil.copyDictionaryMsg(event.rdmDictionaryMsg(), _lastDictionaryMsgEvent.rdmDictionaryMsg()); } return _msgReturnCode; } }
_dictionaryClose = (DictionaryClose)DictionaryMsgFactory.createMsg(); _dictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE);
@Override public int rdmDictionaryMsgCallback(RDMDictionaryMsgEvent event) { System.out.println("DEBUG: ReactorCallbackHandler.rdmDictionaryMsgCallback: entered. dictionaryMsgEventCount=" + ++_dictionaryMsgEventCount + " event=" + event.toString()); _lastDictionaryMsgEvent = new RDMDictionaryMsgEvent(); TestUtil.copyMsgEvent(event, _lastDictionaryMsgEvent); if (event.rdmDictionaryMsg() != null) { _lastDictionaryMsgEvent.rdmDictionaryMsg(DictionaryMsgFactory.createMsg()); TestUtil.copyDictionaryMsg(event.rdmDictionaryMsg(), _lastDictionaryMsgEvent.rdmDictionaryMsg()); } return _msgReturnCode; } }
_fieldDictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg();
dictionaryClose = (DictionaryClose)DictionaryMsgFactory.createMsg(); dictionaryClose.rdmMsgType(DictionaryMsgType.CLOSE);
_enumDictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg();
_genericBuffer = CodecFactory.createBuffer(); _genericBuffer.data(ByteBuffer.allocate(512)); _dictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg(); _dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); _fieldDictionaryName.data("RWFFld");
@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."); }