Skip to content

Commit 6c554c1

Browse files
committed
Renamed executeCommand to runCommand in async API
1 parent 6fc4f6a commit 6c554c1

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

driver-async/src/main/com/mongodb/async/client/MongoDatabase.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public interface MongoDatabase {
111111
* @param command the command to be run
112112
* @param callback the callback that is passed the command result
113113
*/
114-
void executeCommand(Bson command, SingleResultCallback<Document> callback);
114+
void runCommand(Bson command, SingleResultCallback<Document> callback);
115115

116116
/**
117117
* Executes command in the context of the current database.
@@ -120,7 +120,7 @@ public interface MongoDatabase {
120120
* @param readPreference the {@link com.mongodb.ReadPreference} to be used when executing the command
121121
* @param callback the callback that is passed the command result
122122
*/
123-
void executeCommand(Bson command, ReadPreference readPreference, SingleResultCallback<Document> callback);
123+
void runCommand(Bson command, ReadPreference readPreference, SingleResultCallback<Document> callback);
124124

125125
/**
126126
* Executes command in the context of the current database.
@@ -130,7 +130,7 @@ public interface MongoDatabase {
130130
* @param <TResult> the type of the class to use instead of {@code Document}.
131131
* @param callback the callback that is passed the command result
132132
*/
133-
<TResult> void executeCommand(Bson command, Class<TResult> resultClass, SingleResultCallback<TResult> callback);
133+
<TResult> void runCommand(Bson command, Class<TResult> resultClass, SingleResultCallback<TResult> callback);
134134

135135
/**
136136
* Executes command in the context of the current database.
@@ -141,8 +141,8 @@ public interface MongoDatabase {
141141
* @param <TResult> the type of the class to use instead of {@code Document}.
142142
* @param callback the callback that is passed the command result
143143
*/
144-
<TResult> void executeCommand(Bson command, ReadPreference readPreference, Class<TResult> resultClass,
145-
SingleResultCallback<TResult> callback);
144+
<TResult> void runCommand(Bson command, ReadPreference readPreference, Class<TResult> resultClass,
145+
SingleResultCallback<TResult> callback);
146146

147147
/**
148148
* Drops this database.

driver-async/src/main/com/mongodb/async/client/MongoDatabaseImpl.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,25 @@ public <TDocument> MongoCollection<TDocument> getCollection(final String collect
119119
}
120120

121121
@Override
122-
public void executeCommand(final Bson command, final SingleResultCallback<Document> callback) {
123-
executeCommand(command, Document.class, callback);
122+
public void runCommand(final Bson command, final SingleResultCallback<Document> callback) {
123+
runCommand(command, Document.class, callback);
124124
}
125125

126126
@Override
127-
public void executeCommand(final Bson command, final ReadPreference readPreference, final SingleResultCallback<Document> callback) {
128-
executeCommand(command, readPreference, Document.class, callback);
127+
public void runCommand(final Bson command, final ReadPreference readPreference, final SingleResultCallback<Document> callback) {
128+
runCommand(command, readPreference, Document.class, callback);
129129
}
130130

131131
@Override
132-
public <TResult> void executeCommand(final Bson command, final Class<TResult> resultClass,
133-
final SingleResultCallback<TResult> callback) {
132+
public <TResult> void runCommand(final Bson command, final Class<TResult> resultClass,
133+
final SingleResultCallback<TResult> callback) {
134134
notNull("command", command);
135135
executor.execute(new CommandWriteOperation<TResult>(getName(), toBsonDocument(command), codecRegistry.get(resultClass)), callback);
136136
}
137137

138138
@Override
139-
public <TResult> void executeCommand(final Bson command, final ReadPreference readPreference, final Class<TResult> resultClass,
140-
final SingleResultCallback<TResult> callback) {
139+
public <TResult> void runCommand(final Bson command, final ReadPreference readPreference, final Class<TResult> resultClass,
140+
final SingleResultCallback<TResult> callback) {
141141
notNull("command", command);
142142
notNull("readPreference", readPreference);
143143
executor.execute(new CommandReadOperation<TResult>(getName(), toBsonDocument(command), codecRegistry.get(resultClass)),

driver-async/src/test/functional/com/mongodb/async/client/Fixture.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static MongoCollection<Document> initializeCollection(final MongoNamespac
7474
MongoDatabase database = getMongoClient().getDatabase(namespace.getDatabaseName());
7575
try {
7676
FutureResultCallback<Document> futureResultCallback = new FutureResultCallback<Document>();
77-
database.executeCommand(new Document("drop", namespace.getCollectionName()), futureResultCallback);
77+
database.runCommand(new Document("drop", namespace.getCollectionName()), futureResultCallback);
7878
futureResultCallback.get(10, SECONDS);
7979
} catch (MongoCommandException e) {
8080
if (!e.getErrorMessage().startsWith("ns not found")) {
@@ -96,7 +96,7 @@ public static void dropDatabase(final String name) throws InterruptedException,
9696
try {
9797
FutureResultCallback<Document> futureResultCallback = new FutureResultCallback<Document>();
9898
getMongoClient().getDatabase(name)
99-
.executeCommand(new Document("dropDatabase", 1), futureResultCallback);
99+
.runCommand(new Document("dropDatabase", 1), futureResultCallback);
100100
futureResultCallback.get(10, SECONDS);
101101
} catch (MongoCommandException e) {
102102
if (!e.getErrorMessage().startsWith("ns not found")) {
@@ -109,7 +109,7 @@ public static void drop(final MongoNamespace namespace) throws ExecutionExceptio
109109
try {
110110
FutureResultCallback<Document> futureResultCallback = new FutureResultCallback<Document>();
111111
getMongoClient().getDatabase(namespace.getDatabaseName())
112-
.executeCommand(new Document("drop", namespace.getCollectionName()), futureResultCallback);
112+
.runCommand(new Document("drop", namespace.getCollectionName()), futureResultCallback);
113113
futureResultCallback.get();
114114
} catch (MongoCommandException e) {
115115
if (!e.getErrorMessage().contains("ns not found")) {

driver-async/src/test/unit/com/mongodb/async/client/MongoDatabaseSpecification.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class MongoDatabaseSpecification extends Specification {
103103
def futureResultCallback = new FutureResultCallback<Document>()
104104

105105
when:
106-
database.executeCommand(command, futureResultCallback)
106+
database.runCommand(command, futureResultCallback)
107107
futureResultCallback.get()
108108

109109
then:
@@ -114,7 +114,7 @@ class MongoDatabaseSpecification extends Specification {
114114

115115
when:
116116
futureResultCallback = new FutureResultCallback<Document>()
117-
database.executeCommand(command, primaryPreferred(), futureResultCallback)
117+
database.runCommand(command, primaryPreferred(), futureResultCallback)
118118
operation = executor.getReadOperation() as CommandReadOperation<Document>
119119
futureResultCallback.get()
120120

@@ -124,7 +124,7 @@ class MongoDatabaseSpecification extends Specification {
124124

125125
when:
126126
futureResultCallback = new FutureResultCallback<BsonDocument>()
127-
database.executeCommand(command, BsonDocument, futureResultCallback)
127+
database.runCommand(command, BsonDocument, futureResultCallback)
128128
operation = executor.getWriteOperation() as CommandWriteOperation<BsonDocument>
129129
futureResultCallback.get()
130130

@@ -133,7 +133,7 @@ class MongoDatabaseSpecification extends Specification {
133133

134134
when:
135135
futureResultCallback = new FutureResultCallback<BsonDocument>()
136-
database.executeCommand(command, primaryPreferred(), BsonDocument, futureResultCallback)
136+
database.runCommand(command, primaryPreferred(), BsonDocument, futureResultCallback)
137137
operation = executor.getReadOperation() as CommandReadOperation<BsonDocument>
138138
futureResultCallback.get()
139139

0 commit comments

Comments
 (0)