当前位置: 首页>>代码示例>>Java>>正文


Java ServiceDefinition类代码示例

本文整理汇总了Java中org.cloudfoundry.community.servicebroker.model.ServiceDefinition的典型用法代码示例。如果您正苦于以下问题:Java ServiceDefinition类的具体用法?Java ServiceDefinition怎么用?Java ServiceDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ServiceDefinition类属于org.cloudfoundry.community.servicebroker.model包,在下文中一共展示了ServiceDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: catalog

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Bean
public Catalog catalog() throws ScriptException, ParseException {

    return new Catalog(Arrays.asList(
            new ServiceDefinition(
                    this.serviceDefinitionId,
                    this.serviceDefinitionId,
                    "Dump and restore data from your database (db-dumper-service v" + version + ")",
                    true,
                    true,
                    this.getPlans(), //TODO: change it cause set to free
                    Arrays.asList("db-dumper-service", "dump", "restore"),
                    getServiceDefinitionMetadata(),
                    null,
                    this.getDashboardClient())));
}
 
开发者ID:orange-cloudfoundry,项目名称:db-dumper-service,代码行数:17,代码来源:CatalogConfig.java

示例2: catalog

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Bean
public Catalog catalog() {		
	return new Catalog( Arrays.asList(
			new ServiceDefinition(
				"sentimentr", 
				"sentimentr", 
				"A sentiment analysis service based on stanford university nlp framework", 
				true, 
				false,
				Arrays.asList(
						new Plan("development", 
								"development", 
								"This is a developer sentimentr plan. Limited service quality.",
								getDevelopmentPlanMetadata(), true), 
						new Plan("production", 
								"production", 
								"This is a production sentimentr plan. Best service quality.",
								getProductionPlanMetadata())),
				Arrays.asList("sentimentr", "uri"),
				getServiceDefinitionMetadata(),
				null,
				null)));
}
 
开发者ID:dflick-pivotal,项目名称:sentimentr-release,代码行数:24,代码来源:CatalogConfig.java

示例3: catalogConfig_configurationInApplicationYml_configLoaded

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Test
public void catalogConfig_configurationInApplicationYml_configLoaded() {

    List<ServiceDefinition> serviceDefinitions = catalog.getServiceDefinitions();
    assertThat(serviceDefinitions.size(), equalTo(1));

    ServiceDefinition serviceDefinition = serviceDefinitions.get(0);
    assertThat(serviceDefinition.getDashboardClient(), equalTo(null));
    assertThat(serviceDefinition.getDescription(), equalTo("fake_desc"));
    assertThat(serviceDefinition.getId(), equalTo("fake_id"));
    assertThat(serviceDefinition.getMetadata().size(), equalTo(1));
    assertThat(serviceDefinition.getMetadata().get("imageUrl"), equalTo("fake_image"));
    assertThat(serviceDefinition.getName(), equalTo("fake_name"));
    assertThatPlanListsAreEqual(serviceDefinition.getPlans(), Arrays.asList(
        new Plan("fake_baseID-fake_plan_id", "fake_name", "fake_desc", null, true),
        new Plan("fake_baseID-fake_plan_id2", "fake_name2", "fake_desc2", null, false)
    ));
    assertThat(serviceDefinition.getRequires(), equalTo(Arrays.asList("syslog_drain")));
    assertThat(serviceDefinition.getTags(), emptyCollectionOf(String.class));
    assertThat(serviceDefinition.isBindable(), equalTo(true));
    assertThat(serviceDefinition.isPlanUpdateable(), equalTo(true));
}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:23,代码来源:CatalogConfigIntegrationTest.java

示例4: case1_fetchCatalogSucceedsWithCredentials

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
/**
 * cf marketplace
 * cf create-service-broker
 * <p>
 * Fetch Catalog (GET /v2/catalog)
 */

@Override
@Test
public void case1_fetchCatalogSucceedsWithCredentials() throws Exception {
    // same as super code, but we need the response here
    ValidatableResponse response = given().auth().basic(username, password).header(apiVersionHeader).when().get(fetchCatalogPath).then().statusCode(HttpStatus.SC_OK);

    BrokerConfiguration brokerConfiguration = new BrokerConfiguration();
    ServiceDefinition serviceDefinition = brokerConfiguration.catalog().getServiceDefinitions().get(0);

    response.body("services[0].id", equalTo(serviceDefinition.getId()));
    response.body("services[0].name", equalTo(serviceDefinition.getName()));
    response.body("services[0].description", equalTo(serviceDefinition.getDescription()));
    response.body("services[0].requires", equalTo(serviceDefinition.getRequires()));
    response.body("services[0].tags", equalTo(serviceDefinition.getTags()));

    List<String> planIds = new ArrayList<String>();
    for(Plan plan: serviceDefinition.getPlans()) {
        planIds.add(plan.getId());
    }
    response.body("services[0].plans.id", equalTo(planIds));
}
 
开发者ID:cloudfoundry-community,项目名称:postgresql-cf-service-broker,代码行数:29,代码来源:PostgreSQLServiceBrokerV2IntegrationTests.java

示例5: createBucketForInstance

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
public Bucket createBucketForInstance(String instanceId, ServiceDefinition service, String planId,
        String organizationGuid, String spaceGuid) {
    String bucketName = getBucketNameForInstance(instanceId);
    logger.info("Creating bucket '{}' for serviceInstanceId '{}'", bucketName, instanceId);
    Bucket bucket = s3.createBucket(bucketName, Region.fromValue(region));

    // TODO allow for additional, custom tagging options
    BucketTaggingConfiguration bucketTaggingConfiguration = new BucketTaggingConfiguration();
    TagSet tagSet = new TagSet();
    tagSet.setTag("serviceInstanceId", instanceId);
    tagSet.setTag("serviceDefinitionId", service.getId());
    tagSet.setTag("planId", planId);
    tagSet.setTag("organizationGuid", organizationGuid);
    tagSet.setTag("spaceGuid", spaceGuid);
    bucketTaggingConfiguration.withTagSets(tagSet);
    s3.setBucketTaggingConfiguration(bucket.getName(), bucketTaggingConfiguration);

    return bucket;
}
 
开发者ID:cloudfoundry-community,项目名称:s3-cf-service-broker,代码行数:20,代码来源:S3.java

示例6: catalog

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Bean
public Catalog catalog() {
    return new Catalog(Collections.singletonList(
            new ServiceDefinition(
                    serviceDefinitionId,
                    serviceDefinitionId,
                    "Automatically register a Cloud Foundry app to an oauth2 provider",
                    true,
                    false,
                    this.getPlans(),
                    Arrays.asList("oauth", "sso"),
                    getServiceDefinitionMetadata(),
                    null,
                    this.getDashboardClient())));
}
 
开发者ID:cloudfoundry-community,项目名称:oauth-register-broker,代码行数:16,代码来源:CatalogConfig.java

示例7: init

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Before
public void init() {
    initMocks(this);
    plan1 = this.createPlan(dbDumperPlanId1, costPlanId1);
    plan2 = this.createPlan(dbDumperPlanId2, costPlanId2);
    dbDumperPlan1 = new DbDumperPlan(dbDumperPlanId1);
    dbDumperPlan2 = new DbDumperPlan(dbDumperPlanId2);
    bootSequencePlan.currency = currency;
    bootSequencePlan.isFree = false;
    List<Plan> plans = Arrays.asList(plan1, plan2);
    List<ServiceDefinition> serviceDefinitions = Arrays.asList(new ServiceDefinition("1", "name-1", "desc", true, plans));
    when(catalog.getServiceDefinitions()).thenReturn(serviceDefinitions);
    when(dbDumperPlanRepo.findOne(dbDumperPlanId1)).thenReturn(dbDumperPlan1);
    when(dbDumperPlanRepo.findOne(dbDumperPlanId2)).thenReturn(dbDumperPlan2);
}
 
开发者ID:orange-cloudfoundry,项目名称:db-dumper-service,代码行数:16,代码来源:BootSequencePlanTest.java

示例8: catalog

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Bean
Catalog catalog() {
    List<Plan> plans = Collections.singletonList(new Plan("ftp-free", "ftp-free", "'Everybody gets an FTP!'",
            Collections.singletonMap("plan-metadata", "plan-metadata-description"), true));
    List<ServiceDefinition> serviceDefinitions = Collections.singletonList(
            new ServiceDefinition("ftp", "ftp", "Apache Mina FTP", true, true, plans,
                    Collections.singletonList("ftp"),
                    Collections.emptyMap(),
                    Collections.emptyList(),
                    null));
    return new Catalog(serviceDefinitions);
}
 
开发者ID:joshlong,项目名称:cloudfoundry-ftp-service-broker,代码行数:13,代码来源:Application.java

示例9: LCCatalogConfig

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
public LCCatalogConfig() {
	List<Plan> plans = new ArrayList<Plan>();
	plans.add(new Plan(PRODUCTION, PRODUCTION, "The production datasource",
			getProdMetadata()));
	plans.add(new Plan(COPY, COPY, "Copy of production datasource",
			getCopyMetadata()));
	postgresServiceDefinition = new ServiceDefinition("lifecycle-sb",
			"lifecycle-sb", "Postgres Running in AWS", true, plans);
	postgresServiceDefinition.setPlanUpdatable(false);
}
 
开发者ID:krujos,项目名称:data-lifecycle-service-broker,代码行数:11,代码来源:LCCatalogConfig.java

示例10: createServiceInstance

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
private void createServiceInstance() throws Exception {
	ServiceDefinition serviceDef = new LCCatalogConfig().catalog()
			.getServiceDefinitions().get(0);
	CreateServiceInstanceRequest createServiceInstanceRequest = new CreateServiceInstanceRequest(
			serviceDef.getId(), PRODUCTION, "org_guid", "space_guid", true)
			.withServiceInstanceId("service_instance_id").and()
			.withServiceDefinition(serviceDef).withAsyncClient(true);

	instance = service.createServiceInstance(createServiceInstanceRequest);
	verify(copyProvider, never()).createCopy(any());
}
 
开发者ID:krujos,项目名称:data-lifecycle-service-broker,代码行数:12,代码来源:LCServiceInstanceServiceProdTest.java

示例11: catalog

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Bean
public Catalog catalog() {
    return new Catalog(Arrays.asList(new ServiceDefinition(
        serviceId,
        serviceName,
        serviceDescription,
        true,                           //bindable
        true,                           //plan updateable
        plans(),
        null,                           //tags
        serviceDefinitionMetadata(),
        requirements(),
        null                            //dashboardClient
    )));
}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:16,代码来源:CatalogConfig.java

示例12: catalog

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Bean
public Catalog catalog() {
  final String SERVICE_ID = configuration.getCfServiceId();
  final String SERVICE_NAME = configuration.getCfServiceName();
  final String DESCRIPTION = "A simple h2o broker";
  final boolean BINDABLE = true;
  final boolean UPDATEABLE = true;
  final List<String> TAGS = Arrays.asList("data-science-tool");
  final String SYSLOG_DRAIN = "syslog_drain";
  final DashboardClient NO_DASHBOARD = null;

  return new Catalog(Arrays.asList(new ServiceDefinition(SERVICE_ID, SERVICE_NAME, DESCRIPTION,
      BINDABLE, UPDATEABLE, getSharedPlans(), TAGS, getServiceDefinitionMetadata(),
      Arrays.asList(SYSLOG_DRAIN), NO_DASHBOARD)));
}
 
开发者ID:trustedanalytics,项目名称:h2o-broker,代码行数:16,代码来源:CatalogConfig.java

示例13: catalog

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
@Bean
public Catalog catalog() {
	return new Catalog(Arrays.asList(new ServiceDefinition("greenplum",
			"greenplum", "Provides Greenplum DB connection strings", true, false,
			Arrays.asList(new Plan("retail-demo", "retail-demo",
					"This is retail-demo plan for test db on vShere EMEA env.",
					getRetailDemoPlanMetadata(), true)), 
					Arrays.asList(
					"greenplum", "uri"), getServiceDefinitionMetadata(),
			null, null)));
}
 
开发者ID:Pivotal-Field-Engineering,项目名称:pcf-gpbroker-retailclient,代码行数:12,代码来源:CatalogConfig.java

示例14: getCreateServiceInstanceRequest

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
public static CreateServiceInstanceRequest getCreateServiceInstanceRequest() {
	ServiceDefinition service = ServiceFixture.getService();
	return new CreateServiceInstanceRequest(
			service.getId(), 
			service.getPlans().get(0).getId(),
			DataFixture.getOrgOneGuid(),
			DataFixture.getSpaceOneGuid(),
			false,
			ParametersFixture.getParameters()
	);
}
 
开发者ID:cloudfoundry-community,项目名称:spring-boot-cf-service-broker,代码行数:12,代码来源:ServiceInstanceFixture.java

示例15: getService

import org.cloudfoundry.community.servicebroker.model.ServiceDefinition; //导入依赖的package包/类
public static ServiceDefinition getService() {
	return new ServiceDefinition(
			"service-one-id", 
			"Service One", 
			"Description for Service One", 
			true,
			PlanFixture.getAllPlans());
}
 
开发者ID:cloudfoundry-community,项目名称:spring-boot-cf-service-broker,代码行数:9,代码来源:ServiceFixture.java


注:本文中的org.cloudfoundry.community.servicebroker.model.ServiceDefinition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。