@Override protected AbstractCallbackNotifier<PullResponseItem> callbackNotifier(PullImageCmd command, ResultCallback<PullResponseItem> resultCallback) { WebTarget webResource = getBaseResource().path("/images/create").queryParam("tag", command.getTag()) .queryParam("fromImage", command.getRepository()).queryParam("registry", command.getRegistry()); if (command.getPlatform() != null) { webResource = webResource.queryParam("platform", command.getPlatform()); } LOGGER.trace("POST: {}", webResource); Builder builder = resourceWithOptionalAuthConfig(command.getAuthConfig(), webResource.request()).accept( MediaType.APPLICATION_OCTET_STREAM_TYPE); return new POSTCallbackNotifier<PullResponseItem>(new JsonStreamProcessor<PullResponseItem>( PullResponseItem.class), resultCallback, builder, entity(null, MediaType.APPLICATION_JSON)); } }
@Override protected Void execute0(PullImageCmd command, ResultCallback<PullResponseItem> resultCallback) { WebTarget webResource = getBaseResource().path("/images/create").queryParam("tag", command.getTag()) .queryParam("fromImage", command.getRepository()).queryParam("registry", command.getRegistry()); if (command.getPlatform() != null) { webResource = webResource.queryParam("platform", command.getPlatform()); } LOGGER.trace("POST: {}", webResource); resourceWithOptionalAuthConfig(command.getAuthConfig(), webResource.request()) .accept(MediaType.APPLICATION_OCTET_STREAM) .post(null, new TypeReference<PullResponseItem>() { }, resultCallback); return null; } }
@Override protected AbstractCallbackNotifier<PullResponseItem> callbackNotifier(PullImageCmd command, ResultCallback<PullResponseItem> resultCallback) { WebTarget webResource = getBaseResource().path("/images/create").queryParam("tag", command.getTag()) .queryParam("fromImage", command.getRepository()).queryParam("registry", command.getRegistry()); if (command.getPlatform() != null) { webResource = webResource.queryParam("platform", command.getPlatform()); } LOGGER.trace("POST: {}", webResource); Builder builder = resourceWithOptionalAuthConfig(command.getAuthConfig(), webResource.request()).accept( MediaType.APPLICATION_OCTET_STREAM_TYPE); return new POSTCallbackNotifier<PullResponseItem>(new JsonStreamProcessor<PullResponseItem>( PullResponseItem.class), resultCallback, builder, entity(null, MediaType.APPLICATION_JSON)); } }
@Override protected Void execute0(PullImageCmd command, ResultCallback<PullResponseItem> resultCallback) { WebTarget webResource = getBaseResource().path("/images/create").queryParam("tag", command.getTag()) .queryParam("fromImage", command.getRepository()).queryParam("registry", command.getRegistry()); if (command.getPlatform() != null) { webResource = webResource.queryParam("platform", command.getPlatform()); } LOGGER.trace("POST: {}", webResource); resourceWithOptionalAuthConfig(command.getAuthConfig(), webResource.request()) .accept(MediaType.APPLICATION_OCTET_STREAM) .post(null, new TypeReference<PullResponseItem>() { }, resultCallback); return null; } }