Package com.opengamma.engine.cache.msg

Examples of com.opengamma.engine.cache.msg.GetRequest


    getRemoteCacheClient().sendPutMessage(request, CacheMessage.class);
  }

  @Override
  public FudgeMsg get(long identifier) {
    final GetRequest request = new GetRequest(getCacheKey().getViewCycleId(), getCacheKey()
        .getCalculationConfigurationName(), Collections.singleton(identifier));
    final GetResponse response = getRemoteCacheClient().sendGetMessage(request, GetResponse.class);
    final FudgeMsg data = response.getData().get(0);
    return data.isEmpty() ? null : data;
  }
View Full Code Here


    return data.isEmpty() ? null : data;
  }

  @Override
  public Map<Long, FudgeMsg> get(Collection<Long> identifiers) {
    final GetRequest request = new GetRequest(getCacheKey().getViewCycleId(), getCacheKey()
        .getCalculationConfigurationName(), identifiers);
    final GetResponse response = getRemoteCacheClient().sendGetMessage(request, GetResponse.class);
    final Map<Long, FudgeMsg> result = new HashMap<Long, FudgeMsg>();
    final List<FudgeMsg> values = response.getData();
    if (values.size() != identifiers.size()) {
      // An error at the server end, possibly an invalid cache (gives a result with just one null in)
      return Collections.emptyMap();
    }
    int i = 0;
    for (Long identifier : request.getIdentifier()) {
      final FudgeMsg value = values.get(i++);
      if (!value.isEmpty()) {
        result.put(identifier, value);
      }
    }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.cache.msg.GetRequest

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.