| 1 | /** |
| 2 | * |
| 3 | * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com> |
| 4 | * |
| 5 | * ==================================================================== |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | * ==================================================================== |
| 18 | */ |
| 19 | package org.jclouds.vcloud.config; |
| 20 | |
| 21 | import java.util.Map; |
| 22 | |
| 23 | import org.jclouds.http.RequiresHttp; |
| 24 | import org.jclouds.rest.ConfiguresRestClient; |
| 25 | import org.jclouds.vcloud.VCloudAsyncClient; |
| 26 | import org.jclouds.vcloud.VCloudClient; |
| 27 | import org.jclouds.vcloud.features.CatalogAsyncClient; |
| 28 | import org.jclouds.vcloud.features.CatalogClient; |
| 29 | import org.jclouds.vcloud.features.NetworkAsyncClient; |
| 30 | import org.jclouds.vcloud.features.NetworkClient; |
| 31 | import org.jclouds.vcloud.features.OrgAsyncClient; |
| 32 | import org.jclouds.vcloud.features.OrgClient; |
| 33 | import org.jclouds.vcloud.features.TaskAsyncClient; |
| 34 | import org.jclouds.vcloud.features.TaskClient; |
| 35 | import org.jclouds.vcloud.features.VAppAsyncClient; |
| 36 | import org.jclouds.vcloud.features.VAppClient; |
| 37 | import org.jclouds.vcloud.features.VAppTemplateAsyncClient; |
| 38 | import org.jclouds.vcloud.features.VAppTemplateClient; |
| 39 | import org.jclouds.vcloud.features.VDCAsyncClient; |
| 40 | import org.jclouds.vcloud.features.VDCClient; |
| 41 | import org.jclouds.vcloud.features.VmAsyncClient; |
| 42 | import org.jclouds.vcloud.features.VmClient; |
| 43 | |
| 44 | import com.google.common.collect.ImmutableMap; |
| 45 | |
| 46 | /** |
| 47 | * Configures the VCloud authentication service connection, including logging and http transport. |
| 48 | * |
| 49 | * @author Adrian Cole |
| 50 | */ |
| 51 | @RequiresHttp |
| 52 | @ConfiguresRestClient |
| 53 | public class VCloudRestClientModule extends BaseVCloudRestClientModule<VCloudClient, VCloudAsyncClient> { |
| 54 | |
| 55 | public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>> builder()// |
| 56 | .put(VAppTemplateClient.class, VAppTemplateAsyncClient.class)// |
| 57 | .put(VAppClient.class, VAppAsyncClient.class)// |
| 58 | .put(VmClient.class, VmAsyncClient.class)// |
| 59 | .put(CatalogClient.class, CatalogAsyncClient.class)// |
| 60 | .put(TaskClient.class, TaskAsyncClient.class)// |
| 61 | .put(VDCClient.class, VDCAsyncClient.class)// |
| 62 | .put(NetworkClient.class, NetworkAsyncClient.class)// |
| 63 | .put(OrgClient.class, OrgAsyncClient.class)// |
| 64 | .build(); |
| 65 | |
| 66 | public VCloudRestClientModule() { |
| 67 | super(VCloudClient.class, VCloudAsyncClient.class, DELEGATE_MAP); |
| 68 | } |
| 69 | |
| 70 | } |