<commit_before>package info.bitrich.xchangestream.bitflyer;

import info.bitrich.xchangestream.core.ProductSubscription;
import info.bitrich.xchangestream.core.StreamingExchange;
import info.bitrich.xchangestream.core.StreamingMarketDataService;
import info.bitrich.xchangestream.service.pubnub.PubnubStreamingService;
import io.reactivex.Completable;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.bitflyer.BitflyerExchange;
import si.mazi.rescu.SynchronizedValueFactory;

/** Created by <NAME> on 14.11.17. */
public class BitflyerStreamingExchange extends BitflyerExchange implements StreamingExchange {
  private static final String API_KEY = "<KEY>";

  private final PubnubStreamingService streamingService;
  private BitflyerStreamingMarketDataService streamingMarketDataService;

  public BitflyerStreamingExchange() {
    this.streamingService = new PubnubStreamingService(API_KEY);
  }

  @Override
  protected void initServices() {
    streamingMarketDataService = new BitflyerStreamingMarketDataService(streamingService);
    super.initServices();
  }

  @Override
  public Completable connect(ProductSubscription... args) {
    return streamingService.connect();
  }

  @Override
  public Completable disconnect() {
    return streamingService.disconnect();
  }

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

  @Override
  public ExchangeSpecification getDefaultExchangeSpecification() {
    ExchangeSpecification spec = super.getDefaultExchangeSpecification();
    spec.setShouldLoadRemoteMetaData(false);
    return spec;
  }

  @Override
  public StreamingMarketDataService getStreamingMarketDataService() {
    return streamingMarketDataService;
  }

  @Override
  public boolean isAlive() {
    return streamingService.isAlive();
  }

  @Override
  public void useCompressedMessages(boolean compressedMessages) {
    streamingService.useCompressedMessages(compressedMessages);<commit_msg>Bitflyer: Implemented getNonceFactory on BitflyerStreamingExchange<commit_after>package info.bitrich.xchangestream.bitflyer;

import info.bitrich.xchangestream.core.ProductSubscription;
import info.bitrich.xchangestream.core.StreamingExchange;
import info.bitrich.xchangestream.core.StreamingMarketDataService;
import info.bitrich.xchangestream.service.pubnub.PubnubStreamingService;
import io.reactivex.Completable;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.bitflyer.BitflyerExchange;
import org.knowm.xchange.utils.nonce.AtomicLongIncrementalTime2014NonceFactory;
import si.mazi.rescu.SynchronizedValueFactory;

/** Created by <NAME> on 14.11.17. */
public class BitflyerStreamingExchange extends BitflyerExchange implements StreamingExchange {
  private static final String API_KEY = "<KEY>";

  private SynchronizedValueFactory<Long> nonceFactory = new AtomicLongIncrementalTime2014NonceFactory();
  private final PubnubStreamingService streamingService;
  private BitflyerStreamingMarketDataService streamingMarketDataService;

  public BitflyerStreamingExchange() {
    this.streamingService = new PubnubStreamingService(API_KEY);
  }

  @Override
  protected void initServices() {
    streamingMarketDataService = new BitflyerStreamingMarketDataService(streamingService);
    super.initServices();
  }

  @Override
  public Completable connect(ProductSubscription... args) {
    return streamingService.connect();
  }

  @Override
  public Completable disconnect() {
    return streamingService.disconnect();
  }

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

  @Override
  public ExchangeSpecification getDefaultExchangeSpecification() {
    ExchangeSpecification spec = super.getDefaultExchangeSpecification();
    spec.setShouldLoadRemoteMetaData(false);
    return spec;
  }

  @Override
  public StreamingMarketDataService getStreamingMarketDataService() {
    return streamingMarketDataService;
  }

  @Override
  public boolean isAlive() {
    return streamingService.isAlive();
  }

  @Override
  public void useCompressedMessages(boolean compressedMessages) {
    streamingService.useCompressedMessages(compressedMessages);
{'fraction_non_alphanumeric': 0.07536852116024727, 'fraction_numerical': 0.004755111745126011, 'mean_word_length': 6.011666666666667, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3115835', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1174, 'n_words': 216}