Remove deprecated code

Removes PopulateDefaultLoginCredentialsForImageStrategy.execute().
The javadoc said it would be removed in jclouds 1.4.

Adds javadoc to ExecResponse.getExitCode, saying to be deleted in 1.6.
It was deprecated in 1.4 release (so 1.6 would be two releases time).
This commit is contained in:
Aled Sage 2012-06-11 22:32:58 +01:00 committed by Adrian Cole
parent 6ffe7085bc
commit c50edefef6
5 changed files with 11 additions and 30 deletions

View File

@ -51,7 +51,7 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest {
replay(template); replay(template);
ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(
null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of()); null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of());
Credentials creds = converter.execute(template); Credentials creds = converter.apply(template);
assertEquals(creds.identity, "vcloud"); assertEquals(creds.identity, "vcloud");
assertEquals(creds.credential, "$Ep455l0ud!2"); assertEquals(creds.credential, "$Ep455l0ud!2");
verify(template); verify(template);
@ -66,7 +66,7 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest {
replay(template); replay(template);
ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(
null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of()); null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of());
Credentials creds = converter.execute(template); Credentials creds = converter.apply(template);
assertEquals(creds.identity, "ecloud"); assertEquals(creds.identity, "ecloud");
assertEquals(creds.credential, "$Ep455l0ud!2"); assertEquals(creds.credential, "$Ep455l0ud!2");
verify(template); verify(template);
@ -81,7 +81,7 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest {
replay(template); replay(template);
ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(
null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of()); null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of());
Credentials creds = converter.execute(template); Credentials creds = converter.apply(template);
assertEquals(creds.identity, "vpncubed"); assertEquals(creds.identity, "vpncubed");
assertEquals(creds.credential, "vpncubed"); assertEquals(creds.credential, "vpncubed");
verify(template); verify(template);
@ -96,7 +96,7 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest {
replay(template); replay(template);
ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(
null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of()); null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of());
Credentials creds = converter.execute(template); Credentials creds = converter.apply(template);
assertEquals(creds.identity, "ecloud"); assertEquals(creds.identity, "ecloud");
assertEquals(creds.credential, "TmrkCl0ud1s#1!"); assertEquals(creds.credential, "TmrkCl0ud1s#1!");
verify(template); verify(template);
@ -111,7 +111,7 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest {
replay(template); replay(template);
ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(
null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of()); null, ImmutableMap.<String, Credentials> of(), ImmutableMap.<OsFamily, LoginCredentials> of());
Credentials creds = converter.execute(template); Credentials creds = converter.apply(template);
assertEquals(creds.identity, "Administrator"); assertEquals(creds.identity, "Administrator");
assertEquals(creds.credential, null); assertEquals(creds.credential, null);
verify(template); verify(template);

View File

@ -46,6 +46,8 @@ public class ExecResponse implements CustomizationResponse {
} }
/** /**
* <h4>will be removed in jclouds 1.6.0</h4> <br/>
*
* @see #getExitStatus * @see #getExitStatus
*/ */
@Deprecated @Deprecated

View File

@ -19,7 +19,6 @@
package org.jclouds.compute.strategy; package org.jclouds.compute.strategy;
import org.jclouds.compute.strategy.impl.ReturnCredentialsBoundToImage; import org.jclouds.compute.strategy.impl.ReturnCredentialsBoundToImage;
import org.jclouds.domain.Credentials;
import org.jclouds.domain.LoginCredentials; import org.jclouds.domain.LoginCredentials;
import com.google.common.base.Function; import com.google.common.base.Function;
@ -31,21 +30,6 @@ import com.google.inject.ImplementedBy;
@ImplementedBy(ReturnCredentialsBoundToImage.class) @ImplementedBy(ReturnCredentialsBoundToImage.class)
public interface PopulateDefaultLoginCredentialsForImageStrategy extends Function<Object, LoginCredentials> { public interface PopulateDefaultLoginCredentialsForImageStrategy extends Function<Object, LoginCredentials> {
/**
* <h4>will be removed in jclouds 1.4.0</h4> <br/>
*
* Processes the resource to determine credentials.
*
* @param resourceToAuthenticate
* this can be any resource, such as an image, running server
* instance or other. It's the responsibility of an implementation
* to apply the cloud-specific logic.
* @return credentials object. Note: the key may not be set, but the identity
* must be set
*/
@Deprecated
Credentials execute(Object resourceToAuthenticate);
/** /**
* Processes the cloud-specific resources to determine the login credentials. * Processes the cloud-specific resources to determine the login credentials.
* *

View File

@ -67,9 +67,4 @@ public class ReturnCredentialsBoundToImage implements PopulateDefaultLoginCreden
return LoginCredentials.builder().user("root").build(); return LoginCredentials.builder().user("root").build();
} }
} }
@Override
public Credentials execute(Object resourceToAuthenticate) {
return apply(resourceToAuthenticate);
}
} }

View File

@ -46,7 +46,7 @@ public class ReturnCredentialsBoundToImageTest {
LoginCredentials creds = new LoginCredentials("ubuntu", "foo", null, false); LoginCredentials creds = new LoginCredentials("ubuntu", "foo", null, false);
assertEquals(new ReturnCredentialsBoundToImage(creds, ImmutableMap.<String, Credentials> of(), ImmutableMap assertEquals(new ReturnCredentialsBoundToImage(creds, ImmutableMap.<String, Credentials> of(), ImmutableMap
.<OsFamily, LoginCredentials> of()).execute(image), creds); .<OsFamily, LoginCredentials> of()).apply(image), creds);
verify(image); verify(image);
@ -59,7 +59,7 @@ public class ReturnCredentialsBoundToImageTest {
LoginCredentials creds = new LoginCredentials("ubuntu", "foo", null, false); LoginCredentials creds = new LoginCredentials("ubuntu", "foo", null, false);
assertEquals(new ReturnCredentialsBoundToImage(null, ImmutableMap.<String, Credentials> of("image#1", creds), assertEquals(new ReturnCredentialsBoundToImage(null, ImmutableMap.<String, Credentials> of("image#1", creds),
ImmutableMap.<OsFamily, LoginCredentials> of()).execute(image), creds); ImmutableMap.<OsFamily, LoginCredentials> of()).apply(image), creds);
verify(image); verify(image);
@ -74,7 +74,7 @@ public class ReturnCredentialsBoundToImageTest {
Credentials creds = new Credentials("Administrator", null); Credentials creds = new Credentials("Administrator", null);
assertEquals(new ReturnCredentialsBoundToImage(null, ImmutableMap.<String, Credentials> of(), ImmutableMap.of( assertEquals(new ReturnCredentialsBoundToImage(null, ImmutableMap.<String, Credentials> of(), ImmutableMap.of(
OsFamily.WINDOWS, LoginCredentials.builder().user("Administrator").build())).execute(image), creds); OsFamily.WINDOWS, LoginCredentials.builder().user("Administrator").build())).apply(image), creds);
verify(image); verify(image);
@ -89,7 +89,7 @@ public class ReturnCredentialsBoundToImageTest {
Credentials creds = new Credentials("root", null); Credentials creds = new Credentials("root", null);
assertEquals(new ReturnCredentialsBoundToImage(null, ImmutableMap.<String, Credentials> of(), ImmutableMap assertEquals(new ReturnCredentialsBoundToImage(null, ImmutableMap.<String, Credentials> of(), ImmutableMap
.<OsFamily, LoginCredentials> of()).execute(image), creds); .<OsFamily, LoginCredentials> of()).apply(image), creds);
verify(image); verify(image);