Package com.opengamma.master.security

Examples of com.opengamma.master.security.SecurityHistoryRequest


    assertEquals(base.getVersionToInstant(), old.getVersionToInstant());
    assertEquals(base.getCorrectionFromInstant(), old.getCorrectionFromInstant());
    assertEquals(now, old.getCorrectionToInstant())// old version ended
    assertEquals(base.getSecurity(), old.getSecurity());
   
    SecurityHistoryRequest search = new SecurityHistoryRequest(base.getUniqueId(), now, null);
    search.setFullDetail(false);
    SecurityHistoryResult searchResult = _secMaster.history(search);
    assertEquals(2, searchResult.getDocuments().size());
  }
View Full Code Here


    assertEquals(now, old.getVersionToInstant())// old version ended
    assertEquals(base.getCorrectionFromInstant(), old.getCorrectionFromInstant());
    assertEquals(base.getCorrectionToInstant(), old.getCorrectionToInstant());
    assertEquals(base.getSecurity(), old.getSecurity());
   
    SecurityHistoryRequest search = new SecurityHistoryRequest(base.getUniqueId(), null, now);
    search.setFullDetail(false);
    SecurityHistoryResult searchResult = _secMaster.history(search);
    assertEquals(2, searchResult.getDocuments().size());
  }
View Full Code Here

    }
  }

  @Override
  protected AbstractHistoryResult<SecurityDocument> historyByVersionsCorrections(AbstractHistoryRequest request) {
    SecurityHistoryRequest historyRequest = new SecurityHistoryRequest();
    historyRequest.setCorrectionsFromInstant(request.getCorrectionsFromInstant());
    historyRequest.setCorrectionsToInstant(request.getCorrectionsToInstant());
    historyRequest.setVersionsFromInstant(request.getVersionsFromInstant());
    historyRequest.setVersionsToInstant(request.getVersionsToInstant());
    historyRequest.setObjectId(request.getObjectId());
    return history(historyRequest);
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @GET
  public String getHTML() {
    SecurityHistoryRequest request = new SecurityHistoryRequest(data().getSecurity().getUniqueId());
    SecurityHistoryResult result = data().getSecurityMaster().history(request);
   
    FlexiBean out = createRootData();
    out.put("versionsResult", result);
    out.put("versions", result.getSecurities());
View Full Code Here

  public Response getJSON(
      @QueryParam("pgIdx") Integer pgIdx,
      @QueryParam("pgNum") Integer pgNum,
      @QueryParam("pgSze") Integer pgSze) {
    PagingRequest pr = buildPagingRequest(pgIdx, pgNum, pgSze);
    SecurityHistoryRequest request = new SecurityHistoryRequest(data().getSecurity().getUniqueId());
    request.setPagingRequest(pr);
    SecurityHistoryResult result = data().getSecurityMaster().history(request);
   
    FlexiBean out = createRootData();
    out.put("versionsResult", result);
    out.put("versions", result.getSecurities());
View Full Code Here

    UniqueId oid = UniqueId.parse(idStr);
    try {
      SecurityDocument doc = data().getSecurityMaster().get(oid);
      data().setSecurity(doc);
    } catch (DataNotFoundException ex) {
      SecurityHistoryRequest historyRequest = new SecurityHistoryRequest(oid);
      historyRequest.setPagingRequest(PagingRequest.ONE);
      SecurityHistoryResult historyResult = data().getSecurityMaster().history(historyRequest);
      if (historyResult.getDocuments().size() == 0) {
        return null;
      }
      data().setSecurity(historyResult.getFirstDocument());
View Full Code Here

  //-------------------------------------------------------------------------
  @GET
  @Path("versions")
  public Response history(@Context UriInfo uriInfo) {
    SecurityHistoryRequest request = RestUtils.decodeQueryParams(uriInfo, SecurityHistoryRequest.class);
    if (getUrlId().equals(request.getObjectId()) == false) {
      throw new IllegalArgumentException("Document objectId does not match URI");
    }
    SecurityHistoryResult result = getMaster().history(request);
    return responseOkFudge(result);
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Test
  public void test_history_documents() {
    ObjectId oid = ObjectId.of("DbSec", "201");
    SecurityHistoryRequest request = new SecurityHistoryRequest(oid);
    SecurityHistoryResult test = _secMaster.history(request);
   
    assertEquals(2, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
    assert201(test.getDocuments().get(1));
View Full Code Here

  }

  @Test
  public void test_history_documentCountWhenMultipleSecuritys() {
    ObjectId oid = ObjectId.of("DbSec", "102");
    SecurityHistoryRequest request = new SecurityHistoryRequest(oid);
    SecurityHistoryResult test = _secMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
   
    assertEquals(1, test.getDocuments().size());
View Full Code Here

  //-------------------------------------------------------------------------
  @Test
  public void test_history_noInstants() {
    ObjectId oid = ObjectId.of("DbSec", "201");
    SecurityHistoryRequest request = new SecurityHistoryRequest(oid);
    SecurityHistoryResult test = _secMaster.history(request);
   
    assertEquals(PagingRequest.ALL, test.getPaging().getRequest());
    assertEquals(2, test.getPaging().getTotalItems());
   
View Full Code Here

TOP

Related Classes of com.opengamma.master.security.SecurityHistoryRequest

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.