// Path: cdi/src/main/java/org/onsteroids/eve/api/InternalApiException.java
// public final class InternalApiException extends ApiException {
// 	private static final Logger LOG = LoggerFactory.getLogger(InternalApiException.class);
// 
// 	public InternalApiException(String message) {
// 		super(message);
// 	}
// 
// 	public InternalApiException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	public InternalApiException(Throwable cause) {
// 		super(cause);
// 	}
// }
// 
// Path: cdi/src/main/java/org/onsteroids/eve/api/cache/ApiCache.java
// public interface ApiCache {
// 
// 	/**
// 	 * @param apiResult the api result to cache
// 	 */
// 	void putApiResult(ApiResult apiResult);
// 
// 	/**
// 	 * @param serverUri the api server uri
// 	 * @param xmlPath the xml path
// 	 * @param <T> an api result type
// 	 * @return the cached api result or null if apiresult not cached
// 	 */
// 	<T extends ApiResult> T getApiResult(Class<T> resultType, URI serverUri, String xmlPath);
// 
// 	/**
// 	 * @param serverUri the api server uri
// 	 * @param xmlPath the xml path
// 	 * @param parameters the used parameters (can be null)
// 	 * @param <T> an api result type
// 	 * @return the cached api result or null if apiresult not cached
// 	 */
// 	<T extends ApiResult> T getApiResult(Class<T> resultType, URI serverUri, String xmlPath, Map<String,String> parameters);
// 
// 	/**
// 	 * @param serverUri the api server uri
// 	 * @param xmlPath the xml path
// 	 * @param key the used api key (can be null)
// 	 * @param <T> an api result type
// 	 * @return the cached api result or null if apiresult not cached
// 	 */
// 	<T extends ApiResult> T getApiResult(Class<T> resultType, URI serverUri, String xmlPath, ApiKey key);
// 
// 	/**
// 	 * @param serverUri the api server uri
// 	 * @param xmlPath the xml path
// 	 * @param key the used api key (can be null)
// 	 * @param parameters the used parameters (can be null)
// 	 * @param <T> an api result type
// 	 * @return the cached api result or null if apiresult not cached
// 	 */
// 	<T extends ApiResult> T getApiResult(Class<T> resultType, URI serverUri, String xmlPath, ApiKey key, Map<String,String> parameters);
// 
// }
// 
// Path: cdi/src/main/java/org/onsteroids/eve/api/connector/ApiConnection.java
// public interface ApiConnection {
// 
// 	/**
// 	 * @return the used server URI
// 	 */
// 	URI getServerUri();
// 
// 
// 	/**
// 	 * @param xmlPath e.g. /server/ServerStatus.xml.aspx
// 	 * @return the returned response from the server
// 	 * @throws ApiException
// 	 */
// 	XmlApiResult call(String xmlPath) throws ApiException;
// 
// 	/**
// 	 * @param xmlPath e.g. /server/ServerStatus.xml.aspx
// 	 * @param parameters additional parameters to provide, e.g. characterID
// 	 * @return the returned response from the server
// 	 * @throws ApiException
// 	 */
// 	XmlApiResult call(String xmlPath, Map<String,String> parameters) throws ApiException;
// 
// 	/**
// 	 * @param xmlPath e.g. /server/ServerStatus.xml.aspx
// 	 * @param key the API key to authenticate against
// 	 * @return the returned response from the server
// 	 * @throws ApiException
// 	 */
// 	XmlApiResult call(String xmlPath, ApiKey key) throws ApiException;
// 
// 	/**
// 	 * @param xmlPath e.g. /server/ServerStatus.xml.aspx
// 	 * @param key the API key to authenticate against
// 	 * @param parameters additional parameters to provide, e.g. characterID
// 	 * @return the returned response from the server
// 	 * @throws ApiException
// 	 */
// 	XmlApiResult call(String xmlPath, ApiKey key, Map<String,String> parameters) throws ApiException;
// 
// }
// 
// Path: cdi/src/main/java/org/onsteroids/eve/api/connector/XmlApiResult.java
// public interface XmlApiResult extends ApiResult {
// 
// 	/**
// 	 * @return returns the &lt;result&gt; node of the api response
// 	 */
// 	Node getResult();
//         
//     /**
//      * getTimeDifference = serverTime - localTime
//      *
//      * @return the time difference from server to local in milliseconds
//      */
//     long getTimeDifference();
// 
// }


import java.util.Map;
import com.eveonline.api.ApiKey;
import com.eveonline.api.exceptions.ApiException;
import com.eveonline.api.server.ServerStatusApi;
import com.google.common.collect.Maps;
import org.onsteroids.eve.api.InternalApiException;
import org.onsteroids.eve.api.cache.ApiCache;
import org.onsteroids.eve.api.connector.ApiConnection;
import org.onsteroids.eve.api.connector.XmlApiResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * Copyright 2010 Tobias Sarnowski
 *
 * 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.
 */

/**
 * (c) 2010 Tobias Sarnowski
 * All rights reserved.
 */
package org.onsteroids.eve.api.provider;



/**
 * @author Tobias Sarnowski
 */
public abstract class AbstractApiService {
	private static final Logger LOG = LoggerFactory.getLogger(AbstractApiService.class);
// Path: cdi/src/main/java/org/onsteroids/eve/api/InternalApiException.java
// public final class InternalApiException extends ApiException {
// 	private static final Logger LOG = LoggerFactory.getLogger(InternalApiException.class);
// 
// 	public InternalApiException(String message) {
// 		super(message);
// 	}
// 
// 	public InternalApiException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	public InternalApiException(Throwable cause) {
// 		super(cause);
// 	}
// }
// 
// Path: cdi/src/main/java/org/onsteroids/eve/api/cache/ApiCache.java
// public interface ApiCache {
// 
// 	/**
// 	 * @param apiResult the api result to cache
// 	 */
// 	void putApiResult(ApiResult apiResult);
// 
// 	/**
// 	 * @param serverUri the api server uri
// 	 * @param xmlPath the xml path
// 	 * @param <T> an api result type
// 	 * @return the cached api result or null if apiresult not cached
// 	 */
// 	<T extends ApiResult> T getApiResult(Class<T> resultType, URI serverUri, String xmlPath);
// 
// 	/**
// 	 * @param serverUri the api server uri
// 	 * @param xmlPath the xml path
// 	 * @param parameters the used parameters (can be null)
// 	 * @param <T> an api result type
// 	 * @return the cached api result or null if apiresult not cached
// 	 */
// 	<T extends ApiResult> T getApiResult(Class<T> resultType, URI serverUri, String xmlPath, Map<String,String> parameters);
// 
// 	/**
// 	 * @param serverUri the api server uri
// 	 * @param xmlPath the xml path
// 	 * @param key the used api key (can be null)
// 	 * @param <T> an api result type
// 	 * @return the cached api result or null if apiresult not cached
// 	 */
// 	<T extends ApiResult> T getApiResult(Class<T> resultType, URI serverUri, String xmlPath, ApiKey key);
// 
// 	/**
// 	 * @param serverUri the api server uri
// 	 * @param xmlPath the xml path
// 	 * @param key the used api key (can be null)
// 	 * @param parameters the used parameters (can be null)
// 	 * @param <T> an api result type
// 	 * @return the cached api result or null if apiresult not cached
// 	 */
// 	<T extends ApiResult> T getApiResult(Class<T> resultType, URI serverUri, String xmlPath, ApiKey key, Map<String,String> parameters);
// 
// }
// 
// Path: cdi/src/main/java/org/onsteroids/eve/api/connector/ApiConnection.java
// public interface ApiConnection {
// 
// 	/**
// 	 * @return the used server URI
// 	 */
// 	URI getServerUri();
// 
// 
// 	/**
// 	 * @param xmlPath e.g. /server/ServerStatus.xml.aspx
// 	 * @return the returned response from the server
// 	 * @throws ApiException
// 	 */
// 	XmlApiResult call(String xmlPath) throws ApiException;
// 
// 	/**
// 	 * @param xmlPath e.g. /server/ServerStatus.xml.aspx
// 	 * @param parameters additional parameters to provide, e.g. characterID
// 	 * @return the returned response from the server
// 	 * @throws ApiException
// 	 */
// 	XmlApiResult call(String xmlPath, Map<String,String> parameters) throws ApiException;
// 
// 	/**
// 	 * @param xmlPath e.g. /server/ServerStatus.xml.aspx
// 	 * @param key the API key to authenticate against
// 	 * @return the returned response from the server
// 	 * @throws ApiException
// 	 */
// 	XmlApiResult call(String xmlPath, ApiKey key) throws ApiException;
// 
// 	/**
// 	 * @param xmlPath e.g. /server/ServerStatus.xml.aspx
// 	 * @param key the API key to authenticate against
// 	 * @param parameters additional parameters to provide, e.g. characterID
// 	 * @return the returned response from the server
// 	 * @throws ApiException
// 	 */
// 	XmlApiResult call(String xmlPath, ApiKey key, Map<String,String> parameters) throws ApiException;
// 
// }
// 
// Path: cdi/src/main/java/org/onsteroids/eve/api/connector/XmlApiResult.java
// public interface XmlApiResult extends ApiResult {
// 
// 	/**
// 	 * @return returns the &lt;result&gt; node of the api response
// 	 */
// 	Node getResult();
//         
//     /**
//      * getTimeDifference = serverTime - localTime
//      *
//      * @return the time difference from server to local in milliseconds
//      */
//     long getTimeDifference();
// 
// }


// Path: cdi/src/main/java/org/onsteroids/eve/api/provider/AbstractApiService.java
import java.util.Map;
import com.eveonline.api.ApiKey;
import com.eveonline.api.exceptions.ApiException;
import com.eveonline.api.server.ServerStatusApi;
import com.google.common.collect.Maps;
import org.onsteroids.eve.api.InternalApiException;
import org.onsteroids.eve.api.cache.ApiCache;
import org.onsteroids.eve.api.connector.ApiConnection;
import org.onsteroids.eve.api.connector.XmlApiResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Copyright 2010 Tobias Sarnowski
 *
 * 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.
 */

/**
 * (c) 2010 Tobias Sarnowski
 * All rights reserved.
 */
package org.onsteroids.eve.api.provider;



/**
 * @author Tobias Sarnowski
 */
public abstract class AbstractApiService {
	private static final Logger LOG = LoggerFactory.getLogger(AbstractApiService.class);
	private ApiConnection apiConnection;