diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainAsyncClient.java index ccb380805a..fc89a311d7 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainAsyncClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainAsyncClient.java @@ -20,6 +20,7 @@ package org.jclouds.cloudstack; import org.jclouds.cloudstack.features.DomainAccountAsyncClient; import org.jclouds.cloudstack.features.DomainLimitAsyncClient; +import org.jclouds.cloudstack.features.DomainUserAsyncClient; import org.jclouds.rest.annotations.Delegate; /** @@ -48,4 +49,10 @@ public interface CloudStackDomainAsyncClient extends CloudStackAsyncClient { @Override DomainAccountAsyncClient getAccountClient(); + /** + * Provides asynchronous access to Users + */ + @Delegate + DomainUserAsyncClient getUserClient(); + } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainClient.java index 9d5ab03418..62a29ea2e2 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainClient.java @@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit; import org.jclouds.cloudstack.features.DomainAccountClient; import org.jclouds.cloudstack.features.DomainLimitClient; +import org.jclouds.cloudstack.features.DomainUserClient; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; @@ -51,4 +52,10 @@ public interface CloudStackDomainClient extends CloudStackClient { @Delegate @Override DomainAccountClient getAccountClient(); + + /** + * Provides synchronous access to Users + */ + @Delegate + DomainUserClient getUserClient(); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java index d0a6cc4d43..78beda1060 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java @@ -38,6 +38,8 @@ import org.jclouds.cloudstack.features.DomainAccountAsyncClient; import org.jclouds.cloudstack.features.DomainAccountClient; import org.jclouds.cloudstack.features.DomainLimitAsyncClient; import org.jclouds.cloudstack.features.DomainLimitClient; +import org.jclouds.cloudstack.features.DomainUserAsyncClient; +import org.jclouds.cloudstack.features.DomainUserClient; import org.jclouds.cloudstack.features.EventAsyncClient; import org.jclouds.cloudstack.features.EventClient; import org.jclouds.cloudstack.features.FirewallAsyncClient; @@ -126,6 +128,7 @@ public class CloudStackRestClientModule extends RestClientModule + */ +@RequestFilters(QuerySigner.class) +@QueryParams(keys = "response", values = "json") +public interface DomainUserAsyncClient extends AccountAsyncClient { + +} diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java new file mode 100644 index 0000000000..036300102e --- /dev/null +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/DomainUserClient.java @@ -0,0 +1,38 @@ +/** + * 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.cloudstack.features; + +import org.jclouds.concurrent.Timeout; + +import java.util.concurrent.TimeUnit; + +/** + * Provides synchronous access to CloudStack User features available to Domain + * Admin users. + * + * @author Andrei Savu + * @see + */ +@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS) +public interface DomainUserClient extends AccountClient { + + +} diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/DomainUserAsyncClientTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/DomainUserAsyncClientTest.java new file mode 100644 index 0000000000..93d0b759d0 --- /dev/null +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/DomainUserAsyncClientTest.java @@ -0,0 +1,38 @@ +/** + * 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.cloudstack.features; + +import com.google.inject.TypeLiteral; +import org.jclouds.rest.internal.RestAnnotationProcessor; +import org.testng.annotations.Test; + +/** + * Tests behavior of {@code DomainUserAsyncClient} + * + * @author Andrei Savu + */ +@Test(groups = "unit", testName = "DomainUserAsyncClientTest") +public class DomainUserAsyncClientTest extends BaseCloudStackAsyncClientTest { + + @Override + protected TypeLiteral> createTypeLiteral() { + return new TypeLiteral>() { + }; + } +}