Package com.opengamma.livedata

Examples of com.opengamma.livedata.LiveDataValueUpdateBean


    if (getNormalizedMessageSender() == null) {
      // Nothing to do here.
      return;
    }
    FudgeSerializer serializer = new FudgeSerializer(getNormalizedMessageSender().getFudgeContext());
    LiveDataValueUpdateBean updateBean = new LiveDataValueUpdateBean(0, ldspec, normalizedFields);
    FudgeMsg msg = LiveDataValueUpdateBeanFudgeBuilder.toFudgeMsg(serializer, updateBean);
    getNormalizedMessageSender().send(msg);
  }
View Full Code Here


    LiveDataSpecification spec1 = new LiveDataSpecification("foo", ExternalId.of("bar", "baz"));
   
    distributor.addListener(spec1, listener1);
   
    long sequenceNumber = 12345;
    distributor.notifyListeners(new LiveDataValueUpdateBean(sequenceNumber, spec1, _fudgeContext.newMessage()));
   
    List<LiveDataValueUpdate> updates = listener1.getValueUpdates();
    assertEquals(1, updates.size());
    LiveDataValueUpdate update = updates.get(0);
    assertEquals(sequenceNumber, update.getSequenceNumber());
View Full Code Here

          "NormalizationId1",
          ExternalId.of("Domain1", "Value1"));
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
    SubscriptionHandle handle = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, spec, listener);
   
    handle.addTickOnHold(new LiveDataValueUpdateBean(500, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addSnapshotOnHold(new LiveDataValueUpdateBean(501, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(502, spec, FudgeContext.EMPTY_MESSAGE));
    handle.releaseTicksOnHold();
   
    assertEquals(2, listener.getValueUpdates().size());
   
    assertEquals(501, listener.getValueUpdates().get(0).getSequenceNumber());
View Full Code Here

          "NormalizationId1",
          ExternalId.of("Domain1", "Value1"));
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
    SubscriptionHandle handle = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, spec, listener);
   
    handle.addTickOnHold(new LiveDataValueUpdateBean(500, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(501, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addSnapshotOnHold(new LiveDataValueUpdateBean(502, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(0, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(1, spec, FudgeContext.EMPTY_MESSAGE));
    handle.releaseTicksOnHold();
   
    assertEquals(2, listener.getValueUpdates().size());
   
    assertEquals(0, listener.getValueUpdates().get(0).getSequenceNumber());
View Full Code Here

          "NormalizationId1",
          ExternalId.of("Domain1", "Value1"));
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
    SubscriptionHandle handle = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, spec, listener);
   
    handle.addTickOnHold(new LiveDataValueUpdateBean(500, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addSnapshotOnHold(new LiveDataValueUpdateBean(501, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(502, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(0, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(1, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(0, spec, FudgeContext.EMPTY_MESSAGE));
    handle.addTickOnHold(new LiveDataValueUpdateBean(1, spec, FudgeContext.EMPTY_MESSAGE));
    handle.releaseTicksOnHold();
   
    assertEquals(2, listener.getValueUpdates().size());
   
    assertEquals(0, listener.getValueUpdates().get(0).getSequenceNumber());
View Full Code Here

  @Override
  public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) {
    // TODO kirk 2012-08-13 -- Check schema version.
    FudgeMsg msg = msgEnvelope.getMessage();
    LiveDataValueUpdateBean updateBean = LiveDataValueUpdateBeanFudgeBuilder.fromFudgeMsg(new FudgeDeserializer(fudgeContext), msg);
    getLiveDataServer().liveDataReceived(updateBean);
  }
View Full Code Here

  public LiveDataValueUpdateBean getSnapshot() {
    FudgeMsg lastKnownValues = getLastKnownValues();
    if (lastKnownValues == null) {
      return null;
    }
    return new LiveDataValueUpdateBean(
        getNumMessagesSent(), // 0-based as it should be
        getDistributionSpec().getFullyQualifiedLiveDataSpecification(),
        lastKnownValues);
  }
View Full Code Here

    }
   
    if (normalizedMsg != null) {
      updateLastKnownValues(normalizedMsg);
     
      LiveDataValueUpdateBean data = new LiveDataValueUpdateBean(
          getNumMessagesSent(), // 0-based as it should be
          getDistributionSpec().getFullyQualifiedLiveDataSpecification(),
          normalizedMsg);
     
      s_logger.debug("{}: Sending Live Data update {}", this, data);
View Full Code Here

  }

  private void send() {
    DistributionSpecification distributionSpec = getDistributor().getDistributionSpec();
   
    LiveDataValueUpdateBean liveDataValueUpdateBean = new LiveDataValueUpdateBean(
        _lastSequenceNumber,
        distributionSpec.getFullyQualifiedLiveDataSpecification(),
        _cumulativeDelta.getLastKnownValues());
    s_logger.debug("{}: Sending Live Data update {}", this, liveDataValueUpdateBean);
   
View Full Code Here

TOP

Related Classes of com.opengamma.livedata.LiveDataValueUpdateBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.