本文整理汇总了Java中com.spotify.docker.client.messages.ProgressMessage类的典型用法代码示例。如果您正苦于以下问题:Java ProgressMessage类的具体用法?Java ProgressMessage怎么用?Java ProgressMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressMessage类属于com.spotify.docker.client.messages包,在下文中一共展示了ProgressMessage类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: progress
import com.spotify.docker.client.messages.ProgressMessage; //导入依赖的package包/类
@Override
public void progress(ProgressMessage message) throws DockerException {
if (message.error() != null) {
handleError(message.error());
} else if (message.progressDetail() != null) {
handleProgress(message.id(), message.status(), message.progress());
} else if ((message.status() != null) || (message.stream() != null)) {
handleGeneric(message.stream(), message.status());
}
String imageId = message.buildImageId();
if (imageId != null) {
builtImageId = imageId;
}
}
示例2: progress
import com.spotify.docker.client.messages.ProgressMessage; //导入依赖的package包/类
@Override
public void progress(ProgressMessage message) throws DockerException {
// Error handling (taken from
// com.spotify.docker.client.LoggingPullHandler)
if (message.error() != null) {
if (message.error().contains("404") || message.error().contains("not found")) {
throw new ImageNotFoundException(image, message.toString());
} else {
throw new ImagePullFailedException(image, message.toString());
}
}
processProgress(message);
}
示例3: processProgress
import com.spotify.docker.client.messages.ProgressMessage; //导入依赖的package包/类
protected synchronized void processProgress(ProgressMessage message) {
if (message.status().startsWith(SWARM_PULLING_STARTED_STATUS)) {
++pullStartCount;
if (pullStartCount == 2) {
LOGGER.info("Pulling image {}", image);
pullingStartedLogged = true;
}
return;
}
if (!pullingStartedLogged) {
if (message.status().startsWith(SINGLE_IMAGE_UP_TO_DATE_STATUS)) {
LOGGER.info("Image {} is up to date und does not have to be pulled.", image);
} else if (message.status().startsWith(SINGLE_DOWNLOADING_STATUS)) {
LOGGER.info("Image {} is being pulled...", image);
pullingStartedLogged = true;
}
} else {
if (message.status().startsWith(SINGLE_PULLING_COMPLETE_STATUS)) {
LOGGER.info("Pulled image {}.", image);
} else if ((pullStartCount > 0) && (message.status().endsWith(SWARM_PULLING_STOPPED_STATUS))) {
++pullEndCount;
if (pullStartCount == pullEndCount) {
LOGGER.info("Pulled image {}", image);
}
}
}
}
示例4: logPullProgress
import com.spotify.docker.client.messages.ProgressMessage; //导入依赖的package包/类
protected void logPullProgress(Trace trace, ProgressMessage progress) {
if (trace.isDebugEnabled()) {
if ("downloading".equalsIgnoreCase(progress.status())) {
//ommit donloading messages
return;
}
trace.event(Level.DEBUG, "pull progress (id, status, progress, error)", progress.id(), progress.status(), progress.progress(), progress.error());
}
}