package be.iminds.ilabt.jfed.lowlevel.connection;

import org.apache.http.Header;
import org.apache.http.StatusLine;
import org.apache.xmlrpc.client.XmlRpcTransportFactory;

import java.util.List;

/**
 * HttpInfoXmlRpcTransportFactory
 */
public interface HttpInfoXmlRpcTransportFactory extends XmlRpcTransportFactory {
    String getHttpReceivedHistory();

    String getHttpSentHistory();

    StatusLine getHttpStatusLine();

    String getHttpRequestLine();

    String getHttpRequestHeaders();

    String getHttpResponseHeaders();

    List<Header> getRawHttpResponseHeaders();

    void clearLastCallData();

    void close();

    void setProperty(String s, Object o);

    class HttpServerErrorException extends Exception {
        private final int statusNr;
        private final String reason;

        public HttpServerErrorException(int statusNr, String reason) {
            super("HTTP Server is busy");
            this.statusNr = statusNr;
            this.reason = reason;
        }

        public int getStatusNr() {
            return statusNr;
        }

        public String getReason() {
            return reason;
        }
    }
}
