/** * Closes all open dictionary streams for a channel. * * @param chnl - The channel to close the dictionary streams for */ public void closeRequests(Channel chnl) { // find original request information associated with chnl for (DictionaryRequestInfo dictionraryReqInfo : _dictionaryRequestInfoList) { if (dictionraryReqInfo.channel == chnl && dictionraryReqInfo.isInUse) { // clear original request information System.out.println("Closing dictionary stream id " + dictionraryReqInfo.dictionaryRequest.streamId() + " with dictionary name: " + dictionraryReqInfo.dictionaryRequest.dictionaryName()); dictionraryReqInfo.clear(); } } }
private void closeStream(int streamId) { // find original request information associated with streamId for (DictionaryRequestInfo dictionraryReqInfo : _dictionaryRequestInfoList) { if (dictionraryReqInfo.dictionaryRequest.streamId() == streamId && dictionraryReqInfo.isInUse) { // clear original request information System.out.println("Closing dictionary stream id " + dictionraryReqInfo.dictionaryRequest.streamId() + " with dictionary name: " + dictionraryReqInfo.dictionaryRequest.dictionaryName()); dictionraryReqInfo.clear(); break; } } }
bufferSize += ((DictionaryRequest)dictionaryRequest).dictionaryName().length();
void closeStream(ReactorChannel chnl) { // find original request information associated with chnl for (DictionaryRequestInfo dictionraryReqInfo : _dictionaryRequestInfoList) { if (dictionraryReqInfo.channel() == chnl.channel() && dictionraryReqInfo.isInUse()) { // clear original request information System.out.println("Closing dictionary stream id " + dictionraryReqInfo.dictionaryRequest().streamId() + " with dictionary name: " + dictionraryReqInfo.dictionaryRequest().dictionaryName()); dictionraryReqInfo.clear(); } } }
void closeStream(int streamId) { // find original request information associated with streamId for (DictionaryRequestInfo dictionraryReqInfo : _dictionaryRequestInfoList) { if (dictionraryReqInfo.dictionaryRequest().streamId() == streamId && dictionraryReqInfo.isInUse()) { // clear original request information System.out.println("Closing dictionary stream id " + dictionraryReqInfo.dictionaryRequest().streamId() + " with dictionary name: " + dictionraryReqInfo.dictionaryRequest().dictionaryName()); dictionraryReqInfo.clear(); break; } } }
private boolean sendDictionaryResponse(ReactorChannel reactorChannel, DictionaryMsg dictionaryRequest, ReactorErrorInfo error) _dictionaryNameAndServiceId.append(((DictionaryRequest)dictionaryRequest).dictionaryName().toString()).append(((DictionaryRequest)dictionaryRequest).serviceId());
private void sendWatchlistDictionaryRequests(ReactorChannel reactorChannel, Service service) { int ret; if (_requestsSent) return; _dictionaryRequest.applyStreaming(); _dictionaryRequest.verbosity(Dictionary.VerbosityValues.NORMAL); _dictionaryRequest.serviceId(service.serviceId()); _dictionaryRequest.streamId(3); _dictionaryRequest.dictionaryName(_fieldDictionaryName); ret = reactorChannel.submit(_dictionaryRequest, _submitOptions, _errorInfo); if (ret < ReactorReturnCodes.SUCCESS && ret != ReactorReturnCodes.NO_BUFFERS) { closeChannelAndShutDown("Sending field dictionary request failed"); return; } _dictionaryRequest.streamId(4); _dictionaryRequest.dictionaryName(_enumTypeDictionaryName); ret = reactorChannel.submit(_dictionaryRequest, _submitOptions, _errorInfo); if (ret < ReactorReturnCodes.SUCCESS && ret != ReactorReturnCodes.NO_BUFFERS) { closeChannelAndShutDown("Sending enum type dictionary request failed"); return; } }
public int copy(DictionaryRequest destRequestMsg) { assert (destRequestMsg != null) : "destRequestMsg can not be null"; destRequestMsg.streamId(streamId()); destRequestMsg.serviceId(serviceId()); destRequestMsg.verbosity(verbosity()); ByteBuffer byteBuffer = ByteBuffer.allocate(this.dictionaryName.length()); this.dictionaryName.copy(byteBuffer); destRequestMsg.dictionaryName().data(byteBuffer); if (checkStreaming()) { destRequestMsg.applyStreaming(); } return CodecReturnCodes.SUCCESS; }
@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."); }
protected int sendRequest(ChannelSession chnl, String dictionaryName, int streamId, long serviceId, Error error) { TransportBuffer msgBuf = null; /* get a buffer for the dictionary request */ msgBuf = chnl.getTransportBuffer(TRANSPORT_BUFFER_SIZE_REQUEST, false, error); if (msgBuf != null) { /* encode dictionary request */ dictionaryRequest.clear(); dictionaryRequest.dictionaryName().data(dictionaryName); dictionaryRequest.streamId(streamId); dictionaryRequest.serviceId((int)serviceId); encIter.clear(); encIter.setBufferAndRWFVersion(msgBuf, chnl.channel().majorVersion(), chnl.channel().minorVersion()); int ret = dictionaryRequest.encode(encIter); if (ret != CodecReturnCodes.SUCCESS) { error.text("encodeDictionaryRequest(): Failed <code: " + error.errorId() + ">"); return ret; } System.out.println(dictionaryRequest.toString()); //send request return chnl.write(msgBuf, error); } else { return CodecReturnCodes.FAILURE; } }
DictionaryRequest dictionaryRequest = (DictionaryRequest)dictionaryMsg; dictionaryRequest.copy(_dictionaryProvider.dictionaryRequest()); System.out.println("Received Dictionary Request for DictionaryName: " + dictionaryRequest.dictionaryName()); if (_dictionaryProvider.fieldDictionaryDownloadName().equals(dictionaryRequest.dictionaryName())) else if (_dictionaryProvider.enumTypeDictionaryDownloadName().equals(dictionaryRequest.dictionaryName()))
_dictionaryRequest.dictionaryName().data(dictName); _dictionaryRequest.streamId(streamId); _dictionaryRequest.serviceId(serviceId);
if (dictionaryType == FIELD_DICTIONARY_TYPE) _dictionaryRequest.dictionaryName().data(FIELD_DICTIONARY_DOWNLOAD_NAME); _dictionaryRequest.streamId(FIELD_DICTIONARY_STREAM_ID); _dictionaryRequest.dictionaryName().data(ENUM_TABLE_DOWNLOAD_NAME); _dictionaryRequest.streamId(ENUM_DICTIONARY_TYPE);
private void verifyDictionaryRequest(DictionaryRequest dictionaryRequest, int streamId, String name) { assertEquals(DictionaryMsgType.REQUEST, dictionaryRequest.rdmMsgType()); assertEquals(true, dictionaryRequest.checkStreaming()); assertEquals(Dictionary.VerbosityValues.NORMAL, dictionaryRequest.verbosity()); assertEquals(streamId, dictionaryRequest.streamId()); assertTrue(dictionaryRequest.dictionaryName().toString().equals(name)); }
dictionaryRequest.dictionaryName().data(dictName); dictionaryRequest.streamId(streamId); dictionaryRequest.serviceId(serviceId);
_dictionaryRefresh.dictionary(_dictionary); _dictionaryRefresh.verbosity(_dictionaryRequest.verbosity()); _dictionaryRefresh.dictionaryName().data(_dictionaryRequest.dictionaryName().data(), _dictionaryRequest.dictionaryName().position(), _dictionaryRequest.dictionaryName().length()); _dictionaryRefresh.applyRefreshComplete();
_fieldDictionaryRequest.applyStreaming(); _fieldDictionaryRequest.verbosity(Dictionary.VerbosityValues.NORMAL); _fieldDictionaryRequest.dictionaryName(_fieldDictionaryName);
_enumDictionaryRequest.applyStreaming(); _enumDictionaryRequest.verbosity(Dictionary.VerbosityValues.NORMAL); _enumDictionaryRequest.dictionaryName(_enumTypeDictionaryName);
@Test public void dictionaryRequestCopyTests() { DictionaryRequest reqRDMMsg1 = (DictionaryRequest)DictionaryMsgFactory.createMsg(); reqRDMMsg1.rdmMsgType(DictionaryMsgType.REQUEST); reqRDMMsg1.applyStreaming(); DictionaryRequest reqRDMMsg2 = (DictionaryRequest)DictionaryMsgFactory.createMsg(); reqRDMMsg2.rdmMsgType(DictionaryMsgType.REQUEST); int streamId = -5; int serviceId = 273; int verbosity = Dictionary.VerbosityValues.VERBOSE; String dictionaryName = "RWFFld"; System.out.println("DictionaryRequest copy tests..."); reqRDMMsg1.rdmMsgType(DictionaryMsgType.REQUEST); reqRDMMsg1.streamId(streamId); reqRDMMsg1.serviceId(serviceId); reqRDMMsg1.verbosity(verbosity); reqRDMMsg1.dictionaryName().data(dictionaryName); reqRDMMsg1.applyStreaming(); int ret = reqRDMMsg1.copy(reqRDMMsg2); assertEquals(CodecReturnCodes.SUCCESS, ret); assertTrue(reqRDMMsg1.dictionaryName() != reqRDMMsg2.dictionaryName()); assertEquals(reqRDMMsg1.dictionaryName().toString(), reqRDMMsg2.dictionaryName().toString()); assertEquals(reqRDMMsg1.flags(), reqRDMMsg2.flags()); assertEquals(reqRDMMsg1.serviceId(), reqRDMMsg2.serviceId()); assertEquals(reqRDMMsg1.checkStreaming(), reqRDMMsg2.checkStreaming()); assertEquals(reqRDMMsg1.streamId(), reqRDMMsg2.streamId()); assertEquals(reqRDMMsg1.verbosity(), reqRDMMsg2.verbosity()); System.out.println("Done."); }
int decodeDictionaryReqMsg(DictionaryRequest rdmDictionaryRequest, RequestMsg rsslRequestMsg) { rdmDictionaryRequest.clear(); if (rsslRequestMsg.msgClass() != MsgClasses.REQUEST) return CodecReturnCodes.FAILURE; rdmDictionaryRequest.streamId(rsslRequestMsg.streamId()); if (rsslRequestMsg.checkStreaming()) rsslRequestMsg.applyStreaming(); MsgKey msgKey = rsslRequestMsg.msgKey(); if (msgKey == null) return CodecReturnCodes.FAILURE; if (!msgKey.checkHasFilter()) return CodecReturnCodes.FAILURE; if (msgKey.checkHasServiceId()) rdmDictionaryRequest.serviceId(msgKey.serviceId()); if (!msgKey.checkHasName()) return CodecReturnCodes.FAILURE; Buffer name = msgKey.name(); rdmDictionaryRequest.dictionaryName().data(name.data(), name.position(), name.length()); rdmDictionaryRequest.verbosity((int)msgKey.filter()); return CodecReturnCodes.SUCCESS; }