本文整理汇总了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);
}
}
示例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");
}
示例3: load
import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public void load(String string, InputStream in, ProgressHandler ph) {
throw new IllegalStateException(DISCONNECTED);
}
示例4: create
import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public void create(String string, InputStream in, ProgressHandler ph) {
throw new IllegalStateException(DISCONNECTED);
}
示例5: pull
import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public void pull(String string, ProgressHandler ph) {
throw new IllegalStateException(DISCONNECTED);
}
示例6: push
import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public void push(String string, ProgressHandler ph) {
throw new IllegalStateException(DISCONNECTED);
}
示例7: build
import com.spotify.docker.client.ProgressHandler; //导入依赖的package包/类
@Override
public String build(Path path, ProgressHandler ph, BuildParam... bps) {
throw new IllegalStateException(DISCONNECTED);
}