use of rx.Completable in project azure-sdk-for-java by Azure.
the class SqlServerImpl method deleteChildResources.
private void deleteChildResources() {
Completable deleteFirewallRules = deleteFirewallRule();
Completable deleteDatabasesAndElasticPools = deleteDatabasesAndElasticPools();
Completable.merge(deleteFirewallRules, deleteDatabasesAndElasticPools).await();
}
use of rx.Completable in project azure-sdk-for-java by Azure.
the class SqlServerImpl method deleteDatabasesAndElasticPools.
private Completable deleteDatabasesAndElasticPools() {
List<Completable> deleteDBList = new ArrayList<>();
for (String databaseName : this.databasesToDelete) {
deleteDBList.add(this.databases().deleteAsync(databaseName));
}
Completable deleteDBs = Completable.merge(deleteDBList);
List<Completable> deleteElasticPoolList = new ArrayList<>();
for (String elasticPoolName : this.elasticPoolsToDelete) {
deleteElasticPoolList.add(this.elasticPools().deleteAsync(elasticPoolName));
}
Completable deletePools = Completable.merge(deleteElasticPoolList);
return Completable.concat(deleteDBs, deletePools);
}
use of rx.Completable in project azure-sdk-for-java by Azure.
the class QueueImpl method createChildResourceAsync.
@Override
protected Observable<Queue> createChildResourceAsync() {
Completable createQueueCompletable = this.manager().inner().queues().createOrUpdateAsync(this.resourceGroupName(), this.parentName, this.name(), this.inner()).map(new Func1<QueueInner, QueueInner>() {
@Override
public QueueInner call(QueueInner inner) {
setInner(inner);
return inner;
}
}).toCompletable();
Completable childrenOperationsCompletable = submitChildrenOperationsAsync();
final Queue self = this;
return Completable.concat(createQueueCompletable, childrenOperationsCompletable).doOnTerminate(new Action0() {
@Override
public void call() {
initChildrenOperationsCache();
}
}).andThen(Observable.just(self));
}
use of rx.Completable in project storio by pushtorefresh.
the class DeleteOperationDesignTest method deleteObjectCompletable.
@Test
public void deleteObjectCompletable() {
Article article = mock(Article.class);
Completable completable = storIOContentResolver().delete().object(article).withDeleteResolver(ArticleMeta.DELETE_RESOLVER).prepare().asRxCompletable();
}
use of rx.Completable in project storio by pushtorefresh.
the class DeleteOperationDesignTest method deleteByQueryCompletable.
@Test
public void deleteByQueryCompletable() {
final DeleteQuery deleteQuery = DeleteQuery.builder().uri(mock(Uri.class)).where("some_field = ?").whereArgs("someValue").build();
Completable completable = storIOContentResolver().delete().byQuery(deleteQuery).prepare().asRxCompletable();
}
Aggregations