brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m4rkmckenna <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #782: Adds `PUT /applications/{appid}`
Date Mon, 31 Jul 2017 17:18:08 GMT
Github user m4rkmckenna commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/782#discussion_r130405178
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
---
    @@ -143,12 +153,24 @@ public EntityTypeRegistry getEntityTypeRegistry() {
             if (!isRunning()) throw new IllegalStateException("Management context no longer
running");
             return entityTypeRegistry;
         }
    +
    +    @Override
    +    public <T extends Entity> T createEntity(EntitySpec<T> spec) {
    +        return createEntity(spec, Optional.absent());
    +    }
         
    +    @Beta
         @SuppressWarnings("unchecked")
         @Override
    -    public <T extends Entity> T createEntity(EntitySpec<T> spec) {
    +    public <T extends Entity> T createEntity(EntitySpec<T> spec, Optional<String>
entityId) {
    +        if (entityId.isPresent()) {
    +            if (!ENTITY_ID_PATTERN.matcher(entityId.get()).matches()) {
    +                throw new IllegalArgumentException("Invalid entity id '"+entityId.get()+"'");
    --- End diff --
    
    This exception text is never returned so its hard to diagnose the issue


---
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.
---

Mime
View raw message