com.thomsonreuters.upa.codec.Qos.rate()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(15.6k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中com.thomsonreuters.upa.codec.Qos.rate方法的一些代码示例,展示了Qos.rate的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Qos.rate方法的具体详情如下:
包路径:com.thomsonreuters.upa.codec.Qos
类名称:Qos
方法名:rate

Qos.rate介绍

[英]Information rate enum, from QosRates. Used to convey information about the data's period of change.
[中]信息速率枚举,来自QosRates。用于传达有关数据变化周期的信息。

代码示例

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public int rate()
{
  int rate = OmmQos.Rate.JUST_IN_TIME_CONFLATED;
  switch( _rsslQos.rate() )
  {
  case com.thomsonreuters.upa.codec.QosRates.TICK_BY_TICK:
    rate = OmmQos.Rate.TICK_BY_TICK;
    break;
  case com.thomsonreuters.upa.codec.QosRates.JIT_CONFLATED:
    rate = OmmQos.Rate.JUST_IN_TIME_CONFLATED;
    break;
  case com.thomsonreuters.upa.codec.QosRates.TIME_CONFLATED:
    rate = _rsslQos.rateInfo();
    break;
  default:
    break;
  }
  return rate;
}

代码示例来源:origin: Refinitiv/Elektron-SDK

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);
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public String rateAsString()
{
  _toString.setLength(0);
  
  switch(_rsslQos.rate())
  {
  case com.thomsonreuters.upa.codec.QosRates.TICK_BY_TICK:
    _toString.append("TickByTick");
    break;
  case com.thomsonreuters.upa.codec.QosRates.JIT_CONFLATED:
    _toString.append("JustInTimeConflated");
    break;
  default:
    return _toString.append("Rate: ").append(_rsslQos.rateInfo()).toString();
  }
  
  return _toString.toString();
}

代码示例来源:origin: Refinitiv/Elektron-SDK

/**
 * Instantiates a new directory provider.
 */
public DirectoryProvider()
{
  _directoryRefresh = (DirectoryRefresh)DirectoryMsgFactory.createMsg();
  _directoryRefresh.rdmMsgType(DirectoryMsgType.REFRESH);
  _service = DirectoryMsgFactory.createService();
  _qos = CodecFactory.createQos();
  _directoryRefresh.rdmMsgType(DirectoryMsgType.REFRESH);
  
  _qos.dynamic(false);
  _qos.rate(QosRates.TICK_BY_TICK);
  _qos.timeliness(QosTimeliness.REALTIME);
  
  _encodeIter = CodecFactory.createEncodeIterator();
}

代码示例来源:origin: Refinitiv/Elektron-SDK

static void toRsslQos(int rate, int timeliness, Qos rsslQos)
{
  rsslQos.dynamic(false);
  if (rate == OmmQos.Rate.TICK_BY_TICK)
    rsslQos.rate(com.thomsonreuters.upa.codec.QosRates.TICK_BY_TICK);
  else if (rate == OmmQos.Rate.JUST_IN_TIME_CONFLATED)
    rsslQos.rate(com.thomsonreuters.upa.codec.QosRates.JIT_CONFLATED);
  else
  {
    if (rate <= 65535)
    {
      rsslQos.rate(com.thomsonreuters.upa.codec.QosRates.TIME_CONFLATED);
      rsslQos.rateInfo(rate);
    } else
      rsslQos.rate(com.thomsonreuters.upa.codec.QosRates.JIT_CONFLATED);
  }
  if (timeliness == OmmQos.Timeliness.REALTIME)
    rsslQos.timeliness(com.thomsonreuters.upa.codec.QosTimeliness.REALTIME);
  else if (timeliness == OmmQos.Timeliness.INEXACT_DELAYED)
    rsslQos.timeliness(com.thomsonreuters.upa.codec.QosTimeliness.DELAYED_UNKNOWN);
  else
  {
    if (timeliness <= 65535)
    {
      rsslQos.timeliness(com.thomsonreuters.upa.codec.QosTimeliness.DELAYED);
      rsslQos.timeInfo(timeliness);
    } else
      rsslQos.timeliness(com.thomsonreuters.upa.codec.QosTimeliness.DELAYED_UNKNOWN);
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

ItemHandler(DictionaryHandler dictionaryHandler, LoginHandler loginHandler)
{
  _marketByOrderItemWatchList = new MarketByOrderCacheItems();
  _marketByPriceItemWatchList = new MarketByPriceCacheItems();
  _marketPriceItemWatchList = new MarketPriceCacheItems();
  _marketPriceStatus = new MarketPriceStatus();
  _symbolListItemWatchList = new SymbolListItems();
  _itemInfoWatchList = new ItemInfoList();
  _itemRequestWatchList = new ItemRequestInfoList();
  _dictionaryHandler = dictionaryHandler;
  _loginHandler = loginHandler;
  _updateMsg.msgClass(MsgClasses.UPDATE);
  _ackMsg.msgClass(MsgClasses.ACK);
  _statusMsg.msgClass(MsgClasses.STATUS);
  _triItemName.data("TRI");
  _privateStreamItemName.data("RES-DS");
  _slNameBuf.data("_UPA_ITEM_LIST");
  _batchReqName.data(":ItemList");
  
  //set Qos for provider
  _providerQos.dynamic(false);
  _providerQos.rate(QosRates.TICK_BY_TICK);
  _providerQos.timeliness(QosTimeliness.REALTIME);
}

代码示例来源:origin: Refinitiv/Elektron-SDK

void decode(com.thomsonreuters.upa.codec.Qos rsslQos)
{
  if (rsslQos != null)
  {
    _dataCode = DataCode.NO_CODE;
    
    _rsslQos.rate(rsslQos.rate());
    _rsslQos.timeliness(rsslQos.timeliness());
    _rsslQos.dynamic(rsslQos.isDynamic());
    _rsslQos.timeInfo(rsslQos.timeInfo());
    _rsslQos.rateInfo(rsslQos.rateInfo());
  }
  else
  {
    _dataCode = DataCode.BLANK;
    
    _rsslQos.clear();
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

qos.rate(QosRates.JIT_CONFLATED);
qos.timeliness(QosTimeliness.DELAYED);
qos.timeInfo(1);

代码示例来源:origin: Refinitiv/Elektron-SDK

static int encodeQos(EncodeIteratorImpl iter, Qos data)
{
  assert (iter != null);
  assert (data != null);
  int dataLength = 1;
  int Qos;
  if (data.timeliness() == QosTimeliness.UNSPECIFIED || data.rate() == QosRates.UNSPECIFIED)
    return CodecReturnCodes.INVALID_DATA;
  dataLength += (data.timeliness() > QosTimeliness.DELAYED_UNKNOWN) ? 2 : 0;
  dataLength += (data.rate() > QosRates.JIT_CONFLATED) ? 2 : 0;
  if (iter.isIteratorOverrun(dataLength))
    return CodecReturnCodes.BUFFER_TOO_SMALL;
  Qos = (data.timeliness() << 5);
  Qos |= (data.rate() << 1);
  Qos |= (data.isDynamic() ? 1 : 0);
  iter._writer.writeByte(Qos);
  if (data.timeliness() > QosTimeliness.DELAYED_UNKNOWN)
  {
    iter._writer.writeShort(data.timeInfo());
  }
  if (data.rate() > QosRates.JIT_CONFLATED)
  {
    iter._writer.writeShort(data.rateInfo());
  }
  iter._curBufPos = iter._writer.position();
  return CodecReturnCodes.SUCCESS;
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void generateRefreshAndUpdate(int serviceId)
{
  //refresh complete
  marketByOrderRefresh.applyRefreshComplete();
  //service Id
  marketByOrderRefresh.serviceId(serviceId);
  marketByOrderRefresh.applyHasServiceId();
  marketByOrderUpdate.serviceId(serviceId);
  marketByOrderUpdate.applyHasServiceId();
  //QoS
  marketByOrderRefresh.qos().dynamic(false);
  marketByOrderRefresh.qos().timeliness(QosTimeliness.REALTIME);
  marketByOrderRefresh.qos().rate(QosRates.TICK_BY_TICK);
  marketByOrderRefresh.applyHasQos();
  //state
  marketByOrderRefresh.state().streamState(StreamStates.OPEN);
  marketByOrderRefresh.state().dataState(DataStates.OK);
  marketByOrderRefresh.state().code(StateCodes.NONE);
  marketByOrderRefresh.state().text().data("Item Refresh Completed");
}

代码示例来源:origin: Refinitiv/Elektron-SDK

static int encodeQosWithLength(EncodeIteratorImpl iter, Qos data)
{
  assert (iter != null);
  assert (data != null);
  int dataLength = 1;
  int Qos;
  if (data.timeliness() == QosTimeliness.UNSPECIFIED || data.rate() == QosRates.UNSPECIFIED)
    return CodecReturnCodes.INVALID_DATA;
  dataLength += (data.timeliness() > QosTimeliness.DELAYED_UNKNOWN) ? 2 : 0;
  dataLength += (data.rate() > QosRates.JIT_CONFLATED) ? 2 : 0;
  if (iter.isIteratorOverrun(dataLength + 1))
    return CodecReturnCodes.BUFFER_TOO_SMALL;
  iter._writer.writeByte(dataLength);
  Qos = (data.timeliness() << 5);
  Qos |= (data.rate() << 1);
  Qos |= (data.isDynamic() ? 1 : 0);
  iter._writer.writeByte(Qos);
  if (data.timeliness() > QosTimeliness.DELAYED_UNKNOWN)
  {
    iter._writer.writeShort(data.timeInfo());
  }
  if (data.rate() > QosRates.JIT_CONFLATED)
  {
    iter._writer.writeShort(data.rateInfo());
  }
  iter._curBufPos = iter._writer.position();
  return CodecReturnCodes.SUCCESS;
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void generateRefreshAndUpdate(int serviceId)
{
  //refresh complete
  marketPriceRefresh.applyRefreshComplete();
  //service Id
  marketPriceRefresh.serviceId(serviceId);
  marketPriceRefresh.applyHasServiceId();
  marketPriceUpdate.serviceId(serviceId);
  marketPriceUpdate.applyHasServiceId();
  //QoS
  marketPriceRefresh.qos().dynamic(false);
  marketPriceRefresh.qos().timeliness(QosTimeliness.REALTIME);
  marketPriceRefresh.qos().rate(QosRates.TICK_BY_TICK);
  marketPriceRefresh.applyHasQos();
  //state
  marketPriceRefresh.state().streamState(StreamStates.OPEN);
  marketPriceRefresh.state().dataState(DataStates.OK);
  marketPriceRefresh.state().code(StateCodes.NONE);
  marketPriceRefresh.state().text().data("Item Refresh Completed");
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void generateRequest(YieldCurveRequest yieldCurveRequest,
    boolean isPrivateStream, Service srcDirInfo, LoginRefresh loginInfo)
{
  yieldCurveRequest.clear();
  if (!snapshotRequested)
    yieldCurveRequest.applyStreaming();
  yieldCurveRequest.applyHasServiceId();
  yieldCurveRequest.serviceId(srcDirInfo.serviceId());
  yieldCurveRequest.applyHasPriority();
  yieldCurveRequest.priority(1, 1);
  yieldCurveRequest.applyHasQos();
  yieldCurveRequest.qos().dynamic(false);
  yieldCurveRequest.qos().timeInfo(srcDirInfo.info().qosList().get(0).timeInfo());
  yieldCurveRequest.qos().timeliness(srcDirInfo.info().qosList().get(0).timeliness());
  yieldCurveRequest.qos().rateInfo(srcDirInfo.info().qosList().get(0).rateInfo());
  yieldCurveRequest.qos().rate(srcDirInfo.info().qosList().get(0).rate());
  if (isPrivateStream)
    yieldCurveRequest.applyPrivateStream();
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void generateRefreshAndUpdate(Service serviceInfo)
{
  //refresh complete
  marketByOrderRefresh.applyRefreshComplete();
  //service Id
  marketByOrderRefresh.serviceId(serviceInfo.serviceId());
  marketByOrderRefresh.applyHasServiceId();
  marketByOrderUpdate.serviceId(serviceInfo.serviceId());
  marketByOrderUpdate.applyHasServiceId();
  //QoS
  marketByOrderRefresh.qos().dynamic(false);
  marketByOrderRefresh.qos().timeliness(QosTimeliness.REALTIME);
  marketByOrderRefresh.qos().rate(QosRates.TICK_BY_TICK);
  marketByOrderRefresh.applyHasQos();
  //state
  marketByOrderRefresh.state().streamState(StreamStates.OPEN);
  marketByOrderRefresh.state().dataState(DataStates.OK);
  marketByOrderRefresh.state().code(StateCodes.NONE);
  marketByOrderRefresh.state().text().data("Item Refresh Completed");
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void generateRequest(YieldCurveRequest yieldCurveRequest,
    boolean isPrivateStream, Service srcDirInfo, LoginRefresh loginInfo)
{
  yieldCurveRequest.clear();
  if (!snapshotRequested)
    yieldCurveRequest.applyStreaming();
  yieldCurveRequest.applyHasServiceId();
  yieldCurveRequest.serviceId(srcDirInfo.serviceId());
  yieldCurveRequest.applyHasPriority();
  yieldCurveRequest.priority(1, 1);
  yieldCurveRequest.applyHasQos();
  yieldCurveRequest.qos().dynamic(false);
  yieldCurveRequest.qos().timeInfo(srcDirInfo.info().qosList().get(0).timeInfo());
  yieldCurveRequest.qos().timeliness(srcDirInfo.info().qosList().get(0).timeliness());
  yieldCurveRequest.qos().rateInfo(srcDirInfo.info().qosList().get(0).rateInfo());
  yieldCurveRequest.qos().rate(srcDirInfo.info().qosList().get(0).rate());
  if (isPrivateStream)
    yieldCurveRequest.applyPrivateStream();
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void generateRefreshAndUpdate(Service serviceInfo)
{
  //refresh complete
  marketPriceRefresh.applyRefreshComplete();
  //service Id
  marketPriceRefresh.serviceId(serviceInfo.serviceId());
  marketPriceRefresh.applyHasServiceId();
  marketPriceUpdate.serviceId(serviceInfo.serviceId());
  marketPriceUpdate.applyHasServiceId();
  //QoS
  marketPriceRefresh.qos().dynamic(false);
  marketPriceRefresh.qos().timeliness(QosTimeliness.REALTIME);
  marketPriceRefresh.qos().rate(QosRates.TICK_BY_TICK);
  marketPriceRefresh.applyHasQos();
  //state
  marketPriceRefresh.state().streamState(StreamStates.OPEN);
  marketPriceRefresh.state().dataState(DataStates.OK);
  marketPriceRefresh.state().code(StateCodes.NONE);
  marketPriceRefresh.state().text().data("Item Refresh Completed");
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void generateRequest(MarketPriceRequest marketPriceRequest, boolean isPrivateStream,
    Service srcDirInfo, LoginRefresh loginInfo)
{
  marketPriceRequest.clear();
  if (!snapshotRequested)
    marketPriceRequest.applyStreaming();
  marketPriceRequest.applyHasServiceId();
  marketPriceRequest.serviceId(srcDirInfo.serviceId());
  marketPriceRequest.applyHasPriority();
  marketPriceRequest.priority(1, 1);
  if (srcDirInfo.info().qosList().size() > 0)
  {
    marketPriceRequest.applyHasQos();
    marketPriceRequest.qos().dynamic(false);
    marketPriceRequest.qos().timeInfo(srcDirInfo.info().qosList().get(0).timeInfo());
    marketPriceRequest.qos().timeliness(srcDirInfo.info().qosList().get(0).timeliness());
    marketPriceRequest.qos().rateInfo(srcDirInfo.info().qosList().get(0).rateInfo());
    marketPriceRequest.qos().rate(srcDirInfo.info().qosList().get(0).rate());
  }
  if (isPrivateStream)
    marketPriceRequest.applyPrivateStream();
  if (loginInfo.checkHasFeatures() && loginInfo.features().checkHasSupportViewRequests()
      && loginInfo.features().supportViewRequests() == 1 && viewRequested)
  {
    marketPriceRequest.applyHasView();
    marketPriceRequest.viewFields().addAll(viewFieldList);
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void generateRequest(MarketPriceRequest marketPriceRequest, boolean isPrivateStream, Service srcDirInfo, LoginRefresh loginInfo)
{
  marketPriceRequest.clear();
  if (!snapshotRequested)
    marketPriceRequest.applyStreaming();
  marketPriceRequest.applyHasServiceId();
  marketPriceRequest.serviceId(srcDirInfo.serviceId());
  marketPriceRequest.applyHasPriority();
  marketPriceRequest.priority(1, 1);
  if (srcDirInfo.info().qosList().size() > 0)
  {
    marketPriceRequest.applyHasQos();
    marketPriceRequest.qos().dynamic(false);
    marketPriceRequest.qos().timeInfo(srcDirInfo.info().qosList().get(0).timeInfo());
    marketPriceRequest.qos().timeliness(srcDirInfo.info().qosList().get(0)
        .timeliness());
    marketPriceRequest.qos().rateInfo(srcDirInfo.info().qosList().get(0).rateInfo());
    marketPriceRequest.qos().rate(srcDirInfo.info().qosList().get(0).rate());
  }
  if (isPrivateStream)
    marketPriceRequest.applyPrivateStream();
  if (loginInfo.checkHasFeatures() && 
    loginInfo.features().checkHasSupportViewRequests() && 
    loginInfo.features().supportViewRequests() == 1 &&
    viewRequested)
  {
    marketPriceRequest.applyHasView();
    marketPriceRequest.viewFields().addAll(viewFieldList);
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Test
public void qosSetTest()
{
  Qos thisQos = CodecFactory.createQos();
  assertEquals(CodecReturnCodes.SUCCESS, thisQos.rate(QosRates.UNSPECIFIED));
  assertEquals(QosRates.UNSPECIFIED, thisQos.rate());
  assertEquals(CodecReturnCodes.SUCCESS, thisQos.timeliness(QosTimeliness.UNSPECIFIED));
  assertEquals(QosTimeliness.UNSPECIFIED, thisQos.timeliness());
  assertEquals(CodecReturnCodes.SUCCESS, thisQos.rateInfo(0));
  assertEquals(0, thisQos.rateInfo());
  assertEquals(CodecReturnCodes.SUCCESS, thisQos.timeInfo(0));
  assertEquals(0, thisQos.timeInfo());
  assertEquals(CodecReturnCodes.INVALID_ARGUMENT, thisQos.rate(-1));
  assertEquals(CodecReturnCodes.INVALID_ARGUMENT, thisQos.timeliness(-1));
  assertEquals(CodecReturnCodes.INVALID_ARGUMENT, thisQos.rateInfo(-1));
  assertEquals(CodecReturnCodes.INVALID_ARGUMENT, thisQos.timeInfo(-1));
  assertEquals(CodecReturnCodes.INVALID_ARGUMENT, thisQos.rate(16));
  assertEquals(CodecReturnCodes.INVALID_ARGUMENT, thisQos.timeliness(8));
  assertEquals(CodecReturnCodes.INVALID_ARGUMENT, thisQos.rateInfo(65536));
  assertEquals(CodecReturnCodes.INVALID_ARGUMENT, thisQos.timeInfo(65536));
  assertEquals(CodecReturnCodes.SUCCESS, thisQos.rate(QosRates.TIME_CONFLATED));
  assertEquals(QosRates.TIME_CONFLATED, thisQos.rate());
  assertEquals(CodecReturnCodes.SUCCESS, thisQos.timeliness(QosTimeliness.DELAYED));
  assertEquals(QosTimeliness.DELAYED, thisQos.timeliness());
  assertEquals(CodecReturnCodes.SUCCESS, thisQos.rateInfo(65535));
  assertEquals(65535, thisQos.rateInfo());
  assertEquals(CodecReturnCodes.SUCCESS, thisQos.timeInfo(65535));
  assertEquals(65535, thisQos.timeInfo());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

private void qosED(QosImpl qos)
{
  _encIter.clear();
  _buffer.data(ByteBuffer.allocate(15));
  _encIter.setBufferAndRWFVersion(_buffer, Codec.majorVersion(), Codec.minorVersion());
  qos.encode(_encIter);
  _decIter.clear();
  _decIter.setBufferAndRWFVersion(_buffer, Codec.majorVersion(), Codec.minorVersion());
  Qos qos1 = CodecFactory.createQos();
  qos1.decode(_decIter);
  assertEquals(qos.rate(), qos1.rate());
  assertEquals(qos.rateInfo(), qos1.rateInfo());
  assertEquals(qos.timeInfo(), qos1.timeInfo());
  assertEquals(qos.timeliness(), qos1.timeliness());
  assertEquals(qos.isDynamic(), qos1.isDynamic());
}

相关文章