⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abstractauthlogichandler.java

📁 mina是以Java实现的一个开源的网络程序框架
💻 JAVA
字号:
/* *  Licensed to the Apache Software Foundation (ASF) under one *  or more contributor license agreements.  See the NOTICE file *  distributed with this work for additional information *  regarding copyright ownership.  The ASF licenses this file *  to you under the Apache License, Version 2.0 (the *  "License"); you may not use this file except in compliance *  with the License.  You may obtain a copy of the License at * *    http://www.apache.org/licenses/LICENSE-2.0 * *  Unless required by applicable law or agreed to in writing, *  software distributed under the License is distributed on an *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *  KIND, either express or implied.  See the License for the *  specific language governing permissions and limitations *  under the License. * */package org.apache.mina.proxy.handlers.http;import org.apache.mina.core.filterchain.IoFilter.NextFilter;import org.apache.mina.proxy.ProxyAuthException;import org.apache.mina.proxy.handlers.ProxyRequest;import org.apache.mina.proxy.session.ProxyIoSession;import org.slf4j.Logger;import org.slf4j.LoggerFactory;/** * AbstractAuthLogicHandler.java - Abstract class that handles an authentication  * mechanism logic. *  * @author The Apache MINA Project (dev@mina.apache.org) * @version $Rev: 759663 $, $Date: 2009-03-29 12:46:40 +0200 (Sun, 29 Mar 2009) $ * @since MINA 2.0.0-M3 */public abstract class AbstractAuthLogicHandler {    private final static Logger logger = LoggerFactory            .getLogger(AbstractAuthLogicHandler.class);    /**     * The request to be handled by the proxy.     */    protected ProxyRequest request;    /**     * Object that contains all the proxy authentication session informations.     */    protected ProxyIoSession proxyIoSession;    /**     * The current handshake step.     */    protected int step = 0;    /**     * Instantiates a handler for the given proxy session.     *      * @param proxyIoSession the proxy session object     * @throws ProxyAuthException     */    protected AbstractAuthLogicHandler(final ProxyIoSession proxyIoSession)            throws ProxyAuthException {        this.proxyIoSession = proxyIoSession;        this.request = proxyIoSession.getRequest();    }    /**     * Method called at each step of the handshaking process.     *      * @param nextFilter the next filter     * @throws ProxyAuthException     */    public abstract void doHandshake(final NextFilter nextFilter)            throws ProxyAuthException;    /**     * Handles a HTTP response from the proxy server.     *      * @param response The HTTP response.     * @throws ProxyAuthException     */    public abstract void handleResponse(final HttpProxyResponse response)            throws ProxyAuthException;    /**     * Sends an HTTP request.     *      * @param nextFilter the next filter     * @param request the request to write     * @throws ProxyAuthException     */    protected void writeRequest(final NextFilter nextFilter,            final HttpProxyRequest request) throws ProxyAuthException {        logger.debug("  sending HTTP request");        ((AbstractHttpLogicHandler) proxyIoSession.getHandler()).writeRequest(                nextFilter, request);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -