Fix line endings. Use Unix line endings everywhere

This commit is contained in:
Ignasi Barrera 2015-10-13 17:07:04 +02:00
parent 9f85213b4f
commit a585440e70
13 changed files with 737 additions and 737 deletions

View File

@ -1,43 +1,43 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.openstack.keystone.v2_0.functions; package org.jclouds.openstack.keystone.v2_0.functions;
import java.net.URI; import java.net.URI;
import javax.inject.Singleton; import javax.inject.Singleton;
import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; import org.jclouds.openstack.keystone.v2_0.domain.Endpoint;
import com.google.common.base.Supplier; import com.google.common.base.Supplier;
import com.google.common.base.Suppliers; import com.google.common.base.Suppliers;
/** /**
* Select internal URL endpoints services * Select internal URL endpoints services
* *
*/ */
@Singleton @Singleton
public class InternalURL implements EndpointToSupplierURI { public class InternalURL implements EndpointToSupplierURI {
@Override @Override
public Supplier<URI> apply(Endpoint input) { public Supplier<URI> apply(Endpoint input) {
return Suppliers.ofInstance(input.getInternalURL()); return Suppliers.ofInstance(input.getInternalURL());
} }
@Override @Override
public String toString() { public String toString() {
return "supplyInternalURL()"; return "supplyInternalURL()";
} }
} }

View File

@ -1,39 +1,39 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.openstack.keystone.v2_0.functions; package org.jclouds.openstack.keystone.v2_0.functions;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.net.URI; import java.net.URI;
import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; import org.jclouds.openstack.keystone.v2_0.domain.Endpoint;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
*/ */
@Test(groups = "unit", testName = "InternalURLTest") @Test(groups = "unit", testName = "InternalURLTest")
public class InternalURLTest { public class InternalURLTest {
private final InternalURL fn = new InternalURL(); private final InternalURL fn = new InternalURL();
public void testInternalURL() { public void testInternalURL() {
assertEquals( assertEquals(
fn.apply( fn.apply(
Endpoint.builder().region("regionOne").versionId("2.0") Endpoint.builder().region("regionOne").versionId("2.0")
.internalURL(URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")) .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")); .build()).get(), URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0"));
} }
} }

View File

@ -1,74 +1,74 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.openstack.nova.v2_0; package org.jclouds.openstack.nova.v2_0;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.util.Properties; import java.util.Properties;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; 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.internal.BaseNovaApiExpectTest;
import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/** /**
* *
* @see org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties#CREDENTIAL_TYPE * @see org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties#CREDENTIAL_TYPE
*/ */
@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest") @Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest")
public class AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest extends BaseNovaApiExpectTest { public class AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest extends BaseNovaApiExpectTest {
public AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest() { public AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest() {
identity = identityWithTenantId; identity = identityWithTenantId;
} }
/** /**
* this reflects the properties that a user would pass to createContext * this reflects the properties that a user would pass to createContext
*/ */
@Override @Override
protected Properties setupProperties() { protected Properties setupProperties() {
Properties contextProperties = super.setupProperties(); Properties contextProperties = super.setupProperties();
contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials");
contextProperties.setProperty("jclouds.keystone.tenant-id", KeystoneFixture.INSTANCE.getTenantId()); contextProperties.setProperty("jclouds.keystone.tenant-id", KeystoneFixture.INSTANCE.getTenantId());
return contextProperties; return contextProperties;
} }
public void testListServersWhenResponseIs2xx() throws Exception { public void testListServersWhenResponseIs2xx() throws Exception {
HttpRequest listServers = HttpRequest HttpRequest listServers = HttpRequest
.builder() .builder()
.method("GET") .method("GET")
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers")
.addHeader("Accept", "application/json") .addHeader("Accept", "application/json")
.addHeader("X-Auth-Token", authToken).build(); .addHeader("X-Auth-Token", authToken).build();
HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) HttpResponse listServersResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/server_list.json")).build(); .payload(payloadFromResource("/server_list.json")).build();
NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantId, NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantId,
responseWithKeystoneAccess, listServers, listServersResponse); 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.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(), assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(),
new ParseServerListTest().expected().toString()); new ParseServerListTest().expected().toString());
} }
} }

View File

@ -1,74 +1,74 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.openstack.nova.v2_0; package org.jclouds.openstack.nova.v2_0;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.util.Properties; import java.util.Properties;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; 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.internal.BaseNovaApiExpectTest;
import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/** /**
* *
* @see KeystoneProperties#CREDENTIAL_TYPE * @see KeystoneProperties#CREDENTIAL_TYPE
*/ */
@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest") @Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest")
public class AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest extends BaseNovaApiExpectTest { public class AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest extends BaseNovaApiExpectTest {
public AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest() { public AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest() {
identity = "identity"; identity = "identity";
} }
/** /**
* this reflects the properties that a user would pass to createContext * this reflects the properties that a user would pass to createContext
*/ */
@Override @Override
protected Properties setupProperties() { protected Properties setupProperties() {
Properties contextProperties = super.setupProperties(); Properties contextProperties = super.setupProperties();
contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials");
contextProperties.setProperty("jclouds.keystone.tenant-name", KeystoneFixture.INSTANCE.getTenantName()); contextProperties.setProperty("jclouds.keystone.tenant-name", KeystoneFixture.INSTANCE.getTenantName());
return contextProperties; return contextProperties;
} }
public void testListServersWhenResponseIs2xx() throws Exception { public void testListServersWhenResponseIs2xx() throws Exception {
HttpRequest listServers = HttpRequest HttpRequest listServers = HttpRequest
.builder() .builder()
.method("GET") .method("GET")
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers")
.addHeader("Accept", "application/json") .addHeader("Accept", "application/json")
.addHeader("X-Auth-Token", authToken).build(); .addHeader("X-Auth-Token", authToken).build();
HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) HttpResponse listServersResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/server_list.json")).build(); .payload(payloadFromResource("/server_list.json")).build();
NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName,
responseWithKeystoneAccess, listServers, listServersResponse); 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.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(), assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(),
new ParseServerListTest().expected().toString()); new ParseServerListTest().expected().toString());
} }
} }

View File

@ -1,68 +1,68 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.openstack.nova.v2_0; package org.jclouds.openstack.nova.v2_0;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.util.Properties; import java.util.Properties;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest; import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest; import org.jclouds.openstack.nova.v2_0.parse.ParseServerListTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/** /**
* *
* @see org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties#CREDENTIAL_TYPE * @see org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties#CREDENTIAL_TYPE
*/ */
@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAuthenticationExpectTest") @Test(groups = "unit", testName = "AccessKeyAndSecretKeyAuthenticationExpectTest")
public class AccessKeyAndSecretKeyAuthenticationExpectTest extends BaseNovaApiExpectTest { public class AccessKeyAndSecretKeyAuthenticationExpectTest extends BaseNovaApiExpectTest {
/** /**
* this reflects the properties that a user would pass to createContext * this reflects the properties that a user would pass to createContext
*/ */
@Override @Override
protected Properties setupProperties() { protected Properties setupProperties() {
Properties contextProperties = super.setupProperties(); Properties contextProperties = super.setupProperties();
contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials");
return contextProperties; return contextProperties;
} }
public void testListServersWhenResponseIs2xx() throws Exception { public void testListServersWhenResponseIs2xx() throws Exception {
HttpRequest listServers = HttpRequest HttpRequest listServers = HttpRequest
.builder() .builder()
.method("GET") .method("GET")
.endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers") .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers")
.addHeader("Accept", "application/json") .addHeader("Accept", "application/json")
.addHeader("X-Auth-Token", authToken).build(); .addHeader("X-Auth-Token", authToken).build();
HttpResponse listServersResponse = HttpResponse.builder().statusCode(200) HttpResponse listServersResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResource("/server_list.json")).build(); .payload(payloadFromResource("/server_list.json")).build();
NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, NovaApi apiWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName,
responseWithKeystoneAccess, listServers, listServersResponse); 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.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(), assertEquals(apiWhenServersExist.getServerApi("az-1.region-a.geo-1").list().concat().toString(),
new ParseServerListTest().expected().toString()); new ParseServerListTest().expected().toString());
} }
} }

View File

@ -1,69 +1,69 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.openstack.swift.keystone; package org.jclouds.openstack.swift.keystone;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.util.Properties; import java.util.Properties;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
import org.jclouds.openstack.swift.SwiftKeystoneClient; import org.jclouds.openstack.swift.SwiftKeystoneClient;
import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* *
* @see KeystoneProperties#CREDENTIAL_TYPE * @see KeystoneProperties#CREDENTIAL_TYPE
*/ */
@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest") @Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest")
public class AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest<SwiftKeystoneClient> { public class AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest<SwiftKeystoneClient> {
public AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest() { public AccessKeyAndSecretKeyAndTenantIdAuthenticationExpectTest() {
identity = identityWithTenantId; identity = identityWithTenantId;
} }
/** /**
* this reflects the properties that a user would pass to createContext * this reflects the properties that a user would pass to createContext
*/ */
@Override @Override
protected Properties setupProperties() { protected Properties setupProperties() {
Properties contextProperties = super.setupProperties(); Properties contextProperties = super.setupProperties();
contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials");
contextProperties.setProperty("jclouds.keystone.tenant-id", KeystoneFixture.INSTANCE.getTenantId()); contextProperties.setProperty("jclouds.keystone.tenant-id", KeystoneFixture.INSTANCE.getTenantId());
return contextProperties; return contextProperties;
} }
public void testContainerExistsWhenResponseIs2xx() throws Exception { public void testContainerExistsWhenResponseIs2xx() throws Exception {
HttpRequest containerExists = HttpRequest.builder() HttpRequest containerExists = HttpRequest.builder()
.method("HEAD") .method("HEAD")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container")
.addHeader("Accept", MediaType.WILDCARD) .addHeader("Accept", MediaType.WILDCARD)
.addHeader("X-Auth-Token", authToken).build(); .addHeader("X-Auth-Token", authToken).build();
HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build();
SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantId, SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantId,
responseWithKeystoneAccess, containerExists, containerExistsResponse); responseWithKeystoneAccess, containerExists, containerExistsResponse);
assertEquals(clientWhenContainerExists.containerExists("container"), true); assertEquals(clientWhenContainerExists.containerExists("container"), true);
} }
} }

View File

@ -1,70 +1,70 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.openstack.swift.keystone; package org.jclouds.openstack.swift.keystone;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.util.Properties; import java.util.Properties;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture; import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
import org.jclouds.openstack.swift.SwiftKeystoneClient; import org.jclouds.openstack.swift.SwiftKeystoneClient;
import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* *
* @see KeystoneProperties#CREDENTIAL_TYPE * @see KeystoneProperties#CREDENTIAL_TYPE
*/ */
@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest") @Test(groups = "unit", testName = "AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest")
public class AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest<SwiftKeystoneClient> { public class AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest<SwiftKeystoneClient> {
public AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest() { public AccessKeyAndSecretKeyAndTenantNamePropertyAuthenticationExpectTest() {
identity = "identity"; identity = "identity";
} }
/** /**
* this reflects the properties that a user would pass to createContext * this reflects the properties that a user would pass to createContext
*/ */
@Override @Override
protected Properties setupProperties() { protected Properties setupProperties() {
Properties contextProperties = super.setupProperties(); Properties contextProperties = super.setupProperties();
contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials");
contextProperties.setProperty("jclouds.keystone.tenant-name", KeystoneFixture.INSTANCE.getTenantName()); contextProperties.setProperty("jclouds.keystone.tenant-name", KeystoneFixture.INSTANCE.getTenantName());
return contextProperties; return contextProperties;
} }
public void testContainerExistsWhenResponseIs2xx() throws Exception { public void testContainerExistsWhenResponseIs2xx() throws Exception {
HttpRequest containerExists = HttpRequest.builder() HttpRequest containerExists = HttpRequest.builder()
.method("HEAD") .method("HEAD")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container")
.addHeader("Accept", MediaType.WILDCARD) .addHeader("Accept", MediaType.WILDCARD)
.addHeader("X-Auth-Token", authToken).build(); .addHeader("X-Auth-Token", authToken).build();
HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build();
SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName,
responseWithKeystoneAccess, containerExists, containerExistsResponse); responseWithKeystoneAccess, containerExists, containerExistsResponse);
assertEquals(clientWhenContainerExists.containerExists("container"), true); assertEquals(clientWhenContainerExists.containerExists("container"), true);
} }
} }

View File

@ -1,64 +1,64 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.openstack.swift.keystone; package org.jclouds.openstack.swift.keystone;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import java.util.Properties; import java.util.Properties;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.openstack.swift.SwiftKeystoneClient; import org.jclouds.openstack.swift.SwiftKeystoneClient;
import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest; import org.jclouds.openstack.swift.internal.BaseSwiftKeystoneExpectTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* *
* @see KeystoneProperties#CREDENTIAL_TYPE * @see KeystoneProperties#CREDENTIAL_TYPE
*/ */
@Test(groups = "unit", testName = "AccessKeyAndSecretKeyAuthenticationExpectTest") @Test(groups = "unit", testName = "AccessKeyAndSecretKeyAuthenticationExpectTest")
public class AccessKeyAndSecretKeyAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest<SwiftKeystoneClient> { public class AccessKeyAndSecretKeyAuthenticationExpectTest extends BaseSwiftKeystoneExpectTest<SwiftKeystoneClient> {
/** /**
* this reflects the properties that a user would pass to createContext * this reflects the properties that a user would pass to createContext
*/ */
@Override @Override
protected Properties setupProperties() { protected Properties setupProperties() {
Properties contextProperties = super.setupProperties(); Properties contextProperties = super.setupProperties();
contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials"); contextProperties.setProperty("jclouds.keystone.credential-type", "apiAccessKeyCredentials");
return contextProperties; return contextProperties;
} }
public void testContainerExistsWhenResponseIs2xx() throws Exception { public void testContainerExistsWhenResponseIs2xx() throws Exception {
HttpRequest containerExists = HttpRequest.builder() HttpRequest containerExists = HttpRequest.builder()
.method("HEAD") .method("HEAD")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container") .endpoint("https://objects.jclouds.org/v1.0/40806637803162/container")
.addHeader("Accept", MediaType.WILDCARD) .addHeader("Accept", MediaType.WILDCARD)
.addHeader("X-Auth-Token", authToken).build(); .addHeader("X-Auth-Token", authToken).build();
HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build(); HttpResponse containerExistsResponse = HttpResponse.builder().statusCode(200).build();
SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName, SwiftKeystoneClient clientWhenContainerExists = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKeyAndTenantName,
responseWithKeystoneAccess, containerExists, containerExistsResponse); responseWithKeystoneAccess, containerExists, containerExistsResponse);
assertEquals(clientWhenContainerExists.containerExists("container"), true); assertEquals(clientWhenContainerExists.containerExists("container"), true);
} }
} }

View File

@ -1,65 +1,65 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.compute.domain; package org.jclouds.compute.domain;
import java.util.Set; import java.util.Set;
import org.jclouds.compute.domain.internal.ComputeMetadataImpl; import org.jclouds.compute.domain.internal.ComputeMetadataImpl;
import org.jclouds.domain.ResourceMetadata; import org.jclouds.domain.ResourceMetadata;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import com.google.inject.ImplementedBy; import com.google.inject.ImplementedBy;
/** /**
*/ */
@ImplementedBy(ComputeMetadataImpl.class) @ImplementedBy(ComputeMetadataImpl.class)
public interface ComputeMetadata extends ResourceMetadata<ComputeType> { public interface ComputeMetadata extends ResourceMetadata<ComputeType> {
/** /**
* @return Type of the resource, ex node, image, size * @return Type of the resource, ex node, image, size
*/ */
@Override @Override
ComputeType getType(); ComputeType getType();
/** /**
* @return id of the server within the naming scope it was created. potentially generated by the * @return id of the server within the naming scope it was created. potentially generated by the
* service. * service.
*/ */
@Override @Override
String getProviderId(); String getProviderId();
/** /**
* @return user defined name of the server. * @return user defined name of the server.
*/ */
@Override @Override
@Nullable @Nullable
String getName(); String getName();
/** /**
* *
* A means to uniquely address this resource within a provider. For example, if the namespace of * 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 * a node or image is region based, the id will likely include both the region and the
* provider-supplied id encoded to avoid collisions. * provider-supplied id encoded to avoid collisions.
* *
* @return unique id within your account on the provider * @return unique id within your account on the provider
*/ */
String getId(); String getId();
/** /**
* @return tags describing this resource, if supported * @return tags describing this resource, if supported
*/ */
Set<String> getTags(); Set<String> getTags();
} }

View File

@ -1,40 +1,40 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.compute.domain; package org.jclouds.compute.domain;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
/** /**
*/ */
public interface ComputeMetadataIncludingStatus<S extends Enum<S>> extends ComputeMetadata { public interface ComputeMetadataIncludingStatus<S extends Enum<S>> extends ComputeMetadata {
/** /**
* portable status of the resource * portable status of the resource
* *
* @since 1.5 * @since 1.5
*/ */
S getStatus(); S getStatus();
/** /**
* status of the resource, as supplied literally from the backend api. * status of the resource, as supplied literally from the backend api.
* *
* @return status or null, if the backend api has no concept of status * @return status or null, if the backend api has no concept of status
* @since 1.5 * @since 1.5
*/ */
@Nullable @Nullable
String getBackendStatus(); String getBackendStatus();
} }

View File

@ -1,28 +1,28 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.compute.domain; package org.jclouds.compute.domain;
/** /**
* The login type of the server. * The login type of the server.
* *
*/ */
public enum LoginType { public enum LoginType {
RDP, SSH RDP, SSH
} }

View File

@ -1,38 +1,38 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.domain; package org.jclouds.domain;
/** /**
* The scope of the location * The scope of the location
* *
*/ */
public enum LocationScope { public enum LocationScope {
PROVIDER, PROVIDER,
REGION, REGION,
ZONE, ZONE,
/** /**
* @see <a href="http://dmtf.org/standards/cloud">cimi system docs</a> * @see <a href="http://dmtf.org/standards/cloud">cimi system docs</a>
*/ */
SYSTEM, SYSTEM,
/** /**
* E.g. the DMZ segment, secure segment. * E.g. the DMZ segment, secure segment.
*/ */
NETWORK, NETWORK,
HOST; HOST;
} }

View File

@ -1,67 +1,67 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.loadbalancer.domain; package org.jclouds.loadbalancer.domain;
import java.util.Set; import java.util.Set;
import org.jclouds.domain.ResourceMetadata; import org.jclouds.domain.ResourceMetadata;
import org.jclouds.loadbalancer.domain.internal.LoadBalancerMetadataImpl; import org.jclouds.loadbalancer.domain.internal.LoadBalancerMetadataImpl;
import com.google.inject.ImplementedBy; import com.google.inject.ImplementedBy;
/** /**
*/ */
@ImplementedBy(LoadBalancerMetadataImpl.class) @ImplementedBy(LoadBalancerMetadataImpl.class)
public interface LoadBalancerMetadata extends ResourceMetadata<LoadBalancerType> { public interface LoadBalancerMetadata extends ResourceMetadata<LoadBalancerType> {
/** /**
* Type of the resource, ex node, image, size * Type of the resource, ex node, image, size
* *
*/ */
@Override @Override
LoadBalancerType getType(); LoadBalancerType getType();
/** /**
* id of the server within the naming scope it was created. potentially generated by the service. * id of the server within the naming scope it was created. potentially generated by the service.
* *
*/ */
@Override @Override
String getProviderId(); String getProviderId();
/** /**
* user defined name of the server. * user defined name of the server.
* *
*/ */
@Override @Override
String getName(); String getName();
/** /**
* *
* A means to uniquely address this resource within a provider. For example, if the namespace of * 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 * a node or image is region based, the id will likely include both the region and the
* provider-supplied id encoded to avoid collisions. * provider-supplied id encoded to avoid collisions.
* *
*/ */
String getId(); String getId();
/** /**
* @return DNS Name of the load balancer; note we don't use InetAddress, as it is incompatible * @return DNS Name of the load balancer; note we don't use InetAddress, as it is incompatible
* with google appengine. * with google appengine.
*/ */
// TODO: this is no longer the case // TODO: this is no longer the case
Set<String> getAddresses(); Set<String> getAddresses();
} }