void role(ConsumerRole role) { _role = role; _watchlistOptions = _role.watchlistOptions(); }
Watchlist(ReactorChannel reactorChannel, ConsumerRole consumerRole) { _reactorChannel = reactorChannel; _reactor = _reactorChannel.reactor(); _role = consumerRole; _watchlistOptions = _role.watchlistOptions(); if (_watchlistOptions.itemCountHint() > 0) { _streamIdtoWlRequestTable = new HashMap<WlInteger,WlRequest>(_watchlistOptions.itemCountHint() + 10, 1); _streamIdtoWlStreamTable = new HashMap<WlInteger,WlStream>(_watchlistOptions.itemCountHint() + 10, 1); } else { _streamIdtoWlRequestTable = new HashMap<WlInteger,WlRequest>(); _streamIdtoWlStreamTable = new HashMap<WlInteger,WlStream>(); } _loginHandler = new WlLoginHandler(this); _directoryHandler = new WlDirectoryHandler(this); _itemHandler = new WlItemHandler(this); _tempByteBuffer1 = ByteBuffer.allocate(8192); _tempBuffer1.data(_tempByteBuffer1); _tempByteBuffer2 = ByteBuffer.allocate(8192); _tempBuffer2.data(_tempByteBuffer2); }
WlItemHandler(Watchlist watchlist) { _watchlist = watchlist; _defaultQos.clear(); _defaultQos.timeliness(QosTimeliness.REALTIME); _defaultQos.rate(QosRates.TICK_BY_TICK); _statusMsg.msgClass(MsgClasses.STATUS); _wlViewHandler = new WlViewHandler(watchlist); _itemAggregationKeytoWlStreamTable = new HashMap<WlItemAggregationKey,WlStream>(_watchlist.role().watchlistOptions().itemCountHint() + 10, 1); }
ConsumerRole createWatchlistConsumerRole(ReactorCallbackHandler callbackHandler) { ConsumerRole consumerRole = ReactorFactory.createConsumerRole(); assertNotNull(consumerRole); assertNotNull(callbackHandler); consumerRole.defaultMsgCallback(callbackHandler); consumerRole.channelEventCallback(callbackHandler); consumerRole.loginMsgCallback(callbackHandler); consumerRole.directoryMsgCallback(callbackHandler); consumerRole.dictionaryMsgCallback(callbackHandler); consumerRole.watchlistOptions().enableWatchlist(true); consumerRole.watchlistOptions().obeyOpenWindow(true); consumerRole.watchlistOptions().channelOpenCallback(callbackHandler); return consumerRole; }
void copy(ConsumerRole role) { super.copy(role); _loginMsgCallback = role.loginMsgCallback(); _directoryMsgCallback = role.directoryMsgCallback(); _dictionaryMsgCallback = role.dictionaryMsgCallback(); _dictionaryDownloadMode = role.dictionaryDownloadMode(); _consumerWatchlistOptions.copy(role.watchlistOptions()); copyLoginRequest(role.rdmLoginRequest()); copyDirectoryRequest(role.rdmDirectoryRequest()); }
chnlInfo.consumerRole.loginMsgCallback(this); chnlInfo.consumerRole.directoryMsgCallback(this); chnlInfo.consumerRole.watchlistOptions().enableWatchlist(true); chnlInfo.consumerRole.watchlistOptions().itemCountHint(4); chnlInfo.consumerRole.watchlistOptions().maxOutstandingPosts(5); chnlInfo.consumerRole.watchlistOptions().obeyOpenWindow(true); chnlInfo.consumerRole.watchlistOptions().channelOpenCallback(this);
consumerRole.dictionaryMsgCallback(consumer); consumerRole.defaultMsgCallback(consumer); consumerRole.watchlistOptions().enableWatchlist(true); consumerRole.watchlistOptions().channelOpenCallback(consumer); assertTrue(consumerRole.directoryMsgCallback() == reactorChnlConsumerRole.directoryMsgCallback()); assertTrue(consumerRole.loginMsgCallback() == reactorChnlConsumerRole.loginMsgCallback()); assertTrue(consumerRole.watchlistOptions().channelOpenCallback() == reactorChnlConsumerRole.watchlistOptions().channelOpenCallback()); assertTrue(consumerRole.watchlistOptions().enableWatchlist() == reactorChnlConsumerRole.watchlistOptions().enableWatchlist()); assertTrue(consumerRole.watchlistOptions().itemCountHint() == reactorChnlConsumerRole.watchlistOptions().itemCountHint()); assertTrue(consumerRole.watchlistOptions().maxOutstandingPosts() == reactorChnlConsumerRole.watchlistOptions().maxOutstandingPosts()); assertTrue(consumerRole.watchlistOptions().obeyOpenWindow() == reactorChnlConsumerRole.watchlistOptions().obeyOpenWindow()); assertTrue(consumerRole.watchlistOptions().postAckTimeout() == reactorChnlConsumerRole.watchlistOptions().postAckTimeout()); assertTrue(consumerRole.watchlistOptions().requestTimeout() == reactorChnlConsumerRole.watchlistOptions().requestTimeout());
void initializeConsumerRole(LoginRequest loginReq, DirectoryRequest dirReq) { ConsumerRole consumerRole = ReactorFactory.createConsumerRole(); loginReq.applyHasRole(); loginReq.role(Login.RoleTypes.CONS); consumerRole.rdmLoginRequest(loginReq); consumerRole.rdmDirectoryRequest(dirReq); consumerRole.dictionaryDownloadMode(DictionaryDownloadModes.NONE); consumerRole.loginMsgCallback(_baseImpl.loginCallbackClient()); consumerRole.dictionaryMsgCallback(_baseImpl.dictionaryCallbackClient()); consumerRole.directoryMsgCallback(_baseImpl.directoryCallbackClient()); consumerRole.channelEventCallback(_baseImpl.channelCallbackClient()); consumerRole.defaultMsgCallback(_baseImpl.itemCallbackClient()); ConsumerWatchlistOptions watchlistOptions = consumerRole.watchlistOptions(); watchlistOptions.channelOpenCallback(this); watchlistOptions.enableWatchlist(true); watchlistOptions.itemCountHint(_baseImpl.activeConfig().itemCountHint); watchlistOptions.obeyOpenWindow(_baseImpl.activeConfig().obeyOpenWindow > 0 ? true : false); watchlistOptions.postAckTimeout(_baseImpl.activeConfig().postAckTimeout); watchlistOptions.requestTimeout(_baseImpl.activeConfig().requestTimeout); watchlistOptions.maxOutstandingPosts(_baseImpl.activeConfig().maxOutstandingPosts); _rsslReactorRole = consumerRole; initializeReactor(); }
consumerRole.dictionaryMsgCallback(consumer); consumerRole.defaultMsgCallback(consumer); consumerRole.watchlistOptions().enableWatchlist(_enableWatchlist);
assertEquals(1, consumerCallbackHandler._rdmDictionaryMsgCallbackCount); consumerRole.watchlistOptions().enableWatchlist(true); consumerRole.watchlistOptions().itemCountHint(4); consumerRole.watchlistOptions().maxOutstandingPosts(5); consumerRole.watchlistOptions().obeyOpenWindow(true); consumerRole.watchlistOptions().channelOpenCallback(consumerCallbackHandler); assertEquals(ReactorCallbackReturnCodes.SUCCESS, consumerRole.watchlistOptions().channelOpenCallback().reactorChannelEventCallback(reactorChannelEvent)); assertEquals(2, consumerCallbackHandler._reactorChannelEventCallbackCount); assertTrue(consumerRole.watchlistOptions().enableWatchlist()); assertEquals(4, consumerRole.watchlistOptions().itemCountHint()); assertEquals(5, consumerRole.watchlistOptions().maxOutstandingPosts()); assertTrue(consumerRole.watchlistOptions().obeyOpenWindow());
/** This provider always rejects tunnel streams. */ class TunnelStreamRejectProvider extends Provider { TunnelStreamRejectOptions _rejectOptions = ReactorFactory.createTunnelStreamRejectOptions(); public TunnelStreamRejectProvider(TestReactor reactor) { super(reactor); } @Override public int listenerCallback(TunnelStreamRequestEvent event) { super.listenerCallback(event); /* Accept the tunnel stream request. */ _rejectOptions.clear(); _rejectOptions.state().streamState(StreamStates.CLOSED); _rejectOptions.state().dataState(DataStates.SUSPECT); _rejectOptions.state().code(StateCodes.NOT_ENTITLED); assertEquals(ReactorReturnCodes.SUCCESS, reactorChannel().rejectTunnelStream(event, _rejectOptions, _errorInfo)); return ReactorReturnCodes.SUCCESS; } }
consumerRole.dictionaryMsgCallback(this); consumerRole.defaultMsgCallback(this); consumerRole.watchlistOptions().enableWatchlist(enableWatchlist);
consumerRole.initDefaultRDMLoginRequest(); consumerRole.initDefaultRDMDirectoryRequest(); consumerRole.watchlistOptions().requestTimeout(5000);
consumerRole.dictionaryMsgCallback(consumer); consumerRole.defaultMsgCallback(consumer); consumerRole.watchlistOptions().enableWatchlist(true); consumerRole.watchlistOptions().channelOpenCallback(consumer);
consumerRole.dictionaryMsgCallback(consumer); consumerRole.defaultMsgCallback(consumer); consumerRole.watchlistOptions().enableWatchlist(_enableWatchlist);
if (consumerRole.watchlistOptions().enableWatchlist() == false) return; assertEquals(TestReactorEventTypes.DIRECTORY_MSG, event.type()); directoryMsgEvent = (RDMDirectoryMsgEvent)event.reactorEvent(); assertEquals((recoveringChannel && consumerRole.watchlistOptions().enableWatchlist() ? DirectoryMsgType.UPDATE : DirectoryMsgType.REFRESH), directoryMsgEvent.rdmDirectoryMsg().rdmMsgType());
consumerRole.dictionaryMsgCallback(consumer); consumerRole.defaultMsgCallback(consumer); consumerRole.watchlistOptions().enableWatchlist(_enableWatchlist);
consumerRole.dictionaryMsgCallback(consumer); consumerRole.defaultMsgCallback(consumer); consumerRole.watchlistOptions().enableWatchlist(_enableWatchlist);
consumerRole.dictionaryMsgCallback(consumer); consumerRole.defaultMsgCallback(consumer); consumerRole.watchlistOptions().channelOpenCallback(consumer);
consumerRole.dictionaryMsgCallback(consumer); consumerRole.defaultMsgCallback(consumer); consumerRole.watchlistOptions().enableWatchlist(_enableWatchlist);