• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CloudDomain类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: deleteOrphanedRoutes

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
/**
 * Delete routes that do not have any application which is assigned to them.
 *
 * @return deleted routes or an empty list if no routes have been found
 */
@Override
public List<CloudRoute> deleteOrphanedRoutes() {
    List<CloudRoute> orphanRoutes = new ArrayList<>();
    for (CloudDomain cloudDomain : getDomainsForOrg()) {
        orphanRoutes.addAll(fetchOrphanRoutes(cloudDomain.getName()));
    }

    List<CloudRoute> deletedCloudRoutes = new ArrayList<>();
    for (CloudRoute orphanRoute : orphanRoutes) {
        deleteRoute(orphanRoute.getHost(), orphanRoute.getDomain().getName());
        deletedCloudRoutes.add(orphanRoute);
    }

    return deletedCloudRoutes;
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:21,代码来源:CloudControllerClientImpl.java


示例2: prepareClient

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
private void prepareClient() throws Exception {
    CloudDomain domain = mock(CloudDomain.class);
    CloudInfo info;
    if (input.portBasedRouting) {
        info = mock(CloudInfoExtended.class);
        when(((CloudInfoExtended) info).isPortBasedRouting()).thenReturn(true);
    } else {
        info = mock(CloudInfo.class);
    }

    if (info instanceof CloudInfoExtended)
        when(((CloudInfoExtended) info).getDeployServiceUrl()).thenReturn(input.deployServiceUrl);

    when(clientProvider.getPortAllocator(any(), anyString())).thenReturn(portAllocator);

    when(info.getAuthorizationEndpoint()).thenReturn(input.authorizationEndpoint);
    when(domain.getName()).thenReturn(input.defaultDomain);
    when(domain.getMeta()).thenReturn(new Meta(CLOUD_DOMAIN_GUID, null, null));

    when(client.getDefaultDomain()).thenReturn(domain);
    when(client.getCloudInfo()).thenReturn(info);
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:23,代码来源:CollectSystemParametersStepTest.java


示例3: getDefaultApplicationURL

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
/**
 * Either returns a valid, available Cloud Application URL with the given
 * subdomain, or throws {@link CoreException} if unable to generate valid
 * URL.
 * @param subDomain
 * @return Non-null, valid Cloud Application URL using an existing domain.
 */
public CloudApplicationURL getDefaultApplicationURL(String subDomain) throws CoreException {

	List<CloudDomain> domains = getDomains();
	if (domains == null || domains.isEmpty()) {

		throw CloudErrorUtil.toCoreException(NLS.bind(
				Messages.ApplicationUrlLookupService_ERROR_GETDEFAULT_APP_URL,
				cloudServer.getServerId(), subDomain));
	}

	CloudApplicationURL appURL = validateCloudApplicationUrl(new CloudApplicationURL(subDomain, domains.get(0)
			.getName()));

	return appURL;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:23,代码来源:ApplicationUrlLookupService.java


示例4: getDomainsForOrg

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
public List<CloudDomain> getDomainsForOrg(CloudOrganization org) {
	List<CloudDomain> domains = new ArrayList<CloudDomain>();
	String urlPath = API_BASE+"/organizations/"+org.getMeta().getGuid().toString()+"/domains";
	try {
		List<JSONObject> ja = ResponseObject.getResources(urlPath, token);
		for (JSONObject resource : ja) {
			JSONObject meta = resource.getJSONObject(METADATA);
			JSONObject entity = resource.getJSONObject(ENTITY);
			domains.add(new CloudDomain(new Meta(meta),entity.getString("name"),org));
		}
	}
	catch (Throwable t) {
		t.printStackTrace();
	}
	return domains;
}
 
开发者ID:stephen-kruger,项目名称:cloudfoundry-liteclient-lib,代码行数:17,代码来源:CloudFoundryClient.java


示例5: getDefaultDomain

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
@Override
public CloudDomain getDefaultDomain() {
    List<CloudDomain> sharedDomains = getSharedDomains();
    if (sharedDomains.isEmpty()) {
        return null;
    } else {
        return sharedDomains.get(0);
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:10,代码来源:CloudControllerClientImpl.java


示例6: doGetDomains

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
private List<CloudDomain> doGetDomains(CloudOrganization org) {
    Map<String, Object> urlVars = new HashMap<String, Object>();
    String urlPath = "/v2";
    if (org != null) {
        urlVars.put("org", org.getMeta().getGuid());
        urlPath = urlPath + "/organizations/{org}";
    }
    urlPath = urlPath + "/domains";
    return doGetDomains(urlPath, urlVars);
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:11,代码来源:CloudControllerClientImpl.java


示例7: mapRouteResource

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
private CloudRoute mapRouteResource(Map<String, Object> resource) {
    @SuppressWarnings("unchecked")
    List<Object> apps = getEntityAttribute(resource, "apps", List.class);
    String host = getEntityAttribute(resource, "host", String.class);
    CloudDomain domain = mapDomainResource(getEmbeddedResource(resource, "domain"));
    return new CloudRoute(getMeta(resource), host, domain, apps.size());
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:8,代码来源:CloudEntityResourceMapper.java


示例8: getDomains

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
@Test
public void getDomains() {
    connectedClient.addDomain(TEST_DOMAIN);

    List<CloudDomain> allDomains = connectedClient.getDomains();

    assertNotNull(getDomainNamed(defaultDomainName, allDomains));
    assertNotNull(getDomainNamed(TEST_DOMAIN, allDomains));
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:10,代码来源:CloudFoundryClientTest.java


示例9: clearTestDomainAndRoutes

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
private void clearTestDomainAndRoutes() {
    CloudDomain domain = getDomainNamed(TEST_DOMAIN, connectedClient.getDomains());
    if (domain != null) {
        List<CloudRoute> routes = connectedClient.getRoutes(domain.getName());
        for (CloudRoute route : routes) {
            connectedClient.deleteRoute(route.getHost(), route.getDomain().getName());
        }
        connectedClient.deleteDomain(domain.getName());
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:11,代码来源:CloudFoundryClientTest.java


示例10: getDomainNamed

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
private CloudDomain getDomainNamed(String domainName, List<CloudDomain> domains) {
    for (CloudDomain domain : domains) {
        if (domain.getName().equals(domainName)) {
            return domain;
        }
    }
    return null;
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:9,代码来源:CloudFoundryClientTest.java


示例11: getDefaultDomain

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
private String getDefaultDomain(CloudFoundryOperations client) {
    CloudDomain defaultDomain = client.getDefaultDomain();
    if (defaultDomain != null) {
        return defaultDomain.getName();
    }
    return null;
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:8,代码来源:CollectSystemParametersStep.java


示例12: getDomainNames

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
private List<String> getDomainNames(List<CloudDomain> domains) {
    List<String> domainNames = new ArrayList<>();
    for (CloudDomain domain : domains) {
        domainNames.add(domain.getName());
    }
    return domainNames;
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:8,代码来源:AddDomainsStep.java


示例13: getExistingDomainsList

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
private List<CloudDomain> getExistingDomainsList() {
    List<CloudDomain> result = new ArrayList<>();
    for (String existingDomain : existingDomains) {
        result.add(new CloudDomain(null, existingDomain, null));
    }
    return result;
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:8,代码来源:AddDomainsStepTest.java


示例14: testDeleteAllocatedRoutes1

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
@Test
public void testDeleteAllocatedRoutes1() throws Exception {
    Mockito.when(clientProvider.getCloudFoundryClient(USER, ORG, SPACE, null)).thenReturn(client);
    Mockito.when(client.getDefaultDomain()).thenReturn(new CloudDomain(null, DEFAULT_DOMAIN, null));
    Mockito.doThrow(CloudFoundryException.class).when(client).deleteRoute(Integer.toString(1), DEFAULT_DOMAIN);
    Mockito.doThrow(CloudFoundryException.class).when(client).deleteRoute(Integer.toString(3), DEFAULT_DOMAIN);

    allocatedPorts = new TreeSet<>(Arrays.asList(1, 2, 3, 4));

    abortListener.deleteAllocatedRoutes(mock(HistoryService.class), PROCESS_INSTANCE_ID);

    Mockito.verify(client).deleteRoute(Integer.toString(2), DEFAULT_DOMAIN);
    Mockito.verify(client).deleteRoute(Integer.toString(4), DEFAULT_DOMAIN);
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:15,代码来源:AbortProcessListenerTest.java


示例15: getDomain

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
protected String getDomain() throws CoreException {
	if (applicationDomain == null) {

		List<CloudDomain> domains = getBehaviour().getDomainsForSpace(new NullProgressMonitor());

		// Get a default domain
		applicationDomain = domains.get(0).getName();
		applicationDomain = applicationDomain.replace("http://", "");
	}
	return applicationDomain;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:12,代码来源:CloudFoundryTestFixture.java


示例16: getDomains

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
/**
 * 
 * @return non-null list of Domains.
 */
protected List<String> getDomains() {
	List<String> domains = new ArrayList<String>();
	List<CloudDomain> cloudDomains = lookupService.getDomains();
	if (cloudDomains != null) {
		for (CloudDomain cldm : cloudDomains) {
			domains.add(cldm.getName());
		}
	}
	return domains;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:15,代码来源:CloudApplicationUrlPart.java


示例17: updateRoutes

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
protected void updateRoutes() {

			runAsynchWithWizardProgress(new ICoreRunnable() {

				@Override
				public void run(IProgressMonitor monitor) throws CoreException {

					CloudFoundryServerBehaviour behaviour = server.getBehaviour();

					List<CloudDomain> domains = behaviour.getDomainsForSpace(monitor);

					final List<CloudRoute> allRoutes = new ArrayList<CloudRoute>();

					if (domains != null) {
						for (CloudDomain domain : domains) {

							List<CloudRoute> routes = behaviour.getRoutes(domain.getName(), monitor);
							if (routes != null) {
								allRoutes.addAll(routes);

								// Note that fetching routes per domain may be a
								// long running process.
								// Update the UI as routes are fetched to
								// indicate progress to the user (In addition to
								// the progress monitor)
								Display.getDefault().syncExec(new Runnable() {

									public void run() {
										routePart.setInput(allRoutes);
									}

								});
							}
						}
					}

				}

			}, Messages.REFRESHING_DOMAIN_ROUTES);
		}
 
开发者ID:eclipse,项目名称:cft,代码行数:41,代码来源:CloudRoutesWizard.java


示例18: getDomainsForSpace

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
public BaseClientRequest<List<CloudDomain>> getDomainsForSpace() throws CoreException {

		return new BehaviourRequest<List<CloudDomain>>(Messages.CloudFoundryServerBehaviour_DOMAINS_FOR_SPACE,
				behaviour) {
			@Override
			protected List<CloudDomain> doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException {
				return client.getDomains();
			}
		};
	}
 
开发者ID:eclipse,项目名称:cft,代码行数:11,代码来源:ClientRequestFactory.java


示例19: getDomainsFromOrgs

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
public BaseClientRequest<List<CloudDomain>> getDomainsFromOrgs() throws CoreException {
	return new BehaviourRequest<List<CloudDomain>>("Getting domains for orgs", behaviour) { //$NON-NLS-1$
		@Override
		protected List<CloudDomain> doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException {
			return client.getDomainsForOrg();
		}
	};
}
 
开发者ID:eclipse,项目名称:cft,代码行数:9,代码来源:ClientRequestFactory.java


示例20: getDomains

import org.cloudfoundry.client.lib.domain.CloudDomain; //导入依赖的package包/类
/**
 * Returns cached list of domains. If null or empty, refresh the list of
 * domains separately.
 * @return
 */
public List<CloudDomain> getDomains() {
	synchronized(domainsPerActiveSpaceLock) {
		if(domainsPerActiveSpace == null) {
			try {
				refreshDomains(new NullProgressMonitor());
			}
			catch (CoreException e) {
				// Convert to unchecked exception. 
				throw new RuntimeException(e);
			}
		}
	}
	return domainsPerActiveSpace;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:20,代码来源:ApplicationUrlLookupService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProtectionElementPrivilegeContext类代码示例发布时间:2022-05-23
下一篇:
Java EclipseStarter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap