fixing typos

This commit is contained in:
Marian Novotny
2022-12-12 12:28:41 +00:00
parent 6371db0278
commit 1a69f6b532
31 changed files with 91 additions and 74 deletions

View File

@@ -6,7 +6,7 @@ import java.util.ArrayList;
/**
* An object for representing enrichment attributes
*
* <p>This class represents an enrichment attributes such as an enrichment evaluator and enrichment commands that
* <p>This class represents enrichment attributes such as an enrichment evaluator and enrichment commands that
* are used in the enrichment result.
*
* @author Marian Novotny

View File

@@ -10,7 +10,7 @@ import java.util.stream.Collectors;
/**
* An object that represents an enrichment command used after evaluating an enrichment rule
*
* <p>This class implements Serializable interface to be integrated in Storm.
* <p>This class implements Serializable interface in order to be integrated in Storm.
* It represents an enrichment command used after evaluating an enrichment rule.
* It is used for joining enrichment tables and computing enriching fields.
*

View File

@@ -15,9 +15,9 @@ public interface EnrichmentCompiler {
/**
* Compiles rules into an enrichment evaluator
*
* @param rules json string with alerting rules
* @param logger logger for debugging
* @return enrichment result with an enrichment evaluator
* @param rules a json string with enrichment rules
* @param logger a logger for debugging
* @return an enrichment result with an enrichment evaluator
* @see EnrichmentResult
*/
EnrichmentResult compile(String rules, TestingLogger logger);
@@ -25,8 +25,8 @@ public interface EnrichmentCompiler {
/**
* Compiles rules into an enrichment evaluator using an inactive logger
*
* @param rules json string with alerting rules
* @return enrichment result with an enrichment evaluator
* @param rules a json string with alerting rules
* @return an enrichment result with an enrichment evaluator
* @see EnrichmentResult
*/
default EnrichmentResult compile(String rules) {
@@ -36,7 +36,7 @@ public interface EnrichmentCompiler {
/**
* Provides json schema for enrichment rules
*
* @return enrichment result with json schema for enrichment rules
* @return an enrichment result with json schema for enrichment rules
* @see EnrichmentResult
*/
EnrichmentResult getSchema();
@@ -44,7 +44,7 @@ public interface EnrichmentCompiler {
/**
* Provides json schema for testing an enrichment rule
*
* @return enrichment result with json schema for testing an enrichment rule
* @return an enrichment result with json schema for testing an enrichment rule
* @see EnrichmentResult
*/
EnrichmentResult getTestSpecificationSchema();
@@ -52,18 +52,18 @@ public interface EnrichmentCompiler {
/**
* Validates an enrichment rule
*
* @param rule json string with an enrichment rule
* @return enrichment result with status OK if the rule is valid
* @param rule a json string with an enrichment rule
* @return an enrichment result with status OK if the rule is valid
* @see EnrichmentResult
*/
EnrichmentResult validateConfiguration(String rule);
/**
* Validates enrichment rules.
* Default implementation tries to compile the rules and returns the status.
* Default implementation tries to compile the rules and returns the compilation status.
*
* @param rules json string with enrichment rules
* @return enrichment result with status OK if the rules are valid
* @param rules a json string with enrichment rules
* @return an enrichment result with status OK if the rules are valid
* @see EnrichmentResult
*/
default EnrichmentResult validateConfigurations(String rules) {
@@ -77,7 +77,7 @@ public interface EnrichmentCompiler {
/**
* Test an enrichment rule on input from a test specification
*
* @param rule json string with an enrichment rule
* @param rule a json string with an enrichment rule
* @param testSpecification a test specification for testing the rule
* @return an enrichment result with the test result on success otherwise a result with an error status code
* @see EnrichmentResult
@@ -87,7 +87,7 @@ public interface EnrichmentCompiler {
/**
* Test an enrichment rule on input from a test specification
*
* @param rules json string with an enrichment rule
* @param rules a json string with an enrichment rule
* @param testSpecification a test specification for testing the rule
* @return an enrichment result with the test result on success otherwise a result with an error status code
* @see EnrichmentResult

View File

@@ -22,7 +22,8 @@ import java.util.stream.Collectors;
* An object that evaluates enrichment rules
*
* <p>This class implements EnrichmentEvaluator interface. It provides functionality for evaluating enrichment rules.
* It is using alerting engine with a custom implementation of enriching rule to implement evaluation.
* It is using thr alerting engine with a custom implementation of an enriching rule in order to
* implement the enrichment evaluation.
*
* @author Marian Novotny
* @see EnrichmentEvaluator
@@ -102,7 +103,7 @@ public class AlertingEnrichmentEvaluator implements EnrichmentEvaluator {
/**
* Sets enriching rules that should be prepared in advance
*
* @param rules list of pairs of source type and enriching rule
* @param rules a list of pairs of the source type and the enriching rule
* @return this builder
*/
public Builder rules(List<Pair<String, Rule>> rules) {
@@ -113,7 +114,7 @@ public class AlertingEnrichmentEvaluator implements EnrichmentEvaluator {
/**
* Builds the alerting enrichment evaluator
*
* @return alerting enrichment evaluator built from the builder state
* @return the alerting enrichment evaluator built from the builder state
* @throws IllegalArgumentException in case of wrong arguments
*/
public AlertingEnrichmentEvaluator build() {

View File

@@ -16,9 +16,9 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* An object for enriching rule
* An object for representing an enriching rule
*
* <p>This derived class of Rule is implementing an enriching rule.
* <p>This derived class of alerting abstract Rule class is implementing an enriching rule.
*
* @author Marian Novotny
* @see Rule
@@ -54,6 +54,9 @@ public class EnrichingRule extends Rule {
return Optional.of(ret);
}
/**
* {@inheritDoc}
*/
@Override
public AlertingResult match(Map<String, Object> log) {
AlertingResult result = super.match(log);
@@ -78,6 +81,9 @@ public class EnrichingRule extends Rule {
return result;
}
/**
* {@inheritDoc}
*/
@Override
public boolean canModifyEvent() {
return true;
@@ -102,7 +108,7 @@ public class EnrichingRule extends Rule {
/**
* Sets the key for joining the event with the table
*
* @param key string a key for joing the enrichment table. It may contain a variable e.g. ${host}.
* @param key a string for joining the enrichment table. It may contain a variable e.g. ${host}.
* @return this builder
*/
public Builder<T> key(String key) {
@@ -124,7 +130,7 @@ public class EnrichingRule extends Rule {
/**
* Sets the enriching tags added to the event after joining the table
*
* @param enrichingTags the list of enriching tags
* @param enrichingTags a list of enriching tags
* @return this builder
*/
public Builder<T> enrichmentTags(List<Pair<String, String>> enrichingTags) {
@@ -135,7 +141,7 @@ public class EnrichingRule extends Rule {
/**
* Sets the enriching fields (table columns) added to the event after joining the table
*
* @param enrichingFields the list of enriching fields
* @param enrichingFields a list of enriching fields
* @return this builder
*/
public Builder<T> enrichmentFields(List<Pair<String, String>> enrichingFields) {

View File

@@ -2,18 +2,17 @@ package uk.co.gresearch.siembol.enrichments.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.reinert.jjschema.Attributes;
import uk.co.gresearch.siembol.alerts.model.CorrelationAttributesDto;
/**
* A data transfer object for representing enriching field used in correlation attributes
* A data transfer object for representing enriching field used in a table mapping
*
* <p>This class is used for json (de)serialisation of a correlation alert and
* <p>This class is used for json (de)serialisation of an enriching field and
* for generating json schema from this class using annotations.
*
* @author Marian Novotny
* @see com.github.reinert.jjschema.Attributes
* @see com.fasterxml.jackson.annotation.JsonProperty
* @see CorrelationAttributesDto
*
*/
@Attributes(title = "enriching field", description = "Mapping definition for enriching field")
public class EnrichingFieldDto {

View File

@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
* An object that represents and enrichment table using an in-memory map
*
* <p>This class implements EnrichmentTable and Serializable interfaces.
* It uses in-memory hash map for implementing the table.
* It uses an in-memory hash map for implementing the table.
* It provides lookup into the table for an enrichment key.
*
* @author Marian Novotny
@@ -54,6 +54,7 @@ public class EnrichmentMemoryTable implements EnrichmentTable, Serializable {
/**
* Static factory method for creating an enrichment memory table
*
* @param is an input stream for reading a json file with the table
* @return enrichment memory table created from the input stream json file
* @throws IOException when reading from the stream fails, or

View File

@@ -19,6 +19,7 @@ import java.util.Optional;
public interface EnrichmentTable {
/**
* Provides information whether the table contains a key
*
* @param key an input string for table lookup
* @return true if the table contains the key, otherwise false
*/

View File

@@ -39,10 +39,10 @@ import static uk.co.gresearch.siembol.enrichments.common.EnrichmentResult.Status
* An object for integration of an enrichment evaluator into a storm bolt
*
* <p>This class extends a Storm BaseRichBolt class to implement a Storm bolt, that
* computes enrichment commands for a log by evaluating enrichment rules cached in the ZooKeeper,
* watches for the enrichment rules update in ZooKeeper and
* updates the enrichment evaluator without needing to restart the topology or the bolt,
* emits the event on input, the enrichment commands and exceptions after processing.
* computes enrichment commands for a log by evaluating enrichment rules cached in the ZooKeeper.
* It watches for the enrichment rules update in ZooKeeper and
* updates the enrichment evaluator without needing to restart the topology or the bolt.
* It emits the event on input, the enrichment commands and exceptions after processing.
*
* @author Marian Novotny
*

View File

@@ -28,8 +28,8 @@ import java.util.Optional;
* An object for integration of merging enrichment with an event into a storm bolt
*
* <p>This class extends a Storm BaseRichBolt class to implement a Storm bolt, that
* evaluates merges an event with enrichments computed by a table enrichment bolt.
* It also creates messages with topic to be published to Kafka.
* merges an event with enrichment computed by a table enrichment bolt.
* It also creates messages with a topic to be published to Kafka.
* It emits the messages to be written to Kafka and counters after processing.
*
* @author Marian Novotny

View File

@@ -50,7 +50,7 @@ import java.util.concurrent.ConcurrentHashMap;
* The metadata about tables are cached in the ZooKeeper and downloaded from a filesystem such as http or hdfs.
* It watches for the metadata table update in ZooKeeper and
* updates the enrichment tables without needing to restart the topology or the bolt.
* It emits the event on input, the computed enrichments, exceptions and counters after processing.
* It emits the event on input, the computed enrichment, exceptions and counters after processing.
*
* @author Marian Novotny
*

View File

@@ -21,7 +21,7 @@ public interface RespondingEvaluatorFactory {
/**
* Gets the type of the evaluator including its name.
* The name should be unique in siembol response instance.
* The name should be unique in the siembol response instance.
*
* @return a responding result with the evaluator type in attributes on success, or
* the result with ERROR status code and the error message otherwise.

View File

@@ -17,9 +17,9 @@ public interface RespondingCompiler {
/**
* Compiles rules into a response engine
*
* @param rules json string with response rules
* @param logger logger for debugging
* @return alerting result with response engine
* @param rules a json string with response rules
* @param logger a logger for debugging
* @return an alerting result with response engine
* @see RespondingResult
* @see uk.co.gresearch.siembol.response.engine.ResponseEngine
*/
@@ -28,8 +28,8 @@ public interface RespondingCompiler {
/**
* Compiles rules into a response engine
*
* @param rules json string with response rules
* @return alerting result with response engine
* @param rules a json string with response rules
* @return an alerting result with response engine
* @see RespondingResult
* @see uk.co.gresearch.siembol.response.engine.ResponseEngine
*/
@@ -40,7 +40,7 @@ public interface RespondingCompiler {
/**
* Provides json schema for response rules
*
* @return RespondingResult with json schema for alerting rules
* @return RespondingResult with json schema for response rules
* @see RespondingResult
*
*/
@@ -58,9 +58,9 @@ public interface RespondingCompiler {
/**
* Compiles rules into response engine and evaluates a test specification using the engine
*
* @param rules json string with alerting rules
* @param testSpecification json string for test specification
* @return alerting result with testing result
* @param rules a json string with response rules
* @param testSpecification a json string for test specification
* @return a responding result with testing result
* @see RespondingResult
*/
RespondingResult testConfigurations(String rules, String testSpecification);
@@ -68,8 +68,8 @@ public interface RespondingCompiler {
/**
* Validates a rule by trying to compile it
*
* @param rule json string with a response rule
* @return responding result with status OK if the rule was able to compile
* @param rule a json string with a response rule
* @return a responding result with status OK if the rule was able to compile
* @see RespondingResult
*/
RespondingResult validateConfiguration(String rule);
@@ -77,8 +77,8 @@ public interface RespondingCompiler {
/**
* Validates rules by trying to compile them
*
* @param rules json string with response rules
* @return responding result with status OK if rules were able to compile
* @param rules a json string with response rules
* @return a responding result with status OK if rules were able to compile
* @see RespondingResult
*/
default RespondingResult validateConfigurations(String rules) {
@@ -92,7 +92,7 @@ public interface RespondingCompiler {
/**
* Gets evaluator factories
*
* @return responding result with evaluator factories
* @return a responding result with evaluator factories
* @see uk.co.gresearch.siembol.response.common.RespondingEvaluatorFactory
*/
RespondingResult getRespondingEvaluatorFactories();

View File

@@ -27,7 +27,7 @@ import static uk.co.gresearch.siembol.response.common.RespondingResult.StatusCod
/**
* An object that validates, tests and compiles responding rules
*
* <p>This class implements RespondingCompiler interface provides functionality for
* <p>This class implements RespondingCompiler interface and provides functionality for
* validating, testing and compiling response rules.
* Moreover, it computes and provides json schema for response rules.
*
@@ -271,7 +271,7 @@ public class RespondingCompilerImpl implements RespondingCompiler {
/**
* Adds responding evaluator factories
* @param factories the list of responding evaluator factories
* @param factories a list of responding evaluator factories
* @return this builder
*/
public Builder addRespondingEvaluatorFactories(List<RespondingEvaluatorFactory> factories) {
@@ -295,7 +295,7 @@ public class RespondingCompilerImpl implements RespondingCompiler {
/**
* Builds responding compiler instance from the builder state
* @return responding compiler instance
* @return a responding compiler instance
* @throws Exception if the building fails
*/
public RespondingCompilerImpl build() throws Exception {

View File

@@ -12,7 +12,7 @@ import uk.co.gresearch.siembol.response.model.ArrayTableFormatterEvaluatorAttrib
* <p>This class implements RespondingEvaluatorFactory interface.
* It is for creating an array table formatter evaluator and providing metadata such as a type and attributes schema.
* The table formatter evaluator generates a string with a Markdown table from the json array from the alert.
* It writes the table into the alert to be used by next evaluators of the rule.
* It writes the table into the alert to be used by the next evaluators of the rule.
* Moreover, it provides the functionality for validating the evaluator attributes.
*
* @author Marian Novotny

View File

@@ -8,7 +8,7 @@ import uk.co.gresearch.siembol.response.common.ResponseEvaluationResult;
/**
* An enum for representing a matching evaluator result
*
* <p>This enum is used for json (de)serialisation of a metching evaluator result used in a matching evaluator.
* <p>This enum is used for json (de)serialisation of a matching evaluator result used in a matching evaluator.
*
* @author Marian Novotny
* @see com.fasterxml.jackson.annotation.JsonProperty

View File

@@ -31,7 +31,7 @@ import java.util.List;
* A class with static helper methods for implementing OAUTH2
*
* <p>This class exposes static methods for implementing OAUTH2 in Siembol Spring boot projects.
* These helper functions are used in all Siembol components.
* These helper functions are used in various Siembol components.
*
* @author Marian Novotny
*/

View File

@@ -13,8 +13,8 @@ import static uk.co.gresearch.siembol.common.authorisation.SiembolAuthorisationP
* An object that implement OAUTH2 authentication in Spring Boot projects
*
* <p>This class extends WebSecurityConfigurerAdapter from Spring framework.
* It permits all HTTP request in the project from the excluded list of patterns.
* It validates Jason Web Token from the HTTP header in order to decide whether permit the request.
* It permits all HTTP requests from the excluded list of patterns.
* It validates Json Web Token from the HTTP header in order to decide whether to permit the request.
*
* @author Marian Novotny
* @see ResourceServerOauth2Properties

View File

@@ -8,7 +8,7 @@ import java.io.InputStream;
/**
* An object for opening input streams from a http server
*
* <p>This class implements SiembolFileSystem, and it is used for opening input streams from a http server.
* <p>This class implements SiembolFileSystem, and it is used for opening input streams from a Http server.
*
* @author Marian Novotny
* @see SiembolFileSystem

View File

@@ -14,7 +14,7 @@ import java.io.InputStream;
public interface SiembolFileSystem extends Closeable {
/**
* Opens input stream from a path
* @param path a path to an input stream
* @param path a path to an input stream
* @return opened input stream
* @throws IOException on error
*/

View File

@@ -22,9 +22,9 @@ import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*;
/**
* A class with static helper methods for implementing json schema enhancements
* A class with helper methods for implementing json schema enhancements
*
* <p>This class exposes static methods for implementing enhancements in com.github.reinert.jjschema.
* <p>This class exposes methods for implementing enhancements in com.github.reinert.jjschema.
* It supports using default values from Dto classes and preserving ordering of fields from Dto classes.
* It extends the schema by supporting a union type - 'oneOf'
*

View File

@@ -55,6 +55,9 @@ public class SiembolJsonSchemaValidator implements JsonSchemaValidator {
jsonReader = new ObjectMapper().readerFor(clazz);
}
/**
* {@inheritDoc}
*/
@Override
public SiembolResult getJsonSchema() {
SiembolAttributes attr = new SiembolAttributes();
@@ -62,6 +65,9 @@ public class SiembolJsonSchemaValidator implements JsonSchemaValidator {
return new SiembolResult(SiembolResult.StatusCode.OK, attr);
}
/**
* {@inheritDoc}
*/
@Override
public SiembolResult validate(String json) {
try {

View File

@@ -2,8 +2,9 @@ package uk.co.gresearch.siembol.common.metrics;
/**
* An object for inactive registering metrics
*
* <p>This class implements SiembolMetricsRegistrar interface and it is registering dummy metrics implementations.
* It should be used in use cases with disabled collecting metrics.
* <p>This class implements SiembolMetricsRegistrar interface, and it is used for
* registering dummy metrics implementations.
* It should be used in scenarios with disabled collecting metrics.
*
* @author Marian Novotny
* @see SiembolMetricsRegistrar

View File

@@ -5,7 +5,7 @@ import java.util.Map;
/**
* An object for registering metrics with caching
*
* <p>This class implements SiembolMetricsRegistrar interface and it is using a map for caching of metrics.
* <p>This class implements SiembolMetricsRegistrar interface, and it is using internally a map for caching of metrics.
* This class is not thread safe and the caller needs to consider it.
*
* @author Marian Novotny

View File

@@ -2,7 +2,7 @@ package uk.co.gresearch.siembol.common.metrics;
/**
* An object for registering metrics
*
* <p>This interface for registering metrics such as counters and gauges.
* <p>This interface is for registering metrics such as counters and gauges.
*
* @author Marian Novotny
*

View File

@@ -9,7 +9,7 @@ import uk.co.gresearch.siembol.common.metrics.SiembolMetricsRegistrar;
/**
* An object for registering metrics in Spring
*
* <p>This class implements SiembolMetricsRegistrar interface and it is using in Siembol Spring Boot projects.
* <p>This class implements SiembolMetricsRegistrar interface, and it is using in Siembol Spring Boot projects.
*
* @author Marian Novotny
* @see SiembolMetricsRegistrar

View File

@@ -5,7 +5,7 @@ import uk.co.gresearch.siembol.common.metrics.*;
/**
* An object for registering metrics in Storm
*
* <p>This class implements SiembolMetricsRegistrar interface and it is using in Siembol Storm topologies.
* <p>This class implements SiembolMetricsRegistrar interface, and it is used in Siembol Storm topologies.
*
* @author Marian Novotny
* @see SiembolMetricsRegistrar

View File

@@ -9,7 +9,7 @@ import java.io.Serializable;
/**
* A data transfer object for representing ZooKeeper attributes
*
* <p>This class is used for json (de)serialisation of attributes for ZooKeeper connector and
* <p>This class is used for json (de)serialisation of attributes for a ZooKeeper connector and
* for generating json schema from this class using annotations.
*
* @author Marian Novotny

View File

@@ -2,7 +2,7 @@ package uk.co.gresearch.siembol.common.result;
/**
* An object that represents Siembol result
*
* <p>This class represents Siembol result and it combines a status code with Siembol attributes.
* <p>This class represents Siembol result, and it combines a status code with Siembol attributes.
*
* @author Marian Novotny
* @see SiembolAttributes

View File

@@ -30,7 +30,7 @@ import java.util.function.Supplier;
* An object that implements a Http client
*
* <p>This class implements a Http client used in various Siembol components.
* It supports kerberos authentication and methods for get a post requests.
* It supports kerberos authentication and methods for GET and POST requests.
*
* @author Marian Novotny
*/

View File

@@ -25,12 +25,14 @@ public interface ZooKeeperGenericConnector<T> extends Closeable {
/**
* Adds a callback to be called after a node change
* @param listener a callback to eb called after a node change
*
* @param listener a callback to be called after a node change
*/
void addCacheListener(Runnable listener);
/**
* Initializes the node, and it waits until the node is ready.
* Initializes the node and waits until the node is ready
*
* @throws Exception on error
*/
default void initialise() throws Exception {