mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Resolve javadoc warnings not seen on 1.8.0_181 (#10244)
This commit is contained in:
parent
76a1d0a664
commit
2a45a8fd9d
16 changed files with 130 additions and 50 deletions
|
@ -41,7 +41,7 @@ public final class PluginHelper {
|
|||
|
||||
|
||||
/**
|
||||
* Returns a list of the options that are common to all input plugins.
|
||||
* @return Options that are common to all input plugins.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Collection<PluginConfigSpec<?>> commonInputOptions() {
|
||||
|
@ -52,6 +52,8 @@ public final class PluginHelper {
|
|||
* Combines the provided list of options with the options that are common to all input plugins
|
||||
* ignoring any that are already present in the provided list. This allows plugins to override
|
||||
* defaults and other values on the common config options.
|
||||
* @param options provided list of options.
|
||||
* @return combined list of options.
|
||||
*/
|
||||
public static Collection<PluginConfigSpec<?>> commonInputOptions(Collection<PluginConfigSpec<?>> options) {
|
||||
return combineOptions(options, Arrays.asList(ADD_FIELD_CONFIG, ENABLE_METRIC_CONFIG,
|
||||
|
@ -59,7 +61,7 @@ public final class PluginHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a list of the options that are common to all output plugins.
|
||||
* @return Options that are common to all output plugins.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Collection<PluginConfigSpec<?>> commonOutputOptions() {
|
||||
|
@ -70,13 +72,15 @@ public final class PluginHelper {
|
|||
* Combines the provided list of options with the options that are common to all output plugins
|
||||
* ignoring any that are already present in the provided list. This allows plugins to override
|
||||
* defaults and other values on the common config options.
|
||||
* @param options provided list of options.
|
||||
* @return combined list of options.
|
||||
*/
|
||||
public static Collection<PluginConfigSpec<?>> commonOutputOptions(Collection<PluginConfigSpec<?>> options) {
|
||||
return combineOptions(options, Arrays.asList(ENABLE_METRIC_CONFIG, CODEC_CONFIG, ID_CONFIG));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of the options that are common to all filter plugins.
|
||||
* @return Options that are common to all filter plugins.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Collection<PluginConfigSpec<?>> commonFilterOptions() {
|
||||
|
@ -87,6 +91,8 @@ public final class PluginHelper {
|
|||
* Combines the provided list of options with the options that are common to all filter plugins
|
||||
* ignoring any that are already present in the provided list. This allows plugins to override
|
||||
* defaults and other values on the common config options.
|
||||
* @param options provided list of options.
|
||||
* @return combined list of options.
|
||||
*/
|
||||
public static Collection<PluginConfigSpec<?>> commonFilterOptions(Collection<PluginConfigSpec<?>> options) {
|
||||
return combineOptions(options, Arrays.asList(ADD_FIELD_CONFIG, /*ADD_TAG_CONFIG,*/
|
||||
|
|
|
@ -65,6 +65,7 @@ public final class RubyJavaIntegration {
|
|||
* Enable class equivalence between Array and ArrayList so that ArrayList will work with
|
||||
* case o when Array.
|
||||
* @param context Ruby Context
|
||||
* @param rcvd Ruby class to compare against if not a Java ArrayList
|
||||
* @param obj Object to Compare Types with
|
||||
* @return True iff Ruby's `===` is fulfilled between {@code this} and {@code obj}
|
||||
*/
|
||||
|
@ -89,6 +90,8 @@ public final class RubyJavaIntegration {
|
|||
|
||||
/**
|
||||
* Enable class equivalence between Ruby's Hash and Java's Map.
|
||||
* @param context Ruby Context
|
||||
* @param rcvd Ruby class to compare against if not a Java Map
|
||||
* @param obj Object to Compare Types with
|
||||
* @return True iff Ruby's `===` is fulfilled between {@code this} and {@code obj}
|
||||
*/
|
||||
|
@ -157,6 +160,10 @@ public final class RubyJavaIntegration {
|
|||
|
||||
/**
|
||||
* Support the Ruby intersection method on Java Collection.
|
||||
* @param context Thread context
|
||||
* @param self First Ruby collection object
|
||||
* @param other Second Ruby collection object
|
||||
* @return Ruby collection containing intersection of self and other
|
||||
*/
|
||||
@JRubyMethod(name = "&")
|
||||
public static IRubyObject and(final ThreadContext context, final IRubyObject self,
|
||||
|
@ -168,6 +175,10 @@ public final class RubyJavaIntegration {
|
|||
|
||||
/**
|
||||
* Support the Ruby union method on Java Collection.
|
||||
* @param context Thread context
|
||||
* @param self First Ruby collection object
|
||||
* @param other Second Ruby collection object
|
||||
* @return Ruby collection containing union of self and other
|
||||
*/
|
||||
@JRubyMethod(name = "|")
|
||||
public static IRubyObject or(final ThreadContext context, final IRubyObject self,
|
||||
|
@ -226,6 +237,11 @@ public final class RubyJavaIntegration {
|
|||
* relevant JRuby files:
|
||||
* https://github.com/jruby/jruby/blob/master/core/src/main/ruby/jruby/java/java_ext/java.util.rb
|
||||
* https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java
|
||||
*
|
||||
* @param context Thread context
|
||||
* @param self Ruby map object
|
||||
* @param key Key to find
|
||||
* @return RubyBoolean of true if the map contains the key
|
||||
*/
|
||||
@JRubyMethod(name = {"has_key?", "include?", "member?", "key?"})
|
||||
public static IRubyObject containsKey(final ThreadContext context, final IRubyObject self,
|
||||
|
|
|
@ -45,7 +45,7 @@ public final class Page implements Closeable {
|
|||
/**
|
||||
* @param limit the maximum number of elements to read, actual number readcan be smaller
|
||||
* @return {@link SequencedList} collection of serialized elements read
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public SequencedList<byte[]> read(int limit) throws IOException {
|
||||
// first make sure this page is activated, activating previously activated is harmless
|
||||
|
@ -118,7 +118,7 @@ public final class Page implements Closeable {
|
|||
* @param count Number of elements to ack
|
||||
* @param checkpointMaxAcks number of acks before forcing a checkpoint
|
||||
* @return true if Page and its checkpoint were purged as a result of being fully acked
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public boolean ack(long firstSeqNum, int count, int checkpointMaxAcks) throws IOException {
|
||||
assert firstSeqNum >= this.minSeqNum :
|
||||
|
@ -221,7 +221,7 @@ public final class Page implements Closeable {
|
|||
|
||||
/**
|
||||
* signal that this page is not active and resources can be released
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public void deactivate() throws IOException {
|
||||
this.getPageIO().deactivate();
|
||||
|
|
|
@ -135,7 +135,7 @@ public final class Queue implements Closeable {
|
|||
|
||||
/**
|
||||
* Open an existing {@link Queue} or create a new one in the configured path.
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public void open() throws IOException {
|
||||
final int headPageNum;
|
||||
|
@ -323,7 +323,7 @@ public final class Queue implements Closeable {
|
|||
*
|
||||
* @param element the {@link Queueable} element to write
|
||||
* @return the written sequence number
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public long write(Queueable element) throws IOException {
|
||||
byte[] data = element.serialize();
|
||||
|
@ -398,7 +398,7 @@ public final class Queue implements Closeable {
|
|||
* mark head page as read-only (behead) and add it to the tailPages and unreadTailPages collections accordingly
|
||||
* also deactivate it if it's not next-in-line for reading
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
private void behead() throws IOException {
|
||||
// beheading includes checkpoint+fsync if required
|
||||
|
@ -485,7 +485,7 @@ public final class Queue implements Closeable {
|
|||
* guarantee persistence up to a given sequence number.
|
||||
*
|
||||
* @param seqNum the element sequence number upper bound for which persistence should be guaranteed (by fsync'ing)
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public void ensurePersistedUpto(long seqNum) throws IOException{
|
||||
lock.lock();
|
||||
|
@ -501,7 +501,7 @@ public final class Queue implements Closeable {
|
|||
*
|
||||
* @param limit read the next batch of size up to this limit. the returned batch size can be smaller than the requested limit if fewer elements are available
|
||||
* @return {@link Batch} the batch containing 1 or more element up to the required limit or null of no elements were available
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public synchronized Batch nonBlockReadBatch(int limit) throws IOException {
|
||||
lock.lock();
|
||||
|
@ -518,7 +518,7 @@ public final class Queue implements Closeable {
|
|||
* @param limit size limit of the batch to read. returned {@link Batch} can be smaller.
|
||||
* @param timeout the maximum time to wait in milliseconds on write operations
|
||||
* @return the read {@link Batch} or null if no element upon timeout
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public synchronized Batch readBatch(int limit, long timeout) throws IOException {
|
||||
lock.lock();
|
||||
|
@ -536,7 +536,7 @@ public final class Queue implements Closeable {
|
|||
* @param limit size limit of the batch to read.
|
||||
* @param timeout the maximum time to wait in milliseconds on write operations.
|
||||
* @return {@link Batch} with read elements or null if nothing was read
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
private Batch readPageBatch(Page p, int limit, long timeout) throws IOException {
|
||||
int left = limit;
|
||||
|
@ -626,7 +626,7 @@ public final class Queue implements Closeable {
|
|||
*
|
||||
* @param firstAckSeqNum First Sequence Number to Ack
|
||||
* @param ackCount Number of Elements to Ack
|
||||
* @throws IOException
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public void ack(final long firstAckSeqNum, final int ackCount) throws IOException {
|
||||
// as a first implementation we assume that all batches are created from the same page
|
||||
|
|
|
@ -122,6 +122,8 @@ public abstract class QueueReadClientBase extends RubyObject implements QueueRea
|
|||
/**
|
||||
* Closes the specified batch. This JRuby extension method is currently used only in the
|
||||
* original pipeline and rspec tests.
|
||||
* @param batch specified batch
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
@JRubyMethod(name = "close_batch")
|
||||
public void rubyCloseBatch(final IRubyObject batch) throws IOException {
|
||||
|
@ -131,6 +133,7 @@ public abstract class QueueReadClientBase extends RubyObject implements QueueRea
|
|||
/**
|
||||
* Initializes metric on the specified batch. This JRuby extension method is currently used
|
||||
* only in the original pipeline and rspec tests.
|
||||
* @param batch specified batch
|
||||
*/
|
||||
@JRubyMethod(name = "start_metrics")
|
||||
public void rubyStartMetrics(final IRubyObject batch) {
|
||||
|
@ -141,6 +144,8 @@ public abstract class QueueReadClientBase extends RubyObject implements QueueRea
|
|||
* Extracts QueueBatch from one of two possible IRubyObject classes. Only the Ruby pipeline
|
||||
* uses JavaProxy instances, so once that is fully deprecated, this method can be simplified
|
||||
* to eliminate the type check.
|
||||
* @param batch specified IRubyObject batch
|
||||
* @return Extracted queue batch
|
||||
*/
|
||||
private static QueueBatch extractQueueBatch(final IRubyObject batch) {
|
||||
if (batch instanceof JavaProxy) {
|
||||
|
@ -153,6 +158,7 @@ public abstract class QueueReadClientBase extends RubyObject implements QueueRea
|
|||
/**
|
||||
* Increments the filter metrics. This JRuby extension method is currently used
|
||||
* only in the original pipeline and rspec tests.
|
||||
* @param size numeric value by which to increment metric
|
||||
*/
|
||||
@JRubyMethod(name = "add_filtered_metrics")
|
||||
public void rubyAddFilteredMetrics(final IRubyObject size) {
|
||||
|
@ -162,6 +168,7 @@ public abstract class QueueReadClientBase extends RubyObject implements QueueRea
|
|||
/**
|
||||
* Increments the output metrics. This JRuby extension method is currently used
|
||||
* only in the original pipeline and rspec tests.
|
||||
* @param size numeric value by which to increment metric
|
||||
*/
|
||||
@JRubyMethod(name = "add_output_metrics")
|
||||
public void rubyAddOutputMetrics(final IRubyObject size) {
|
||||
|
|
|
@ -44,6 +44,7 @@ public abstract class ClasspathHelper {
|
|||
* <p>
|
||||
* If the input is null or empty, it defaults to both {@link #contextClassLoader()} and {@link #staticClassLoader()}
|
||||
*
|
||||
* @param classLoaders provided ClassLoaders
|
||||
* @return the array of class loaders, not null
|
||||
*/
|
||||
public static ClassLoader[] classLoaders(ClassLoader... classLoaders) {
|
||||
|
@ -76,6 +77,8 @@ public abstract class ClasspathHelper {
|
|||
* <p>
|
||||
* The returned URLs retains the order of the given {@code classLoaders}.
|
||||
*
|
||||
* @param resourceName resource name on which to search
|
||||
* @param classLoaders optional ClassLoaders to search
|
||||
* @return the collection of URLs, not null
|
||||
*/
|
||||
public static Collection<URL> forResource(String resourceName, ClassLoader... classLoaders) {
|
||||
|
@ -108,6 +111,8 @@ public abstract class ClasspathHelper {
|
|||
* If the optional {@link ClassLoader}s are not specified, then both {@link #contextClassLoader()}
|
||||
* and {@link #staticClassLoader()} are used for {@link ClassLoader#getResources(String)}.
|
||||
*
|
||||
* @param aClass class for which to search
|
||||
* @param classLoaders optional ClassLoaders to search
|
||||
* @return the URL containing the class, null if not found
|
||||
*/
|
||||
public static URL forClass(Class<?> aClass, ClassLoader... classLoaders) {
|
||||
|
@ -151,6 +156,7 @@ public abstract class ClasspathHelper {
|
|||
* <p>
|
||||
* The returned URLs retains the order of the given {@code classLoaders}.
|
||||
*
|
||||
* @param classLoaders optional ClassLoaders to search
|
||||
* @return the collection of URLs, not null
|
||||
*/
|
||||
public static Collection<URL> forClassLoader(ClassLoader... classLoaders) {
|
||||
|
|
|
@ -7,33 +7,33 @@ import java.util.concurrent.ExecutorService;
|
|||
|
||||
public interface Configuration {
|
||||
/**
|
||||
* the scanner instances used for scanning different metadata
|
||||
* @return the scanner instances used for scanning different metadata
|
||||
*/
|
||||
Set<Scanner> getScanners();
|
||||
|
||||
/**
|
||||
* the urls to be scanned
|
||||
* @return the urls to be scanned
|
||||
*/
|
||||
Set<URL> getUrls();
|
||||
|
||||
/**
|
||||
* the metadata adapter used to fetch metadata from classes
|
||||
* @return the metadata adapter used to fetch metadata from classes
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
MetadataAdapter getMetadataAdapter();
|
||||
|
||||
/**
|
||||
* get the fully qualified name filter used to filter types to be scanned
|
||||
* @return the fully qualified name filter used to filter types to be scanned
|
||||
*/
|
||||
Predicate<String> getInputsFilter();
|
||||
|
||||
/**
|
||||
* executor service used to scan files. if null, scanning is done in a simple for loop
|
||||
* @return executor service used to scan files. if null, scanning is done in a simple for loop
|
||||
*/
|
||||
ExecutorService getExecutorService();
|
||||
|
||||
/**
|
||||
* get class loaders, might be used for resolving methods/fields
|
||||
* @return class loaders, might be used for resolving methods/fields
|
||||
*/
|
||||
ClassLoader[] getClassLoaders();
|
||||
|
||||
|
|
|
@ -115,6 +115,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
|
||||
/**
|
||||
* set the scanners instances for scanning different metadata
|
||||
* @param scanners provided scanners
|
||||
* @return updated {@link ConfigurationBuilder} instance
|
||||
*/
|
||||
public ConfigurationBuilder setScanners(final Scanner... scanners) {
|
||||
this.scanners.clear();
|
||||
|
@ -123,6 +125,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
|
||||
/**
|
||||
* set the scanners instances for scanning different metadata
|
||||
* @param scanners provided scanners
|
||||
* @return updated {@link ConfigurationBuilder} instance
|
||||
*/
|
||||
public ConfigurationBuilder addScanners(final Scanner... scanners) {
|
||||
this.scanners.addAll(Sets.newHashSet(scanners));
|
||||
|
@ -138,6 +142,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
/**
|
||||
* add urls to be scanned
|
||||
* <p>use {@link ClasspathHelper} convenient methods to get the relevant urls
|
||||
* @param urls provided URLs
|
||||
* @return updated {@link ConfigurationBuilder} instance
|
||||
*/
|
||||
public ConfigurationBuilder addUrls(final Collection<URL> urls) {
|
||||
this.urls.addAll(urls);
|
||||
|
@ -147,6 +153,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
/**
|
||||
* add urls to be scanned
|
||||
* <p>use {@link ClasspathHelper} convenient methods to get the relevant urls
|
||||
* @param urls provided URLs
|
||||
* @return updated {@link ConfigurationBuilder} instance
|
||||
*/
|
||||
public ConfigurationBuilder addUrls(final URL... urls) {
|
||||
this.urls.addAll(Sets.newHashSet(urls));
|
||||
|
@ -154,7 +162,7 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
}
|
||||
|
||||
/**
|
||||
* returns the metadata adapter.
|
||||
* @return the metadata adapter.
|
||||
* if javassist library exists in the classpath, this method returns {@link JavassistAdapter} otherwise defaults to {@link JavaReflectionAdapter}.
|
||||
* <p>the {@link JavassistAdapter} is preferred in terms of performance and class loading.
|
||||
*/
|
||||
|
@ -180,6 +188,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
/**
|
||||
* sets the input filter for all resources to be scanned.
|
||||
* <p> supply a {@link Predicate} or use the {@link FilterBuilder}
|
||||
* @param inputsFilter provided inputs filter
|
||||
* @return updated {@link ConfigurationBuilder} instance
|
||||
*/
|
||||
public ConfigurationBuilder filterInputsBy(Predicate<String> inputsFilter) {
|
||||
this.inputsFilter = inputsFilter;
|
||||
|
@ -193,6 +203,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
|
||||
/**
|
||||
* sets the executor service used for scanning.
|
||||
* @param executorService provided executor service
|
||||
* @return updated {@link ConfigurationBuilder} instance
|
||||
*/
|
||||
public ConfigurationBuilder setExecutorService(ExecutorService executorService) {
|
||||
this.executorService = executorService;
|
||||
|
@ -200,9 +212,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
}
|
||||
|
||||
/**
|
||||
* get class loader, might be used for scanning or resolving methods/fields
|
||||
* @return class loader, might be used for scanning or resolving methods/fields
|
||||
*/
|
||||
|
||||
@Override
|
||||
public ClassLoader[] getClassLoaders() {
|
||||
return classLoaders;
|
||||
|
@ -215,6 +226,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
|
||||
/**
|
||||
* add class loader, might be used for resolving methods/fields
|
||||
* @param classLoaders provided class loaders
|
||||
* @return updated {@link ConfigurationBuilder} instance
|
||||
*/
|
||||
public ConfigurationBuilder addClassLoaders(ClassLoader... classLoaders) {
|
||||
this.classLoaders = this.classLoaders == null ? classLoaders : ObjectArrays.concat(this.classLoaders, classLoaders, ClassLoader.class);
|
||||
|
@ -223,6 +236,8 @@ public final class ConfigurationBuilder implements Configuration {
|
|||
|
||||
/**
|
||||
* add class loader, might be used for resolving methods/fields
|
||||
* @param classLoaders provided class loaders
|
||||
* @return updated {@link ConfigurationBuilder} instance
|
||||
*/
|
||||
public ConfigurationBuilder addClassLoaders(Collection<ClassLoader> classLoaders) {
|
||||
return addClassLoaders(classLoaders.toArray(new ClassLoader[classLoaders.size()]));
|
||||
|
|
|
@ -15,6 +15,8 @@ public class FilterBuilder implements Predicate<String> {
|
|||
|
||||
/**
|
||||
* exclude a regular expression
|
||||
* @param regex regex to exclude
|
||||
* @return updated {@link FilterBuilder} instance
|
||||
*/
|
||||
public FilterBuilder exclude(final String regex) {
|
||||
add(new FilterBuilder.Exclude(regex));
|
||||
|
@ -23,6 +25,8 @@ public class FilterBuilder implements Predicate<String> {
|
|||
|
||||
/**
|
||||
* add a Predicate to the chain of predicates
|
||||
* @param filter predicate to add
|
||||
* @return updated {@link FilterBuilder} instance
|
||||
*/
|
||||
public FilterBuilder add(Predicate<String> filter) {
|
||||
chain.add(filter);
|
||||
|
@ -31,6 +35,8 @@ public class FilterBuilder implements Predicate<String> {
|
|||
|
||||
/**
|
||||
* include a package of a given class
|
||||
* @param aClass provided class
|
||||
* @return updated {@link FilterBuilder} instance
|
||||
*/
|
||||
public FilterBuilder includePackage(final Class<?> aClass) {
|
||||
return add(new FilterBuilder.Include(packageNameRegex(aClass)));
|
||||
|
@ -38,6 +44,8 @@ public class FilterBuilder implements Predicate<String> {
|
|||
|
||||
/**
|
||||
* include packages of given prefixes
|
||||
* @param prefixes package prefixes
|
||||
* @return updated {@link FilterBuilder} instance
|
||||
*/
|
||||
public FilterBuilder includePackage(final String... prefixes) {
|
||||
for (String prefix : prefixes) {
|
||||
|
|
|
@ -14,7 +14,8 @@ public abstract class ReflectionUtils {
|
|||
public static boolean includeObject;
|
||||
|
||||
/**
|
||||
* get the immediate supertype and interfaces of the given {@code type}
|
||||
* @param type type to query
|
||||
* @return immediate supertype and interfaces of the given {@code type}
|
||||
*/
|
||||
public static Set<Class<?>> getSuperTypes(Class<?> type) {
|
||||
Set<Class<?>> result = new LinkedHashSet<>();
|
||||
|
@ -72,7 +73,10 @@ public abstract class ReflectionUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* try to resolve all given string representation of types to a list of java types
|
||||
* @param <T> Search will include subclasses of this type
|
||||
* @param classes list of names of Java types
|
||||
* @param classLoaders class loaders to search
|
||||
* @return list of Java types given string representations of their names
|
||||
*/
|
||||
public static <T> List<Class<? extends T>> forNames(final Iterable<String> classes, ClassLoader... classLoaders) {
|
||||
List<Class<? extends T>> result = new ArrayList<>();
|
||||
|
|
|
@ -33,14 +33,15 @@ public final class Store {
|
|||
}
|
||||
|
||||
/**
|
||||
* return all indices
|
||||
* @return all indices
|
||||
*/
|
||||
public Set<String> keySet() {
|
||||
return storeMap.keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* get or create the multimap object for the given {@code index}
|
||||
* @param index specified index
|
||||
* @return existing or newly-created multimap object for the given {@code index}
|
||||
*/
|
||||
public Multimap<String, String> getOrCreate(String index) {
|
||||
Multimap<String, String> mmap = storeMap.get(index);
|
||||
|
@ -63,14 +64,18 @@ public final class Store {
|
|||
}
|
||||
|
||||
/**
|
||||
* get the values stored for the given {@code index} and {@code keys}
|
||||
* @param index specified index
|
||||
* @param keys specified keys
|
||||
* @return values stored for the given {@code index} and {@code keys}
|
||||
*/
|
||||
public Iterable<String> get(String index, String... keys) {
|
||||
return get(index, Arrays.asList(keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* get the values stored for the given {@code index} and {@code keys}
|
||||
* @param index specified index
|
||||
* @param keys specified keys
|
||||
* @return values stored for the given {@code index} and {@code keys}
|
||||
*/
|
||||
public Iterable<String> get(String index, Iterable<String> keys) {
|
||||
Multimap<String, String> mmap = get(index);
|
||||
|
@ -82,7 +87,10 @@ public final class Store {
|
|||
}
|
||||
|
||||
/**
|
||||
* recursively get the values stored for the given {@code index} and {@code keys}, including keys
|
||||
* @param index specified index
|
||||
* @param keys specified keys
|
||||
* @param result accumulates intermediate results
|
||||
* @return values stored for the given {@code index} and {@code keys}, including keys
|
||||
*/
|
||||
private Iterable<String> getAllIncluding(String index, Iterable<String> keys, IterableChain<String> result) {
|
||||
result.addAll(keys);
|
||||
|
@ -96,7 +104,9 @@ public final class Store {
|
|||
}
|
||||
|
||||
/**
|
||||
* recursively get the values stored for the given {@code index} and {@code keys}, not including keys
|
||||
* @param index specified index
|
||||
* @param keys specified keys
|
||||
* @return values stored for the given {@code index} and {@code keys}, not including keys
|
||||
*/
|
||||
public Iterable<String> getAll(String index, Iterable<String> keys) {
|
||||
return getAllIncluding(index, get(index, keys), new IterableChain<>());
|
||||
|
|
|
@ -26,7 +26,8 @@ public abstract class Utils {
|
|||
}
|
||||
|
||||
/**
|
||||
* isEmpty compatible with Java 5
|
||||
* @param s string to test
|
||||
* @return Java5-compatible isEmpty result
|
||||
*/
|
||||
public static boolean isEmpty(String s) {
|
||||
return s == null || s.length() == 0;
|
||||
|
|
|
@ -59,14 +59,17 @@ public abstract class Vfs {
|
|||
}
|
||||
|
||||
/**
|
||||
* tries to create a Dir from the given url, using the defaultUrlTypes
|
||||
* @param url URL from which to create a Dir
|
||||
* @return Dir created from the given url, using the defaultUrlTypes
|
||||
*/
|
||||
public static Vfs.Dir fromURL(final URL url) {
|
||||
return fromURL(url, defaultUrlTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* tries to create a Dir from the given url, using the given urlTypes
|
||||
* @param url URL from which to create a Dir
|
||||
* @param urlTypes given URL types
|
||||
* @return Dir created from the given url, using the given urlTypes
|
||||
*/
|
||||
public static Vfs.Dir fromURL(final URL url, final List<Vfs.UrlType> urlTypes) {
|
||||
for (final Vfs.UrlType type : urlTypes) {
|
||||
|
@ -88,7 +91,8 @@ public abstract class Vfs {
|
|||
}
|
||||
|
||||
/**
|
||||
* try to get {@link Vfs.File} from url
|
||||
* @param url provided URL
|
||||
* @return {@link Vfs.File} from provided URL
|
||||
*/
|
||||
public static java.io.File getFile(final URL url) {
|
||||
java.io.File file;
|
||||
|
|
|
@ -17,7 +17,7 @@ public class AddressState {
|
|||
|
||||
/**
|
||||
* Add the given output and ensure associated input's receivers are updated
|
||||
* @param output
|
||||
* @param output output to be added
|
||||
* @return true if the output was not already added
|
||||
*/
|
||||
public boolean addOutput(PipelineOutput output) {
|
||||
|
@ -34,7 +34,7 @@ public class AddressState {
|
|||
|
||||
/**
|
||||
* Assigns an input to listen on this address. Will return false if another input is already listening.
|
||||
* @param newInput
|
||||
* @param newInput input to assign as listener
|
||||
* @return true if successful, false if another input is listening
|
||||
*/
|
||||
public synchronized boolean assignInputIfMissing(PipelineInput newInput) {
|
||||
|
@ -50,7 +50,7 @@ public class AddressState {
|
|||
|
||||
/**
|
||||
* Unsubscribes the given input from this address
|
||||
* @param unsubscribingInput
|
||||
* @param unsubscribingInput input to unsubscribe from this address
|
||||
* @return true if this input was listening, false otherwise
|
||||
*/
|
||||
public synchronized boolean unassignInput(PipelineInput unsubscribingInput) {
|
||||
|
|
|
@ -61,8 +61,8 @@ public class PipelineBus {
|
|||
|
||||
/**
|
||||
* Should be called by an output on register
|
||||
* @param output
|
||||
* @param addresses
|
||||
* @param output output to be registered
|
||||
* @param addresses collection of addresses on which to register this sender
|
||||
*/
|
||||
public void registerSender(final PipelineOutput output, final Iterable<String> addresses) {
|
||||
addresses.forEach((String address) -> {
|
||||
|
@ -99,7 +99,7 @@ public class PipelineBus {
|
|||
/**
|
||||
* Updates the internal state for this output to reflect the fact that there may be a change
|
||||
* in the inputs receiving events from it.
|
||||
* @param output
|
||||
* @param output output to update
|
||||
*/
|
||||
private void updateOutputReceivers(final PipelineOutput output) {
|
||||
outputsToAddressStates.compute(output, (k, value) -> {
|
||||
|
@ -116,8 +116,8 @@ public class PipelineBus {
|
|||
/**
|
||||
* Listens to a given address with the provided listener
|
||||
* Only one listener can listen on an address at a time
|
||||
* @param address
|
||||
* @param input
|
||||
* @param input Input to register as listener
|
||||
* @param address Address on which to listen
|
||||
* @return true if the listener successfully subscribed
|
||||
*/
|
||||
public boolean listen(final PipelineInput input, final String address) {
|
||||
|
@ -143,8 +143,9 @@ public class PipelineBus {
|
|||
* Stop listening on the given address with the given listener
|
||||
* Will change behavior depending on whether {@link #isBlockOnUnlisten()} is true or not.
|
||||
* Will call a blocking method if it is, a non-blocking one if it isn't
|
||||
* @param input
|
||||
* @param address
|
||||
* @param input Input that should stop listening
|
||||
* @param address Address on which the input should stop listening
|
||||
* @throws InterruptedException if interrupted while attempting to stop listening
|
||||
*/
|
||||
public void unlisten(final PipelineInput input, final String address) throws InterruptedException {
|
||||
if (isBlockOnUnlisten()) {
|
||||
|
@ -155,9 +156,10 @@ public class PipelineBus {
|
|||
}
|
||||
|
||||
/**
|
||||
* Stop listing on the given address with the given listener
|
||||
* @param address
|
||||
* @param input
|
||||
* Stop listening on the given address with the given listener
|
||||
* @param input Input that should stop listening
|
||||
* @param address Address on which to stop listening
|
||||
* @throws InterruptedException if interrupted while attempting to stop listening
|
||||
*/
|
||||
public void unlistenBlock(final PipelineInput input, final String address) throws InterruptedException {
|
||||
final boolean[] waiting = {true};
|
||||
|
@ -193,8 +195,8 @@ public class PipelineBus {
|
|||
|
||||
/**
|
||||
* Unlisten to use during reloads. This lets upstream outputs block while this input is missing
|
||||
* @param input
|
||||
* @param address
|
||||
* @param input Input that should stop listening
|
||||
* @param address Address on which to stop listening
|
||||
*/
|
||||
public void unlistenNonblock(final PipelineInput input, final String address) {
|
||||
addressStates.computeIfPresent(address, (k, state) -> {
|
||||
|
|
|
@ -57,6 +57,7 @@ public class SecretStoreFactory {
|
|||
|
||||
/**
|
||||
* Determine if this secret store currently exists
|
||||
* @param secureConfig The configuration to pass to the implementation
|
||||
* @return true if the secret store exists, false otherwise
|
||||
*/
|
||||
public boolean exists(SecureConfig secureConfig) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue