diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURL.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURL.java index 048645e6ba..fbd23d2ea2 100644 --- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURL.java +++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURL.java @@ -1,43 +1,43 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.openstack.keystone.v2_0.functions; - -import java.net.URI; - -import javax.inject.Singleton; - -import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; - -import com.google.common.base.Supplier; -import com.google.common.base.Suppliers; - -/** - * Select internal URL endpoints services - * - */ -@Singleton -public class InternalURL implements EndpointToSupplierURI { - @Override - public Supplier apply(Endpoint input) { - return Suppliers.ofInstance(input.getInternalURL()); - } - - @Override - public String toString() { - return "supplyInternalURL()"; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.openstack.keystone.v2_0.functions; + +import java.net.URI; + +import javax.inject.Singleton; + +import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; + +import com.google.common.base.Supplier; +import com.google.common.base.Suppliers; + +/** + * Select internal URL endpoints services + * + */ +@Singleton +public class InternalURL implements EndpointToSupplierURI { + @Override + public Supplier apply(Endpoint input) { + return Suppliers.ofInstance(input.getInternalURL()); + } + + @Override + public String toString() { + return "supplyInternalURL()"; + } +} diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java index 7d3e1def26..3f3782542d 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java @@ -1,39 +1,39 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.openstack.keystone.v2_0.functions; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; - -import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; -import org.testng.annotations.Test; - -/** - */ -@Test(groups = "unit", testName = "InternalURLTest") -public class InternalURLTest { - private final InternalURL fn = new InternalURL(); - - public void testInternalURL() { - assertEquals( - fn.apply( - Endpoint.builder().region("regionOne").versionId("2.0") - .internalURL(URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")) - .build()).get(), URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.openstack.keystone.v2_0.functions; + +import static org.testng.Assert.assertEquals; + +import java.net.URI; + +import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; +import org.testng.annotations.Test; + +/** + */ +@Test(groups = "unit", testName = "InternalURLTest") +public class InternalURLTest { + private final InternalURL fn = new InternalURL(); + + public void testInternalURL() { + assertEquals( + fn.apply( + Endpoint.builder().region("regionOne").versionId("2.0") + .internalURL(URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")) + .build()).get(), URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")); + } +} diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest.java index 47eeeaf063..a19dc754c0 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest.java @@ -1,74 +1,74 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.openstack.nova.v2_0; - -import static org.testng.Assert.assertEquals; - -import java.util.Properties; - -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; -import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest; -import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableSet; - -/** - * - * @see org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties#CREDENTIAL_TYPE - */ -@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest") -public class AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest extends BaseNovaApiExpectTest { - public AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest() { - identity = identityWithTenantId; - } - - /** - * this reflects the properties that a user would pass to createContext - */ - @Override - protected Properties setupProperties() { - Properties contextProperties = super.setupProperties(); - contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); - contextProperties.setProperty("jclouds.keystone.tenant-id", KeystoneFixture.INSTANCE.getTenantId()); - return contextProperties; - } - - public void testListServersWhenResponseIs2xx() throws Exception { - HttpRequest listServers = HttpRequest - .builder() - .method("GET") - .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") - .addHeader("Accept", "application/json") - .addHeader("X-Auth-Token", authToken).build(); - - HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) - .payload(payloadFromResource("/server_list.json")).build(); - - NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantId, - responseWithKeystoneAccess, listServers, listServersResponse); - - assertEquals(apiWhenServersExist.getConfiguredRegions(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1")); - - assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(), - new ParseServerListTest().expected().toString()); - } - -} - +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.openstack.nova.v2_0; + +import static org.testng.Assert.assertEquals; + +import java.util.Properties; + +import org.jclouds.http.HttpRequest; +import org.jclouds.http.HttpResponse; +import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; +import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest; +import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableSet; + +/** + * + * @see org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties#CREDENTIAL_TYPE + */ +@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest") +public class AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest extends BaseNovaApiExpectTest { + public AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest() { + identity = identityWithTenantId; + } + + /** + * this reflects the properties that a user would pass to createContext + */ + @Override + protected Properties setupProperties() { + Properties contextProperties = super.setupProperties(); + contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); + contextProperties.setProperty("jclouds.keystone.tenant-id", KeystoneFixture.INSTANCE.getTenantId()); + return contextProperties; + } + + public void testListServersWhenResponseIs2xx() throws Exception { + HttpRequest listServers = HttpRequest + .builder() + .method("GET") + .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") + .addHeader("Accept", "application/json") + .addHeader("X-Auth-Token", authToken).build(); + + HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) + .payload(payloadFromResource("/server_list.json")).build(); + + NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantId, + responseWithKeystoneAccess, listServers, listServersResponse); + + assertEquals(apiWhenServersExist.getConfiguredRegions(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1")); + + assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(), + new ParseServerListTest().expected().toString()); + } + +} + diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest.java index a05e6c79d4..8a949e5b6c 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest.java @@ -1,74 +1,74 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.openstack.nova.v2_0; - -import static org.testng.Assert.assertEquals; - -import java.util.Properties; - -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; -import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest; -import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableSet; - -/** - * - * @see KeystoneProperties#CREDENTIAL_TYPE - */ -@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest") -public class AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest extends BaseNovaApiExpectTest { - public AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest() { - identity = "identity"; - } - - /** - * this reflects the properties that a user would pass to createContext - */ - @Override - protected Properties setupProperties() { - Properties contextProperties = super.setupProperties(); - contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); - contextProperties.setProperty("jclouds.keystone.tenant-name", KeystoneFixture.INSTANCE.getTenantName()); - return contextProperties; - } - - public void testListServersWhenResponseIs2xx() throws Exception { - HttpRequest listServers = HttpRequest - .builder() - .method("GET") - .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") - .addHeader("Accept", "application/json") - .addHeader("X-Auth-Token", authToken).build(); - - HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) - .payload(payloadFromResource("/server_list.json")).build(); - - NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, - responseWithKeystoneAccess, listServers, listServersResponse); - - assertEquals(apiWhenServersExist.getConfiguredRegions(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1")); - - assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(), - new ParseServerListTest().expected().toString()); - } - -} - +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.openstack.nova.v2_0; + +import static org.testng.Assert.assertEquals; + +import java.util.Properties; + +import org.jclouds.http.HttpRequest; +import org.jclouds.http.HttpResponse; +import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; +import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest; +import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableSet; + +/** + * + * @see KeystoneProperties#CREDENTIAL_TYPE + */ +@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest") +public class AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest extends BaseNovaApiExpectTest { + public AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest() { + identity = "identity"; + } + + /** + * this reflects the properties that a user would pass to createContext + */ + @Override + protected Properties setupProperties() { + Properties contextProperties = super.setupProperties(); + contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); + contextProperties.setProperty("jclouds.keystone.tenant-name", KeystoneFixture.INSTANCE.getTenantName()); + return contextProperties; + } + + public void testListServersWhenResponseIs2xx() throws Exception { + HttpRequest listServers = HttpRequest + .builder() + .method("GET") + .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") + .addHeader("Accept", "application/json") + .addHeader("X-Auth-Token", authToken).build(); + + HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) + .payload(payloadFromResource("/server_list.json")).build(); + + NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, + responseWithKeystoneAccess, listServers, listServersResponse); + + assertEquals(apiWhenServersExist.getConfiguredRegions(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1")); + + assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(), + new ParseServerListTest().expected().toString()); + } + +} + diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAuthenticationExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAuthenticationExpectTest.java index ff6b068374..bd3f714a2b 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAuthenticationExpectTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/AccessKeyAndSecretKeyAuthenticationExpectTest.java @@ -1,68 +1,68 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.openstack.nova.v2_0; - -import static org.testng.Assert.assertEquals; - -import java.util.Properties; - -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest; -import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableSet; - -/** - * - * @see org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties#CREDENTIAL_TYPE - */ -@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAuthenticationExpectTest") -public class AccessKeyAndSecretKeyAuthenticationExpectTest extends BaseNovaApiExpectTest { - - /** - * this reflects the properties that a user would pass to createContext - */ - @Override - protected Properties setupProperties() { - Properties contextProperties = super.setupProperties(); - contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); - return contextProperties; - } - - public void testListServersWhenResponseIs2xx() throws Exception { - HttpRequest listServers = HttpRequest - .builder() - .method("GET") - .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") - .addHeader("Accept", "application/json") - .addHeader("X-Auth-Token", authToken).build(); - - HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) - .payload(payloadFromResource("/server_list.json")).build(); - - NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, - responseWithKeystoneAccess, listServers, listServersResponse); - - assertEquals(apiWhenServersExist.getConfiguredRegions(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1")); - - assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(), - new ParseServerListTest().expected().toString()); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.openstack.nova.v2_0; + +import static org.testng.Assert.assertEquals; + +import java.util.Properties; + +import org.jclouds.http.HttpRequest; +import org.jclouds.http.HttpResponse; +import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest; +import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableSet; + +/** + * + * @see org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties#CREDENTIAL_TYPE + */ +@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAuthenticationExpectTest") +public class AccessKeyAndSecretKeyAuthenticationExpectTest extends BaseNovaApiExpectTest { + + /** + * this reflects the properties that a user would pass to createContext + */ + @Override + protected Properties setupProperties() { + Properties contextProperties = super.setupProperties(); + contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); + return contextProperties; + } + + public void testListServersWhenResponseIs2xx() throws Exception { + HttpRequest listServers = HttpRequest + .builder() + .method("GET") + .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") + .addHeader("Accept", "application/json") + .addHeader("X-Auth-Token", authToken).build(); + + HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) + .payload(payloadFromResource("/server_list.json")).build(); + + NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, + responseWithKeystoneAccess, listServers, listServersResponse); + + assertEquals(apiWhenServersExist.getConfiguredRegions(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1")); + + assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(), + new ParseServerListTest().expected().toString()); + } + +} diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest.java index 88a0016f56..4ddf183012 100644 --- a/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest.java +++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest.java @@ -1,69 +1,69 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.openstack.swift.keystone; - -import static org.testng.Assert.assertEquals; - -import java.util.Properties; - -import javax.ws.rs.core.MediaType; - -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; -import org.jclouds.openstack.swift.SwiftKeystoneClient; -import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; -import org.testng.annotations.Test; - -/** - * - * @see KeystoneProperties#CREDENTIAL_TYPE - */ -@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest") -public class AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest { - public AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest() { - identity = identityWithTenantId; - } - - /** - * this reflects the properties that a user would pass to createContext - */ - @Override - protected Properties setupProperties() { - Properties contextProperties = super.setupProperties(); - contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); - contextProperties.setProperty("jclouds.keystone.tenant-id", KeystoneFixture.INSTANCE.getTenantId()); - return contextProperties; - } - - public void testContainerExistsWhenResponseIs2xx() throws Exception { - HttpRequest containerExists = HttpRequest.builder() - .method("HEAD") - .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") - .addHeader("Accept", MediaType.WILDCARD) - .addHeader("X-Auth-Token", authToken).build(); - - HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); - - SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantId, - responseWithKeystoneAccess, containerExists, containerExistsResponse); - - assertEquals(clientWhenContainerExists.containerExists("container"), true); - } - -} - +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.openstack.swift.keystone; + +import static org.testng.Assert.assertEquals; + +import java.util.Properties; + +import javax.ws.rs.core.MediaType; + +import org.jclouds.http.HttpRequest; +import org.jclouds.http.HttpResponse; +import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; +import org.jclouds.openstack.swift.SwiftKeystoneClient; +import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; +import org.testng.annotations.Test; + +/** + * + * @see KeystoneProperties#CREDENTIAL_TYPE + */ +@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest") +public class AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest { + public AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest() { + identity = identityWithTenantId; + } + + /** + * this reflects the properties that a user would pass to createContext + */ + @Override + protected Properties setupProperties() { + Properties contextProperties = super.setupProperties(); + contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); + contextProperties.setProperty("jclouds.keystone.tenant-id", KeystoneFixture.INSTANCE.getTenantId()); + return contextProperties; + } + + public void testContainerExistsWhenResponseIs2xx() throws Exception { + HttpRequest containerExists = HttpRequest.builder() + .method("HEAD") + .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") + .addHeader("Accept", MediaType.WILDCARD) + .addHeader("X-Auth-Token", authToken).build(); + + HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); + + SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantId, + responseWithKeystoneAccess, containerExists, containerExistsResponse); + + assertEquals(clientWhenContainerExists.containerExists("container"), true); + } + +} + diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest.java index 257a60c6f9..7fda986f31 100644 --- a/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest.java +++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest.java @@ -1,70 +1,70 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.openstack.swift.keystone; - -import static org.testng.Assert.assertEquals; - -import java.util.Properties; - -import javax.ws.rs.core.MediaType; - -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; -import org.jclouds.openstack.swift.SwiftKeystoneClient; -import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; -import org.testng.annotations.Test; - -/** - * - * @see KeystoneProperties#CREDENTIAL_TYPE - */ -@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest") -public class AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest { - public AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest() { - identity = "identity"; - } - - /** - * this reflects the properties that a user would pass to createContext - */ - @Override - protected Properties setupProperties() { - Properties contextProperties = super.setupProperties(); - contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); - contextProperties.setProperty("jclouds.keystone.tenant-name", KeystoneFixture.INSTANCE.getTenantName()); - return contextProperties; - } - - public void testContainerExistsWhenResponseIs2xx() throws Exception { - HttpRequest containerExists = HttpRequest.builder() - .method("HEAD") - .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") - .addHeader("Accept", MediaType.WILDCARD) - .addHeader("X-Auth-Token", authToken).build(); - - HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); - - SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, - responseWithKeystoneAccess, containerExists, containerExistsResponse); - - assertEquals(clientWhenContainerExists.containerExists("container"), true); - } - - -} - +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.openstack.swift.keystone; + +import static org.testng.Assert.assertEquals; + +import java.util.Properties; + +import javax.ws.rs.core.MediaType; + +import org.jclouds.http.HttpRequest; +import org.jclouds.http.HttpResponse; +import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; +import org.jclouds.openstack.swift.SwiftKeystoneClient; +import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; +import org.testng.annotations.Test; + +/** + * + * @see KeystoneProperties#CREDENTIAL_TYPE + */ +@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest") +public class AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest { + public AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest() { + identity = "identity"; + } + + /** + * this reflects the properties that a user would pass to createContext + */ + @Override + protected Properties setupProperties() { + Properties contextProperties = super.setupProperties(); + contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); + contextProperties.setProperty("jclouds.keystone.tenant-name", KeystoneFixture.INSTANCE.getTenantName()); + return contextProperties; + } + + public void testContainerExistsWhenResponseIs2xx() throws Exception { + HttpRequest containerExists = HttpRequest.builder() + .method("HEAD") + .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") + .addHeader("Accept", MediaType.WILDCARD) + .addHeader("X-Auth-Token", authToken).build(); + + HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); + + SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, + responseWithKeystoneAccess, containerExists, containerExistsResponse); + + assertEquals(clientWhenContainerExists.containerExists("container"), true); + } + + +} + diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAuthenticationExpectTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAuthenticationExpectTest.java index a27630ce75..d6a2d974c3 100644 --- a/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAuthenticationExpectTest.java +++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/keystone/AccessKeyAndSecretKeyAuthenticationExpectTest.java @@ -1,64 +1,64 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.openstack.swift.keystone; - -import static org.testng.Assert.assertEquals; - -import java.util.Properties; - -import javax.ws.rs.core.MediaType; - -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.openstack.swift.SwiftKeystoneClient; -import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; -import org.testng.annotations.Test; - -/** - * - * @see KeystoneProperties#CREDENTIAL_TYPE - */ -@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAuthenticationExpectTest") -public class AccessKeyAndSecretKeyAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest { - - /** - * this reflects the properties that a user would pass to createContext - */ - @Override - protected Properties setupProperties() { - Properties contextProperties = super.setupProperties(); - contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); - return contextProperties; - } - - public void testContainerExistsWhenResponseIs2xx() throws Exception { - HttpRequest containerExists = HttpRequest.builder() - .method("HEAD") - .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") - .addHeader("Accept", MediaType.WILDCARD) - .addHeader("X-Auth-Token", authToken).build(); - - HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); - - SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, - responseWithKeystoneAccess, containerExists, containerExistsResponse); - - assertEquals(clientWhenContainerExists.containerExists("container"), true); - } - - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.openstack.swift.keystone; + +import static org.testng.Assert.assertEquals; + +import java.util.Properties; + +import javax.ws.rs.core.MediaType; + +import org.jclouds.http.HttpRequest; +import org.jclouds.http.HttpResponse; +import org.jclouds.openstack.swift.SwiftKeystoneClient; +import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; +import org.testng.annotations.Test; + +/** + * + * @see KeystoneProperties#CREDENTIAL_TYPE + */ +@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAuthenticationExpectTest") +public class AccessKeyAndSecretKeyAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest { + + /** + * this reflects the properties that a user would pass to createContext + */ + @Override + protected Properties setupProperties() { + Properties contextProperties = super.setupProperties(); + contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); + return contextProperties; + } + + public void testContainerExistsWhenResponseIs2xx() throws Exception { + HttpRequest containerExists = HttpRequest.builder() + .method("HEAD") + .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") + .addHeader("Accept", MediaType.WILDCARD) + .addHeader("X-Auth-Token", authToken).build(); + + HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); + + SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, + responseWithKeystoneAccess, containerExists, containerExistsResponse); + + assertEquals(clientWhenContainerExists.containerExists("container"), true); + } + + +} diff --git a/compute/src/main/java/org/jclouds/compute/domain/ComputeMetadata.java b/compute/src/main/java/org/jclouds/compute/domain/ComputeMetadata.java index ce0cda5670..a13ad5cbc6 100644 --- a/compute/src/main/java/org/jclouds/compute/domain/ComputeMetadata.java +++ b/compute/src/main/java/org/jclouds/compute/domain/ComputeMetadata.java @@ -1,65 +1,65 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.compute.domain; - -import java.util.Set; - -import org.jclouds.compute.domain.internal.ComputeMetadataImpl; -import org.jclouds.domain.ResourceMetadata; -import org.jclouds.javax.annotation.Nullable; - -import com.google.inject.ImplementedBy; - -/** - */ -@ImplementedBy(ComputeMetadataImpl.class) -public interface ComputeMetadata extends ResourceMetadata { - /** - * @return Type of the resource, ex node, image, size - */ - @Override - ComputeType getType(); - - /** - * @return id of the server within the naming scope it was created. potentially generated by the - * service. - */ - @Override - String getProviderId(); - - /** - * @return user defined name of the server. - */ - @Override - @Nullable - String getName(); - - /** - * - * A means to uniquely address this resource within a provider. For example, if the namespace of - * a node or image is region based, the id will likely include both the region and the - * provider-supplied id encoded to avoid collisions. - * - * @return unique id within your account on the provider - */ - String getId(); - - /** - * @return tags describing this resource, if supported - */ - Set getTags(); -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.compute.domain; + +import java.util.Set; + +import org.jclouds.compute.domain.internal.ComputeMetadataImpl; +import org.jclouds.domain.ResourceMetadata; +import org.jclouds.javax.annotation.Nullable; + +import com.google.inject.ImplementedBy; + +/** + */ +@ImplementedBy(ComputeMetadataImpl.class) +public interface ComputeMetadata extends ResourceMetadata { + /** + * @return Type of the resource, ex node, image, size + */ + @Override + ComputeType getType(); + + /** + * @return id of the server within the naming scope it was created. potentially generated by the + * service. + */ + @Override + String getProviderId(); + + /** + * @return user defined name of the server. + */ + @Override + @Nullable + String getName(); + + /** + * + * A means to uniquely address this resource within a provider. For example, if the namespace of + * a node or image is region based, the id will likely include both the region and the + * provider-supplied id encoded to avoid collisions. + * + * @return unique id within your account on the provider + */ + String getId(); + + /** + * @return tags describing this resource, if supported + */ + Set getTags(); +} diff --git a/compute/src/main/java/org/jclouds/compute/domain/ComputeMetadataIncludingStatus.java b/compute/src/main/java/org/jclouds/compute/domain/ComputeMetadataIncludingStatus.java index 17905367f8..32df8e9e0f 100644 --- a/compute/src/main/java/org/jclouds/compute/domain/ComputeMetadataIncludingStatus.java +++ b/compute/src/main/java/org/jclouds/compute/domain/ComputeMetadataIncludingStatus.java @@ -1,40 +1,40 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.compute.domain; - -import org.jclouds.javax.annotation.Nullable; - -/** - */ -public interface ComputeMetadataIncludingStatus> extends ComputeMetadata { - - /** - * portable status of the resource - * - * @since 1.5 - */ - S getStatus(); - - /** - * status of the resource, as supplied literally from the backend api. - * - * @return status or null, if the backend api has no concept of status - * @since 1.5 - */ - @Nullable - String getBackendStatus(); -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.compute.domain; + +import org.jclouds.javax.annotation.Nullable; + +/** + */ +public interface ComputeMetadataIncludingStatus> extends ComputeMetadata { + + /** + * portable status of the resource + * + * @since 1.5 + */ + S getStatus(); + + /** + * status of the resource, as supplied literally from the backend api. + * + * @return status or null, if the backend api has no concept of status + * @since 1.5 + */ + @Nullable + String getBackendStatus(); +} diff --git a/compute/src/main/java/org/jclouds/compute/domain/LoginType.java b/compute/src/main/java/org/jclouds/compute/domain/LoginType.java index a82c75f48e..6eded6aa73 100644 --- a/compute/src/main/java/org/jclouds/compute/domain/LoginType.java +++ b/compute/src/main/java/org/jclouds/compute/domain/LoginType.java @@ -1,28 +1,28 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.compute.domain; - - -/** - * The login type of the server. - * - */ -public enum LoginType { - - RDP, SSH - +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.compute.domain; + + +/** + * The login type of the server. + * + */ +public enum LoginType { + + RDP, SSH + } diff --git a/core/src/main/java/org/jclouds/domain/LocationScope.java b/core/src/main/java/org/jclouds/domain/LocationScope.java index 32c7fdc6f4..c71aabca22 100644 --- a/core/src/main/java/org/jclouds/domain/LocationScope.java +++ b/core/src/main/java/org/jclouds/domain/LocationScope.java @@ -1,38 +1,38 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.domain; - -/** - * The scope of the location - * - */ -public enum LocationScope { - - PROVIDER, - REGION, - ZONE, - /** - * @see cimi system docs - */ - SYSTEM, - /** - * E.g. the DMZ segment, secure segment. - */ - NETWORK, - HOST; - +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.domain; + +/** + * The scope of the location + * + */ +public enum LocationScope { + + PROVIDER, + REGION, + ZONE, + /** + * @see cimi system docs + */ + SYSTEM, + /** + * E.g. the DMZ segment, secure segment. + */ + NETWORK, + HOST; + } diff --git a/loadbalancer/src/main/java/org/jclouds/loadbalancer/domain/LoadBalancerMetadata.java b/loadbalancer/src/main/java/org/jclouds/loadbalancer/domain/LoadBalancerMetadata.java index e12ac78405..c8c11b0232 100644 --- a/loadbalancer/src/main/java/org/jclouds/loadbalancer/domain/LoadBalancerMetadata.java +++ b/loadbalancer/src/main/java/org/jclouds/loadbalancer/domain/LoadBalancerMetadata.java @@ -1,67 +1,67 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF 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.loadbalancer.domain; - -import java.util.Set; - -import org.jclouds.domain.ResourceMetadata; -import org.jclouds.loadbalancer.domain.internal.LoadBalancerMetadataImpl; - -import com.google.inject.ImplementedBy; - -/** - */ -@ImplementedBy(LoadBalancerMetadataImpl.class) -public interface LoadBalancerMetadata extends ResourceMetadata { - /** - * Type of the resource, ex node, image, size - * - */ - @Override - LoadBalancerType getType(); - - /** - * id of the server within the naming scope it was created. potentially generated by the service. - * - */ - @Override - String getProviderId(); - - /** - * user defined name of the server. - * - */ - @Override - String getName(); - - /** - * - * A means to uniquely address this resource within a provider. For example, if the namespace of - * a node or image is region based, the id will likely include both the region and the - * provider-supplied id encoded to avoid collisions. - * - */ - String getId(); - - /** - * @return DNS Name of the load balancer; note we don't use InetAddress, as it is incompatible - * with google appengine. - */ - // TODO: this is no longer the case - Set getAddresses(); - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.loadbalancer.domain; + +import java.util.Set; + +import org.jclouds.domain.ResourceMetadata; +import org.jclouds.loadbalancer.domain.internal.LoadBalancerMetadataImpl; + +import com.google.inject.ImplementedBy; + +/** + */ +@ImplementedBy(LoadBalancerMetadataImpl.class) +public interface LoadBalancerMetadata extends ResourceMetadata { + /** + * Type of the resource, ex node, image, size + * + */ + @Override + LoadBalancerType getType(); + + /** + * id of the server within the naming scope it was created. potentially generated by the service. + * + */ + @Override + String getProviderId(); + + /** + * user defined name of the server. + * + */ + @Override + String getName(); + + /** + * + * A means to uniquely address this resource within a provider. For example, if the namespace of + * a node or image is region based, the id will likely include both the region and the + * provider-supplied id encoded to avoid collisions. + * + */ + String getId(); + + /** + * @return DNS Name of the load balancer; note we don't use InetAddress, as it is incompatible + * with google appengine. + */ + // TODO: this is no longer the case + Set getAddresses(); + +}