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

com.launchdarkly.sdk.server.BigSegmentStoreStatusProviderImpl Maven / Gradle / Ivy

There is a newer version: 7.5.0
Show newest version
package com.launchdarkly.sdk.server;

import com.launchdarkly.sdk.server.interfaces.BigSegmentStoreStatusProvider;

final class BigSegmentStoreStatusProviderImpl implements BigSegmentStoreStatusProvider {
  private final EventBroadcasterImpl statusNotifier;
  private final BigSegmentStoreWrapper storeWrapper;

  BigSegmentStoreStatusProviderImpl(
      EventBroadcasterImpl bigSegmentStatusNotifier,
      BigSegmentStoreWrapper storeWrapper) {
    this.storeWrapper = storeWrapper;
    this.statusNotifier = bigSegmentStatusNotifier;
  }

  @Override
  public Status getStatus() {
    return storeWrapper == null ? new Status(false, false) : storeWrapper.getStatus();
  }

  @Override
  public void addStatusListener(StatusListener listener) {
    statusNotifier.register(listener);
  }

  @Override
  public void removeStatusListener(StatusListener listener) {
    statusNotifier.unregister(listener);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy