Add an async save method to ServerGroup

This commit is contained in:
Colin McDonald 2016-06-17 01:13:20 -04:00
parent dff1e16283
commit ba17babfb8

View File

@ -1,5 +1,6 @@
package net.frozenorb.apiv3.model;
import com.mongodb.async.SingleResultCallback;
import com.mongodb.async.client.MongoCollection;
import com.mongodb.client.result.DeleteResult;
import com.mongodb.client.result.UpdateResult;
@ -77,10 +78,8 @@ public final class ServerGroup {
callback.get();
}
public void save() {
BlockingCallback<UpdateResult> callback = new BlockingCallback<>();
public void save(SingleResultCallback<UpdateResult> callback) {
serverGroupsCollection.replaceOne(new Document("_id", id), this, callback);
callback.get();
}
public void delete() {