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

Java ApplicationArchive类代码示例

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

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



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

示例1: uploadApplication

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public void uploadApplication(String appName, ApplicationArchive archive, UploadStatusCallback callback) throws IOException {
    Assert.notNull(appName, "AppName must not be null");
    Assert.notNull(archive, "Archive must not be null");
    UUID appId = getAppId(appName);

    if (callback == null) {
        callback = UploadStatusCallback.NONE;
    }
    CloudResources knownRemoteResources = getKnownRemoteResources(archive);
    callback.onCheckResources();
    callback.onMatchedFileNames(knownRemoteResources.getFilenames());
    UploadApplicationPayload payload = new UploadApplicationPayload(archive, knownRemoteResources);
    callback.onProcessMatchedResources(payload.getTotalUncompressedSize());
    HttpEntity<?> entity = generatePartialResourceRequest(payload, knownRemoteResources);
    ResponseEntity<Map<String, Object>> responseEntity = getRestTemplate().exchange(getUrl("/v2/apps/{guid}/bits?async=true"),
        HttpMethod.PUT, entity, new ParameterizedTypeReference<Map<String, Object>>() {
        }, appId);
    processAsyncJob(responseEntity.getBody(), callback);
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:21,代码来源:CloudControllerClientImpl.java


示例2: shouldPackOnlyMissingResources

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Test
public void shouldPackOnlyMissingResources() throws Exception {
    ZipFile zipFile = new ZipFile(SampleProjects.springTravel());
    try {
        ApplicationArchive archive = new ZipApplicationArchive(zipFile);
        CloudResources allResources = new CloudResources(archive);
        List<CloudResource> resources = new ArrayList<CloudResource>(allResources.asList());
        resources.remove(0);
        CloudResources knownRemoteResources = new CloudResources(resources);
        UploadApplicationPayload payload = new UploadApplicationPayload(archive, knownRemoteResources);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        FileCopyUtils.copy(payload.getInputStream(), bos);
        assertThat(payload.getArchive(), is(archive));
        assertThat(payload.getTotalUncompressedSize(), is(93));
        assertThat(bos.toByteArray().length, is(2451));
    } finally {
        zipFile.close();
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:20,代码来源:UploadApplicationPayloadTest.java


示例3: getKnownRemoteResources

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
private CloudResources getKnownRemoteResources(ApplicationArchive archive) throws IOException {
    CloudResources archiveResources = new CloudResources(archive);
    String json = JsonUtil.convertToJson(archiveResources);
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(JsonUtil.JSON_MEDIA_TYPE);
    HttpEntity<String> requestEntity = new HttpEntity<String>(json, headers);
    ResponseEntity<String> responseEntity = getRestTemplate().exchange(getUrl("/v2/resource_match"), HttpMethod.PUT, requestEntity,
        String.class);
    List<CloudResource> cloudResources = JsonUtil.convertJsonToCloudResourceList(responseEntity.getBody());
    return new CloudResources(cloudResources);
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:12,代码来源:CloudControllerClientImpl.java


示例4: CloudResources

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
/**
 * Create a new {@link CloudResources} instance for the specified {@link ApplicationArchive}.
 *
 * @param archive the application archive
 */
public CloudResources(ApplicationArchive archive) throws IOException {
    Assert.notNull(archive, "Archive must not be null");
    this.resources = new ArrayList<CloudResource>();
    for (ApplicationArchive.Entry entry : archive.getEntries()) {
        if (!entry.isDirectory()) {
            String name = entry.getName();
            long size = entry.getSize();
            String sha1 = bytesToHex(entry.getSha1Digest());
            CloudResource resource = new CloudResource(name, size, sha1);
            resources.add(resource);
        }
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:19,代码来源:CloudResources.java


示例5: UploadApplicationPayload

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
/**
 * Create a new {@link UploadApplicationPayload}.
 *
 * @param archive              the source archive
 * @param knownRemoteResources resources that are already known on the remote server
 * @throws IOException
 */
public UploadApplicationPayload(ApplicationArchive archive, CloudResources knownRemoteResources) throws
        IOException {
    this.archive = archive;
    this.totalUncompressedSize = 0;
    Set<String> matches = knownRemoteResources.getFilenames();
    this.entriesToUpload = new ArrayList<DynamicZipInputStream.Entry>();
    for (ApplicationArchive.Entry entry : archive.getEntries()) {
        if (entry.isDirectory() || !matches.contains(entry.getName())) {
            entriesToUpload.add(new DynamicZipInputStreamEntryAdapter(entry));
            totalUncompressedSize += entry.getSize();
        }
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:21,代码来源:UploadApplicationPayload.java


示例6: shouldGetFromArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Test
public void shouldGetFromArchive() throws Exception {
    ZipFile zipFile = new ZipFile(SampleProjects.springTravel());
    try {
        ApplicationArchive archive = new ZipApplicationArchive(zipFile);
        CloudResources o = new CloudResources(archive);
        List<CloudResource> l = o.asList();
        assertThat(l.size(), is(96));
        assertThat(l.get(0).getFilename(), is("index.html"));
    } finally {
        zipFile.close();
    }
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:14,代码来源:CloudResourcesTest.java


示例7: getEntries

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public Iterable<Entry> getEntries() {
	Iterable<ArchiveEntry> cfEntries = cfArchive.getEntries();
	List<ApplicationArchive.Entry> legacyEntries = new ArrayList<ApplicationArchive.Entry>();
	if (cfEntries != null) {
		for (ArchiveEntry entry : cfEntries) {
			legacyEntries.add(new V1ArchiveEntry(entry));
		}
	}
	return legacyEntries;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:12,代码来源:ApplicationUtil.java


示例8: getEntries

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public Iterable<Entry> getEntries() {
	if (entries == null) {
		entries = new ArrayList<ApplicationArchive.Entry>();
		collectEntriesPriorToDeployment(entries, resources.toArray(new IModuleResource[0]));
	}
	return entries;
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:8,代码来源:AbstractModuleResourceArchive.java


示例9: getApplicationArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public ApplicationArchive getApplicationArchive(DockerFoundryApplicationModule module,
		DockerFoundryServer cloudServer, IModuleResource[] moduleResources, IProgressMonitor monitor)
		throws CoreException {
	// No need for application archive, as the CF plugin framework generates
	// .war files for Java Web applications.
	return null;
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:8,代码来源:JavaWebApplicationDelegate.java


示例10: getIncrementalPublishArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
protected ApplicationArchive getIncrementalPublishArchive(final ApplicationDeploymentInfo deploymentInfo,
		IModule[] modules) {
	IModuleResource[] allResources = getResources(modules);
	IModuleResourceDelta[] deltas = getPublishedResourceDelta(modules);
	List<IModuleResource> changedResources = getChangedResources(deltas);
	ApplicationArchive moduleArchive = new CachingApplicationArchive(Arrays.asList(allResources), changedResources,
			modules[0], deploymentInfo.getDeploymentName());

	return moduleArchive;
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:11,代码来源:DockerFoundryServerBehaviour.java


示例11: uploadApplication

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public void uploadApplication(String appName, ApplicationArchive archive) throws IOException {
    cc.uploadApplication(appName, archive, null);
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:5,代码来源:CloudFoundryClient.java


示例12: DynamicZipInputStreamEntryAdapter

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public DynamicZipInputStreamEntryAdapter(ApplicationArchive.Entry entry) {
    this.entry = entry;
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:4,代码来源:UploadApplicationPayload.java


示例13: uploadApplication

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public void uploadApplication(String appName, ApplicationArchive archive) throws IOException {
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:4,代码来源:MockCloudFoundryClient.java


示例14: asV1ApplicationArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public static ApplicationArchive asV1ApplicationArchive(CFApplicationArchive cfArchive) {
	if (cfArchive != null) {
		return new V1ApplicationArchiveAdapter(cfArchive);
	}
	return null;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:7,代码来源:ApplicationUtil.java


示例15: getApplicationArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
public ApplicationArchive getApplicationArchive(DockerFoundryApplicationModule module,
		IModuleResource[] moduleResources) throws CoreException {
	return new ModuleResourceApplicationArchive(module.getLocalModule(), Arrays.asList(moduleResources));
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:5,代码来源:ModuleResourceApplicationDelegate.java


示例16: generateApplicationArchiveFile

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
/**
 * 
 * @param descriptor that contains the application information, and that
 * also will be updated with an archive containing the application resources
 * to be deployed to the Cloud Foundry Server
 * @param cloudModule the Cloud Foundry wrapper around the application
 * module to be pushed to the server
 * @param modules list of WTP modules.
 * @param server where app should be pushed to
 * @param
 * @param monitor
 * @throws CoreException if failure occurred while generated an archive file
 * containing the application's payload
 */
protected ApplicationArchive generateApplicationArchiveFile(ApplicationDeploymentInfo deploymentInfo,
		DockerFoundryApplicationModule cloudModule, IModule[] modules, Server server, boolean incrementalPublish,
		IProgressMonitor monitor) throws CoreException {

	// Perform local operations like building an archive file
	// and payload for the application
	// resources prior to pushing it to the server.

	// If the module is not external (meaning that it is
	// mapped to a local, accessible workspace project),
	// create an
	// archive file containing changes to the
	// application's
	// resources. Use incremental publishing if
	// possible.

	AbstractApplicationDelegate delegate = ApplicationRegistry.getApplicationDelegate(cloudModule.getLocalModule());

	ApplicationArchive archive = null;
	if (delegate != null && delegate.providesApplicationArchive(cloudModule.getLocalModule())) {
		IModuleResource[] resources = getResources(modules);

		archive = getApplicationArchive(cloudModule, monitor, delegate, resources);
	}

	// If no application archive was provided,then attempt an incremental
	// publish. Incremental publish is only supported for apps without child
	// modules.
	if (archive == null && incrementalPublish && !hasChildModules(modules)) {
		// Determine if an incremental publish
		// should
		// occur
		// For the time being support incremental
		// publish
		// only if the app does not have child
		// modules
		// To compute incremental deltas locally,
		// modules must be provided
		// Computes deltas locally before publishing
		// to
		// the server.
		// Potentially more efficient. Should be
		// used
		// only on incremental
		// builds

		archive = getIncrementalPublishArchive(deploymentInfo, modules);
	}
	return archive;

}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:66,代码来源:DockerFoundryServerBehaviour.java


示例17: getApplicationArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
private ApplicationArchive getApplicationArchive(DockerFoundryApplicationModule cloudModule,
		IProgressMonitor monitor, AbstractApplicationDelegate delegate, IModuleResource[] resources)
		throws CoreException {
	return delegate.getApplicationArchive(cloudModule, getCloudFoundryServer(), resources, monitor);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:6,代码来源:DockerFoundryServerBehaviour.java


示例18: uploadApplication

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
/**
 * Upload an application to Cloud Foundry.
 *
 * @param appName the application name
 * @param archive the application archive
 * @throws java.io.IOException
 */
void uploadApplication(String appName, ApplicationArchive archive) throws IOException;
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:9,代码来源:CloudFoundryOperations.java


示例19: getArchive

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
/**
 * Returns the source archive.
 *
 * @return the archive
 */
public ApplicationArchive getArchive() {
    return archive;
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:9,代码来源:UploadApplicationPayload.java


示例20: uploadApplication

import org.cloudfoundry.client.lib.archive.ApplicationArchive; //导入依赖的package包/类
@Override
public void uploadApplication(String appName, ApplicationArchive archive) throws IOException {

}
 
开发者ID:orange-cloudfoundry,项目名称:db-dumper-service,代码行数:5,代码来源:CloudFoundryClientFake.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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