package org.knowm.xchange.coinbene;

import java.io.IOException;
import org.knowm.xchange.BaseExchange;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.coinbene.service.CoinbeneAccountService;
import org.knowm.xchange.coinbene.service.CoinbeneMarketDataService;
import org.knowm.xchange.coinbene.service.CoinbeneTradeService;
import org.knowm.xchange.utils.nonce.CurrentTimeNonceFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import si.mazi.rescu.SynchronizedValueFactory;

public class CoinbeneExchange extends BaseExchange implements Exchange {

  private static final Logger LOG = LoggerFactory.getLogger(CoinbeneExchange.class);

  private SynchronizedValueFactory<Long> nonceFactory = new CurrentTimeNonceFactory();

  @Override
  protected void initServices() {

    this.marketDataService = new CoinbeneMarketDataService(this);
    this.accountService = new CoinbeneAccountService(this);
    this.tradeService = new CoinbeneTradeService(this);
  }

  @Override
  public ExchangeSpecification getDefaultExchangeSpecification() {

    ExchangeSpecification exchangeSpecification =
        new ExchangeSpecification(this.getClass().getCanonicalName());
    exchangeSpecification.setSslUri("https://api.coinbene.com/");
    exchangeSpecification.setHost("coinbene.com");
    exchangeSpecification.setPort(80);
    exchangeSpecification.setExchangeName("Coinbene");
    exchangeSpecification.setExchangeDescription("Coinbene is a bitcoin and altcoin exchange.");

    return exchangeSpecification;
  }

  @Override
  public SynchronizedValueFactory<Long> getNonceFactory() {
    return nonceFactory;
  }

  @Override
  public void remoteInit() {

    try {
      exchangeMetaData = ((CoinbeneMarketDataService) marketDataService).getMetadata();
    } catch (IOException e) {
      LOG.error("Retrieving MetaData for Coinbene failed", e);
    }
  }
}

package org.knowm.xchange.coinbene;

import java.io.IOException;
import org.knowm.xchange.BaseExchange;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.coinbene.service.CoinbeneAccountService;
import org.knowm.xchange.coinbene.service.CoinbeneMarketDataService;
import org.knowm.xchange.coinbene.service.CoinbeneTradeService;
import org.knowm.xchange.exceptions.ExchangeException;
import org.knowm.xchange.utils.nonce.CurrentTimeNonceFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import si.mazi.rescu.SynchronizedValueFactory;

public class CoinbeneExchange extends BaseExchange implements Exchange {

  private static final Logger LOG = LoggerFactory.getLogger(CoinbeneExchange.class);

  private SynchronizedValueFactory<Long> nonceFactory = new CurrentTimeNonceFactory();

  @Override
  protected void initServices() {

    this.marketDataService = new CoinbeneMarketDataService(this);
    this.accountService = new CoinbeneAccountService(this);
    this.tradeService = new CoinbeneTradeService(this);
  }

  @Override
  public ExchangeSpecification getDefaultExchangeSpecification() {

    ExchangeSpecification exchangeSpecification = new ExchangeSpecification(this.getClass().getCanonicalName());
    exchangeSpecification.setSslUri("https://api.coinbene.com/");
    exchangeSpecification.setHost("coinbene.com");
    exchangeSpecification.setPort(80);
    exchangeSpecification.setExchangeName("Coinbene");
    exchangeSpecification.setExchangeDescription("Coinbene is a bitcoin and altcoin exchange.");

    return exchangeSpecification;
  }

  @Override
  public SynchronizedValueFactory<Long> getNonceFactory() {
    return nonceFactory;
  }

  @Override
  public void remoteInit() throws IOException, ExchangeException {

    try {
      exchangeMetaData = ((CoinbeneMarketDataService) marketDataService).getMetadata();
    } catch (IOException e) {
      throw new IOException("Retrieving MetaData for Coinbene failed", e);
    }
  }
}

add symbols to market data throw new IOException in remoteInit