com.launchdarkly.sdk.server.BigSegmentStoreStatusProviderImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of launchdarkly-java-server-sdk Show documentation
Show all versions of launchdarkly-java-server-sdk Show documentation
Official LaunchDarkly SDK for Java
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);
}
}