Search in sources :

Example 1 with ErrorMessageHandler

use of io.bitsquare.common.handlers.ErrorMessageHandler in project bitsquare by bitsquare.

the class Offer method checkOfferAvailability.

///////////////////////////////////////////////////////////////////////////////////////////
// Availability
///////////////////////////////////////////////////////////////////////////////////////////
public void checkOfferAvailability(OfferAvailabilityModel model, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {
    availabilityProtocol = new OfferAvailabilityProtocol(model, () -> {
        cancelAvailabilityRequest();
        resultHandler.handleResult();
    }, (errorMessage) -> {
        if (availabilityProtocol != null)
            availabilityProtocol.cancel();
        log.error(errorMessage);
        errorMessageHandler.handleErrorMessage(errorMessage);
    });
    availabilityProtocol.sendOfferAvailabilityRequest();
}
Also used : Version(io.bitsquare.app.Version) MathUtils(io.bitsquare.common.util.MathUtils) PaymentMethod(io.bitsquare.payment.PaymentMethod) PriceFeedService(io.bitsquare.btc.pricefeed.PriceFeedService) PubKeyRing(io.bitsquare.common.crypto.PubKeyRing) MarketPrice(io.bitsquare.btc.pricefeed.MarketPrice) ErrorMessageHandler(io.bitsquare.common.handlers.ErrorMessageHandler) Coin(org.bitcoinj.core.Coin) Date(java.util.Date) Restrictions(io.bitsquare.btc.Restrictions) LoggerFactory(org.slf4j.LoggerFactory) ArrayList(java.util.ArrayList) DevFlags(io.bitsquare.app.DevFlags) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) RequiresOwnerIsOnlinePayload(io.bitsquare.p2p.storage.payload.RequiresOwnerIsOnlinePayload) KeyRing(io.bitsquare.common.crypto.KeyRing) ResultHandler(io.bitsquare.common.handlers.ResultHandler) Nullable(javax.annotation.Nullable) javafx.beans.property(javafx.beans.property) Utilities(io.bitsquare.common.util.Utilities) Logger(org.slf4j.Logger) ExchangeRate(org.bitcoinj.utils.ExchangeRate) OfferAvailabilityProtocol(io.bitsquare.trade.protocol.availability.OfferAvailabilityProtocol) DecimalFormat(java.text.DecimalFormat) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) JsonExclude(io.bitsquare.common.util.JsonExclude) NodeAddress(io.bitsquare.p2p.NodeAddress) Fiat(org.bitcoinj.utils.Fiat) IOException(java.io.IOException) PublicKey(java.security.PublicKey) StoragePayload(io.bitsquare.p2p.storage.payload.StoragePayload) TimeUnit(java.util.concurrent.TimeUnit) MarketPriceNotAvailableException(io.bitsquare.trade.exceptions.MarketPriceNotAvailableException) List(java.util.List) TradePriceOutOfToleranceException(io.bitsquare.trade.exceptions.TradePriceOutOfToleranceException) OfferAvailabilityModel(io.bitsquare.trade.protocol.availability.OfferAvailabilityModel) CurrencyUtil(io.bitsquare.locale.CurrencyUtil) OfferAvailabilityProtocol(io.bitsquare.trade.protocol.availability.OfferAvailabilityProtocol)

Aggregations

Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)1 DevFlags (io.bitsquare.app.DevFlags)1 Version (io.bitsquare.app.Version)1 Restrictions (io.bitsquare.btc.Restrictions)1 MarketPrice (io.bitsquare.btc.pricefeed.MarketPrice)1 PriceFeedService (io.bitsquare.btc.pricefeed.PriceFeedService)1 KeyRing (io.bitsquare.common.crypto.KeyRing)1 PubKeyRing (io.bitsquare.common.crypto.PubKeyRing)1 ErrorMessageHandler (io.bitsquare.common.handlers.ErrorMessageHandler)1 ResultHandler (io.bitsquare.common.handlers.ResultHandler)1 JsonExclude (io.bitsquare.common.util.JsonExclude)1 MathUtils (io.bitsquare.common.util.MathUtils)1 Utilities (io.bitsquare.common.util.Utilities)1 CurrencyUtil (io.bitsquare.locale.CurrencyUtil)1 NodeAddress (io.bitsquare.p2p.NodeAddress)1 RequiresOwnerIsOnlinePayload (io.bitsquare.p2p.storage.payload.RequiresOwnerIsOnlinePayload)1 StoragePayload (io.bitsquare.p2p.storage.payload.StoragePayload)1 PaymentMethod (io.bitsquare.payment.PaymentMethod)1 MarketPriceNotAvailableException (io.bitsquare.trade.exceptions.MarketPriceNotAvailableException)1