Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3ce73e7
UNOMI-920 Improve toString() methods with YAML formatting for debugging
sergehuber May 5, 2026
94ec7a3
UNOMI-879 Unified CRUD shell developer commands
sergehuber May 6, 2026
51aa61c
UNOMI-888: Javadoc and API cleanup for import/export router extension
sergehuber May 6, 2026
dd35f3e
Add manual dispatch to CodeQL Java workflow
sergehuber May 15, 2026
86d14d0
Add manual dispatch to CodeQL JavaScript workflow
sergehuber May 15, 2026
124af7e
Add manual dispatch to CodeQL Java workflow
sergehuber May 15, 2026
c5b167c
Add manual dispatch to CodeQL JavaScript workflow
sergehuber May 15, 2026
7261e6a
Add manual dispatch to CodeQL Java workflow
sergehuber May 15, 2026
624b027
Add manual dispatch to CodeQL JavaScript workflow
sergehuber May 15, 2026
22de38c
CI: always publish IT JUnit report and update check on re-run
sergehuber May 15, 2026
e07e3e4
Merge branch 'UNOMI-920-yaml-tostring' into UNOMI-879-unified-crud-shell
sergehuber May 15, 2026
fe30c97
Merge remote-tracking branch 'origin/UNOMI-879-unified-crud-shell' in…
sergehuber May 15, 2026
c0f7484
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 15, 2026
e07010d
Merge remote-tracking branch 'origin/UNOMI-888-import-export-javadoc'…
sergehuber May 15, 2026
bcf5a68
UNOMI-920: Address PR review feedback for YAML toString support
sergehuber May 16, 2026
fdf372e
Merge branch 'UNOMI-920-yaml-tostring' into UNOMI-879-unified-crud-shell
sergehuber May 16, 2026
ca29dab
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 16, 2026
c836baa
Merge branch 'master' into UNOMI-920-yaml-tostring
sergehuber May 16, 2026
ba50cc8
Merge branch 'UNOMI-920-yaml-tostring' into UNOMI-879-unified-crud-shell
sergehuber May 16, 2026
6c4637c
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 16, 2026
4bd200a
UNOMI-879: Address PR review feedback for unified CRUD shell
sergehuber May 16, 2026
4608112
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 16, 2026
83c6a68
UNOMI-888: Address PR review feedback for router Javadoc
sergehuber May 17, 2026
df1dc2a
UNOMI-880 (split A0): migrate Elasticsearch integration tests to Docker
sergehuber May 18, 2026
cab5662
Merge branch 'UNOMI-itests-es-docker' into UNOMI-920-yaml-tostring
sergehuber May 18, 2026
6c46aee
Merge branch 'UNOMI-920-yaml-tostring' into UNOMI-879-unified-crud-shell
sergehuber May 18, 2026
a00a859
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 18, 2026
a2e008c
UNOMI-921: Replace elasticsearch-maven-plugin with Docker-based Elast…
sergehuber May 18, 2026
30c444e
Merge branch 'UNOMI-itests-es-docker' into UNOMI-920-yaml-tostring
sergehuber May 18, 2026
600098a
Merge branch 'UNOMI-920-yaml-tostring' into UNOMI-879-unified-crud-shell
sergehuber May 18, 2026
bd506c3
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 18, 2026
2f991d0
Merge branch 'master' into UNOMI-itests-es-docker
sergehuber May 19, 2026
2f881c4
Merge branch 'UNOMI-itests-es-docker' into UNOMI-920-yaml-tostring
sergehuber May 19, 2026
b45e422
Merge branch 'UNOMI-920-yaml-tostring' into UNOMI-879-unified-crud-shell
sergehuber May 19, 2026
2d6c00e
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 19, 2026
944c39b
UNOMI-937: Add build.sh CI mode for non-interactive GitHub Actions
sergehuber May 23, 2026
eb294da
UNOMI-937: Harden flaky integration tests with keepTrying polling
sergehuber May 23, 2026
c2f3001
UNOMI-937: Add waitForProfileProperty helper for async rule updates
sergehuber May 23, 2026
2611dea
UNOMI-937: Run GitHub Actions unit and IT jobs via build.sh
sergehuber May 23, 2026
88da78a
UNOMI-921: Replace elasticsearch-maven-plugin with Docker-based Elast…
sergehuber May 18, 2026
983e6a2
Merge remote-tracking branch 'origin/UNOMI-itests-es-docker' into UNO…
sergehuber May 23, 2026
dea4cd0
Merge branch 'UNOMI-921-itests-es-docker' into UNOMI-920-yaml-tostring
sergehuber May 23, 2026
8c03514
Merge branch 'UNOMI-920-yaml-tostring' into UNOMI-879-unified-crud-shell
sergehuber May 28, 2026
2cbd134
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 28, 2026
899daf1
Merge branch 'master' into UNOMI-921-itests-es-docker
sergehuber May 28, 2026
749c5ae
Merge branch 'UNOMI-921-itests-es-docker' into UNOMI-920-yaml-tostring
sergehuber May 28, 2026
a29f08c
Merge branch 'UNOMI-920-yaml-tostring' into UNOMI-879-unified-crud-shell
sergehuber May 28, 2026
5b54849
Merge branch 'UNOMI-879-unified-crud-shell' into UNOMI-888-import-exp…
sergehuber May 28, 2026
42c7515
Merge branch 'master' into UNOMI-888-import-export-javadoc
sergehuber Jun 2, 2026
eb22dd1
UNOMI-888: Remove duplicate Condition methods (merge artifact)
sergehuber Jun 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,79 @@
package org.apache.unomi.router.api;

/**
* Created by amidani on 18/10/2017.
* Facade for the Apache Camel runtime used by the Unomi Router extension.
* Implementations manage dynamic routes for profile import (from sources such as Kafka or files)
* and profile export (collection and producer pipelines), and expose a minimal API so callers do not
* depend on Camel types unless they choose to.
*
* <p>Key responsibilities:
* <ul>
* <li>Removing obsolete Camel route definitions when configurations change or are deleted</li>
* <li>Rebuilding import reader routes after an {@link org.apache.unomi.router.api.ImportConfiguration} update</li>
* <li>Rebuilding export reader routes after an {@link org.apache.unomi.router.api.ExportConfiguration} update</li>
* <li>Optional Camel tracing for troubleshooting route execution</li>
* </ul>
* </p>
*
* <p>Typical usage:
* <ul>
* <li>Management services call update methods when import/export configuration documents change</li>
* <li>Cleanup paths call {@link #killExistingRoute(String, boolean)} to drop routes whose configs were removed</li>
* </ul>
* </p>
*
* @since 1.0
*/
public interface IRouterCamelContext {

/**
* Stops and removes an existing Camel route by id, if it is currently registered in the context.
*
* @param routeId Camel route identifier (usually aligned with import/export configuration id)
* @param fireEvent when {@code true}, signals that router lifecycle events may be emitted; the concrete
* implementation defines whether events are fired (reserved hook for observability)
* @throws Exception if Camel fails to remove the route definition
*/
void killExistingRoute(String routeId, boolean fireEvent) throws Exception;

/**
* Refreshes the profile import reader route for the given configuration: removes any existing route with the
* same id, loads the {@link org.apache.unomi.router.api.ImportConfiguration}, and—for recurrent configs—
* registers a new route built from current settings.
*
* @param configId identifier of the import configuration whose reader route should be updated
* @param fireEvent when {@code true}, signals that router lifecycle events may be emitted after the update
* @throws Exception if route removal or registration fails
*/
void updateProfileImportReaderRoute(String configId, boolean fireEvent) throws Exception;

/**
* Refreshes the profile export reader (collect) route for the given configuration: removes any existing route
* with the same id, loads the {@link org.apache.unomi.router.api.ExportConfiguration}, and—for recurrent
* configs—registers a new collect route built from current settings.
*
* @param configId identifier of the export configuration whose reader route should be updated
* @param fireEvent when {@code true}, signals that router lifecycle events may be emitted after the update
* @throws Exception if route removal or registration fails
*/
void updateProfileExportReaderRoute(String configId, boolean fireEvent) throws Exception;

/**
* Enables or disables Camel route tracing on the underlying {@code CamelContext} for debugging (message flow,
* exchanges). Intended for diagnostics in development or incident analysis; may have performance impact when on.
*
* @param tracing {@code true} to enable Camel tracing, {@code false} to disable
*/
void setTracing(boolean tracing);

/**
* Returns the underlying Camel context instance.
* The API uses {@link Object} so consumers of this module are not required to depend on Camel at compile time.
* Callers that ship Camel may cast to {@code org.apache.camel.CamelContext}.
*
* @return the Camel context instance, or {@code null} if not initialized or not exposed
*/
default Object getCamelContext() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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}
*/
Comment thread
sergehuber marked this conversation as resolved.
public void setConfigType(String configType) {
this.configType = configType;
Expand All @@ -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;
Expand All @@ -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) {
Comment thread
sergehuber marked this conversation as resolved.
if (columnSeparator.length() != 1) {
throw new IllegalArgumentException("columnSeparator must be exactly one character");
}
this.columnSeparator = columnSeparator;
}
}
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Loading
Loading