Package org.jclouds.internal
Class ContextImpl
- java.lang.Object
-
- org.jclouds.internal.ContextImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Context,Location
- Direct Known Subclasses:
ApiContextImpl
public class ContextImpl extends Object implements Context
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedContextImpl(String name, ProviderMetadata providerMetadata, com.google.common.base.Supplier<Credentials> creds, Utils utils, Closer closer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes all connections, including executor servicebooleanequals(Object obj)StringgetDescription()Description of the locationStringgetId()Unique ID provided by the provider (us-standard, miami, etc)StringgetIdentity()Set<String>getIso3166Codes()Map<String,Object>getMetadata()StringgetName()Identifies the Context.LocationgetParent()The parent, or null, if top-levelProviderMetadatagetProviderMetadata()LocationScopegetScope()Scope of the location, ex.inthashCode()booleanisOpen()StringtoString()Utilsutils()
-
-
-
Constructor Detail
-
ContextImpl
@Inject protected ContextImpl(String name, ProviderMetadata providerMetadata, com.google.common.base.Supplier<Credentials> creds, Utils utils, Closer closer)
-
-
Method Detail
-
close
public void close()
Closes all connections, including executor service
-
isOpen
public boolean isOpen()
-
getProviderMetadata
public ProviderMetadata getProviderMetadata()
- Specified by:
getProviderMetadatain interfaceContext- 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.
-
getIdentity
public String getIdentity()
- Specified by:
getIdentityin interfaceContext- Returns:
- the current login user, access key, email, or whatever the 'identity' field was building the context.
- See Also:
ApiMetadata#getDefaultIdentity
-
getDescription
public String getDescription()
Description of the location- Specified by:
getDescriptionin interfaceLocation
-
getId
public String getId()
Unique ID provided by the provider (us-standard, miami, etc)
-
getIso3166Codes
public Set<String> getIso3166Codes()
- Specified by:
getIso3166Codesin interfaceLocation- 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:
getMetadatain interfaceLocation- Returns:
- immutable set of metadata relating to this location
-
getParent
public Location getParent()
The parent, or null, if top-level
-
getScope
public LocationScope getScope()
Scope of the location, ex. region, zone, host
-
-