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

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

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

Qos.timeInfo介绍

[英]Specific timeliness information. Only present when timeliness is set to QosTimeliness#DELAYED.
[中]具体的及时性信息。仅当时效性设置为QosTimeliness#延迟时才出现。

代码示例

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

@Override
public int timeliness()
{
  int timeliness = OmmQos.Timeliness.INEXACT_DELAYED;
  switch( _rsslQos.timeliness() )
  {
  case com.thomsonreuters.upa.codec.QosTimeliness.REALTIME:
    timeliness = OmmQos.Timeliness.REALTIME;
    break;
  case com.thomsonreuters.upa.codec.QosTimeliness.DELAYED_UNKNOWN :
    timeliness = OmmQos.Timeliness.INEXACT_DELAYED;
    break;
  case com.thomsonreuters.upa.codec.QosTimeliness.DELAYED:
    timeliness = _rsslQos.timeInfo();
    break;
  default:
    break;
  }
  return timeliness;
}

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

@Override
public String timelinessAsString()
{
  _toString.setLength(0);
  
  switch(_rsslQos.timeliness())
  {
  case com.thomsonreuters.upa.codec.QosTimeliness.REALTIME:
    _toString.append("RealTime");
    break;
  case com.thomsonreuters.upa.codec.QosTimeliness.DELAYED_UNKNOWN:
    _toString.append("InexactDelayed");
    break;
  default:
    return _toString.append("Timeliness: ").append(_rsslQos.timeInfo()).toString();
  }
  
  return _toString.toString();
}

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

break;
case com.thomsonreuters.upa.codec.QosTimeliness.DELAYED:
  _toString.append("Timeliness: ").append(_rsslQos.timeInfo());
  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.timeliness(timeliness[tm]);
qos.rateInfo(rateInfo);
qos.timeInfo(timeInfo);
qos.dynamic(false);
qosED((QosImpl)qos);
qos.timeliness(timeliness[tm]);
qos.rateInfo(rateInfo);
qos.timeInfo(timeInfo);
qos.dynamic(true);
qosED((QosImpl)qos);

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

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

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

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

assertEquals(qos.isDynamic(), qosDec.isDynamic());
assertEquals(qos.timeliness(), qosDec.timeliness());
assertEquals(qos.timeInfo(), qosDec.timeInfo());
assertEquals(qos.rateInfo(), qosDec.rateInfo());

代码示例来源: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().rateInfo(qos().rateInfo());
requestMsg.qos().timeliness(qos().timeliness());
requestMsg.qos().timeInfo(qos().timeInfo());

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

qos1.clear();
assertTrue(qos1.equals(qos2));
qos1.timeInfo(2000);
assertFalse(qos1.equals(qos2));
qos1.clear();

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

assertFalse(qos1.isBetter(qos2));
qos1.timeliness(QosTimeliness.DELAYED);
qos1.timeInfo(2000);
assertTrue(qos1.isBetter(qos2));
qos1.clear();

相关文章