jclouds/jclouds — pull request #981 by adriancole (2012-11-11 19:13:28+00:00)
Title: added ability to test if an api is available based on apiVersion

per https://groups.google.com/d/topic/jclouds-dev/4XCxTOzvWDQ/discussion

add the ability to auto-detect if a type is available based on api version. once this is merged, we can backport EC2 to check for features based on apiVersion in a provider

ex.

// feature present in base api
interface KeyPairAsyncApi

SinceApiVersion("2010-08-31")
interface TagAsyncApi

SinceApiVersion("2011-01-01")
interface VpcAsyncApi

interface EC2AsyncApi {

// returns present for all versions
Delegate
Optional getKeyPairApi();

// returns present when apiVersion greater than or equal to 2010-08-31
Delegate
Optional getTagApi();

// returns present when apiVersion greater than or equal to 2011-01-01
Delegate
Optional getVpcApi();

}