if(dictionaryRequest.copy(dictRequestInfo.dictionaryRequest) == CodecReturnCodes.FAILURE) return null;
dictionaryRequest.copy(_dictionaryProvider.dictionaryRequest()); System.out.println("Received Dictionary Request for DictionaryName: " + dictionaryRequest.dictionaryName()); if (_dictionaryProvider.fieldDictionaryDownloadName().equals(dictionaryRequest.dictionaryName()))
/** 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; } } }
@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."); }