com.googlecode.gmail4j.http.ProxyAware Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2008-2009 Tomas Varaneckas
* http://www.varaneckas.com
*
* Licensed 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 com.googlecode.gmail4j.http;
import java.net.Proxy;
import com.googlecode.gmail4j.auth.Credentials;
/**
* Interface that provides way of setting and getting proxy and it's credentials.
*
* Example use:
*
* GmailConnection conn = //some new GmailConnection
* if (conn instanceof ProxyAware) {
* ((ProxyAware) conn).setProxy("proxy.example.com", 8080);
* ((ProxyAware) conn).setProxyCredentials(proxyUser, proxyPass);
* }
*
*
* @author Tomas Varaneckas <[email protected]>
* @version $Id: ProxyAware.java 37 2009-07-09 17:26:41Z tomas.varaneckas $
* @since 0.1
*/
public interface ProxyAware {
/**
* Sets the {@link #proxy}
*
* @param proxy Proxy for RSS connection
*/
public void setProxy(final Proxy proxy);
/**
* Gets the {@link #proxy}
*
* @return Proxy or null if unavailable
*/
public Proxy getProxy();
/**
* A convenience method for setting HTTP {@link #proxy}
*
* @param proxyHost Proxy host
* @param proxyPort Proxy port
*/
public void setProxy(final String proxyHost, final int proxyPort);
/**
* Sets {@link #proxyCredentials}
*
* @param proxyCredentials Proxy authentication
*/
public void setProxyCredentials(final Credentials proxyCredentials);
/**
* A convenience method for setting {@link #proxyCredentials}
*
* @param username Proxy auth username
* @param password Proxy auth password
*/
public void setProxyCredentials(final String username, final char[] password);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy