brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorbett <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Mongodb authentication
Date Tue, 15 Sep 2015 09:53:47 GMT
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/894#discussion_r39492619
  
    --- Diff: software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/mongodb/sharding/CoLocatedMongoDBRouterImpl.java
---
    @@ -19,32 +19,47 @@
     package org.apache.brooklyn.entity.nosql.mongodb.sharding;
     
     import java.util.Collection;
    +import java.util.concurrent.ExecutionException;
     
     import org.apache.brooklyn.api.entity.EntitySpec;
     import org.apache.brooklyn.api.location.Location;
    +import org.apache.brooklyn.api.mgmt.Task;
     import org.apache.brooklyn.core.entity.Entities;
     import org.apache.brooklyn.core.entity.trait.Startable;
     import org.apache.brooklyn.core.sensor.DependentConfiguration;
     import org.apache.brooklyn.enricher.stock.Enrichers;
    +import org.apache.brooklyn.entity.group.AbstractGroup;
    +import org.apache.brooklyn.entity.nosql.mongodb.MongoDBAuthenticationMixins;
    +import org.apache.brooklyn.entity.nosql.mongodb.MongoDBAuthenticationUtils;
     import org.apache.brooklyn.entity.software.base.SameServerEntityImpl;
    +import org.apache.brooklyn.util.exceptions.Exceptions;
     
     import com.google.common.base.Predicates;
     import com.google.common.collect.Iterables;
     
    -public class CoLocatedMongoDBRouterImpl extends SameServerEntityImpl implements CoLocatedMongoDBRouter
{
    +public class CoLocatedMongoDBRouterImpl extends SameServerEntityImpl implements CoLocatedMongoDBRouter,
MongoDBAuthenticationMixins {
    +
    +    private MongoDBRouter router;
    +
         @Override
         public void init() {
             super.init();
    -        
    +        router = addChild(EntitySpec.create(MongoDBRouter.class)
    +                .configure(MongoDBRouter.CONFIG_SERVERS,
    +                        DependentConfiguration.attributeWhenReady(
    +                                getConfig(CoLocatedMongoDBRouter.SHARDED_DEPLOYMENT),
    +                                MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES)));
             for (EntitySpec<?> siblingSpec : getConfig(CoLocatedMongoDBRouter.SIBLING_SPECS))
{
                 addChild(siblingSpec);
             }
    +        sensors().set(ROUTER, (MongoDBRouter) Iterables.tryFind(getChildren(), Predicates.instanceOf(MongoDBRouter.class)).get());
         }
     
         @Override
         protected void doStart(Collection<? extends Location> locations) {
    +
             // TODO Changed to create the router child after init as a workaround.
    --- End diff --
    
    Is this still valid now you've moved the creation of the router back to init?


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