![JAR search and dependency download from the Maven repository](/logo.png)
com.kolibrifx.plovercrest.server.streams.SingleNameStreamProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plovercrest-server Show documentation
Show all versions of plovercrest-server Show documentation
Plovercrest server library.
The newest version!
/*
* Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
*/
package com.kolibrifx.plovercrest.server.streams;
import java.util.Collection;
import java.util.Collections;
import com.kolibrifx.common.Disposable;
import com.kolibrifx.common.NullDisposable;
import com.kolibrifx.plovercrest.server.TableInfo;
/**
* Base class for a {@link StreamProvider} with a single name, which can be either a concrete name
* or a template.
*/
public abstract class SingleNameStreamProvider implements StreamProvider {
protected final String spec;
public SingleNameStreamProvider(final String spec) {
this.spec = spec;
}
@Override
public Collection list() {
return Collections.singleton(new StreamInfo(spec, false));
}
@Override
public boolean tryCreate(final TableInfo info) {
return false;
}
@Override
public Disposable addAvailableStreamsListener(final StreamNamesListener listener) {
listener.onInit(Collections.singleton(spec));
return new NullDisposable();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy