All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.julienviet.reactivex.pgclient.PgTransaction Maven / Gradle / Ivy

/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package com.julienviet.reactivex.pgclient;

import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;

/**
 * A transaction that allows to control the transaction and receive events.
 *
 * 

* NOTE: This class has been automatically generated from the {@link com.julienviet.pgclient.PgTransaction original} non RX-ified interface using Vert.x codegen. */ @io.vertx.lang.reactivex.RxGen(com.julienviet.pgclient.PgTransaction.class) public class PgTransaction { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PgTransaction that = (PgTransaction) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final io.vertx.lang.reactivex.TypeArg __TYPE_ARG = new io.vertx.lang.reactivex.TypeArg<>( obj -> new PgTransaction((com.julienviet.pgclient.PgTransaction) obj), PgTransaction::getDelegate ); private final com.julienviet.pgclient.PgTransaction delegate; public PgTransaction(com.julienviet.pgclient.PgTransaction delegate) { this.delegate = delegate; } public com.julienviet.pgclient.PgTransaction getDelegate() { return delegate; } /** * Commit the current transaction. */ public void commit() { delegate.commit(); } /** * Like {@link com.julienviet.reactivex.pgclient.PgTransaction#commit} with an handler to be notified when the transaction commit has completed * @param handler */ public void commit(Handler> handler) { delegate.commit(handler); } /** * Like {@link com.julienviet.reactivex.pgclient.PgTransaction#commit} with an handler to be notified when the transaction commit has completed * @return */ public Completable rxCommit() { return new io.vertx.reactivex.core.impl.AsyncResultCompletable(handler -> { commit(handler); }); } /** * Rollback the current transaction. */ public void rollback() { delegate.rollback(); } /** * Like {@link com.julienviet.reactivex.pgclient.PgTransaction#rollback} with an handler to be notified when the transaction rollback has completed * @param handler */ public void rollback(Handler> handler) { delegate.rollback(handler); } /** * Like {@link com.julienviet.reactivex.pgclient.PgTransaction#rollback} with an handler to be notified when the transaction rollback has completed * @return */ public Completable rxRollback() { return new io.vertx.reactivex.core.impl.AsyncResultCompletable(handler -> { rollback(handler); }); } /** * Set an handler to be called when the transaction is aborted. * @param handler the handler * @return */ public PgTransaction abortHandler(Handler handler) { delegate.abortHandler(handler); return this; } public static PgTransaction newInstance(com.julienviet.pgclient.PgTransaction arg) { return arg != null ? new PgTransaction(arg) : null; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy