diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java new file mode 100644 index 0000000000..0f8ef3cf44 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java @@ -0,0 +1,57 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you 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. + */ +package org.jclouds.vcloud.director.v1_5.features; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; + +import org.jclouds.rest.annotations.EndpointParam; +import org.jclouds.rest.annotations.ExceptionParser; +import org.jclouds.rest.annotations.JAXBResponseParser; +import org.jclouds.rest.annotations.RequestFilters; +import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; +import org.jclouds.vcloud.director.v1_5.domain.URISupplier; +import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; +import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; +import org.jclouds.vcloud.director.v1_5.functions.URISupplierToEndpoint; + +import com.google.common.util.concurrent.ListenableFuture; + +/** + * @see AdminCatalogClient + * @author danikov + */ +@RequestFilters(AddVCloudAuthorizationToRequest.class) +public interface AdminCatalogAsyncClient { + + /** + * Retrieves an admin catalog. + */ + @GET + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getCatalog(@EndpointParam(parser = URISupplierToEndpoint.class) URISupplier catalogRef); + +// PUT /admin/catalog/{id} +// DELETE /admin/catalog/{id} +// POST /admin/catalog/{id}/action/publish +// GET /admin/catalog/{id}/owner +// PUT /admin/catalog/{id}/owner +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java new file mode 100644 index 0000000000..001fe526ab --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java @@ -0,0 +1,47 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you 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. + */ +package org.jclouds.vcloud.director.v1_5.features; + +import java.util.concurrent.TimeUnit; + +import org.jclouds.concurrent.Timeout; +import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; +import org.jclouds.vcloud.director.v1_5.domain.URISupplier; + +/** + * Provides synchronous access to {@link AdminCatalog} objects. + * + * @see AdminCatalogAsyncClient + * @author danikov + */ +@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) +public interface AdminCatalogClient { + + /** + * Retrieves a catalog. + * + *
+    * GET /admin/catalog/{id}
+    * 
+ * + * @param catalogRef the reference for the catalog + * @return a catalog + */ + AdminCatalog getCatalog(URISupplier catalogRef); +}