diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/config/VCloudComputeServiceDependenciesModule.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/config/VCloudComputeServiceDependenciesModule.java index c4dc4a992a..31984337e0 100644 --- a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/config/VCloudComputeServiceDependenciesModule.java +++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/config/VCloudComputeServiceDependenciesModule.java @@ -40,7 +40,6 @@ import org.jclouds.functions.IdentityFunction; import org.jclouds.vcloud.compute.functions.HardwareForVApp; import org.jclouds.vcloud.compute.functions.HardwareForVAppTemplate; import org.jclouds.vcloud.compute.functions.ImageForVAppTemplate; -import org.jclouds.vcloud.compute.functions.VAppTemplatesInOrg; import org.jclouds.vcloud.compute.functions.VAppToNodeMetadata; import org.jclouds.vcloud.compute.internal.VCloudTemplateBuilderImpl; import org.jclouds.vcloud.compute.options.VCloudTemplateOptions; @@ -49,6 +48,7 @@ import org.jclouds.vcloud.domain.Org; import org.jclouds.vcloud.domain.Status; import org.jclouds.vcloud.domain.VApp; import org.jclouds.vcloud.domain.VAppTemplate; +import org.jclouds.vcloud.functions.VAppTemplatesInOrg; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadata.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadata.java index 1454296d88..58fe90844c 100644 --- a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadata.java +++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadata.java @@ -38,7 +38,6 @@ import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.domain.NodeMetadataBuilder; import org.jclouds.compute.domain.NodeState; import org.jclouds.domain.Credentials; -import org.jclouds.domain.LoginCredentials; import org.jclouds.logging.Logger; import org.jclouds.util.InetAddresses2.IsPrivateIPAddress; import org.jclouds.vcloud.domain.Status; @@ -87,8 +86,6 @@ public class VAppToNodeMetadata implements Function { Credentials fromApi = getCredentialsFrom(from); if (fromApi != null && !credentialStore.containsKey("node#" + from.getHref().toASCIIString())) credentialStore.put("node#" + from.getHref().toASCIIString(), fromApi); - builder.credentials(LoginCredentials.fromCredentials(credentialStore - .get("node#" + from.getHref().toASCIIString()))); return builder.build(); } } \ No newline at end of file diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppTemplatesInOrg.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/functions/VAppTemplatesInOrg.java similarity index 69% rename from apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppTemplatesInOrg.java rename to apis/vcloud/src/main/java/org/jclouds/vcloud/functions/VAppTemplatesInOrg.java index 7fd0f8a9ea..f2ea52af28 100644 --- a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppTemplatesInOrg.java +++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/functions/VAppTemplatesInOrg.java @@ -16,9 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.jclouds.vcloud.compute.functions; - -import static org.jclouds.vcloud.compute.util.VCloudComputeUtils.getCredentialsFrom; +package org.jclouds.vcloud.functions; import java.util.Map; @@ -26,7 +24,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import org.jclouds.domain.Credentials; -import org.jclouds.domain.LoginCredentials; import org.jclouds.vcloud.domain.CatalogItem; import org.jclouds.vcloud.domain.Org; import org.jclouds.vcloud.domain.VAppTemplate; @@ -44,7 +41,6 @@ public class VAppTemplatesInOrg implements Function> private final AllCatalogItemsInOrg allCatalogItemsInOrg; private final Function, Iterable> vAppTemplatesForCatalogItems; - private final Map credentialStore; @Inject VAppTemplatesInOrg(AllCatalogItemsInOrg allCatalogItemsInOrg, @@ -52,27 +48,13 @@ public class VAppTemplatesInOrg implements Function> Map credentialStore) { this.allCatalogItemsInOrg = allCatalogItemsInOrg; this.vAppTemplatesForCatalogItems = vAppTemplatesForCatalogItems; - this.credentialStore = credentialStore; } @Override public Iterable apply(Org from) { Iterable catalogs = allCatalogItemsInOrg.apply(from); Iterable vAppTemplates = vAppTemplatesForCatalogItems.apply(catalogs); - return Iterables.transform(Iterables.filter(vAppTemplates, Predicates.notNull()), - new Function() { - - @Override - public VAppTemplate apply(VAppTemplate arg0) { - LoginCredentials creds = getCredentialsFrom(arg0); - if (creds == null) - credentialStore.remove("image#" + arg0.getHref().toASCIIString()); - else - credentialStore.put("image#" + arg0.getHref().toASCIIString(), creds); - return arg0; - } - - }); + return Iterables.filter(vAppTemplates, Predicates.notNull()); } } \ No newline at end of file