Package org.jclouds.providers
Class Providers
- java.lang.Object
-
- org.jclouds.providers.Providers
-
public class Providers extends Object
The Providers class provides static methods for accessing providers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Providers.ApiMetadataFunction
static class
Providers.IdFunction
-
Constructor Summary
Constructors Constructor Description Providers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Iterable<ProviderMetadata>
all()
Returns all available providers.static Iterable<ProviderMetadata>
apiMetadataAssignableFrom(com.google.common.reflect.TypeToken<? extends ApiMetadata> api)
Returns the providers that are of the provided api.static com.google.common.base.Function<ProviderMetadata,ApiMetadata>
apiMetadataFunction()
static Iterable<ProviderMetadata>
boundedByIso3166Code(String iso3166Code)
Returns the providers that are bound to the same location as the given ISO 3166 code regardless of viewableAs.static Iterable<ProviderMetadata>
boundedByIso3166Code(String iso3166Code, com.google.common.reflect.TypeToken<? extends View> viewableAs)
Returns the providers that are bound to the same location as the given ISO 3166 code and of the given viewableAs.static Iterable<ProviderMetadata>
boundedByIso3166Code(String iso3166Code, Class<? extends View> viewableAs)
static Iterable<ProviderMetadata>
collocatedWith(ProviderMetadata providerMetadata)
Returns the providers that have at least one common ISO 3166 code in common regardless of viewableAs.static Iterable<ProviderMetadata>
collocatedWith(ProviderMetadata providerMetadata, com.google.common.reflect.TypeToken<? extends View> viewableAs)
Returns the providers that have at least one common ISO 3166 code and are of the given viewableAs.static Iterable<ProviderMetadata>
collocatedWith(ProviderMetadata providerMetadata, Class<? extends View> viewableAs)
static <C extends Context>
Iterable<ProviderMetadata>contextAssignableFrom(com.google.common.reflect.TypeToken<? extends Context> context)
Returns the providers that are of the provided context.static Iterable<ProviderMetadata>
fromServiceLoader()
Returns the providers located on the classpath viaServiceLoader
.static com.google.common.base.Function<ProviderMetadata,String>
idFunction()
static Iterable<ProviderMetadata>
viewableAs(com.google.common.reflect.TypeToken<? extends View> viewableAs)
Returns the providers that are of the provided viewableAs.static Iterable<ProviderMetadata>
viewableAs(Class<? extends View> viewableAs)
static ProviderMetadata
withId(String id)
Returns the first provider with the provided id
-
-
-
Method Detail
-
idFunction
public static com.google.common.base.Function<ProviderMetadata,String> idFunction()
-
apiMetadataFunction
public static com.google.common.base.Function<ProviderMetadata,ApiMetadata> apiMetadataFunction()
-
fromServiceLoader
public static Iterable<ProviderMetadata> fromServiceLoader()
Returns the providers located on the classpath viaServiceLoader
.- Returns:
- all available providers loaded from classpath via ServiceLoader
-
all
public static Iterable<ProviderMetadata> all()
Returns all available providers.- Returns:
- all available providers
-
withId
public static ProviderMetadata withId(String id) throws NoSuchElementException
Returns the first provider with the provided id- Parameters:
id
- the id of the provider to return- Returns:
- the provider with the given id
- Throws:
NoSuchElementException
- whenever there are no providers with the provided id
-
viewableAs
public static Iterable<ProviderMetadata> viewableAs(com.google.common.reflect.TypeToken<? extends View> viewableAs)
Returns the providers that are of the provided viewableAs.- Parameters:
viewableAs
- the viewableAs to providers to return- Returns:
- the providers of the provided viewableAs
-
viewableAs
public static Iterable<ProviderMetadata> viewableAs(Class<? extends View> viewableAs)
-
apiMetadataAssignableFrom
public static Iterable<ProviderMetadata> apiMetadataAssignableFrom(com.google.common.reflect.TypeToken<? extends ApiMetadata> api)
Returns the providers that are of the provided api.- Parameters:
api
- the api to providers to return- Returns:
- the providers of the provided api
-
contextAssignableFrom
public static <C extends Context> Iterable<ProviderMetadata> contextAssignableFrom(com.google.common.reflect.TypeToken<? extends Context> context)
Returns the providers that are of the provided context.- Parameters:
context
- the context to providers to return- Returns:
- the providers of the provided context
-
boundedByIso3166Code
public static Iterable<ProviderMetadata> boundedByIso3166Code(String iso3166Code)
Returns the providers that are bound to the same location as the given ISO 3166 code regardless of viewableAs.- Parameters:
isoCode
- the ISO 3166 code to filter providers by- Returns:
- the providers bound by the given ISO 3166 code
-
boundedByIso3166Code
public static Iterable<ProviderMetadata> boundedByIso3166Code(String iso3166Code, com.google.common.reflect.TypeToken<? extends View> viewableAs)
Returns the providers that are bound to the same location as the given ISO 3166 code and of the given viewableAs.- Parameters:
iso3166Code
- the ISO 3166 code to filter providers byviewableAs
- the viewableAs to filter providers by- Returns:
- the providers bound by the given ISO 3166 code and of the proper viewableAs
-
boundedByIso3166Code
public static Iterable<ProviderMetadata> boundedByIso3166Code(String iso3166Code, Class<? extends View> viewableAs)
-
collocatedWith
public static Iterable<ProviderMetadata> collocatedWith(ProviderMetadata providerMetadata)
Returns the providers that have at least one common ISO 3166 code in common regardless of viewableAs.- Parameters:
providerMetadata
- the provider metadata to use to filter providers by- Returns:
- the providers that share at least one common ISO 3166 code
-
collocatedWith
public static Iterable<ProviderMetadata> collocatedWith(ProviderMetadata providerMetadata, com.google.common.reflect.TypeToken<? extends View> viewableAs)
Returns the providers that have at least one common ISO 3166 code and are of the given viewableAs.- Parameters:
providerMetadata
- the provider metadata to use to filter providers byviewableAs
- the viewableAs to filter providers by- Returns:
- the providers that share at least one common ISO 3166 code and of the given viewableAs
-
collocatedWith
public static Iterable<ProviderMetadata> collocatedWith(ProviderMetadata providerMetadata, Class<? extends View> viewableAs)
-
-