Package com.opengamma.master.config

Examples of com.opengamma.master.config.ConfigMetaDataResult


  }

  @Test
  public void test_metaData() {
    ConfigMetaDataRequest request = new ConfigMetaDataRequest();
    ConfigMetaDataResult result = _cfgMaster.metaData(request);
    assertNotNull(result);
    assertEquals(2, result.getConfigTypes().size());
    assertTrue(result.getConfigTypes().contains(ExternalId.class));
    assertTrue(result.getConfigTypes().contains(ExternalIdBundle.class));
  }
View Full Code Here


  }

  public void test_metaData_noTypes() {
    ConfigMetaDataRequest request = new ConfigMetaDataRequest();
    request.setConfigTypes(false);
    ConfigMetaDataResult result = _cfgMaster.metaData(request);
    assertNotNull(result);
    assertEquals(0, result.getConfigTypes().size());
  }
View Full Code Here

    assertEquals(_item2, result.getFirstDocument().getConfig());
  }

  //-------------------------------------------------------------------------
  public void test_metaData() {
    ConfigMetaDataResult test = _testPopulated.metaData(new ConfigMetaDataRequest());
    assertNotNull(test);
    assertEquals(2, test.getConfigTypes().size());
    assertTrue(test.getConfigTypes().contains(ExternalId.class));
    assertTrue(test.getConfigTypes().contains(ExternalIdBundle.class));
  }
View Full Code Here

  }

  public void test_metaData_noTypes() {
    ConfigMetaDataRequest request = new ConfigMetaDataRequest();
    request.setConfigTypes(false);
    ConfigMetaDataResult test = _testPopulated.metaData(request);
    assertNotNull(test);
    assertEquals(0, test.getConfigTypes().size());
  }
View Full Code Here

      throw new IllegalArgumentException("Destination directory " + getDestinationDirectory() + " must exist and be a directory.");
    }
   
    ConfigMetaDataRequest request = new ConfigMetaDataRequest();
    request.setConfigTypes(true);
    ConfigMetaDataResult result = getConfigMaster().metaData(request);
   
    for (Class<?> clazz : result.getConfigTypes()) {
      outputFilesForConfigClass(clazz);
    }
  }
View Full Code Here

  public ConfigMetaDataResult metaData(ConfigMetaDataRequest request) {
    ArgumentChecker.notNull(request, "request");
   
    Timer.Context context = _metaDataTimer.time();
    try {
      ConfigMetaDataResult result = new ConfigMetaDataResult();
      if (request.isConfigTypes()) {
        final String sql = getElSqlBundle().getSql("SelectTypes");
        List<String> configTypes = getJdbcTemplate().getJdbcOperations().queryForList(sql, String.class);
        for (String configType : configTypes) {
          try {
            result.getConfigTypes().add(ClassUtils.loadClass(configType));
          } catch (ClassNotFoundException ex) {
            s_logger.warn("Unable to load class", ex);
          }
        }
      }
View Full Code Here

  @GET
  @Path("metaData")
  public Response metaData(@Context UriInfo uriInfo) {
    ConfigMetaDataRequest request = RestUtils.decodeQueryParams(uriInfo, ConfigMetaDataRequest.class);
    ConfigMetaDataResult result = getConfigMaster().metaData(request);
    return responseOkFudge(result);
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Override
  public ConfigMetaDataResult metaData(final ConfigMetaDataRequest request) {
    ArgumentChecker.notNull(request, "request");
    final ConfigMetaDataResult result = new ConfigMetaDataResult();
    if (request.isConfigTypes()) {
      final Set<Class<?>> types = Sets.newHashSet();
      for (final ConfigDocument doc : _store.values()) {
        types.add(doc.getConfig().getType());
      }
      result.getConfigTypes().addAll(types);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.config.ConfigMetaDataResult

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.