• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NotModifiedException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.github.dockerjava.api.exception.NotModifiedException的典型用法代码示例。如果您正苦于以下问题:Java NotModifiedException类的具体用法?Java NotModifiedException怎么用?Java NotModifiedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NotModifiedException类属于com.github.dockerjava.api.exception包,在下文中一共展示了NotModifiedException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: filter

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
@Override
public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
    int status = responseContext.getStatus();
    switch (status) {
        case 200:
        case 201:
        case 204:
            return;
        case 304:
            throw new NotModifiedException(getBodyAsMessage(responseContext));
        case 400:
            throw new BadRequestException(getBodyAsMessage(responseContext));
        case 401:
            throw new UnauthorizedException(getBodyAsMessage(responseContext));
        case 404:
            throw new NotFoundException(getBodyAsMessage(responseContext));
        case 406:
            throw new NotAcceptableException(getBodyAsMessage(responseContext));
        case 409:
            throw new ConflictException(getBodyAsMessage(responseContext));
        case 500:
            throw new InternalServerErrorException(getBodyAsMessage(responseContext));
        default:
            throw new DockerException(getBodyAsMessage(responseContext), status);
    }
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:27,代码来源:ResponseStatusExceptionFilter.java


示例2: execute

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
@Override
public void execute(Run<?, ?> build, Launcher launcher, TaskListener listener)
        throws DockerException {
    final PrintStream llog = listener.getLogger();
    LOG.info("Stopping container " + containerId);
    llog.println("Stopping container " + containerId);

    DockerClient client = getCloud(build, launcher).getClient();
    try {
        client.stopContainerCmd(containerId).exec();
    } catch (NotModifiedException ex) {
        LOG.info("Already stopped.");
        llog.println("Already stopped.");
    }

    getLaunchAction(build).stopped(client, containerId);

    if (remove) {
        LOG.info("Removing container {}...", containerId);
        llog.println("Removing container " + containerId + "...");
        client.removeContainerCmd(containerId);
    }
}
 
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:24,代码来源:DockerBuilderControlOptionStop.java


示例3: stopNode

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
public void stopNode(String nodeName) {
    try {
        dockerClient.killContainerCmd(nodeName).exec();
    } catch (NotModifiedException e) {
        System.out.println("There is a problem stopping the container " + nodeName + " ERROR:" + e.getMessage());
    }

}
 
开发者ID:mcafee,项目名称:management-sdk-for-kafka,代码行数:9,代码来源:DockerCompose.java


示例4: startContainer

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
@Override
public void startContainer(ContainerName containerName) {
    try {
        dockerClient.startContainerCmd(containerName.asString()).exec();
    } catch (NotModifiedException ignored) {
        // If is already started, ignore
    } catch (RuntimeException e) {
        numberOfDockerDaemonFails.add();
        throw new DockerException("Failed to start container '" + containerName.asString() + "'", e);
    }
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:12,代码来源:DockerImpl.java


示例5: stopContainer

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
@Override
public void stopContainer(final ContainerName containerName) {
    try {
        dockerClient.stopContainerCmd(containerName.asString()).withTimeout(SECONDS_TO_WAIT_BEFORE_KILLING).exec();
    } catch (NotModifiedException ignored) {
        // If is already stopped, ignore
    } catch (RuntimeException e) {
        numberOfDockerDaemonFails.add();
        throw new DockerException("Failed to stop container '" + containerName.asString() + "'", e);
    }
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:12,代码来源:DockerImpl.java


示例6: execute

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
@Override
public void execute() throws KevoreeAdaptationException {
    final String repo = ((Package) instance.getTypeDefinition().eContainer()).getName();
    final String image = instance.getTypeDefinition().getName();
    final String tag = instance.getTypeDefinition().getVersion();

    try {
        CreateContainerCmd cmd = this.docker.createContainerCmd(repo + "/" + image + ":" + tag);
        envDecorator(linkDecorator(portDecorator(cmdDecorator(cmd)))).withName(instance.getName()).exec();
    } catch (NotModifiedException ignore) {
        Log.debug("Container \"{}\" ({}) is already created", instance.getName(), repo + "/" + image + ":" + tag);
    } catch (Exception e) {
        throw new KevoreeAdaptationException("Unable to create container \""+instance.getName()+"\"", e);
    }
}
 
开发者ID:kevoree,项目名称:kevoree-library,代码行数:16,代码来源:CreateContainer.java


示例7: execute

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
@Override
public void execute() throws KevoreeAdaptationException {
    try {
        this.docker.stopContainerCmd(instance.getName()).exec();
    } catch (NotModifiedException ignore) {
        Log.debug("Container \"{}\" is already stopped", instance.getName());
    } catch (Exception e) {
        throw new KevoreeAdaptationException("Unable to stop container \""+instance.getName()+"\"", e);
    }
}
 
开发者ID:kevoree,项目名称:kevoree-library,代码行数:11,代码来源:StopContainer.java


示例8: execute

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
@Override
public void execute() throws KevoreeAdaptationException {
    try {
        this.docker.startContainerCmd(instance.getName()).exec();
    } catch (NotModifiedException ignore) {
        Log.debug("Container \"{}\" is already started", instance.getName());
    } catch (Exception e) {
        throw new KevoreeAdaptationException("Unable to start container \""+instance.getName()+"\"", e);
    }
}
 
开发者ID:kevoree,项目名称:kevoree-library,代码行数:11,代码来源:StartContainer.java


示例9: channelRead0

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
@Override
protected void channelRead0(final ChannelHandlerContext ctx, HttpObject msg) throws Exception {
    if (msg instanceof HttpResponse) {

        response = (HttpResponse) msg;

        resultCallback.onStart(new Closeable() {
            @Override
            public void close() {
                ctx.channel().close();
            }
        });

    } else if (msg instanceof HttpContent) {

        HttpContent content = (HttpContent) msg;

        ByteBuf byteBuf = content.content();

        switch (response.status().code()) {
            case 200:
            case 201:
            case 204:
                ctx.fireChannelRead(byteBuf);
                break;
            default:
                errorBody.writeBytes(byteBuf);
        }

        if (content instanceof LastHttpContent) {
            try {

                switch (response.status().code()) {
                    case 101:
                    case 200:
                    case 201:
                    case 204:
                        break;
                    case 301:
                    case 302:
                        if (response.headers().contains(HttpHeaderNames.LOCATION)) {
                            String location = response.headers().get(HttpHeaderNames.LOCATION);
                            HttpRequest redirected = requestProvider.getHttpRequest(location);

                            ctx.channel().writeAndFlush(redirected);
                        }
                        break;
                    case 304:
                        throw new NotModifiedException(getBodyAsMessage(errorBody));
                    case 400:
                        throw new BadRequestException(getBodyAsMessage(errorBody));
                    case 401:
                        throw new UnauthorizedException(getBodyAsMessage(errorBody));
                    case 404:
                        throw new NotFoundException(getBodyAsMessage(errorBody));
                    case 406:
                        throw new NotAcceptableException(getBodyAsMessage(errorBody));
                    case 409:
                        throw new ConflictException(getBodyAsMessage(errorBody));
                    case 500:
                        throw new InternalServerErrorException(getBodyAsMessage(errorBody));
                    default:
                        throw new DockerException(getBodyAsMessage(errorBody), response.status().code());
                }
            } catch (Throwable e) {
                resultCallback.onError(e);
            } finally {
                resultCallback.onComplete();
            }
        }
    }
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:73,代码来源:HttpResponseHandler.java


示例10: exec

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
/**
 * @throws NotFoundException
 *             No such container
 * @throws NotModifiedException
 *             Container already started
 */
@Override
Void exec() throws NotFoundException, NotModifiedException;
 
开发者ID:docker-java,项目名称:docker-java,代码行数:9,代码来源:StartContainerCmd.java


示例11: exec

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
/**
 * @throws NotFoundException
 *             No such container
 * @throws NotModifiedException
 *             Container already stopped
 */
@Override
Void exec() throws NotFoundException, NotModifiedException;
 
开发者ID:docker-java,项目名称:docker-java,代码行数:9,代码来源:StopContainerCmd.java


示例12: exec

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
/**
 * @throws NotFoundException
 *             No such container
 * @throws NotModifiedException
 *             Container already started
 */
@Override
public Void exec() throws NotFoundException, NotModifiedException {
    return super.exec();
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:11,代码来源:StartContainerCmdImpl.java


示例13: exec

import com.github.dockerjava.api.exception.NotModifiedException; //导入依赖的package包/类
/**
 * @throws NotFoundException
 *             No such container
 * @throws NotModifiedException
 *             Container already stopped
 */
@Override
public Void exec() throws NotFoundException, NotModifiedException {
    return super.exec();
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:11,代码来源:StopContainerCmdImpl.java



注:本文中的com.github.dockerjava.api.exception.NotModifiedException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java QuerydslBindings类代码示例发布时间:2022-05-23
下一篇:
Java JForEach类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap