Examples of LiveDataSubscriptionResponse


Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

      + " subscription persistent. Returns the name of the JMS topic market data will be published on.")
  @ManagedOperationParameters({ @ManagedOperationParameter(name = "securityUniqueId", description = "Security unique ID. Server type dependent.)") })
  public String subscribePersistently(String securityUniqueId) {
    try {
      LiveDataSpecification spec = getServer().getLiveDataSpecification(securityUniqueId);
      LiveDataSubscriptionResponse response = getServer().subscribe(spec, true);
      if (response.getSubscriptionResult() != LiveDataSubscriptionResult.SUCCESS) {
        throw new RuntimeException("Unsuccessful subscription: " + response.getUserMessage());
      }
      return response.getTickDistributionSpecification();
    } catch (RuntimeException e) {
      s_logger.error("subscribe(" + securityUniqueId + ") failed", e);
      throw new RuntimeException(e.getMessage());
    }
  }
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

  private void dispatchSnapshotResponse(FudgeMsg msg, SubscriptionHandle subHandle) {
    CogdaLiveDataSnapshotResponseMessage responseMessage = CogdaLiveDataSnapshotResponseBuilder.buildObjectStatic(new FudgeDeserializer(getFudgeContext()), msg);
    LiveDataSpecification ldSpec = new LiveDataSpecification(responseMessage.getNormalizationScheme(), responseMessage.getSubscriptionId());
   
    LiveDataSubscriptionResult ldsResult = responseMessage.getGenericResult().toLiveDataSubscriptionResult();
    LiveDataSubscriptionResponse ldsResponse = new LiveDataSubscriptionResponse(subHandle.getRequestedSpecification(), ldsResult);
    ldsResponse.setFullyQualifiedSpecification(ldSpec);
    ldsResponse.setUserMessage(responseMessage.getUserMessage());
   
    LiveDataValueUpdateBean valueUpdateBean = new LiveDataValueUpdateBean(0L, subHandle.getRequestedSpecification(), responseMessage.getValues());
    ldsResponse.setSnapshot(valueUpdateBean);
    subHandle.subscriptionResultReceived(ldsResponse);
  }
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

  private void dispatchSubscriptionResponse(FudgeMsg msg, SubscriptionHandle subHandle) {
    CogdaLiveDataSubscriptionResponseMessage responseMessage = CogdaLiveDataSubscriptionResponseBuilder.buildObjectStatic(new FudgeDeserializer(getFudgeContext()), msg);
    LiveDataSpecification ldSpec = new LiveDataSpecification(responseMessage.getNormalizationScheme(), responseMessage.getSubscriptionId());
   
    LiveDataSubscriptionResult ldsResult = responseMessage.getGenericResult().toLiveDataSubscriptionResult();
    LiveDataSubscriptionResponse ldsResponse = new LiveDataSubscriptionResponse(subHandle.getRequestedSpecification(), ldsResult);
    ldsResponse.setFullyQualifiedSpecification(ldSpec);
    ldsResponse.setUserMessage(responseMessage.getUserMessage());
   
    LiveDataValueUpdateBean valueUpdateBean = new LiveDataValueUpdateBean(0L, subHandle.getRequestedSpecification(), responseMessage.getSnapshot());
    ldsResponse.setSnapshot(valueUpdateBean);
   
    switch (responseMessage.getGenericResult()) {
      case SUCCESSFUL:
        super.subscriptionRequestSatisfied(subHandle, ldsResponse);
        super.subscriptionStartingToReceiveTicks(subHandle, ldsResponse);
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

    CogdaLiveDataClient client = new CogdaLiveDataClient(UserPrincipal.getLocalUser());
    //client.setServerName("cogdasvr-lx-1.hq.opengamma.com");
    client.start();
   
    LiveDataSpecification lds = new LiveDataSpecification("OpenGamma", ExternalId.of("SURF", "FV2DBEURUSD12M"));
    LiveDataSubscriptionResponse response = client.snapshot(UserPrincipal.getLocalUser(), lds, 60000L);
    s_logger.warn("Snapshot {}", response);
    List<LiveDataSpecification> subs = new LinkedList<LiveDataSpecification>();
    subs.add(lds);
    subs.add(new LiveDataSpecification("OpenGamma", ExternalId.of("SURF", "ASIRSEUR49Y30A03L")));
    subs.add(new LiveDataSpecification("OpenGamma", ExternalId.of("SURF", "FV1DRUSDBRL06M")));
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

  }

  //-------------------------------------------------------------------------
  public void defaultSubscription() {
    LiveDataSpecification spec = new LiveDataSpecification("No Normalization", ExternalId.of(_domainD, "X"));
    LiveDataSubscriptionResponse subscribe = _combiningServer.subscribe(spec, false);
    assertEquals(LiveDataSubscriptionResult.NOT_PRESENT, subscribe.getSubscriptionResult());
  }
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

    assertEquals(1, _serverC.getSubscriptions().size());
  }

  public void matchingSubscription() {
    LiveDataSpecification spec = new LiveDataSpecification("No Normalization", ExternalId.of(_domainC, "X"));
    LiveDataSubscriptionResponse result = _combiningServer.subscribe(spec, false);
    assertEquals(LiveDataSubscriptionResult.SUCCESS, result.getSubscriptionResult());
   
    assertEquals(0, _serverB.getSubscriptions().size());
    assertEquals(1, _serverC.getSubscriptions().size());
  }
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

    assertEquals(1, _serverC.getSubscriptions().size());
  }

  public void prioritySubscription() {
    LiveDataSpecification spec = new LiveDataSpecification("No Normalization", ExternalId.of(_domainB, "X"), ExternalId.of(_domainC, "X"));
    LiveDataSubscriptionResponse result = _combiningServer.subscribe(spec, false);
    assertEquals(LiveDataSubscriptionResult.SUCCESS, result.getSubscriptionResult());
   
    assertEquals(1, _serverB.getSubscriptions().size());
    assertEquals(0, _serverC.getSubscriptions().size());
  }
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

  }

  //-------------------------------------------------------------------------
  @Test
  public void testSnapshot() {
    LiveDataSubscriptionResponse snapshotResponse = snapshot("AAPL US Equity");
   
    assertNotNull(snapshotResponse);
    assertEquals(LiveDataSubscriptionResult.SUCCESS, snapshotResponse.getSubscriptionResult());
    StandardRulesUtils.validateOpenGammaMsg(snapshotResponse.getSnapshot().getFields());
  }
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

    StandardRulesUtils.validateOpenGammaMsg(snapshotResponse.getSnapshot().getFields());
  }

  @Test(groups = {"bbgSubscriptionTests" }, enabled = false)
  public void testSnapshotNotPresent() {
    LiveDataSubscriptionResponse snapshotResponse = snapshot("AAPL.O");
    assertNotNull(snapshotResponse);
    assertEquals(LiveDataSubscriptionResult.NOT_PRESENT, snapshotResponse.getSubscriptionResult());
  }
View Full Code Here

Examples of com.opengamma.livedata.msg.LiveDataSubscriptionResponse

  }

  protected void assertSwapCollectionValid(String subscription, CollectingLiveDataListener listener) throws Exception {
    try {
      assertEquals(subscription, 1, listener.getSubscriptionResponses().size());
      LiveDataSubscriptionResponse subscriptionResponse = listener.getSubscriptionResponses().get(0);
      assertNotNull(subscriptionResponse);
      assertEquals(LiveDataSubscriptionResult.SUCCESS, subscriptionResponse.getSubscriptionResult());
     
      assertFalse(listener.getValueUpdates().isEmpty());
      for(LiveDataValueUpdate valueUpdate : listener.getValueUpdates()) {
        assertNotNull(valueUpdate);
        Set<String> fieldNames = valueUpdate.getFields().getAllFieldNames();
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.