// Path: client/src/main/java/com/nesscomputing/httpclient/HttpClientAuthProvider.java
// public interface HttpClientAuthProvider
// {
//     /**
//      * Called by the HttpClient for checking authentication information. Should return true if the
//      * provided authentication parameters are deemed sufficient by the implementation. HttpClient
//      * will then use the getters to retrieve exact authentication information, login and password.
//      *
//      * @param authScheme The authentication scheme used. E.g. "BASIC" or "DIGEST".
//      * @param authHost The host requesting authentication.
//      * @param authPort Port for the requesting host.
//      * @param authRealm The authentication realm presented by the host.
//      * @return True If the implementation accepts the authentication.
//      *
//      */
//     boolean acceptRequest(String authScheme, String authHost, int authPort, String authRealm);
// 
//     /**
//      * Return the accepted scheme. Can be null, then any scheme is accepted.
//      */
//     String getScheme();
// 
//     /**
//      * Return the accepted host. Can be null, then any host is accepted.
//      */
//     String getHost();
// 
//     /**
//      * Return the accepted port. Can be -1, then any port is accepted.
//      */
//     int getPort();
// 
//     /**
//      * Return the accepted realm. Can be null, then any realm is accepted.
//      */
//     String getRealm();
// 
//     /**
//      * Return an user name to present to the remote host.
//      */
//     String getUser();
// 
//     /**
//      * Return a password to present to the remote host.
//      */
//     String getPassword();
// }


import java.security.Principal;
import java.util.List;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.BasicUserPrincipal;
import org.apache.http.auth.Credentials;
import org.apache.http.client.CredentialsProvider;
import com.nesscomputing.httpclient.HttpClientAuthProvider;
/**
 * Copyright (C) 2012 Ness Computing, Inc.
 *
 * 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.nesscomputing.httpclient.factory.httpclient4;





/**
 * An Apache Httpclient credentials provider that uses the internal structures of the tc-httpclient to provide
 * credentials.
 *
 */
public class InternalCredentialsProvider implements CredentialsProvider
{
// Path: client/src/main/java/com/nesscomputing/httpclient/HttpClientAuthProvider.java
// public interface HttpClientAuthProvider
// {
//     /**
//      * Called by the HttpClient for checking authentication information. Should return true if the
//      * provided authentication parameters are deemed sufficient by the implementation. HttpClient
//      * will then use the getters to retrieve exact authentication information, login and password.
//      *
//      * @param authScheme The authentication scheme used. E.g. "BASIC" or "DIGEST".
//      * @param authHost The host requesting authentication.
//      * @param authPort Port for the requesting host.
//      * @param authRealm The authentication realm presented by the host.
//      * @return True If the implementation accepts the authentication.
//      *
//      */
//     boolean acceptRequest(String authScheme, String authHost, int authPort, String authRealm);
// 
//     /**
//      * Return the accepted scheme. Can be null, then any scheme is accepted.
//      */
//     String getScheme();
// 
//     /**
//      * Return the accepted host. Can be null, then any host is accepted.
//      */
//     String getHost();
// 
//     /**
//      * Return the accepted port. Can be -1, then any port is accepted.
//      */
//     int getPort();
// 
//     /**
//      * Return the accepted realm. Can be null, then any realm is accepted.
//      */
//     String getRealm();
// 
//     /**
//      * Return an user name to present to the remote host.
//      */
//     String getUser();
// 
//     /**
//      * Return a password to present to the remote host.
//      */
//     String getPassword();
// }


// Path: client/src/main/java/com/nesscomputing/httpclient/factory/httpclient4/InternalCredentialsProvider.java
import java.security.Principal;
import java.util.List;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.BasicUserPrincipal;
import org.apache.http.auth.Credentials;
import org.apache.http.client.CredentialsProvider;
import com.nesscomputing.httpclient.HttpClientAuthProvider;

/**
 * Copyright (C) 2012 Ness Computing, Inc.
 *
 * 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.nesscomputing.httpclient.factory.httpclient4;





/**
 * An Apache Httpclient credentials provider that uses the internal structures of the tc-httpclient to provide
 * credentials.
 *
 */
public class InternalCredentialsProvider implements CredentialsProvider
{
    private final List<HttpClientAuthProvider> authProviders;