|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.entity.nosql.mongodb.MongoClientSupport
public class MongoClientSupport
Manages connections to standalone MongoDB servers.
Constructor Summary | |
MongoClientSupport(ServerAddress standalone)
|
Method Summary | |
---|---|
boolean
|
addMemberToReplicaSet(MongoDBServer secondary, java.lang.Integer id)
Reconfigures the replica set that this client is the primary member of to include a new member. |
void
|
close()
|
static MongoClientSupport
|
forServer(MongoDBServer standalone)
Creates a MongoClientSupport instance in standalone mode. |
BSONObject
|
getReplicaSetConfig()
Java equivalent of calling rs.conf() in the console. |
BasicBSONObject
|
getReplicaSetStatus()
Runs |
BasicBSONObject
|
getServerStatus()
|
boolean
|
initializeReplicaSet(java.lang.String replicaSetName, java.lang.Integer id)
|
boolean
|
removeMemberFromReplicaSet(MongoDBServer server)
Reconfigures the replica set that this client is the primary member of to remove the given server. |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public MongoClientSupport(ServerAddress standalone)
Method Detail |
---|
public boolean addMemberToReplicaSet(MongoDBServer secondary, java.lang.Integer id)
secondary
- New member of the set.id
- The id for the new set member. Must be unique within the set.
client.close(); public void close()
public static MongoClientSupport forServer(MongoDBServer standalone)
public BSONObject getReplicaSetConfig()
public BasicBSONObject getReplicaSetStatus()
replSetGetStatus
on the admin database.
replSetGetStatus
, or
an empty BasicBSONObject if the command threw an exception (e.g. if
the connection was reset) or if the resultant CommandResult#ok#ok was false.
public BasicBSONObject getServerStatus()
public boolean initializeReplicaSet(java.lang.String replicaSetName, java.lang.Integer id)
public boolean removeMemberFromReplicaSet(MongoDBServer server)
server
- The server to remove
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.