brooklyn.entity.nosql.mongodb.MongoDBSshDriver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-software-nosql Show documentation
Show all versions of brooklyn-software-nosql Show documentation
Brooklyn entities for NoSQL data store software entities
The newest version!
package brooklyn.entity.nosql.mongodb;
import static com.google.common.base.Preconditions.checkState;
import brooklyn.location.basic.SshMachineLocation;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
public class MongoDBSshDriver extends AbstractMongoDBSshDriver implements MongoDBDriver {
public MongoDBSshDriver(MongoDBServerImpl entity, SshMachineLocation machine) {
super(entity, machine);
}
@Override
public MongoDBServerImpl getEntity() {
return MongoDBServerImpl.class.cast(super.getEntity());
}
@Override
public void launch() {
MongoDBServer server = getEntity();
ImmutableList.Builder argsBuilder = getArgsBuilderWithDefaults(server)
.add("--dbpath", getDataDirectory());
if (server.isReplicaSetMember()) {
String replicaSetName = server.getReplicaSet().getName();
checkState(!Strings.isNullOrEmpty(replicaSetName), "Replica set name must not be null or empty");
argsBuilder.add("--replSet", replicaSetName);
}
if (Boolean.TRUE.equals(server.getConfig(MongoDBServer.ENABLE_REST_INTERFACE)))
argsBuilder.add("--rest");
launch(argsBuilder);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy