@Test public void testLoadImage() { givenAnImageName("test"); givenArchiveFile("test.tar"); whenLoadImage(); thenNoException(); }
@Override public void loadImage(String image, File tarArchive) throws DockerAccessException { String url = urlBuilder.loadImage(); try { delegate.post(url, tarArchive, new ApacheHttpClientDelegate.BodyAndStatusResponseHandler(), HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to load %s", tarArchive); } }
DockerAccessWithHcClient implements DockerAccess { @Override public void loadImage(String image, File tarArchive) throws DockerAccessException { String url = urlBuilder.loadImage(); try { delegate.post(url, tarArchive, new ApacheHttpClientDelegate.BodyAndStatusResponseHandler(), HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to load %s", tarArchive); } } }
DockerAccessWithHcClient implements DockerAccess { @Override public void loadImage(String image, File tarArchive) throws DockerAccessException { String url = urlBuilder.loadImage(); try { delegate.post(url, tarArchive, new ApacheHttpClientDelegate.BodyAndStatusResponseHandler(), HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to load %s", tarArchive); } } DockerAccessWithHcClient(String baseUrl,
                                    String certPath,
                                    int maxConnections,
                                    KitLogger log); }
DockerAccessWithHcClient implements DockerAccess { @Override public void loadImage(String image, File tarArchive) throws DockerAccessException { String url = urlBuilder.loadImage(); try { delegate.post(url, tarArchive, new ApacheHttpClientDelegate.BodyAndStatusResponseHandler(), HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to load %s", tarArchive); } } DockerAccessWithHcClient(String baseUrl,
                                    String certPath,
                                    int maxConnections,
                                    KitLogger log); @Override String getServerApiVersion(); @Override void startExecContainer(String containerId, LogOutputSpec outputSpec); @Override String createExecContainer(String containerId, Arguments arguments); @Override String createContainer(ContainerCreateConfig containerConfig, String containerName); @Override void startContainer(String containerId); @Override void stopContainer(String containerId, int killWait); @Override void buildImage(String image, File dockerArchive, BuildOptions options); @Override void copyArchive(String containerId, File archive, String targetPath); @Override void getLogSync(String containerId, LogCallback callback); @Override LogGetHandle getLogAsync(String containerId, LogCallback callback); @Override List<Container> getContainersForImage(String image, boolean all); @Override ContainerDetails getContainer(String containerIdOrName); @Override ExecDetails getExecContainer(String containerIdOrName); @Override boolean hasImage(String name); @Override String getImageId(String name); @Override void removeContainer(String containerId, boolean removeVolumes); @Override void loadImage(String image, File tarArchive); @Override void pullImage(String image, AuthConfig authConfig, String registry); @Override void pushImage(String image, AuthConfig authConfig, String registry, int retries); @Override void saveImage(String image, String filename, ArchiveCompression compression); @Override void tag(String sourceImage, String targetImage, boolean force); @Override boolean removeImage(String image, boolean... forceOpt); @Override List<Network> listNetworks(); @Override String createNetwork(NetworkCreateConfig networkConfig); @Override boolean removeNetwork(String networkId); @Override String createVolume(VolumeCreateConfig containerConfig); @Override void removeVolume(String name); @Override void start(); @Override void shutdown(); String fetchApiVersionFromServer(String baseUrl, ApacheHttpClientDelegate delegate); }
DockerAccessWithHcClient implements DockerAccess { @Override public void loadImage(String image, File tarArchive) throws DockerAccessException { String url = urlBuilder.loadImage(); try { delegate.post(url, tarArchive, new ApacheHttpClientDelegate.BodyAndStatusResponseHandler(), HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to load %s", tarArchive); } } DockerAccessWithHcClient(String baseUrl,
                                    String certPath,
                                    int maxConnections,
                                    KitLogger log); @Override String getServerApiVersion(); @Override void startExecContainer(String containerId, LogOutputSpec outputSpec); @Override String createExecContainer(String containerId, Arguments arguments); @Override String createContainer(ContainerCreateConfig containerConfig, String containerName); @Override void startContainer(String containerId); @Override void stopContainer(String containerId, int killWait); @Override void buildImage(String image, File dockerArchive, BuildOptions options); @Override void copyArchive(String containerId, File archive, String targetPath); @Override void getLogSync(String containerId, LogCallback callback); @Override LogGetHandle getLogAsync(String containerId, LogCallback callback); @Override List<Container> getContainersForImage(String image, boolean all); @Override ContainerDetails getContainer(String containerIdOrName); @Override ExecDetails getExecContainer(String containerIdOrName); @Override boolean hasImage(String name); @Override String getImageId(String name); @Override void removeContainer(String containerId, boolean removeVolumes); @Override void loadImage(String image, File tarArchive); @Override void pullImage(String image, AuthConfig authConfig, String registry); @Override void pushImage(String image, AuthConfig authConfig, String registry, int retries); @Override void saveImage(String image, String filename, ArchiveCompression compression); @Override void tag(String sourceImage, String targetImage, boolean force); @Override boolean removeImage(String image, boolean... forceOpt); @Override List<Network> listNetworks(); @Override String createNetwork(NetworkCreateConfig networkConfig); @Override boolean removeNetwork(String networkId); @Override String createVolume(VolumeCreateConfig containerConfig); @Override void removeVolume(String name); @Override void start(); @Override void shutdown(); String fetchApiVersionFromServer(String baseUrl, ApacheHttpClientDelegate delegate); static final String API_VERSION; }