com.mongodb.rx.client.Success Java Examples

The following examples show how to use com.mongodb.rx.client.Success. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AggregateObservableImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> toCollection() {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.toCollection(voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #2
Source File: StudentController.java    From Java-programming-methodology-Rxjava-articles with Apache License 2.0 5 votes vote down vote up
@ApiOperation(value="学生创建", notes="根据BaseStudentDTO对象创建学生")
@ApiImplicitParam(name = "student", value = "学生详细实体student", required = true, dataType = "BaseStudentDTO")
@PostMapping(value = "",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public Observable<Success> createStudent(@RequestBody BaseStudentDTO student) {
    logger.debug("Creating a new Student.");
    return studentRepository.createStudent(student);
}
 
Example #3
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> drop() {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.drop(voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #4
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> dropIndex(final String indexName) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.dropIndex(indexName, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #5
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> dropIndex(final Bson keys) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.dropIndex(keys, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #6
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> renameCollection(final MongoNamespace newCollectionNamespace, final RenameCollectionOptions options) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.renameCollection(newCollectionNamespace, options, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #7
Source File: MongoDatabaseImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> drop() {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.drop(voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #8
Source File: MongoDatabaseImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> createCollection(final String collectionName, final CreateCollectionOptions options) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.createCollection(collectionName, options, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #9
Source File: MongoDatabaseImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> createView(final String viewName, final String viewOn, final List<? extends Bson> pipeline) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.createView(viewName, viewOn, pipeline, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #10
Source File: MongoDatabaseImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> createView(final String viewName, final String viewOn, final List<? extends Bson> pipeline,
                                      final CreateViewOptions createViewOptions) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.createView(viewName, viewOn, pipeline, createViewOptions, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #11
Source File: GridFSDownloadStreamImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> close() {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.close(voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #12
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> insertMany(final List<? extends TDocument> documents, final InsertManyOptions options) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.insertMany(documents, options, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #13
Source File: ObservableHelper.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
/**
 * Helper to trigger Boolean SingleResultCallbacks for Void operations
 *
 * @param callback the boolean single result callback.
 * @return the results callback for an operation that returns null to signal success.
 */
public static SingleResultCallback<Void> voidToSuccessCallback(final SingleResultCallback<Success> callback) {
    return new SingleResultCallback<Void>() {
        @Override
        public void onResult(final Void result, final Throwable t) {
            callback.onResult(Success.SUCCESS, t);
        }
    };
}
 
Example #14
Source File: GridFSBucketImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> uploadFromStream(final BsonValue id, final String filename, final AsyncInputStream source) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.uploadFromStream(id, filename, toCallbackAsyncInputStream(source), voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #15
Source File: GridFSBucketImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> uploadFromStream(final BsonValue id, final String filename, final AsyncInputStream source,
                                           final GridFSUploadOptions options) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.uploadFromStream(id, filename, toCallbackAsyncInputStream(source), options, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #16
Source File: GridFSBucketImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> delete(final ObjectId id) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.delete(id, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #17
Source File: GridFSBucketImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> delete(final BsonValue id) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.delete(id, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #18
Source File: GridFSBucketImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> rename(final ObjectId id, final String newFilename) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.rename(id, newFilename, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #19
Source File: GridFSBucketImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> rename(final BsonValue id, final String newFilename) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.rename(id, newFilename, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #20
Source File: GridFSBucketImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> drop() {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.drop(voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #21
Source File: MapReduceObservableImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> toCollection() {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.toCollection(voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #22
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> insertOne(final TDocument document) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.insertOne(document, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #23
Source File: GridFSUploadStreamImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> abort() {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.abort(voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #24
Source File: GridFSUploadStreamImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> close() {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.close(voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #25
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> insertOne(final TDocument document, final InsertOneOptions options) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.insertOne(document, options, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #26
Source File: StudentController.java    From Java-programming-methodology-Rxjava-articles with Apache License 2.0 5 votes vote down vote up
@ApiOperation(value="学生创建", notes="根据BaseStudentDTO对象创建学生")
@ApiImplicitParam(name = "student", value = "学生详细实体student", required = true, dataType = "BaseStudentDTO")
@PostMapping(value = "",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public Observable<Success> createStudent(@RequestBody BaseStudentDTO student) {
    logger.debug("Creating a new Student.");
    return studentRepository.createStudent(student);
}
 
Example #27
Source File: StudentController.java    From Java-9-Spring-Webflux with Apache License 2.0 5 votes vote down vote up
@ApiOperation(value="学生创建", notes="根据BaseStudentDTO对象创建学生")
@ApiImplicitParam(name = "student", value = "学生详细实体student", required = true, dataType = "BaseStudentDTO")
@PostMapping(value = "",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public Observable<Success> createStudent(@RequestBody BaseStudentDTO student) {
    logger.debug("Creating a new Student.");
    return studentRepository.createStudent(student);
}
 
Example #28
Source File: StudentController.java    From Java-9-Spring-Webflux with Apache License 2.0 5 votes vote down vote up
@ApiOperation(value="学生创建", notes="根据BaseStudentDTO对象创建学生")
@ApiImplicitParam(name = "student", value = "学生详细实体student", required = true, dataType = "BaseStudentDTO")
@PostMapping(value = "",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public Observable<Success> createStudent(@RequestBody BaseStudentDTO student) {
    logger.debug("Creating a new Student.");
    return studentRepository.createStudent(student);
}
 
Example #29
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 4 votes vote down vote up
@Override
public Observable<Success> insertMany(final List<? extends TDocument> documents) {
    return insertMany(documents, new InsertManyOptions());
}
 
Example #30
Source File: MongoCollectionImpl.java    From mongo-java-driver-rx with Apache License 2.0 4 votes vote down vote up
@Override
public Observable<Success> dropIndexes() {
    return dropIndex("*");
}