org.jclouds.internal
Class ContextImpl

java.lang.Object
  extended by org.jclouds.internal.ContextImpl
All Implemented Interfaces:
Closeable, Context, Location
Direct Known Subclasses:
RestContextImpl

public class ContextImpl
extends Object
implements Context

Author:
Adrian Cole

Constructor Summary
protected ContextImpl(String name, ProviderMetadata providerMetadata, String identity, Utils utils, Closer closer)
           
 
Method Summary
 void close()
          Closes all connections, including executor service
 Map<String,Credentials> credentialStore()
          will be removed in jclouds 1.6
 boolean equals(Object obj)
          
 String getApiVersion()
          will be removed in jclouds 1.6
 String getBuildVersion()
          will be removed in jclouds 1.6
 Map<String,Credentials> getCredentialStore()
          will be removed in jclouds 1.6
 String getDescription()
          Description of the location
 URI getEndpoint()
          will be removed in jclouds 1.6
 String getId()
          Unique ID provided by the provider (us-standard, miami, etc)
 String getIdentity()
          
 Set<String> getIso3166Codes()
          
 Map<String,Object> getMetadata()
          
 String getName()
          Identifies the Context.
 Location getParent()
          The parent, or null, if top-level
 ProviderMetadata getProviderMetadata()
          
 LocationScope getScope()
          Scope of the location, ex.
 Utils getUtils()
          
 int hashCode()
          
 String toString()
          
 Utils utils()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContextImpl

@Inject
protected ContextImpl(String name,
                             ProviderMetadata providerMetadata,
                             String identity,
                             Utils utils,
                             Closer closer)
Method Detail

close

public void close()
Closes all connections, including executor service

Specified by:
close in interface Closeable
Specified by:
close in interface Context

getProviderMetadata

public ProviderMetadata getProviderMetadata()

Specified by:
getProviderMetadata in interface Context
Returns:
the providerMetadata used to create this context
See Also:
ContextBuilder.newBuilder(org.jclouds.providers.ProviderMetadata)

getName

public String getName()
Identifies the Context. This is a unique name optionally specified by the user and safe to index on. The purpose of this property is to provide means to distinct between multiple contexts, without having to check multiple properties or have explicit knowledge of how the context was created.

Specified by:
getName in interface Context
Returns:

getIdentity

public String getIdentity()

Specified by:
getIdentity in interface Context
Returns:
the current login user, access key, email, or whatever the 'identity' field was building the context.
See Also:
ApiMetadata.getDefaultIdentity()

getEndpoint

public URI getEndpoint()
will be removed in jclouds 1.6

Specified by:
getEndpoint in interface Context
See Also:
Context.getProviderMetadata(), ProviderMetadata.getEndpoint()

getUtils

public Utils getUtils()

Specified by:
getUtils in interface Context

utils

public Utils utils()
Specified by:
utils in interface Context
See Also:
Context.getUtils()

getApiVersion

public String getApiVersion()
will be removed in jclouds 1.6

Specified by:
getApiVersion in interface Context
See Also:
Context.getProviderMetadata(), ProviderMetadata.getApiMetadata(), ApiMetadata.getVersion()

getBuildVersion

public String getBuildVersion()
will be removed in jclouds 1.6

Specified by:
getBuildVersion in interface Context
See Also:
Context.getProviderMetadata(), ProviderMetadata.getApiMetadata(), ApiMetadata.getBuildVersion()

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object

getDescription

public String getDescription()
Description of the location

Specified by:
getDescription in interface Location

getId

public String getId()
Unique ID provided by the provider (us-standard, miami, etc)

Specified by:
getId in interface Location

getIso3166Codes

public Set<String> getIso3166Codes()

Specified by:
getIso3166Codes in interface Location
Returns:
if known, the IS0 3166 or 3166-2 divisions where this service may run. ex. a set of strings like "US" or "US-CA"; otherwise returns an empty list.
See Also:
3166

getMetadata

public Map<String,Object> getMetadata()

Specified by:
getMetadata in interface Location
Returns:
immutable set of metadata relating to this location

getParent

public Location getParent()
The parent, or null, if top-level

Specified by:
getParent in interface Location

getScope

public LocationScope getScope()
Scope of the location, ex. region, zone, host

Specified by:
getScope in interface Location

credentialStore

public Map<String,Credentials> credentialStore()
will be removed in jclouds 1.6

Specified by:
credentialStore in interface Context
See Also:
Utils.credentialStore()

getCredentialStore

public Map<String,Credentials> getCredentialStore()
will be removed in jclouds 1.6

Specified by:
getCredentialStore in interface Context
See Also:
Utils.getCredentialStore()


Copyright © 2009-2013 jclouds. All Rights Reserved.