You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by ahgittin <gi...@git.apache.org> on 2017/02/28 16:08:43 UTC

[GitHub] brooklyn-server pull request #575: Clean up location metadata and OSGi packa...

GitHub user ahgittin opened a pull request:

    https://github.com/apache/brooklyn-server/pull/575

    Clean up location metadata and OSGi packaging

    Discovered when trying to use the REST API that we didn't get much of the location detail we might want; in particular we didn't have info on provider/endpoint/region, and the parent spec was not accurately identified.  Tracked the latter to confusion around `ORIGINAL_SPEC` which I've clarified and deprecated the confusing other field, and the former to a place where flags weren't pulled in, just config.
    
    Also had trouble accessing some of the data because it required a cast to `JcloudsLocation`, which pulled in an OSGi dependency on the main brooklyn-jclouds package, and classes in that package pulled in jclouds bundles through their signatures, giving a huge set of bundle constraints in my downstream project.  Have refactored here so that we can access many common things through an `api` package which doesn't pull in jclouds dependencies.
    
    Finally, noticed some other places where more machine detail would probably be wanted, but wasn't provided.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ahgittin/brooklyn-server locations-more-detail

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/575.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #575
    
----
commit bfbcddd5d2088ce2cdeedc1b70e5db1edf37a0fb
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date:   2017-02-18T00:50:28Z

    provide more detail of locations in REST calls
    
    with some confused parts marked TODO

commit e2319e5e1ebf13551a414182965034440c6b40ff
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date:   2017-02-28T14:11:08Z

    extract many API methods to an api package so osgi projects can access much functionality
    without needing to pull in an exported jclouds dependency
    
    (because JcloudsLocation has methods which access jclouds objects in the signature,
    use of the jclouds package _exports_ a bunch of jclouds osgi deps which is rarely wanted)
    
    this has been done in a backwards compatible way; the classes in the package look the same,
    there are just now intermediate interfaces which are jclouds-free

commit 1e8873a8d52a03267cbbbd06af1e70ba9a57fcf3
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date:   2017-02-28T16:01:05Z

    sort out ORIGINAL_SPEC and NAMED_SPEC_NAME, deprecating the latter
    
    and ensuring the former is always set to the originally requested spec, with tests

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #575: Clean up location metadata and OSGi packa...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/575


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #575: Clean up location metadata and OSGi packa...

Posted by duncangrant <gi...@git.apache.org>.
Github user duncangrant commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/575#discussion_r114517277
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java ---
    @@ -372,7 +377,10 @@ public final Location getLocationManaged(String spec, Map locationFlags) {
     
                 if (resolver != null) {
                     try {
    -                    return (Maybe) Maybe.of(resolver.newLocationSpecFromString(spec, locationFlags, this));
    +                    LocationSpec<? extends Location> specO = resolver.newLocationSpecFromString(spec, locationFlags, this);
    --- End diff --
    
    I feel like the naming in this function has gotten a bit lost.  We have a spec and a specO and it took me a bit too much time to understand what I was seeing.  Can't think of a better naming convention now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---