org.jclouds.compute.strategy.impl
Class ReturnCredentialsBoundToImage

java.lang.Object
  extended by org.jclouds.compute.strategy.impl.ReturnCredentialsBoundToImage
All Implemented Interfaces:
com.google.common.base.Function<Object,LoginCredentials>, PopulateDefaultLoginCredentialsForImageStrategy
Direct Known Subclasses:
EC2PopulateDefaultLoginCredentialsForImageStrategy, ParseVAppTemplateDescriptionToGetDefaultLoginCredentials

@Singleton
public class ReturnCredentialsBoundToImage
extends Object
implements PopulateDefaultLoginCredentialsForImageStrategy

Author:
Adrian Cole

Field Summary
protected  Map<String,Credentials> credentialStore
           
protected  LoginCredentials creds
           
 
Constructor Summary
ReturnCredentialsBoundToImage(LoginCredentials creds, Map<String,Credentials> credentialStore)
           
 
Method Summary
 LoginCredentials apply(Object resourceToAuthenticate)
          Processes the cloud-specific resources to determine the login credentials.
 Credentials execute(Object resourceToAuthenticate)
          will be removed in jclouds 1.4.0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Function
equals
 

Field Detail

creds

protected final LoginCredentials creds

credentialStore

protected Map<String,Credentials> credentialStore
Constructor Detail

ReturnCredentialsBoundToImage

@Inject
public ReturnCredentialsBoundToImage(@Nullable@Named(value="image")
                                            LoginCredentials creds,
                                            Map<String,Credentials> credentialStore)
Method Detail

apply

public LoginCredentials apply(Object resourceToAuthenticate)
Description copied from interface: PopulateDefaultLoginCredentialsForImageStrategy
Processes the cloud-specific resources to determine the login credentials.

Specified by:
apply in interface com.google.common.base.Function<Object,LoginCredentials>
Specified by:
apply in interface PopulateDefaultLoginCredentialsForImageStrategy
Parameters:
resourceToAuthenticate - this is the cloud-specific representation of the image object.
Returns:
credentials parsed from the image if not null

execute

public Credentials execute(Object resourceToAuthenticate)
Description copied from interface: PopulateDefaultLoginCredentialsForImageStrategy

will be removed in jclouds 1.4.0


Processes the resource to determine credentials.

Specified by:
execute in interface PopulateDefaultLoginCredentialsForImageStrategy
Parameters:
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.
Returns:
credentials object. Note: the key may not be set, but the identity must be set


Copyright © 2009-2012 jclouds. All Rights Reserved.