// Path: src/main/java/uk/bl/odin/orcid/domain/CacheManager.java
// public class CacheManager {
// 
// 	private final Cache<SearchKey, OrcidSearchResults> searchCache;
// 
// 	private final Cache<String, OrcidProfile> profileCache;
// 
// 	@Inject
// 	public CacheManager(@Named("OrcidCacheTimeout") Integer timeOutInMinutes,
// 			@Named("OrcidCacheMaxsize") Integer maximumSize) {
// 		searchCache = CacheBuilder.newBuilder().expireAfterWrite(timeOutInMinutes, TimeUnit.MINUTES)
// 				.maximumSize(maximumSize).build();
// 		profileCache = CacheBuilder.newBuilder().expireAfterWrite(timeOutInMinutes, TimeUnit.MINUTES)
// 				.maximumSize(maximumSize).build();
// 	}
// 
// 	public Cache<SearchKey, OrcidSearchResults> getSearchCache() {
// 		return searchCache;
// 	}
// 
// 	public Cache<String, OrcidProfile> getProfilecache() {
// 		return profileCache;
// 	}
// 
// }
// 
// Path: src/main/java/uk/bl/odin/orcid/domain/IsOrcidWorkProvider.java
// public interface IsOrcidWorkProvider {
// 	public IsOrcidWork fetch(String id) throws IOException;
// }


import java.util.logging.Level;
import java.util.logging.Logger;
import org.restlet.Context;
import uk.bl.odin.orcid.client.OrcidOAuthClient;
import uk.bl.odin.orcid.client.OrcidPublicClient;
import uk.bl.odin.orcid.domain.CacheManager;
import uk.bl.odin.orcid.domain.IsOrcidWorkProvider;
import com.google.inject.AbstractModule;
import com.google.inject.name.Names;
package uk.bl.odin.orcid;





/**
 * Manages dependencies. Uses context passed from Servlet Init params.
 * 
 * @author tom
 * 
 */
public class GuiceConfigModule extends AbstractModule {

	private static final Logger log = Logger.getLogger(GuiceConfigModule.class.getName());
	private Context context;
	public static final String CONFIG_KEY_OrcidClientID = "OrcidClientID";
	public static final String CONFIG_KEY_OrcidClientSecret = "OrcidClientSecret";
	public static final String CONFIG_KEY_OrcidReturnURI = "OrcidReturnURI";
	public static final String CONFIG_KEY_OrcidSandbox = "OrcidSandbox";
	public static final String CONFIG_KEY_OrcidWorkProvider = "OrcidWorkProvider";

	public static final String CONFIG_KEY_CacheTimeout = "OrcidCacheTimeout";
	public static final String CONFIG_KEY_CacheMaxsize = "OrcidCacheMaxsize";

// Path: src/main/java/uk/bl/odin/orcid/domain/CacheManager.java
// public class CacheManager {
// 
// 	private final Cache<SearchKey, OrcidSearchResults> searchCache;
// 
// 	private final Cache<String, OrcidProfile> profileCache;
// 
// 	@Inject
// 	public CacheManager(@Named("OrcidCacheTimeout") Integer timeOutInMinutes,
// 			@Named("OrcidCacheMaxsize") Integer maximumSize) {
// 		searchCache = CacheBuilder.newBuilder().expireAfterWrite(timeOutInMinutes, TimeUnit.MINUTES)
// 				.maximumSize(maximumSize).build();
// 		profileCache = CacheBuilder.newBuilder().expireAfterWrite(timeOutInMinutes, TimeUnit.MINUTES)
// 				.maximumSize(maximumSize).build();
// 	}
// 
// 	public Cache<SearchKey, OrcidSearchResults> getSearchCache() {
// 		return searchCache;
// 	}
// 
// 	public Cache<String, OrcidProfile> getProfilecache() {
// 		return profileCache;
// 	}
// 
// }
// 
// Path: src/main/java/uk/bl/odin/orcid/domain/IsOrcidWorkProvider.java
// public interface IsOrcidWorkProvider {
// 	public IsOrcidWork fetch(String id) throws IOException;
// }


// Path: src/main/java/uk/bl/odin/orcid/GuiceConfigModule.java
import java.util.logging.Level;
import java.util.logging.Logger;
import org.restlet.Context;
import uk.bl.odin.orcid.client.OrcidOAuthClient;
import uk.bl.odin.orcid.client.OrcidPublicClient;
import uk.bl.odin.orcid.domain.CacheManager;
import uk.bl.odin.orcid.domain.IsOrcidWorkProvider;
import com.google.inject.AbstractModule;
import com.google.inject.name.Names;

package uk.bl.odin.orcid;





/**
 * Manages dependencies. Uses context passed from Servlet Init params.
 * 
 * @author tom
 * 
 */
public class GuiceConfigModule extends AbstractModule {

	private static final Logger log = Logger.getLogger(GuiceConfigModule.class.getName());
	private Context context;
	public static final String CONFIG_KEY_OrcidClientID = "OrcidClientID";
	public static final String CONFIG_KEY_OrcidClientSecret = "OrcidClientSecret";
	public static final String CONFIG_KEY_OrcidReturnURI = "OrcidReturnURI";
	public static final String CONFIG_KEY_OrcidSandbox = "OrcidSandbox";
	public static final String CONFIG_KEY_OrcidWorkProvider = "OrcidWorkProvider";

	public static final String CONFIG_KEY_CacheTimeout = "OrcidCacheTimeout";
	public static final String CONFIG_KEY_CacheMaxsize = "OrcidCacheMaxsize";

	public GuiceConfigModule(Context context) {