Package com.opengamma.id

Examples of com.opengamma.id.UniqueId


      case 0:
        s_logger.info("Creating new portfolio");
        portfolioMaster.add(new PortfolioDocument(portfolio));
        break;
      case 1:
        final UniqueId previousId = result.getDocuments().get(0).getUniqueId();
        s_logger.info("Updating portfolio {}", previousId);
        portfolio.setUniqueId(previousId);
        final PortfolioDocument document = new PortfolioDocument(portfolio);
        document.setUniqueId(previousId);
        portfolioMaster.update(document);
View Full Code Here


    String clientId = _webPushTestUtils.handshake();
    String restUrl = "/jax/test/positions";
    // this REST request should set up a subscription for any changes in the position master
    _webPushTestUtils.readFromPath(restUrl, clientId);
    // send a change event
    UniqueId uid = UniqueId.of("Tst", "101");
    _positionChangeManager.entityChanged(ChangeType.CHANGED, uid.getObjectId(), null, null, Instant.now());
    // connect to the long-polling URL to receive notification of the change
    String json = _webPushTestUtils.readFromPath("/updates/" + clientId);
    WebPushTestUtils.checkJsonResults(json, restUrl);
  }
View Full Code Here

      if (ComputationTargetSpecification.NULL.equals(targetSpecification)) {
        idScheme = null;
        idValue = null;
        idVersion = null;
      } else {
        UniqueId uniqueId = targetSpecification.getUniqueId();
        idScheme = uniqueId.getScheme();
        idValue = uniqueId.getValue();
        idVersion = uniqueId.getVersion();
      }
      attribs.put("id_scheme", idScheme);
      attribs.put("id_value", idValue);
      attribs.put("id_version", idVersion);
      attribs.put("type", targetSpecification.getType().toString());
View Full Code Here

    ExternalIdBundleWithDates bundle = ExternalIdBundleWithDates.of(id);
    info.setExternalIdBundle(bundle);
    HistoricalTimeSeriesInfoDocument doc = new HistoricalTimeSeriesInfoDocument(info);
    HistoricalTimeSeriesInfoDocument test = _htsMaster.add(doc);
   
    UniqueId uniqueId = test.getUniqueId();
    assertNotNull(uniqueId);
    assertEquals("DbHts", uniqueId.getScheme());
    assertTrue(uniqueId.isVersioned());
    assertTrue(Long.parseLong(uniqueId.getValue()) >= 1000);
    assertEquals("0", uniqueId.getVersion());
    assertEquals(now, test.getVersionFromInstant());
    assertEquals(null, test.getVersionToInstant());
    assertEquals(now, test.getCorrectionFromInstant());
    assertEquals(null, test.getCorrectionToInstant());
    ManageableHistoricalTimeSeriesInfo testInfo = test.getInfo();
View Full Code Here

        return getFXMultiplierFromExternalId(bundle.getExternalId(ExternalSchemes.BLOOMBERG_TICKER), multiplier);
      } else if (bundle.getExternalId(ExternalSchemes.BLOOMBERG_TICKER_WEAK) != null) {
        return getFXMultiplierFromExternalId(bundle.getExternalId(ExternalSchemes.BLOOMBERG_TICKER_WEAK), multiplier);
      }
    } else if (id instanceof UniqueId) {
      final UniqueId uid = (UniqueId) id;
      return getFXMultiplierFromExternalId(ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, uid.getValue()), multiplier);
    }
    throw new OpenGammaRuntimeException("id was not FX rate, which shouldn't happen");
  }
View Full Code Here

        return isFXRateFromBloombergTicker(bundle.getExternalId(ExternalSchemes.BLOOMBERG_TICKER));
      } else if (bundle.getExternalId(ExternalSchemes.BLOOMBERG_TICKER_WEAK) != null) {
        return isFXRateFromBloombergTicker(bundle.getExternalId(ExternalSchemes.BLOOMBERG_TICKER_WEAK));
      }
    } else if (id instanceof UniqueId) {
      final UniqueId uid = (UniqueId) id;
      return isFXRateFromBloombergTicker(ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, uid.getValue()));
    }
    return false;
  }
View Full Code Here

      return msg;
    }

    @Override
    public SecurityNotional buildObject(FudgeDeserializer deserializer, FudgeMsg msg) {
      UniqueId id = UniqueIdFudgeBuilder.fromFudgeMsg(deserializer, msg.getMessage(NOTIONAL_IDENTIFIER_FIELD_NAME));
      return new SecurityNotional(id);
    }
View Full Code Here

    ArgumentChecker.notNull(document.getOrganization().getObligor().getStandardAndPoorsCreditRating(),
                            "organization.trade.obligor_standard_and_poors_credit_rating");

    final long docId = nextId("org_organisation_seq");
    final long docOid = (document.getUniqueId() != null ? extractOid(document.getUniqueId()) : docId);
    final UniqueId organizationUid = createUniqueId(docOid, docId);
    final ManageableOrganization organization = document.getOrganization();

    // the arguments for inserting into the organization table
    final DbMapSqlParameterSource docArgs = new DbMapSqlParameterSource()
        .addValue("doc_id", docId)
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_history_documents_noInstants_node_depthZero() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertEquals(2, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
View Full Code Here

    assert201(test.getDocuments().get(1));
  }

  @Test
  public void test_history_documents_noInstants_node_depthOne() {
    UniqueId oid = UniqueId.of("DbPrt", "101");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setDepth(1);
    PortfolioHistoryResult test = _prtMaster.history(request);
    assert101(test.getDocuments().get(0), 1);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.id.UniqueId

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.