Examples of LastKnownValueStore


Examples of com.opengamma.livedata.server.LastKnownValueStore

    if (!getServer().isValidLiveData(request.getSubscriptionId(), request.getNormalizationScheme())) {
      response.setGenericResult(CogdaCommandResponseResult.NOT_AVAILABLE);
    } else if (!isEntitled(EntitlementUtils.SNAPSHOT, request.getSubscriptionId(), request.getNormalizationScheme())) {
      response.setGenericResult(CogdaCommandResponseResult.NOT_AUTHORIZED);
    } else {
      LastKnownValueStore lkvStore = getServer().getLastKnownValueStore(request.getSubscriptionId(), request.getNormalizationScheme());
      FudgeMsg fields = null;
      if (lkvStore != null) {
        fields = lkvStore.getFields();
      } else {
        s_logger.warn("Valid live data {} lacks fields in LKV store", request);
        fields = fudgeContext.newMessage();
      }
     
View Full Code Here

Examples of com.opengamma.livedata.server.LastKnownValueStore

    if (!getServer().isValidLiveData(request.getSubscriptionId(), request.getNormalizationScheme())) {
      response.setGenericResult(CogdaCommandResponseResult.NOT_AVAILABLE);
    } else if (!isEntitled(EntitlementUtils.SUBSCRIBE, request.getSubscriptionId(), request.getNormalizationScheme())) {
      response.setGenericResult(CogdaCommandResponseResult.NOT_AUTHORIZED);
    } else {
      LastKnownValueStore lkvStore = getServer().getLastKnownValueStore(request.getSubscriptionId(), request.getNormalizationScheme());
      FudgeMsg fields = null;
      if (lkvStore != null) {
        fields = lkvStore.getFields();
      } else {
        s_logger.warn("Valid live data {} lacks fields in LKV store", request);
        fields = fudgeContext.newMessage();
      }
     
View Full Code Here

Examples of com.opengamma.livedata.server.LastKnownValueStore

 
  public LastKnownValueStore getLastKnownValueStore(ExternalId subscriptionId, String normalizationScheme) {
    LiveDataSpecification ldspec = new LiveDataSpecification(normalizationScheme, subscriptionId);
    // TODO kirk 2012-07-23 -- Check to see if valid.
   
    LastKnownValueStore store = _lastKnownValueStores.get(ldspec);
    if (store == null) {
      LastKnownValueStore fresh = getLastKnownValueStoreProvider().newInstance(subscriptionId, normalizationScheme);
      LastKnownValueStore fromMap = _lastKnownValueStores.putIfAbsent(ldspec, fresh);
      if (fromMap == null) {
        store = fresh;
      } else {
        store = fromMap;
      }
View Full Code Here

Examples of com.opengamma.livedata.server.LastKnownValueStore

   * @param id identifier for which to create store
   * @param normalizationScheme normalization scheme of store
   * @return The value store
   */
  protected LastKnownValueStore ensureLastKnownValueStore(ExternalId id, String normalizationScheme) {
    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

Examples of com.opengamma.livedata.server.LastKnownValueStore

  public void updateReceived(ExternalId id, FudgeMsg fields) {
    _tickMeter.mark();
    // Iterate over all normalization schemes.
    for (Map.Entry<String, NormalizationRuleSet> normalizationEntry : _normalization.entrySet()) {
      LiveDataSpecification ldspec = new LiveDataSpecification(normalizationEntry.getKey(), id);
      LastKnownValueStore lkvStore = ensureLastKnownValueStore(id, normalizationEntry.getKey());
     
      NormalizationRuleSet ruleSet = normalizationEntry.getValue();
      FudgeMsg normalizedFields = ruleSet.getNormalizedMessage(fields, id.getValue(), _normalizationState.get(ldspec));
     
      // If nothing to update, this returns null.
      if ((normalizedFields != null) && !normalizedFields.isEmpty()) {
        // update the LKV store
        lkvStore.updateFields(normalizedFields);
       
        // Blast them out.
        distributeNormalizedUpdate(ldspec, normalizedFields);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.