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


Java ProgressHandler类代码示例

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


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

示例1: predownloadImagesIfRequired

import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
private static void predownloadImagesIfRequired() throws DockerException, InterruptedException {

        DockerClient client = getClient();
        LOG.warning("Commencing download of images.");
        Collection<MappingInfo> images = getInstance().getMapping().values();

        ProgressHandler handler = new LoggingBuildHandler();
        for (MappingInfo image : images) {
            List<Image> foundImages = client.listImages(DockerClient.ListImagesParam.byName(image.getTarget()));
            if (! foundImages.isEmpty()) {
                LOG.warning(String.format("Skipping download for Image [%s] because it's already available.",
                    image.getTarget()));
                continue;
            }
            client.pull(image.getTarget(), handler);
        }
    }
 
开发者ID:RationaleEmotions,项目名称:just-ask,代码行数:18,代码来源:DockerHelper.java

示例2: testCreateContainer

import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Test
public void testCreateContainer() throws Exception, MccyException {
    ContainerRequest request = new ContainerRequest();
    request.setName("server-1");
    request.setStartOnCreate(true);
    request.setAckEula(true);

    when(dockerClient.createContainer(any(ContainerConfig.class), anyString()))
            .thenReturn(new ContainerCreation("id-1"));

    ContainerConfig stubbedConfig = ContainerConfig.builder().build();
    when(containerBuilderService.buildContainerConfig(any(), any(), any()))
            .thenReturn(stubbedConfig);

    final UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString("http://localhost:8080");
    containersService.setProxyUriBuilder(uriComponentsBuilder);

    final String id = containersService.create(request, "user1",
            containerCreateStatus -> {});

    verify(dockerClient).pull(anyString(), any(ProgressHandler.class));

    final ArgumentCaptor<ContainerConfig> containerConfigCaptor =
            ArgumentCaptor.forClass(ContainerConfig.class);
    verify(dockerClient).createContainer(containerConfigCaptor.capture(), eq("server_1"));

    verify(dockerClient).startContainer(eq(id));

    Mockito.verifyNoMoreInteractions(dockerClient);

    assertThat(id, not(isEmptyOrNullString()));
    assertEquals(id, "id-1");
}
 
开发者ID:moorkop,项目名称:mccy-engine,代码行数:34,代码来源:ContainersServiceTest.java

示例3: load

import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public void load(String string, InputStream in, ProgressHandler ph) {
    throw new IllegalStateException(DISCONNECTED); 
}
 
开发者ID:amihaiemil,项目名称:comdor,代码行数:5,代码来源:Disconnected.java

示例4: create

import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public void create(String string, InputStream in, ProgressHandler ph) {
    throw new IllegalStateException(DISCONNECTED); 
}
 
开发者ID:amihaiemil,项目名称:comdor,代码行数:5,代码来源:Disconnected.java

示例5: pull

import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public void pull(String string, ProgressHandler ph) {
    throw new IllegalStateException(DISCONNECTED); 
}
 
开发者ID:amihaiemil,项目名称:comdor,代码行数:5,代码来源:Disconnected.java

示例6: push

import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public void push(String string, ProgressHandler ph) {
    throw new IllegalStateException(DISCONNECTED); 
}
 
开发者ID:amihaiemil,项目名称:comdor,代码行数:5,代码来源:Disconnected.java

示例7: build

import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public String build(Path path, ProgressHandler ph, BuildParam... bps) {
    throw new IllegalStateException(DISCONNECTED); 
}
 
开发者ID:amihaiemil,项目名称:comdor,代码行数:5,代码来源:Disconnected.java


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