View Javadoc

1   /**
2    * Licensed to jclouds, Inc. (jclouds) under one or more
3    * contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  jclouds licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  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,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.jclouds.trmk.ecloud.features;
20  
21  import java.net.URI;
22  import java.util.Set;
23  import javax.ws.rs.Consumes;
24  import javax.ws.rs.GET;
25  
26  import com.google.common.util.concurrent.ListenableFuture;
27  import org.jclouds.javax.annotation.Nullable;
28  import org.jclouds.rest.annotations.EndpointParam;
29  import org.jclouds.rest.annotations.ExceptionParser;
30  import org.jclouds.rest.annotations.RequestFilters;
31  import org.jclouds.rest.annotations.XMLResponseParser;
32  import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
33  import org.jclouds.trmk.ecloud.functions.OrgURIToDataCentersListEndpoint;
34  import org.jclouds.trmk.vcloud_0_8.domain.DataCenter;
35  import org.jclouds.trmk.vcloud_0_8.domain.KeyPair;
36  import org.jclouds.trmk.vcloud_0_8.filters.SetVCloudTokenCookie;
37  import org.jclouds.trmk.vcloud_0_8.xml.DataCentersHandler;
38  
39  import static org.jclouds.trmk.ecloud.TerremarkECloudMediaType.DATACENTERSLIST_XML;
40  
41  /**
42   * 
43   * @see <a href=
44   *      "http://support.theenterprisecloud.com/kb/default.asp?id=960&Lang=1&SID="
45   *      />
46   * @see DataCenterOperationsClient
47   * 
48   * @author Adrian Cole
49   */
50  @RequestFilters(SetVCloudTokenCookie.class)
51  public interface DataCenterOperationsAsyncClient {
52  
53     /**
54      * @see DataCenterOperationsClient#listDataCentersInOrg
55      */
56     @GET
57     @Consumes(DATACENTERSLIST_XML)
58     @XMLResponseParser(DataCentersHandler.class)
59     @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
60     ListenableFuture<? extends Set<KeyPair>> listDataCentersInOrg(
61           @Nullable @EndpointParam(parser = OrgURIToDataCentersListEndpoint.class) URI org);
62  
63     /**
64      * @see DataCenterOperationsClient#listDataCenters
65      */
66     @GET
67     @Consumes(DATACENTERSLIST_XML)
68     @XMLResponseParser(DataCentersHandler.class)
69     @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
70     ListenableFuture<? extends Set<DataCenter>> listDataCenters(@EndpointParam URI dataCenters);
71  }