fix(api): create clouddriver-api and move cloud provider API (#4694)
* fix(api): create clouddriver-api and move cloud provider API
This moves the current cloud provider API to the new clouddriver-api module. Not everything that is API was moved, but it is almost everything I used in the Nomad plugin. Most of what was moved has been left as is for now. The things not yet moved or modified were mainly due to the need to limit external dependencies in clouddriver-api. There are specific notes below.
build.gradle doesn't add any of the cross module stuff to clouddriver-api just like clouddriver-bom.
Several modules now depend on clouddriver-api, but some of thier other interproject depedencies can be removed soon (especially for the cloud providers).
Modifications:
* DefaultCacheData was split into DefaultCacheData and DefaultJsonCacheData to separate out the jackson based construction.
* AbstractAccountCredentials was separated from AccountCredentials to remove the getPermissions method (which requires fiat)
* OnDemandMetricsSupportable is a new interface for OnDemandMetricsSupport which requires spectator, but only for implementation.
* SearchableProvider no longer uses groovy.transform.Canonical. It shouldn't matter since it is a Java class.
I've fix a few places in the code that these changes affect. DefaultJsonCacheData is used for object mappers. AccountCredentials implemenations now extend AbstractAccountCredentials. DefaultAllowedAccountsValidator has added conditional logic around getPermissions() calls because that isn't in the AccountCredentials interface.
Todo:
* DescriptionValidator uses org.springframework.validation.Errors from spring-context in the method contract.
* DeployHandler uses DeploymentResult which is groovy and should be refactored separately.
* A few unit tests need to move to clouddriver. I didn't know if we were cool with Groovy unit tests or if I needed to rewrite them. They work where they are.
This was the least invasive commit I could make. The above todos will happen in follow up PRs.