Package com.opengamma.livedata.server

Examples of com.opengamma.livedata.server.FieldHistoryStore


    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.BID, 0.0);
    msg.add(MarketDataRequirementNames.ASK, 1.0);
    msg.add(MarketDataRequirementNames.LAST, 0.57);
   
    FieldHistoryStore store = new FieldHistoryStore();
    store.liveDataReceived(msg);
   
    MutableFudgeMsg normalized = calculator.apply(msg, "123", store);
    assertEquals(4, normalized.getAllFields().size());
    assertEquals(0.5, normalized.getDouble(MarketDataRequirementNames.MARKET_VALUE), 0.0001);
  }
View Full Code Here


    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add(MarketDataRequirementNames.CLOSING_BID, 0.1);
    msg.add(MarketDataRequirementNames.CLOSING_ASK, 0.2);
    msg.add(MarketDataRequirementNames.CLOSE, 0.14);
   
    FieldHistoryStore store = new FieldHistoryStore();
   
    MutableFudgeMsg normalized = calculator.apply(msg, "123", store);
    assertEquals(0.14, normalized.getDouble(MarketDataRequirementNames.MARKET_VALUE));
  }
View Full Code Here

    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add("Foo", "1");
    msg.add("Bar", 2.0);
    msg.add("Baz", 500);
   
    MutableFudgeMsg normalized = nameChange.apply(msg, "123", new FieldHistoryStore());
    assertEquals(3, normalized.getAllFields().size());
    assertNull(normalized.getByName("Foo"));
    assertEquals(2.0, (Double) normalized.getAllByName("Bar").get(0).getValue(), 0.0001);
    assertEquals("1", (String) normalized.getAllByName("Bar").get(1).getValue());
    assertEquals(500, normalized.getInt("Baz").intValue());
View Full Code Here

    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add("Foo", "1");
    msg.add("Bar", 2.0);
    msg.add("Baz", 500);
   
    MutableFudgeMsg normalized = filter.apply(msg, "123", new FieldHistoryStore());
    assertEquals("1", normalized.getString("Foo"));
    assertEquals(2.0, normalized.getDouble("Bar"), 0.0001);
    assertNull(normalized.getByName("Baz"));
  }
View Full Code Here

    FieldFilter filter = new FieldFilter(fieldsToAccept);
   
    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add("Foo2", "1");
   
    MutableFudgeMsg normalized = filter.apply(msg, "123", new FieldHistoryStore());
    assertNull(normalized);
  }
View Full Code Here

    FieldFilter filter = new FieldFilter(fieldsToAccept);
   
    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add("Foo", "1");
   
    MutableFudgeMsg normalized = filter.apply(msg, "123", new FieldHistoryStore());
    assertNull(normalized);
  }
View Full Code Here

   
    MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage();
    msg.add("Bar", 2.0);
    msg.add("Baz", 500);
   
    FudgeMsg normalizedMsg = ruleSet.getNormalizedMessage(msg, "123", new FieldHistoryStore());
    assertNull(normalizedMsg);
  }
View Full Code Here

    LastKnownValueStore lkvStore = _lastKnownValueStoreProvider.newInstance(id, normalizationScheme);
    LiveDataSpecification ldspec = new LiveDataSpecification(normalizationScheme, id);
    if (_valueStores.putIfAbsent(ldspec, lkvStore) == null) {
      s_logger.debug("Created new LKV store and history state for {}", ldspec);
      // We actually did the creation. Also create the field history map.
      FieldHistoryStore historyStore = new FieldHistoryStore(lkvStore.getFields());
      _normalizationState.put(ldspec, historyStore);
      return lkvStore;
    }
    return _valueStores.get(ldspec);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.livedata.server.FieldHistoryStore

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.