-
Notifications
You must be signed in to change notification settings - Fork 141
UNOMI-888: Javadoc and API cleanup for import/export router extension #756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sergehuber
wants to merge
12
commits into
UNOMI-879-unified-crud-shell
Choose a base branch
from
UNOMI-888-import-export-javadoc
base: UNOMI-879-unified-crud-shell
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
51aa61c
UNOMI-888: Javadoc and API cleanup for import/export router extension
sergehuber 7261e6a
Add manual dispatch to CodeQL Java workflow
sergehuber 624b027
Add manual dispatch to CodeQL JavaScript workflow
sergehuber c0f7484
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber e07010d
Merge remote-tracking branch 'origin/UNOMI-888-import-export-javadoc'…
sergehuber ca29dab
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber 6c4637c
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber 4608112
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber 83c6a68
UNOMI-888: Address PR review feedback for router Javadoc
sergehuber a00a859
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber bd506c3
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber 2d6c00e
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,15 +16,52 @@ | |
| */ | ||
| package org.apache.unomi.router.api; | ||
|
|
||
| import org.apache.unomi.api.Item; | ||
| import org.apache.unomi.api.Item; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.ArrayList; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Created by amidani on 21/06/2017. | ||
| * Base configuration class for import and export operations in Apache Unomi. | ||
| * This class serves as the foundation for both ImportConfiguration and ExportConfiguration, | ||
| * providing common configuration properties and behaviors needed for data transfer operations. | ||
| * | ||
| * <p>Key features and responsibilities: | ||
| * <ul> | ||
| * <li>Defines common configuration properties for import/export operations</li> | ||
| * <li>Manages separators and delimiters for CSV-like file formats</li> | ||
| * <li>Tracks execution status and history</li> | ||
| * <li>Handles configuration activation/deactivation</li> | ||
| * </ul> | ||
| * </p> | ||
| * | ||
| * <p>Usage in Unomi: | ||
| * <ul> | ||
| * <li>Used by ImportExportConfigurationService to manage data transfer configurations</li> | ||
| * <li>Consumed by Camel routes to determine how to process data</li> | ||
| * <li>Referenced by import/export processors to format data correctly</li> | ||
| * </ul> | ||
| * </p> | ||
| * | ||
| * <p>Configuration properties include: | ||
| * <ul> | ||
| * <li>itemId - persisted identifier used by router services and routes ({@link Item#getItemId()})</li> | ||
| * <li>name - human-readable display name (not used as the route or persistence key)</li> | ||
| * <li>configType - scheduling mode ({@link RouterConstants#IMPORT_EXPORT_CONFIG_TYPE_RECURRENT} or | ||
| * {@link RouterConstants#IMPORT_EXPORT_CONFIG_TYPE_ONESHOT})</li> | ||
| * <li>columnSeparator - character used to separate columns (default: ",")</li> | ||
| * <li>lineSeparator - character used to separate lines (default: "\n")</li> | ||
| * <li>multiValueSeparator - character used to separate multiple values (default: ";")</li> | ||
| * <li>active - whether the configuration is currently active</li> | ||
| * <li>status - current status of the configuration</li> | ||
| * <li>executions - history of execution attempts</li> | ||
| * </ul> | ||
| * </p> | ||
| * | ||
| * @see org.apache.unomi.router.api.services.ImportExportConfigurationService | ||
| * @since 1.0 | ||
| */ | ||
| public class ImportExportConfiguration extends Item { | ||
|
|
||
|
|
@@ -53,43 +90,51 @@ public void setProperty(String name, Object value) { | |
| } | ||
|
|
||
| /** | ||
| * Retrieves the name of the import configuration | ||
| * @return the name of the import configuration | ||
| * Retrieves the display name of this configuration. | ||
| * | ||
| * @return the name of this configuration | ||
| */ | ||
| public String getName() { return this.name; } | ||
|
|
||
| /** | ||
| * Sets the name of the import configuration | ||
| * @param name the name of the import configuration | ||
| * Sets the display name of this configuration. | ||
| * | ||
| * @param name the name of this configuration | ||
| */ | ||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| /** | ||
| * Retrieves the description of the import configuration | ||
| * @return the description of the import configuration | ||
| * Retrieves the human-readable description of this configuration. | ||
| * | ||
| * @return the description of this configuration | ||
| */ | ||
| public String getDescription() { return this.description; } | ||
|
|
||
| /** | ||
| * Sets the description of the import configuration | ||
| * @param description the description of the import configuration | ||
| * Sets the human-readable description of this configuration. | ||
| * | ||
| * @param description the description of this configuration | ||
| */ | ||
| public void setDescription(String description) { | ||
| this.description = description; | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Retrieves the config type of the import configuration | ||
| * @return the config type of the import configuration | ||
| * Returns the scheduling mode for this configuration ({@code recurrent} or {@code oneshot}). | ||
| * | ||
| * @return {@link RouterConstants#IMPORT_EXPORT_CONFIG_TYPE_RECURRENT} or | ||
| * {@link RouterConstants#IMPORT_EXPORT_CONFIG_TYPE_ONESHOT} | ||
| */ | ||
| public String getConfigType() { return this.configType; } | ||
|
|
||
| /** | ||
| * Sets the config type of the import configuration | ||
| * @param configType the config type of the import configuration | ||
| * Sets the scheduling mode for this configuration. | ||
| * | ||
| * @param configType {@link RouterConstants#IMPORT_EXPORT_CONFIG_TYPE_RECURRENT} or | ||
| * {@link RouterConstants#IMPORT_EXPORT_CONFIG_TYPE_ONESHOT} | ||
| */ | ||
| public void setConfigType(String configType) { | ||
| this.configType = configType; | ||
|
|
@@ -106,45 +151,45 @@ public Object getProperty(String name) { | |
| } | ||
|
|
||
| /** | ||
| * Retrieves a Map of all property name - value pairs for this import configuration. | ||
| * Retrieves a map of all property name/value pairs for this configuration. | ||
| * | ||
| * @return a Map of all property name - value pairs for this import configuration | ||
| * @return a map of all property name/value pairs for this configuration | ||
| */ | ||
| public Map<String, Object> getProperties() { | ||
| return properties; | ||
| } | ||
|
|
||
| /** | ||
| * Retrieves the import configuration active flag. | ||
| * Returns whether this configuration is active (eligible for scheduled or triggered runs). | ||
| * | ||
| * @return true if the import configuration is active false if not | ||
| * @return {@code true} if this configuration is active, {@code false} otherwise | ||
| */ | ||
| public boolean isActive() { | ||
| return this.active; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the active flag true/false. | ||
| * Sets whether this configuration is active. | ||
| * | ||
| * @param active a boolean to set to active or inactive the import configuration | ||
| * @param active {@code true} to activate, {@code false} to deactivate | ||
| */ | ||
| public void setActive(boolean active) { | ||
| this.active = active; | ||
| } | ||
|
|
||
| /** | ||
| * Retrieves the import configuration status for last execution. | ||
| * Retrieves the status of the last execution for this configuration. | ||
| * | ||
| * @return status of the last execution | ||
| * @return status of the last execution, or {@code null} if none | ||
| */ | ||
| public String getStatus() { | ||
| return this.status; | ||
| } | ||
|
|
||
| /** | ||
| * Sets status of the last execution. | ||
| * Sets the status of the last execution for this configuration. | ||
| * | ||
| * @param status of the last execution | ||
| * @param status the status of the last execution | ||
| */ | ||
| public void setStatus(String status) { | ||
| this.status = status; | ||
|
|
@@ -159,11 +204,16 @@ public String getColumnSeparator() { | |
| } | ||
|
|
||
| /** | ||
| * Sets the column separator. | ||
| * @param columnSeparator property used to specify a line separator. Defaults to ',' | ||
| * Sets the column separator used when reading or writing delimited text (typically CSV). | ||
| * | ||
| * @param columnSeparator the column delimiter; must be exactly one character when non-null | ||
| * @throws IllegalArgumentException if {@code columnSeparator} is empty or longer than one character | ||
| */ | ||
| public void setColumnSeparator(String columnSeparator) { | ||
| if(this.columnSeparator !=null) { | ||
| if (columnSeparator != null) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed. |
||
| if (columnSeparator.length() != 1) { | ||
| throw new IllegalArgumentException("columnSeparator must be exactly one character"); | ||
| } | ||
| this.columnSeparator = columnSeparator; | ||
| } | ||
| } | ||
|
|
@@ -187,9 +237,9 @@ public void setLineSeparator(String lineSeparator) { | |
| } | ||
|
|
||
| /** | ||
| * Gets the multi value separator. | ||
| * Returns the separator used between multiple values within a single field. | ||
| * | ||
| * @return multiValueSeparator multi value separator | ||
| * @return the multi-value separator (often {@code ";"}) | ||
| */ | ||
| public String getMultiValueSeparator() { | ||
| return this.multiValueSeparator; | ||
|
|
@@ -206,9 +256,9 @@ public void setMultiValueSeparator(String multiValueSeparator) { | |
| } | ||
|
|
||
| /** | ||
| * Gets the multi value delimiter. | ||
| * Returns the delimiter wrapping multi-valued fields when serialized. | ||
| * | ||
| * @return multiValueDelimiter multi value delimiter | ||
| * @return the multi-value delimiter (may be empty when not used) | ||
| */ | ||
| public String getMultiValueDelimiter() { | ||
| return this.multiValueDelimiter; | ||
|
|
@@ -225,17 +275,19 @@ public void setMultiValueDelimiter(String multiValueDelimiter) { | |
| } | ||
|
|
||
| /** | ||
| * Retrieves the executions | ||
| * @return executions | ||
| * Returns the history of execution records for this configuration (timestamps, counts, errors, etc.). | ||
| * | ||
| * @return the list of execution maps; may be empty | ||
| */ | ||
| public List<Map<String, Object>> getExecutions() { | ||
| return this.executions; | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Sets the executions | ||
| * @param executions executions | ||
| * Replaces the execution history for this configuration. | ||
| * | ||
| * @param executions the new execution history list | ||
| */ | ||
| public void setExecutions(List<Map<String, Object>> executions) { | ||
| this.executions = executions; | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
getConfigType()/setConfigType()Javadoc now documents scheduling mode (recurrent/oneshotviaRouterConstants.IMPORT_EXPORT_CONFIG_TYPE_*), not import vs export.