Class DelegatingDockerClient
- All Implemented Interfaces:
com.github.dockerjava.api.DockerClient
,Closeable
,AutoCloseable
DockerClient
interface.
This makes it easy for other classes to override specific methods without having to implement all of them. Every method here:
- calls
getDelegate()
, - calls the matching method on the delegate class,
- for methods that return void, calls
interceptVoid()
and then returns, - for other methods, calls
interceptAnswer(Object)
, passing in the delegate method's answer and returns whateverinterceptAnswer(Object)
returned.
If you are writing a Jenkins plugin that needs a class to implement/wrap
DockerClient
, you'd be best advised to extend this one, otherwise
your code could fail whenever the version of this plugin changes and the
DockerClient
gains additional methods.
-
Constructor Summary
ConstructorDescriptionDelegatingDockerClient
(com.github.dockerjava.api.DockerClient delegate) Constructs a new instance that delegates all API calls to the specifiedDockerClient
. -
Method Summary
Modifier and TypeMethodDescriptioncom.github.dockerjava.api.command.AttachContainerCmd
attachContainerCmd
(String arg0) com.github.dockerjava.api.command.AuthCmd
authCmd()
com.github.dockerjava.api.model.AuthConfig
com.github.dockerjava.api.command.BuildImageCmd
com.github.dockerjava.api.command.BuildImageCmd
buildImageCmd
(File arg0) com.github.dockerjava.api.command.BuildImageCmd
buildImageCmd
(InputStream arg0) void
close()
com.github.dockerjava.api.command.CommitCmd
com.github.dockerjava.api.command.ConnectToNetworkCmd
com.github.dockerjava.api.command.ContainerDiffCmd
containerDiffCmd
(String arg0) com.github.dockerjava.api.command.CopyArchiveFromContainerCmd
copyArchiveFromContainerCmd
(String arg0, String arg1) com.github.dockerjava.api.command.CopyArchiveToContainerCmd
com.github.dockerjava.api.command.CopyFileFromContainerCmd
copyFileFromContainerCmd
(String arg0, String arg1) com.github.dockerjava.api.command.CreateConfigCmd
com.github.dockerjava.api.command.CreateContainerCmd
createContainerCmd
(String arg0) com.github.dockerjava.api.command.CreateImageCmd
createImageCmd
(String arg0, InputStream arg1) com.github.dockerjava.api.command.CreateNetworkCmd
com.github.dockerjava.api.command.CreateSecretCmd
createSecretCmd
(com.github.dockerjava.api.model.SecretSpec secretSpec) com.github.dockerjava.api.command.CreateServiceCmd
createServiceCmd
(com.github.dockerjava.api.model.ServiceSpec serviceSpec) com.github.dockerjava.api.command.CreateVolumeCmd
com.github.dockerjava.api.command.DisconnectFromNetworkCmd
com.github.dockerjava.api.command.EventsCmd
com.github.dockerjava.api.command.ExecCreateCmd
execCreateCmd
(String arg0) com.github.dockerjava.api.command.ExecStartCmd
execStartCmd
(String arg0) protected com.github.dockerjava.api.DockerClient
Obtains the underlyingDockerClient
interface.com.github.dockerjava.api.command.InfoCmd
infoCmd()
com.github.dockerjava.api.command.InitializeSwarmCmd
initializeSwarmCmd
(com.github.dockerjava.api.model.SwarmSpec swarmSpec) com.github.dockerjava.api.command.InspectConfigCmd
inspectConfigCmd
(String configId) com.github.dockerjava.api.command.InspectContainerCmd
inspectContainerCmd
(String arg0) com.github.dockerjava.api.command.InspectExecCmd
inspectExecCmd
(String arg0) com.github.dockerjava.api.command.InspectImageCmd
inspectImageCmd
(String arg0) com.github.dockerjava.api.command.InspectNetworkCmd
com.github.dockerjava.api.command.InspectServiceCmd
inspectServiceCmd
(String serviceId) com.github.dockerjava.api.command.InspectSwarmCmd
com.github.dockerjava.api.command.InspectVolumeCmd
inspectVolumeCmd
(String arg0) protected <T> T
interceptAnswer
(T originalAnswer) Called just before the result is returned.protected void
Called just before the method returns void.com.github.dockerjava.api.command.JoinSwarmCmd
com.github.dockerjava.api.command.KillContainerCmd
killContainerCmd
(String arg0) com.github.dockerjava.api.command.LeaveSwarmCmd
com.github.dockerjava.api.command.ListConfigsCmd
com.github.dockerjava.api.command.ListContainersCmd
com.github.dockerjava.api.command.ListImagesCmd
com.github.dockerjava.api.command.ListNetworksCmd
com.github.dockerjava.api.command.ListSecretsCmd
com.github.dockerjava.api.command.ListServicesCmd
com.github.dockerjava.api.command.ListSwarmNodesCmd
com.github.dockerjava.api.command.ListTasksCmd
com.github.dockerjava.api.command.ListVolumesCmd
com.github.dockerjava.api.command.LoadImageAsyncCmd
loadImageAsyncCmd
(InputStream inputStream) com.github.dockerjava.api.command.LoadImageCmd
loadImageCmd
(InputStream arg0) com.github.dockerjava.api.command.LogContainerCmd
logContainerCmd
(String arg0) com.github.dockerjava.api.command.LogSwarmObjectCmd
logServiceCmd
(String serviceId) com.github.dockerjava.api.command.LogSwarmObjectCmd
logTaskCmd
(String taskId) com.github.dockerjava.api.command.PauseContainerCmd
pauseContainerCmd
(String arg0) com.github.dockerjava.api.command.PingCmd
pingCmd()
com.github.dockerjava.api.command.PruneCmd
pruneCmd
(com.github.dockerjava.api.model.PruneType pruneType) com.github.dockerjava.api.command.PullImageCmd
pullImageCmd
(String arg0) com.github.dockerjava.api.command.PushImageCmd
pushImageCmd
(com.github.dockerjava.api.model.Identifier arg0) com.github.dockerjava.api.command.PushImageCmd
pushImageCmd
(String arg0) com.github.dockerjava.api.command.RemoveConfigCmd
removeConfigCmd
(String configId) com.github.dockerjava.api.command.RemoveContainerCmd
removeContainerCmd
(String arg0) com.github.dockerjava.api.command.RemoveImageCmd
removeImageCmd
(String arg0) com.github.dockerjava.api.command.RemoveNetworkCmd
removeNetworkCmd
(String arg0) com.github.dockerjava.api.command.RemoveSecretCmd
removeSecretCmd
(String secretId) com.github.dockerjava.api.command.RemoveServiceCmd
removeServiceCmd
(String serviceId) com.github.dockerjava.api.command.RemoveSwarmNodeCmd
removeSwarmNodeCmd
(String swarmNodeId) com.github.dockerjava.api.command.RemoveVolumeCmd
removeVolumeCmd
(String arg0) com.github.dockerjava.api.command.RenameContainerCmd
renameContainerCmd
(String arg0) com.github.dockerjava.api.command.ResizeContainerCmd
resizeContainerCmd
(String containerId) com.github.dockerjava.api.command.ResizeExecCmd
resizeExecCmd
(String execId) com.github.dockerjava.api.command.RestartContainerCmd
restartContainerCmd
(String arg0) com.github.dockerjava.api.command.SaveImageCmd
saveImageCmd
(String arg0) com.github.dockerjava.api.command.SaveImagesCmd
com.github.dockerjava.api.command.SearchImagesCmd
searchImagesCmd
(String arg0) com.github.dockerjava.api.command.StartContainerCmd
startContainerCmd
(String arg0) com.github.dockerjava.api.command.StatsCmd
com.github.dockerjava.api.command.StopContainerCmd
stopContainerCmd
(String arg0) com.github.dockerjava.api.command.TagImageCmd
tagImageCmd
(String arg0, String arg1, String arg2) com.github.dockerjava.api.command.TopContainerCmd
topContainerCmd
(String arg0) com.github.dockerjava.api.command.UnpauseContainerCmd
unpauseContainerCmd
(String arg0) com.github.dockerjava.api.command.UpdateContainerCmd
updateContainerCmd
(String arg0) com.github.dockerjava.api.command.UpdateServiceCmd
updateServiceCmd
(String serviceId, com.github.dockerjava.api.model.ServiceSpec serviceSpec) com.github.dockerjava.api.command.UpdateSwarmCmd
updateSwarmCmd
(com.github.dockerjava.api.model.SwarmSpec swarmSpec) com.github.dockerjava.api.command.UpdateSwarmNodeCmd
com.github.dockerjava.api.command.VersionCmd
com.github.dockerjava.api.command.WaitContainerCmd
waitContainerCmd
(String arg0)
-
Constructor Details
-
DelegatingDockerClient
public DelegatingDockerClient(@NonNull com.github.dockerjava.api.DockerClient delegate) Constructs a new instance that delegates all API calls to the specifiedDockerClient
.- Parameters:
delegate
- TheDockerClient
to delegate to.
-
-
Method Details
-
getDelegate
@NonNull protected com.github.dockerjava.api.DockerClient getDelegate()Obtains the underlyingDockerClient
interface. Subclasses can override this if they need to hook into every call before anything else happens.- Returns:
- the
DockerClient
to be delegated to.
-
interceptAnswer
protected <T> T interceptAnswer(T originalAnswer) Called just before the result is returned. Subclasses can override this if they need to hook into every call just before the method returns and/or to alter the result.Note: If a subclass only wishes to act upon certain specific
DockerClient
calls then it may be clearer to override those specific methods instead. This hook is intended for use by subclasses that need to act upon "all methods" or need to act on methods that were not part of theDockerClient
API at the time they were implemented.- Type Parameters:
T
- The type of theoriginalAnswer
.- Parameters:
originalAnswer
- The result from the delegate.- Returns:
- The result to be returned instead.
-
interceptVoid
protected void interceptVoid()Called just before the method returns void. Allows a subclass to act just before the method returns.Note: If a subclass only wishes to act upon certain specific
DockerClient
calls then it may be clearer to override those specific methods instead. This hook is intended for use by subclasses that need to act upon "all methods" or need to act on methods that were not part of theDockerClient
API at the time they were implemented. -
attachContainerCmd
- Specified by:
attachContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
authCmd
public com.github.dockerjava.api.command.AuthCmd authCmd()- Specified by:
authCmd
in interfacecom.github.dockerjava.api.DockerClient
-
authConfig
public com.github.dockerjava.api.model.AuthConfig authConfig() throws com.github.dockerjava.api.exception.DockerException- Specified by:
authConfig
in interfacecom.github.dockerjava.api.DockerClient
- Throws:
com.github.dockerjava.api.exception.DockerException
-
buildImageCmd
public com.github.dockerjava.api.command.BuildImageCmd buildImageCmd()- Specified by:
buildImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
buildImageCmd
- Specified by:
buildImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
buildImageCmd
- Specified by:
buildImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacecom.github.dockerjava.api.DockerClient
- Throws:
IOException
-
commitCmd
- Specified by:
commitCmd
in interfacecom.github.dockerjava.api.DockerClient
-
connectToNetworkCmd
public com.github.dockerjava.api.command.ConnectToNetworkCmd connectToNetworkCmd()- Specified by:
connectToNetworkCmd
in interfacecom.github.dockerjava.api.DockerClient
-
containerDiffCmd
- Specified by:
containerDiffCmd
in interfacecom.github.dockerjava.api.DockerClient
-
copyArchiveFromContainerCmd
public com.github.dockerjava.api.command.CopyArchiveFromContainerCmd copyArchiveFromContainerCmd(String arg0, String arg1) - Specified by:
copyArchiveFromContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
copyArchiveToContainerCmd
public com.github.dockerjava.api.command.CopyArchiveToContainerCmd copyArchiveToContainerCmd(String arg0) - Specified by:
copyArchiveToContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
copyFileFromContainerCmd
public com.github.dockerjava.api.command.CopyFileFromContainerCmd copyFileFromContainerCmd(String arg0, String arg1) - Specified by:
copyFileFromContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
createContainerCmd
- Specified by:
createContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
createImageCmd
public com.github.dockerjava.api.command.CreateImageCmd createImageCmd(String arg0, InputStream arg1) - Specified by:
createImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
createNetworkCmd
public com.github.dockerjava.api.command.CreateNetworkCmd createNetworkCmd()- Specified by:
createNetworkCmd
in interfacecom.github.dockerjava.api.DockerClient
-
createVolumeCmd
public com.github.dockerjava.api.command.CreateVolumeCmd createVolumeCmd()- Specified by:
createVolumeCmd
in interfacecom.github.dockerjava.api.DockerClient
-
disconnectFromNetworkCmd
public com.github.dockerjava.api.command.DisconnectFromNetworkCmd disconnectFromNetworkCmd()- Specified by:
disconnectFromNetworkCmd
in interfacecom.github.dockerjava.api.DockerClient
-
eventsCmd
public com.github.dockerjava.api.command.EventsCmd eventsCmd()- Specified by:
eventsCmd
in interfacecom.github.dockerjava.api.DockerClient
-
execCreateCmd
- Specified by:
execCreateCmd
in interfacecom.github.dockerjava.api.DockerClient
-
execStartCmd
- Specified by:
execStartCmd
in interfacecom.github.dockerjava.api.DockerClient
-
infoCmd
public com.github.dockerjava.api.command.InfoCmd infoCmd()- Specified by:
infoCmd
in interfacecom.github.dockerjava.api.DockerClient
-
inspectContainerCmd
- Specified by:
inspectContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
inspectExecCmd
- Specified by:
inspectExecCmd
in interfacecom.github.dockerjava.api.DockerClient
-
inspectImageCmd
- Specified by:
inspectImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
inspectNetworkCmd
public com.github.dockerjava.api.command.InspectNetworkCmd inspectNetworkCmd()- Specified by:
inspectNetworkCmd
in interfacecom.github.dockerjava.api.DockerClient
-
inspectVolumeCmd
- Specified by:
inspectVolumeCmd
in interfacecom.github.dockerjava.api.DockerClient
-
killContainerCmd
- Specified by:
killContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listContainersCmd
public com.github.dockerjava.api.command.ListContainersCmd listContainersCmd()- Specified by:
listContainersCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listImagesCmd
public com.github.dockerjava.api.command.ListImagesCmd listImagesCmd()- Specified by:
listImagesCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listNetworksCmd
public com.github.dockerjava.api.command.ListNetworksCmd listNetworksCmd()- Specified by:
listNetworksCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listVolumesCmd
public com.github.dockerjava.api.command.ListVolumesCmd listVolumesCmd()- Specified by:
listVolumesCmd
in interfacecom.github.dockerjava.api.DockerClient
-
loadImageCmd
- Specified by:
loadImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
loadImageAsyncCmd
public com.github.dockerjava.api.command.LoadImageAsyncCmd loadImageAsyncCmd(@NonNull InputStream inputStream) - Specified by:
loadImageAsyncCmd
in interfacecom.github.dockerjava.api.DockerClient
-
logContainerCmd
- Specified by:
logContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
pauseContainerCmd
- Specified by:
pauseContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
pingCmd
public com.github.dockerjava.api.command.PingCmd pingCmd()- Specified by:
pingCmd
in interfacecom.github.dockerjava.api.DockerClient
-
pullImageCmd
- Specified by:
pullImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
pushImageCmd
- Specified by:
pushImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
pushImageCmd
public com.github.dockerjava.api.command.PushImageCmd pushImageCmd(com.github.dockerjava.api.model.Identifier arg0) - Specified by:
pushImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
removeContainerCmd
- Specified by:
removeContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
removeImageCmd
- Specified by:
removeImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
removeNetworkCmd
- Specified by:
removeNetworkCmd
in interfacecom.github.dockerjava.api.DockerClient
-
removeVolumeCmd
- Specified by:
removeVolumeCmd
in interfacecom.github.dockerjava.api.DockerClient
-
renameContainerCmd
- Specified by:
renameContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
restartContainerCmd
- Specified by:
restartContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
saveImageCmd
- Specified by:
saveImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
searchImagesCmd
- Specified by:
searchImagesCmd
in interfacecom.github.dockerjava.api.DockerClient
-
startContainerCmd
- Specified by:
startContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
statsCmd
- Specified by:
statsCmd
in interfacecom.github.dockerjava.api.DockerClient
-
stopContainerCmd
- Specified by:
stopContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
tagImageCmd
public com.github.dockerjava.api.command.TagImageCmd tagImageCmd(String arg0, String arg1, String arg2) - Specified by:
tagImageCmd
in interfacecom.github.dockerjava.api.DockerClient
-
topContainerCmd
- Specified by:
topContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
unpauseContainerCmd
- Specified by:
unpauseContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
updateContainerCmd
- Specified by:
updateContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
versionCmd
public com.github.dockerjava.api.command.VersionCmd versionCmd()- Specified by:
versionCmd
in interfacecom.github.dockerjava.api.DockerClient
-
waitContainerCmd
- Specified by:
waitContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
initializeSwarmCmd
public com.github.dockerjava.api.command.InitializeSwarmCmd initializeSwarmCmd(com.github.dockerjava.api.model.SwarmSpec swarmSpec) - Specified by:
initializeSwarmCmd
in interfacecom.github.dockerjava.api.DockerClient
-
inspectSwarmCmd
public com.github.dockerjava.api.command.InspectSwarmCmd inspectSwarmCmd()- Specified by:
inspectSwarmCmd
in interfacecom.github.dockerjava.api.DockerClient
-
joinSwarmCmd
public com.github.dockerjava.api.command.JoinSwarmCmd joinSwarmCmd()- Specified by:
joinSwarmCmd
in interfacecom.github.dockerjava.api.DockerClient
-
leaveSwarmCmd
public com.github.dockerjava.api.command.LeaveSwarmCmd leaveSwarmCmd()- Specified by:
leaveSwarmCmd
in interfacecom.github.dockerjava.api.DockerClient
-
updateSwarmCmd
public com.github.dockerjava.api.command.UpdateSwarmCmd updateSwarmCmd(com.github.dockerjava.api.model.SwarmSpec swarmSpec) - Specified by:
updateSwarmCmd
in interfacecom.github.dockerjava.api.DockerClient
-
updateSwarmNodeCmd
public com.github.dockerjava.api.command.UpdateSwarmNodeCmd updateSwarmNodeCmd()- Specified by:
updateSwarmNodeCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listSwarmNodesCmd
public com.github.dockerjava.api.command.ListSwarmNodesCmd listSwarmNodesCmd()- Specified by:
listSwarmNodesCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listServicesCmd
public com.github.dockerjava.api.command.ListServicesCmd listServicesCmd()- Specified by:
listServicesCmd
in interfacecom.github.dockerjava.api.DockerClient
-
createServiceCmd
public com.github.dockerjava.api.command.CreateServiceCmd createServiceCmd(com.github.dockerjava.api.model.ServiceSpec serviceSpec) - Specified by:
createServiceCmd
in interfacecom.github.dockerjava.api.DockerClient
-
inspectServiceCmd
- Specified by:
inspectServiceCmd
in interfacecom.github.dockerjava.api.DockerClient
-
updateServiceCmd
public com.github.dockerjava.api.command.UpdateServiceCmd updateServiceCmd(String serviceId, com.github.dockerjava.api.model.ServiceSpec serviceSpec) - Specified by:
updateServiceCmd
in interfacecom.github.dockerjava.api.DockerClient
-
removeServiceCmd
- Specified by:
removeServiceCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listTasksCmd
public com.github.dockerjava.api.command.ListTasksCmd listTasksCmd()- Specified by:
listTasksCmd
in interfacecom.github.dockerjava.api.DockerClient
-
logServiceCmd
- Specified by:
logServiceCmd
in interfacecom.github.dockerjava.api.DockerClient
-
logTaskCmd
- Specified by:
logTaskCmd
in interfacecom.github.dockerjava.api.DockerClient
-
pruneCmd
public com.github.dockerjava.api.command.PruneCmd pruneCmd(com.github.dockerjava.api.model.PruneType pruneType) - Specified by:
pruneCmd
in interfacecom.github.dockerjava.api.DockerClient
-
removeConfigCmd
- Specified by:
removeConfigCmd
in interfacecom.github.dockerjava.api.DockerClient
-
inspectConfigCmd
- Specified by:
inspectConfigCmd
in interfacecom.github.dockerjava.api.DockerClient
-
createConfigCmd
public com.github.dockerjava.api.command.CreateConfigCmd createConfigCmd()- Specified by:
createConfigCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listConfigsCmd
public com.github.dockerjava.api.command.ListConfigsCmd listConfigsCmd()- Specified by:
listConfigsCmd
in interfacecom.github.dockerjava.api.DockerClient
-
removeSecretCmd
- Specified by:
removeSecretCmd
in interfacecom.github.dockerjava.api.DockerClient
-
createSecretCmd
public com.github.dockerjava.api.command.CreateSecretCmd createSecretCmd(com.github.dockerjava.api.model.SecretSpec secretSpec) - Specified by:
createSecretCmd
in interfacecom.github.dockerjava.api.DockerClient
-
listSecretsCmd
public com.github.dockerjava.api.command.ListSecretsCmd listSecretsCmd()- Specified by:
listSecretsCmd
in interfacecom.github.dockerjava.api.DockerClient
-
removeSwarmNodeCmd
- Specified by:
removeSwarmNodeCmd
in interfacecom.github.dockerjava.api.DockerClient
-
resizeContainerCmd
- Specified by:
resizeContainerCmd
in interfacecom.github.dockerjava.api.DockerClient
-
saveImagesCmd
public com.github.dockerjava.api.command.SaveImagesCmd saveImagesCmd()- Specified by:
saveImagesCmd
in interfacecom.github.dockerjava.api.DockerClient
-
resizeExecCmd
- Specified by:
resizeExecCmd
in interfacecom.github.dockerjava.api.DockerClient
-