public class DockerTraceabilityHelper extends Object
Constructor and Description |
---|
DockerTraceabilityHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
formatDate(Date date)
Formats the time to the Docker-standard format.
|
static String |
formatTime(long time)
Formats the time to the Docker-standard format.
|
static String |
getContainerHash(String containerId) |
static String |
getImageHash(String imageId) |
static DockerContainerRecord |
getLastContainerRecord(String containerId)
Retrieves the last deployment record for the specified container.
|
static org.jenkinsci.plugins.docker.traceability.dockerjava.api.command.InspectImageResponse |
getLastInspectImageResponse(String imageId)
Retrieves the last
InspectImageResponse for the specified image. |
static org.jenkinsci.plugins.docker.traceability.api.DockerTraceabilityReport |
getLastReport(String containerId)
Retrieves the last trace report for the specified container.
|
static hudson.model.Fingerprint |
make(String containerId,
String name)
Get or create a fingerprint by the specified container ID.
|
static hudson.model.Fingerprint |
makeImage(String imageId,
String name,
long timestamp)
Get or create a fingerprint by the specified image ID.
|
static hudson.model.Fingerprint |
of(String containerId)
Get a fingerprint by the specified container ID.
|
static hudson.model.Fingerprint |
ofValidated(String containerId)
Get a fingerprint by the specified container ID.
|
@CheckForNull public static hudson.model.Fingerprint ofValidated(@Nonnull String containerId) throws IOException
of(java.lang.String)
to get a default behavior.containerId
- Full 64-symbol container id. Short forms are not supported.IOException
- Fingerprint loading error@CheckForNull public static hudson.model.Fingerprint of(@Nonnull String containerId)
IOException
s on fingerprint loading.containerId
- Full 64-symbol container id. Short forms are not supported.@CheckForNull public static hudson.model.Fingerprint make(@Nonnull String containerId, @CheckForNull String name) throws IOException
containerId
- Full 64-symbol container id. Short forms are not supported.name
- Optional name of the container. If it is not available,
the container ID will be used to produce the nameIOException
- Fingerprint loading error@CheckForNull public static hudson.model.Fingerprint makeImage(@Nonnull String imageId, @CheckForNull String name, long timestamp) throws IOException
imageId
- Full 64-symbol image id. Short forms are not supported.name
- Optional container nametimestamp
- Timestamp if there is a need to create a new imageIOException
- Fingerprint loading error@CheckForNull public static DockerContainerRecord getLastContainerRecord(@Nonnull String containerId)
containerId
- Container Id@CheckForNull public static org.jenkinsci.plugins.docker.traceability.api.DockerTraceabilityReport getLastReport(@Nonnull String containerId)
containerId
- Container Id@CheckForNull public static org.jenkinsci.plugins.docker.traceability.dockerjava.api.command.InspectImageResponse getLastInspectImageResponse(@Nonnull String imageId)
InspectImageResponse
for the specified image.imageId
- Image Id@Nonnull public static String formatTime(long time)
time
- Time to be convertedyyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'
Up to nanoseconds, but actually the last 6 digits are null in the current implementation.@Nonnull public static String formatDate(Date date)
date
- Date to be convertedyyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'
Up to nanoseconds, but actually the last 6 digits are null in the current implementation.Copyright © 2015–2016. All rights reserved.