Package com.opengamma.provider.security

Examples of com.opengamma.provider.security.SecurityProviderResult


  // delegate convenience methods to request/result method
  // code copied from AbstractSecurityProvider due to lack of multiple inheritance
  @Override
  public Security getSecurity(ExternalIdBundle externalIdBundle) {
    SecurityProviderRequest request = SecurityProviderRequest.createGet(externalIdBundle, null);
    SecurityProviderResult result = getSecurities(request);
    return result.getResultMap().get(externalIdBundle);
  }
View Full Code Here


  }

  @Override
  public Map<ExternalIdBundle, Security> getSecurities(Collection<ExternalIdBundle> externalIdBundles) {
    SecurityProviderRequest request = SecurityProviderRequest.createGet(externalIdBundles, null);
    SecurityProviderResult result = getSecurities(request);
    return result.getResultMap();
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Override
  protected SecurityProviderResult doBulkGet(SecurityProviderRequest request) {
    Map<ExternalIdBundle, ManageableSecurity> map = _bloombergBulkSecurityLoader.loadSecurity(request.getExternalIdBundles());
    return new SecurityProviderResult(map);
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Override
  public Security getSecurity(ExternalIdBundle externalIdBundle) {
    SecurityProviderRequest request = SecurityProviderRequest.createGet(externalIdBundle, null);
    SecurityProviderResult result = getSecurities(request);
    return result.getResultMap().get(externalIdBundle);
  }
View Full Code Here

  }

  @Override
  public Map<ExternalIdBundle, Security> getSecurities(Collection<ExternalIdBundle> externalIdBundles) {
    SecurityProviderRequest request = SecurityProviderRequest.createGet(externalIdBundles, null);
    SecurityProviderResult result = getSecurities(request);
    return result.getResultMap();
  }
View Full Code Here

    ArgumentChecker.isTrue(request.getDataSource() == null ||
        request.getDataSource().matches(_dataSourceRegex), "Unsupported data source: " + request.getDataSource());
   
    // short-cut empty case
    if (request.getExternalIdBundles().isEmpty()) {
      return new SecurityProviderResult();
    }
   
    // get securities
    return doBulkGet(request);
  }
View Full Code Here

  }

  @POST  // should be a get, but query is too large
  @Path("securityGet")
  public Response getSecurity(SecurityProviderRequest request) {
    SecurityProviderResult result = getSecurityProvider().getSecurities(request);
    return responseOkFudge(result);
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Override
  protected SecurityProviderResult doBulkGet(SecurityProviderRequest request) {
    SecurityProviderResult result = new SecurityProviderResult();
    for (ExternalIdBundle bundle : request.getExternalIdBundles()) {
      result.getResultMap().put(bundle, null);
    }
    return result;
  }
View Full Code Here

  @Test
  public void test_get_request() {
    NoneFoundSecurityProvider test = new NoneFoundSecurityProvider();
    SecurityProviderRequest request = SecurityProviderRequest.createGet(BUNDLE, "FOO");
    SecurityProviderResult expected = new SecurityProviderResult();
    expected.getResultMap().put(BUNDLE, null);
    assertEquals(expected, test.getSecurities(request));
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Test
  public void testGet() {
    final SecurityProviderRequest request = SecurityProviderRequest.createGet(
        ExternalIdBundle.of("A", "B"), "S");
    final SecurityProviderResult result = new SecurityProviderResult();
   
    when(_underlying.getSecurities(same(request))).thenReturn(result);
   
    Response test = _resource.getSecurity(request);
    assertEquals(Status.OK.getStatusCode(), test.getStatus());
View Full Code Here

TOP

Related Classes of com.opengamma.provider.security.SecurityProviderResult

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.