All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.openservices.ots.comm.ExecutionContext Maven / Gradle / Ivy

package com.aliyun.openservices.ots.comm;

import java.util.LinkedList;
import java.util.List;

import com.aliyun.openservices.ots.auth.RequestSigner;
import com.aliyun.openservices.ots.utils.ServiceConstants;

public class ExecutionContext {
    private String charset = ServiceConstants.DEFAULT_ENCODING;
    private RequestSigner signer;
    // The request handlers that handle request content in as a pipeline
    private List requestHandlers = new LinkedList();
    // The response handlers that handle response message in as a pipeline.
    private List responseHandlers = new LinkedList();

    /**
     * Constructor.
     */
    public ExecutionContext() {
    }

    /**
     * Returns the default encoding (charset). Default: "UTF-8"
     * 
     * @return 编码类型
     */
    public String getCharset() {
        return charset;
    }

    /**
     * Sets the default encoding (charset). Default: "UTF-8"
     * 
     * @param defaultEncoding 编码类型
     */
    public void setCharset(String defaultEncoding) {
        this.charset = defaultEncoding;
    }

    /**
     * @return the signer
     */
    public RequestSigner getSigner() {
        return signer;
    }

    /**
     * @param signer
     *            the signer to set
     */
    public void setSigner(RequestSigner signer) {
        this.signer = signer;
    }

    /**
     * @return the responseHandlers
     */
    public List getResponseHandlers() {
        return responseHandlers;
    }

    public void addResponseHandler(ResponseHandler handler) {
        responseHandlers.add(handler);
    }

    public void insertResponseHandler(int position, ResponseHandler handler) {
        responseHandlers.add(position, handler);
    }

    public void removeResponseHandler(ResponseHandler handler) {
        responseHandlers.remove(handler);
    }

    /**
     * @return the requestHandlers
     */
    public List getResquestHandlers() {
        return requestHandlers;
    }

    public void addRequestHandler(RequestHandler handler) {
        requestHandlers.add(handler);
    }

    public void insertRequestHandler(int position, RequestHandler handler) {
        requestHandlers.add(position, handler);
    }

    public void removeRequestHandler(RequestHandler handler) {
        requestHandlers.remove(handler);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy