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

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

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

Qos.rateInfo介绍

[英]Specific rate information in milliseconds. Only present when rate is set to QosRates#TIME_CONFLATED.
[中]以毫秒为单位的特定速率信息。仅当速率设置为QosRates#TIME#CONFLATED时出现。

代码示例

代码示例来源: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

@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

break;
case com.thomsonreuters.upa.codec.QosRates.TIME_CONFLATED:
  _toString.append("Rate: ").append(_rsslQos.rateInfo());
  break;
default:

代码示例来源: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

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 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 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

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

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

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

qos.rateInfo(rateInfo);
qos.timeInfo(timeInfo);
qos.dynamic(false);
qos.rateInfo(rateInfo);
qos.timeInfo(timeInfo);
qos.dynamic(true);

代码示例来源: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

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

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

requestMsg.qos().dynamic(qos().isDynamic());
requestMsg.qos().rate(qos().rate());
requestMsg.qos().rateInfo(qos().rateInfo());
requestMsg.qos().timeliness(qos().timeliness());
requestMsg.qos().timeInfo(qos().timeInfo());

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

refreshMsg.qos().rate(qos().rate());
refreshMsg.qos().timeliness(qos().timeliness());
refreshMsg.qos().rateInfo(qos().rateInfo());
refreshMsg.qos().timeInfo(qos().timeInfo());

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

refreshMsg.qos().rate(qos().rate());
refreshMsg.qos().timeliness(qos().timeliness());
refreshMsg.qos().rateInfo(qos().rateInfo());
refreshMsg.qos().timeInfo(qos().timeInfo());

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

qos1.clear();
assertTrue(qos1.equals(qos2));
qos1.rateInfo(1000);
assertFalse(qos1.equals(qos2));
qos1.clear();

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

assertFalse(qos1.isBetter(qos2));
qos1.rate(QosRates.TIME_CONFLATED);
qos1.rateInfo(1000);
assertTrue(qos1.isBetter(qos2));
qos1.clear();

相关文章