Package com.opengamma.livedata

Examples of com.opengamma.livedata.LiveDataSpecification


*/
@Test(groups = TestGroup.UNIT)
public class LiveDataSubscriptionResponseTest {

  public void simpleConstruction() {
    LiveDataSpecification lds = new LiveDataSpecification("Foo", ExternalId.of("A", "B"));
    LiveDataSubscriptionResponse ldsr = new LiveDataSubscriptionResponse(lds,
        LiveDataSubscriptionResult.SUCCESS,
        null,
        lds,
        null,
        null);
    assertEquals("Foo", lds.getNormalizationRuleSetId());
    assertEquals(ExternalIdBundle.of("A", "B"), lds.getIdentifiers());
    assertEquals(LiveDataSubscriptionResult.SUCCESS, ldsr.getSubscriptionResult());
    assertEquals(lds, ldsr.getRequestedSpecification());
  }
View Full Code Here


  public void nonpersistentSubscription() {
    getMethods("nonpersistent", false);
  }

  private LiveDataSpecification getSpec(String uniqueId) {
    LiveDataSpecification spec = new LiveDataSpecification(
        _server.getDefaultNormalizationRuleSetId(),
        ExternalId.of(_server.getUniqueIdDomain(), uniqueId));
    return spec;
  }
View Full Code Here

        ExternalId.of(_server.getUniqueIdDomain(), uniqueId));
    return spec;
  }

  private void getMethods(String uniqueId, boolean persistent) {
    LiveDataSpecification spec = getSpec(uniqueId);

    LiveDataSubscriptionResponse result = _server.subscribe(uniqueId, persistent);

    assertNotNull(result);
    assertTrue(result.getSubscriptionResult() == LiveDataSubscriptionResult.SUCCESS);
View Full Code Here

  }

  public void subscribeUnsubscribeC() {
    UserPrincipal user = new UserPrincipal("mark", "1.1.1.1");

    LiveDataSpecification requestedSpec = new LiveDataSpecification(
        StandardRules.getNoNormalization().getId(),
        ExternalId.of(_domain, "testsub"));

    LiveDataSubscriptionRequest request = new LiveDataSubscriptionRequest(
        user,
View Full Code Here

    assertEquals(1, _server.getNumActiveSubscriptions());

    Subscription sub = _server.getSubscription("mysub");
    assertEquals(1, sub.getDistributors().size());

    LiveDataSpecification spec = getSpec("mysub");
    MarketDataDistributor distributor = _server.getMarketDataDistributor(spec);
    assertNotNull(distributor);

    assertFalse(_server.stopDistributor(distributor));
    distributor.setPersistent(false);
View Full Code Here

  }

  public void snapshot() {
    UserPrincipal user = new UserPrincipal("mark", "1.1.1.1");

    LiveDataSpecification requestedSpec = new LiveDataSpecification(
        StandardRules.getNoNormalization().getId(),
        ExternalId.of(_domain, "testsub"));

    LiveDataSubscriptionRequest request = new LiveDataSubscriptionRequest(
        user,
View Full Code Here

   
    ArrayList<LiveDataSpecification> specs = new ArrayList<>();
    for (SubscriptionHandle subHandle : subHandles) {

      // TODO - as a LiveDataSpec is immutable, why do we copy rather than just use it?
      specs.add(new LiveDataSpecification(subHandle.getRequestedSpecification()));
     
      if (user == null) {
        user = subHandle.getUser();
      } else if (!user.equals(subHandle.getUser())) {
        throw new OpenGammaRuntimeException("Not all usernames are equal");       
View Full Code Here

    return returnValue;
  }

  public synchronized void addPersistentSubscription(String securityUniqueId) {
    LiveDataSpecification spec = getFullyQualifiedLiveDataSpec(securityUniqueId);
    addPersistentSubscription(new PersistentSubscription(spec));
    updateServer(false);
  }
View Full Code Here

    DBCursor cursor = _mongoCollection.find();
    while (cursor.hasNext()) {
      DBObject mainObject = cursor.next();
      DBObject fieldData = (DBObject) mainObject.get("fieldData");
      MutableFudgeMsg msg = serializer.objectToFudgeMsg(fieldData);
      LiveDataSpecification spec = LiveDataSpecificationFudgeBuilder.fromFudgeMsg(deserializer, msg);
      addPersistentSubscription(new PersistentSubscription(spec));
    }
  }
View Full Code Here

   * Converts this specification to a {@code LiveDataSpecification}.
   *
   * @return the live data specification, not null
   */
  public LiveDataSpecification getFullyQualifiedLiveDataSpecification() {
    return new LiveDataSpecification(_normalizationRuleSet.getId(), _marketDataId);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.livedata.LiveDataSpecification

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.