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 protected
ContextImpl(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 void
close()
Closes all connections, including executor serviceboolean
equals(Object obj)
String
getDescription()
Description of the locationString
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-levelProviderMetadata
getProviderMetadata()
LocationScope
getScope()
Scope of the location, ex.int
hashCode()
boolean
isOpen()
String
toString()
Utils
utils()
-
-
-
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:
getProviderMetadata
in 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:
getIdentity
in 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:
getDescription
in interfaceLocation
-
getId
public String getId()
Unique ID provided by the provider (us-standard, miami, etc)
-
getIso3166Codes
public Set<String> getIso3166Codes()
- Specified by:
getIso3166Codes
in 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:
getMetadata
in 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
-
-