diff --git a/archetypes/json-client-archetype/src/main/resources/archetype-resources/src/main/java/__providerName__ContextFactory.java b/archetypes/json-client-archetype/src/main/resources/archetype-resources/src/main/java/__providerName__ContextFactory.java index 5a388300be..e7368680ad 100644 --- a/archetypes/json-client-archetype/src/main/resources/archetype-resources/src/main/java/__providerName__ContextFactory.java +++ b/archetypes/json-client-archetype/src/main/resources/archetype-resources/src/main/java/__providerName__ContextFactory.java @@ -1,27 +1,9 @@ -/** - * - * Copyright (C) 2009 Cloud Conscious, LLC. - * - * ==================================================================== - * 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. - * ==================================================================== - */ #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) /** * - * Copyright (C) 2009 Cloud Conscious, LLC. + * Copyright (C) 2010 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -44,6 +26,7 @@ */ package ${package}; +import java.net.URI; import java.util.Properties; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; @@ -74,7 +57,13 @@ public class ${providerName}ContextFactory { return new ${providerName}ContextBuilder("${artifactId}", new ${providerName}PropertiesBuilder(user, password).build()) .withModules(modules).buildContext(); } - + + public static RestContext<${providerName}AsyncClient, ${providerName}Client> createContext(URI endpoint, String user, String password, + Module... modules) { + return new ${providerName}ContextBuilder("${artifactId}", new ${providerName}PropertiesBuilder(user, password).withEndpoint(endpoint).build()) + .withModules(modules).buildContext(); + } + public static RestContext<${providerName}AsyncClient, ${providerName}Client> createContext(Properties properties, Module... modules) { return new ${providerName}ContextBuilder("${artifactId}", new ${providerName}PropertiesBuilder(properties).build()) .withModules(modules).buildContext();