├── .gitignore
├── .java-version
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── DISCLAIMER.md
├── LICENSE
├── LICENSES
└── Apache-2.0.txt
├── README.md
├── REUSE.toml
├── commercedbsync
├── .classpath
├── buildcallbacks.xml
├── extensioninfo.xml
├── external-dependencies.xml
├── project.properties
├── resources
│ ├── anonymizer
│ │ ├── address.json
│ │ └── config.yml
│ ├── commercedbsync-beans.xml
│ ├── commercedbsync-items.xml
│ ├── commercedbsync-spring.xml
│ ├── commercedbsync
│ │ └── sap-hybris-platform.png
│ ├── groovy
│ │ ├── MigrationSummaryScript.groovy
│ │ └── ddlaltercreate.groovy
│ ├── impex
│ │ └── projectdata-commercemigration-jobs.impex
│ ├── localization
│ │ ├── commercedbsync-locales_de.properties
│ │ ├── commercedbsync-locales_en.properties
│ │ ├── commercedbsync-locales_es.properties
│ │ ├── commercedbsync-locales_fr.properties
│ │ ├── commercedbsync-locales_it.properties
│ │ ├── commercedbsync-locales_ja.properties
│ │ ├── commercedbsync-locales_ko.properties
│ │ ├── commercedbsync-locales_pt.properties
│ │ ├── commercedbsync-locales_ru.properties
│ │ └── commercedbsync-locales_zh.properties
│ └── sql
│ │ ├── createSchedulerTablesHANA.sql
│ │ ├── createSchedulerTablesMSSQL.sql
│ │ ├── createSchedulerTablesMYSQL.sql
│ │ ├── createSchedulerTablesORACLE.sql
│ │ ├── createSchedulerTablesPOSTGRESQL.sql
│ │ ├── createSchemaSchedulerTablesHANA.sql
│ │ ├── createSchemaSchedulerTablesMSSQL.sql
│ │ ├── createSchemaSchedulerTablesMYSQL.sql
│ │ ├── createSchemaSchedulerTablesORACLE.sql
│ │ ├── createSchemaSchedulerTablesPOSTGRESQL.sql
│ │ └── transformationFunctions
│ │ ├── mssql-general.sql
│ │ └── mssql-typeinfotable.sql
├── src
│ ├── com
│ │ └── sap
│ │ │ └── cx
│ │ │ └── boosters
│ │ │ └── commercedbsync
│ │ │ ├── CommercedbsyncStandalone.java
│ │ │ ├── adapter
│ │ │ ├── DataRepositoryAdapter.java
│ │ │ └── impl
│ │ │ │ └── ContextualDataRepositoryAdapter.java
│ │ │ ├── anonymizer
│ │ │ ├── AnonymizeFunctions.java
│ │ │ ├── AnonymizerConfigurator.java
│ │ │ ├── TextEvaluator.java
│ │ │ ├── TextTokenizer.java
│ │ │ ├── exception
│ │ │ │ └── ValidationException.java
│ │ │ ├── functions
│ │ │ │ ├── FunctionEvaluator.java
│ │ │ │ └── impl
│ │ │ │ │ ├── GuidFunctionEvaluator.java
│ │ │ │ │ ├── RandomAddressGenerator.java
│ │ │ │ │ └── RandomFunctionEvaluator.java
│ │ │ └── model
│ │ │ │ ├── AnonymizerConfiguration.java
│ │ │ │ ├── Column.java
│ │ │ │ ├── Operation.java
│ │ │ │ └── Table.java
│ │ │ ├── concurrent
│ │ │ ├── DataCopyMethod.java
│ │ │ ├── DataPipe.java
│ │ │ ├── DataPipeFactory.java
│ │ │ ├── DataThreadPoolConfigBuilder.java
│ │ │ ├── DataThreadPoolFactory.java
│ │ │ ├── DataThreadPoolMonitor.java
│ │ │ ├── DataWorkerExecutor.java
│ │ │ ├── DataWorkerPoolFactory.java
│ │ │ ├── MDCTaskDecorator.java
│ │ │ ├── MaybeFinished.java
│ │ │ ├── PipeAbortedException.java
│ │ │ └── impl
│ │ │ │ ├── DefaultDataPipe.java
│ │ │ │ ├── DefaultDataPipeFactory.java
│ │ │ │ ├── DefaultDataThreadPoolFactory.java
│ │ │ │ ├── DefaultDataThreadPoolMonitor.java
│ │ │ │ ├── DefaultDataWorkerExecutor.java
│ │ │ │ └── task
│ │ │ │ ├── BatchMarkerDataReaderTask.java
│ │ │ │ ├── BatchOffsetDataReaderTask.java
│ │ │ │ ├── ChunkDataReaderTask.java
│ │ │ │ ├── DataReaderTask.java
│ │ │ │ ├── DefaultDataReaderTask.java
│ │ │ │ ├── PartitionedBatchMarkerDataReaderTask.java
│ │ │ │ ├── PipeTaskContext.java
│ │ │ │ └── RetriableTask.java
│ │ │ ├── constants
│ │ │ └── CommercedbsyncConstants.java
│ │ │ ├── context
│ │ │ ├── CopyContext.java
│ │ │ ├── IncrementalMigrationContext.java
│ │ │ ├── LaunchOptions.java
│ │ │ ├── MigrationContext.java
│ │ │ ├── MigrationContextFactory.java
│ │ │ ├── SchemaDifferenceContext.java
│ │ │ ├── impl
│ │ │ │ ├── DefaultIncrementalMigrationContext.java
│ │ │ │ └── DefaultMigrationContext.java
│ │ │ └── validation
│ │ │ │ ├── MigrationContextValidator.java
│ │ │ │ └── impl
│ │ │ │ └── DefaultMigrationContextValidator.java
│ │ │ ├── cron
│ │ │ ├── FullMigrationCronJob.java
│ │ │ ├── IncrementalMigrationCronJob.java
│ │ │ └── MigrationCronJob.java
│ │ │ ├── dataset
│ │ │ ├── DataColumn.java
│ │ │ ├── DataSet.java
│ │ │ └── impl
│ │ │ │ ├── DefaultDataColumn.java
│ │ │ │ └── DefaultDataSet.java
│ │ │ ├── datasource
│ │ │ ├── MigrationDataSourceFactory.java
│ │ │ └── impl
│ │ │ │ ├── AbstractMigrationDataSourceFactory.java
│ │ │ │ └── DefaultMigrationDataSourceFactory.java
│ │ │ ├── events
│ │ │ ├── CopyCompleteEvent.java
│ │ │ ├── CopyDatabaseTableEvent.java
│ │ │ ├── OperationEvent.java
│ │ │ ├── SchemaDifferenceEvent.java
│ │ │ └── handlers
│ │ │ │ ├── CopyCompleteEventListener.java
│ │ │ │ └── CopyDatabaseTableEventListener.java
│ │ │ ├── filter
│ │ │ ├── DataCopyTableFilter.java
│ │ │ └── impl
│ │ │ │ ├── CompositeDataCopyTableFilter.java
│ │ │ │ ├── ExclusionDataCopyTableFilter.java
│ │ │ │ ├── InclusionDataCopyTableFilter.java
│ │ │ │ └── IncrementalDataCopyTableFilter.java
│ │ │ ├── interceptors
│ │ │ └── DefaultCMTRemoveInterceptor.java
│ │ │ ├── jalo
│ │ │ └── ItemDeletionMarker.java
│ │ │ ├── jobs
│ │ │ ├── AbstractMigrationJobPerformable.java
│ │ │ ├── FullMigrationJob.java
│ │ │ ├── IncrementalMigrationJob.java
│ │ │ └── MigrationPrepJob.java
│ │ │ ├── listeners
│ │ │ └── DefaultCMTAfterSaveListener.java
│ │ │ ├── logging
│ │ │ ├── JDBCQueriesStore.java
│ │ │ ├── JdbcQueryLog.java
│ │ │ ├── LoggingConnectionWrapper.java
│ │ │ ├── LoggingPreparedStatementWrapper.java
│ │ │ └── LoggingStatementWrapper.java
│ │ │ ├── performance
│ │ │ ├── PerformanceCategory.java
│ │ │ ├── PerformanceProfiler.java
│ │ │ ├── PerformanceRecorder.java
│ │ │ ├── PerformanceUnit.java
│ │ │ └── impl
│ │ │ │ └── DefaultPerformanceProfiler.java
│ │ │ ├── processors
│ │ │ ├── MigrationPostProcessor.java
│ │ │ ├── MigrationPreProcessor.java
│ │ │ └── impl
│ │ │ │ ├── AdjustActiveTypeSystemPostProcessor.java
│ │ │ │ ├── DefaultMigrationPostProcessor.java
│ │ │ │ ├── IndexAlignerPostProcessor.java
│ │ │ │ ├── JdbcQueriesPostProcessor.java
│ │ │ │ ├── MSSQLUpdateStatisticsPostProcessor.java
│ │ │ │ ├── ReportMigrationPostProcessor.java
│ │ │ │ ├── TransformFunctionGeneratorPreProcessor.java
│ │ │ │ ├── TruncateNotMigratedTablesPreProcessor.java
│ │ │ │ ├── TypeInfoTableGeneratorPreProcessor.java
│ │ │ │ ├── UpdateYDeploymentsPostProcessor.java
│ │ │ │ ├── ViewDropPostProcessor.java
│ │ │ │ └── ViewGeneratorPreProcessor.java
│ │ │ ├── profile
│ │ │ ├── DataSourceConfiguration.java
│ │ │ ├── DataSourceConfigurationFactory.java
│ │ │ └── impl
│ │ │ │ ├── DefaultDataSourceConfiguration.java
│ │ │ │ ├── DefaultDataSourceConfigurationFactory.java
│ │ │ │ └── InvalidDataSourceConfigurationException.java
│ │ │ ├── provider
│ │ │ ├── CopyItemProvider.java
│ │ │ └── impl
│ │ │ │ └── DefaultDataCopyItemProvider.java
│ │ │ ├── repository
│ │ │ ├── DataRepository.java
│ │ │ ├── impl
│ │ │ │ ├── AbstractDataRepository.java
│ │ │ │ ├── AzureDataRepository.java
│ │ │ │ ├── AzureIncrementalDataRepository.java
│ │ │ │ ├── DataRepositoryFactory.java
│ │ │ │ ├── HanaDataRepository.java
│ │ │ │ ├── HsqlRepository.java
│ │ │ │ ├── MySQLDataRepository.java
│ │ │ │ ├── MySQLIncrementalDataRepository.java
│ │ │ │ ├── NullRepository.java
│ │ │ │ ├── OracleDataRepository.java
│ │ │ │ └── PostGresDataRepository.java
│ │ │ └── platform
│ │ │ │ ├── MigrationHybrisHANABuilder.java
│ │ │ │ ├── MigrationHybrisHANAPlatform.java
│ │ │ │ ├── MigrationHybrisMSSqlBuilder.java
│ │ │ │ ├── MigrationHybrisMSSqlPlatform.java
│ │ │ │ ├── MigrationHybrisMySqlBuilder.java
│ │ │ │ ├── MigrationHybrisMySqlPlatform.java
│ │ │ │ ├── MigrationHybrisPostGresBuilder.java
│ │ │ │ └── MigrationHybrisPostGresPlatform.java
│ │ │ ├── scheduler
│ │ │ ├── ClusterTableSplittingStrategy.java
│ │ │ ├── DatabaseCopyScheduler.java
│ │ │ ├── DatabaseOperationSchedulerAlgorithm.java
│ │ │ ├── DatabaseSchemaDifferenceScheduler.java
│ │ │ └── impl
│ │ │ │ ├── CustomClusterDatabaseCopyScheduler.java
│ │ │ │ ├── DefaultClusterTableSplittingStrategy.java
│ │ │ │ ├── DefaultDatabaseSchemaDifferenceScheduler.java
│ │ │ │ └── RoundRobinClusterSchedulerAlgorithm.java
│ │ │ ├── service
│ │ │ ├── DatabaseCopyTaskRepository.java
│ │ │ ├── DatabaseMigrationCopyService.java
│ │ │ ├── DatabaseMigrationDataTypeMapperService.java
│ │ │ ├── DatabaseMigrationReportService.java
│ │ │ ├── DatabaseMigrationReportStorageService.java
│ │ │ ├── DatabaseMigrationService.java
│ │ │ ├── DatabaseSchemaDifferenceService.java
│ │ │ ├── DatabaseSchemaDifferenceTaskRepository.java
│ │ │ └── impl
│ │ │ │ ├── BlobDatabaseMigrationReportStorageService.java
│ │ │ │ ├── DefaultDatabaseCopyTaskRepository.java
│ │ │ │ ├── DefaultDatabaseMigrationDataTypeMapperService.java
│ │ │ │ ├── DefaultDatabaseMigrationReportService.java
│ │ │ │ ├── DefaultDatabaseMigrationService.java
│ │ │ │ ├── DefaultDatabaseSchemaDifferenceService.java
│ │ │ │ ├── DefaultDatabaseSchemaDifferenceTaskRepository.java
│ │ │ │ └── PipeDatabaseMigrationCopyService.java
│ │ │ ├── setup
│ │ │ └── InitUpdateProcessTrigger.java
│ │ │ ├── strategy
│ │ │ ├── PipeWriterStrategy.java
│ │ │ └── impl
│ │ │ │ ├── CopyPipeWriterContext.java
│ │ │ │ ├── CopyPipeWriterStrategy.java
│ │ │ │ ├── CopyPipeWriterTask.java
│ │ │ │ └── DataDeleteWriterTask.java
│ │ │ ├── utils
│ │ │ ├── FileUtils.java
│ │ │ ├── LocalDateTypeAdapter.java
│ │ │ └── MaskUtil.java
│ │ │ └── views
│ │ │ ├── TableViewGenerator.java
│ │ │ └── ViewConfigurationContext.java
│ └── de
│ │ └── hybris
│ │ └── platform
│ │ ├── azure
│ │ └── media
│ │ │ └── AzureCloudUtils.java
│ │ └── core
│ │ └── TenantPropertiesLoader.java
└── testsrc
│ └── com
│ └── sap
│ └── cx
│ └── boosters
│ └── commercedbsync
│ └── views
│ └── TableViewGeneratorTest.java
├── commercedbsynchac
├── .classpath
├── .externalToolBuilders
│ └── HybrisCodeGeneration.launch
├── buildcallbacks.xml
├── extensioninfo.xml
├── external-dependencies.xml
├── hac
│ ├── resources
│ │ ├── jsp
│ │ │ ├── dataCopy.jsp
│ │ │ ├── dataSource.jsp
│ │ │ ├── migrationReports.jsp
│ │ │ └── schemaCopy.jsp
│ │ └── static
│ │ │ ├── audio
│ │ │ └── pling.mp3
│ │ │ ├── css
│ │ │ ├── dataCopy.css
│ │ │ ├── database.css
│ │ │ ├── schemaCopy.css
│ │ │ └── table.css
│ │ │ └── js
│ │ │ ├── configPanel.js
│ │ │ ├── customStatistics.js
│ │ │ ├── dataCopy.js
│ │ │ ├── dataSource.js
│ │ │ ├── migrationMetrics.js
│ │ │ ├── migrationReports.js
│ │ │ └── schemaCopy.js
│ ├── src
│ │ └── de
│ │ │ └── hybris
│ │ │ └── platform
│ │ │ └── hac
│ │ │ └── controller
│ │ │ └── CommercemigrationhacController.java
│ └── testsrc
│ │ └── de
│ │ └── hybris
│ │ └── platform
│ │ └── hac
│ │ └── controller
│ │ └── CommercemigrationhacControllerTest.java
├── project.properties
├── resources
│ ├── com
│ │ └── sap
│ │ │ └── cx
│ │ │ └── boosters
│ │ │ └── commercedbsynchac
│ │ │ └── dummy.txt
│ ├── commercedbsynchac-beans.xml
│ ├── commercedbsynchac-items.xml
│ ├── commercedbsynchac-spring.xml
│ ├── commercedbsynchac-tab-config.json
│ ├── commercedbsynchac-without-migration-tab-config.json
│ └── localization
│ │ ├── i2ihac-locales_de.properties
│ │ ├── i2ihac-locales_en.properties
│ │ ├── i2ihac-locales_es.properties
│ │ ├── i2ihac-locales_fr.properties
│ │ ├── i2ihac-locales_it.properties
│ │ ├── i2ihac-locales_ja.properties
│ │ ├── i2ihac-locales_ko.properties
│ │ ├── i2ihac-locales_pt.properties
│ │ ├── i2ihac-locales_ru.properties
│ │ └── i2ihac-locales_zh.properties
└── src
│ └── com
│ └── sap
│ └── cx
│ └── boosters
│ └── commercedbsynchac
│ ├── CommercedbsynchacStandalone.java
│ ├── constants
│ └── YhacextConstants.java
│ └── metric
│ ├── MetricService.java
│ ├── impl
│ └── DefaultMetricService.java
│ └── populator
│ ├── MetricPopulator.java
│ └── impl
│ ├── CpuMetricPopulator.java
│ ├── DTUMetricPopulator.java
│ ├── HikariConnectionMetricPopulator.java
│ ├── HikariSourceConnectionMetricPopulator.java
│ ├── HikariTargetConnectionMetricPopulator.java
│ ├── IOMetricPopulator.java
│ ├── MemoryMetricPopulator.java
│ ├── TaskExecutorMetricPopulator.java
│ └── ThreadPoolMetricPopulator.java
└── docs
├── anonymizer
└── README.md
├── commercedbsync
├── after_save_listener_1.png
└── after_save_listener_2.png
├── configuration
├── CONFIGURATION-GUIDE.md
└── CONFIGURATION-REFERENCE.md
├── developer
└── DEVELOPER-GUIDE.md
├── performance
├── PERFORMANCE-GUIDE.md
├── performance_architecture.png
└── template_for_scheduled_operational_activity.docx
├── security
└── SECURITY-GUIDE.md
├── support
├── SUPPORT-GUIDE.md
└── support_groovy_preview.png
├── troubleshooting
└── TROUBLESHOOTING-GUIDE.md
└── user
├── SUPPORT-DELETE-GUIDE.md
├── USER-GUIDE-DATA-MIGRATION.md
├── USER-GUIDE-DATA-REPLICATION.md
├── commerce-db-sync-demo.png
├── data_migration_architecture.drawio
├── data_migration_architecture.png
├── data_replication_architecture.drawio
├── data_replication_architecture.png
├── db-sync-flows.svg
├── hac_migrate_data.png
├── hac_report.png
├── hac_schema_diff_exec.png
├── hac_schema_diff_prev.png
├── hac_validate_ds.png
└── proxy_timeout.png
/.gitignore:
--------------------------------------------------------------------------------
1 | build.xml
2 | extensioninfo.xsd
3 | beans.xsd
4 | items.xsd
5 | *testclasses.xml
6 | platformhome.properties
7 |
8 | classes/
9 | gensrc/
10 | lib/
--------------------------------------------------------------------------------
/.java-version:
--------------------------------------------------------------------------------
1 | 17.0
2 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ## Code of Conduct
4 |
5 | All members of the project community must abide by the [Contributor Covenant, version 2.1](CODE_OF_CONDUCT.md).
6 | Only by respecting each other we can develop a productive, collaborative community.
7 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting [a project maintainer](.reuse/dep5).
8 |
9 | ## Engaging in Our Project
10 |
11 | We use GitHub to manage reviews of pull requests.
12 |
13 | * If you are a new contributor, see: [Steps to Contribute](#steps-to-contribute)
14 |
15 | * Before implementing your change, create an issue that describes the problem you would like to solve or the code that should be enhanced. Please note that you are willing to work on that issue.
16 |
17 | * The team will review the issue and decide whether it should be implemented as a pull request. In that case, they will assign the issue to you. If the team decides against picking up the issue, the team will post a comment with an explanation.
18 |
19 | ## Steps to Contribute
20 |
21 | Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on. This is to prevent duplicated efforts from other contributors on the same issue.
22 |
23 | If you have questions about one of the issues, please comment on them, and one of the maintainers will clarify.
24 |
25 | ## Contributing Code or Documentation
26 |
27 | You are welcome to contribute code in order to fix a bug or to implement a new feature that is logged as an issue.
28 |
29 | The following rule governs code contributions:
30 |
31 | * Contributions must be licensed under the [Apache 2.0 License](./LICENSE)
32 | * Due to legal reasons, contributors will be asked to accept a Developer Certificate of Origin (DCO) when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).
33 |
34 | ## Issues and Planning
35 |
36 | * We use GitHub issues to track bugs and enhancement requests.
37 |
38 | * Please provide as much context as possible when you open an issue. The information you provide must be comprehensive enough to reproduce that issue for the assignee.
39 |
--------------------------------------------------------------------------------
/DISCLAIMER.md:
--------------------------------------------------------------------------------
1 | These Project development objects are not managed or delivered or intended for future inclusion as a standard component of the SAP Software. Therefore, at Project closure, these Project development objects will not include any further support services, defect resolution, maintenance, or upgrades or in any way be within scope of SAP support obligations for licensed SAP Software. Licensee is solely responsible for supporting such objects. SAP does not assure the compatibility of such objects with future releases of SAP Software or other SAP solutions.
2 |
--------------------------------------------------------------------------------
/REUSE.toml:
--------------------------------------------------------------------------------
1 | version = 1
2 | SPDX-PackageName = "SAP Commerce DB Sync"
3 | SPDX-PackageSupplier = "yannick.robin@sap.com"
4 | SPDX-PackageDownloadLocation = "https://github.com/SAP/sap-commerce-db-sync"
5 | SPDX-PackageComment = "The code in this project may include calls to APIs (\"API Calls\") of\n SAP or third-party products or services developed outside of this project\n (\"External Products\").\n \"APIs\" means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products,or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project's code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls."
6 |
7 | [[annotations]]
8 | path = "**"
9 | precedence = "aggregate"
10 | SPDX-FileCopyrightText = "2025 SAP SE or an SAP affiliate company and SAP Commerce DB Sync contributors"
11 | SPDX-License-Identifier = "Apache-2.0"
12 |
--------------------------------------------------------------------------------
/commercedbsync/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/commercedbsync/extensioninfo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/commercedbsync/external-dependencies.xml:
--------------------------------------------------------------------------------
1 |
6 |
8 | 4.0.0
9 | de.hybris.platform
10 | commercedbsync
11 | 6.7.0.0-RC19
12 |
13 | jar
14 |
15 |
16 |
17 | com.google.code.gson
18 | gson
19 | 2.8.6
20 |
21 |
22 | com.google.guava
23 | guava
24 | 28.0-jre
25 |
26 |
27 | org.apache.commons
28 | commons-dbcp2
29 | 2.7.0
30 |
31 |
32 | com.zaxxer
33 | HikariCP
34 | 5.0.1
35 |
36 |
37 | com.github.freva
38 | ascii-table
39 | 1.1.0
40 |
41 |
42 | com.fasterxml.jackson.datatype
43 | jackson-datatype-jsr310
44 | 2.13.3
45 |
46 |
47 | org.openjdk.jol
48 | jol-core
49 | 0.10
50 |
51 |
52 | com.fasterxml.jackson.dataformat
53 | jackson-dataformat-yaml
54 | 2.16.0
55 |
56 |
57 | org.yaml
58 | snakeyaml
59 | 2.2
60 |
61 |
62 | com.googlecode.json-simple
63 | json-simple
64 | 1.1.1
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/commercedbsync/resources/commercedbsync/sap-hybris-platform.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/commercedbsync/resources/commercedbsync/sap-hybris-platform.png
--------------------------------------------------------------------------------
/commercedbsync/resources/groovy/MigrationSummaryScript.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package groovy
8 |
9 | import de.hybris.platform.util.Config
10 | import org.apache.commons.lang.StringUtils
11 |
12 | import java.util.stream.Collectors
13 |
14 | def result = generateMigrationSummary(migrationContext)
15 | println result
16 | return result
17 |
18 | def generateMigrationSummary(context) {
19 | StringBuilder sb = new StringBuilder();
20 | try {
21 | final String sourcePrefix = context.getDataSourceRepository().getDataSourceConfiguration().getTablePrefix();
22 | final String targetPrefix = context.getDataTargetRepository().getDataSourceConfiguration().getTablePrefix();
23 | final String dbPrefix = Config.getString("db.tableprefix", "");
24 | final Set sourceSet = migrationContext.getDataSourceRepository().getAllTableNames()
25 | .stream()
26 | .map({ tableName -> tableName.replace(sourcePrefix, "") })
27 | .collect(Collectors.toSet());
28 |
29 | final Set targetSet = migrationContext.getDataTargetRepository().getAllTableNames()
30 | sb.append("------------").append("\n")
31 | sb.append("All tables: ").append(sourceSet.size() + targetSet.size()).append("\n")
32 | sb.append("Source tables: ").append(sourceSet.size()).append("\n")
33 | sb.append("Target tables: ").append(targetSet.size()).append("\n")
34 | sb.append("------------").append("\n")
35 | sb.append("Source prefix: ").append(sourcePrefix).append("\n")
36 | sb.append("Target prefix: ").append(targetPrefix).append("\n")
37 | sb.append("DB prefix: ").append(dbPrefix).append("\n")
38 | sb.append("------------").append("\n")
39 | sb.append("Migration Type: ").append("\n")
40 | sb.append(StringUtils.isNotEmpty(dbPrefix) &&
41 | StringUtils.isNotEmpty(targetPrefix) && !StringUtils.equalsIgnoreCase(dbPrefix, targetPrefix) ? "STAGED" : "DIRECT").append("\n")
42 | sb.append("------------").append("\n")
43 | sb.append("Found prefixes:").append("\n")
44 |
45 | Map prefixes = new HashMap<>()
46 | targetSet.forEach({ tableName ->
47 | String srcTable = schemaDifferenceService.findCorrespondingSrcTable(sourceSet, tableName);
48 | String prefix = tableName.replace(srcTable, "");
49 | prefixes.put(prefix, targetSet.stream().filter({ e -> e.startsWith(prefix) }).count());
50 | });
51 | prefixes.forEach({ k, v -> sb.append("Prefix: ").append(k).append(" number of tables: ").append(v).append("\n") });
52 | sb.append("------------").append("\n");
53 |
54 | } catch (Exception e) {
55 | e.printStackTrace();
56 | }
57 | return sb.toString();
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/commercedbsync/resources/groovy/ddlaltercreate.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | // Parameters
8 | queryToRun = 'select p_streetname from addresses where p_streetname like \'%Test%\''
9 | indexToCreateaddresses = 'CREATE INDEX addresses_ownerpkstring_ddl ON ADDRESSES(typepkstring, ownerpkstring) ONLINE;'
10 | indexToDropAddresses = 'drop index addresses_ownerpkstring_ddl ONLINE;'
11 | AlterAddColumnAddressesQuery = 'ALTER TABLE ADDRESSES ADD (TEST%s BIGINT) ONLINE;'
12 | AlterRemoveColumnAddresses = 'ALTER TABLE ADDRESSES DROP (TEST%s) ONLINE;'
13 |
14 | queryLoopCount = 600
15 | threadSize = 1
16 | threadPoolSize = 1 // Long Running Query Test
17 |
18 | import java.util.concurrent.Callable
19 | import java.util.concurrent.TimeUnit
20 | import java.util.concurrent.Executors
21 | import groovy.time.TimeCategory
22 | import de.hybris.platform.core.Registry
23 | import de.hybris.platform.jalo.JaloSession
24 | import de.hybris.platform.core.Tenant
25 |
26 | queryTasks = []
27 | Tenant currentTenant = Registry.getCurrentTenant();
28 | // Create Callable Threads
29 | 1.upto(threadSize) { index ->
30 | // Create a database connection within each Thread
31 | queryTasks << {
32 | def totalTime1 = 0
33 | def totalTime2 = 0
34 | def indexCreation = true;
35 | // Each thread runs a thread/loop specific template query X times
36 | 1.upto(queryLoopCount) { loopIndex ->
37 |
38 | try {
39 | Registry.setCurrentTenant(currentTenant);
40 | JaloSession.getCurrentSession().activate();
41 |
42 | start = new Date()
43 | totalTime2 = 0
44 | String AlterAddColumnAddresses = String.format(AlterRemoveColumnAddresses ,loopIndex);
45 | println(AlterAddColumnAddresses)
46 | jdbcTemplate.execute(AlterAddColumnAddresses)
47 | stop = new Date()
48 | totalTime2 += TimeCategory.minus(stop, start).toMilliseconds()
49 | println "Table Column Creation AlterAddColumnAddresses loop ${loopIndex} totalTime(ms) ${totalTime2}"
50 | // Thread.sleep(5000);
51 |
52 | } finally {
53 | JaloSession.getCurrentSession().close();
54 | Registry.unsetCurrentTenant();
55 | }
56 | }
57 | // Return average as the result of the Callable
58 | totalTime1 + totalTime2 / queryLoopCount
59 | } as Callable
60 | }
61 |
62 | executorService = Executors.newFixedThreadPool(threadPoolSize)
63 | println "Test started at ${new Date()}"
64 | results = executorService.invokeAll(queryTasks)
65 | totalAverage = 0
66 | results.eachWithIndex { it, index ->
67 | totalAverage += it.get()
68 | println "$index --> ${it.get()}"
69 | }
70 | println "Total Average --> ${totalAverage / threadSize}"
71 | println "Test finished at ${new Date()}"
72 | executorService.shutdown()
73 | executorService.awaitTermination(200, TimeUnit.SECONDS)
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_de.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_en.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 | type.MigrationCronJob.truncateEnabled.name=Truncate Enabled
8 | type.MigrationCronJob.truncateEnabled.description=
9 |
10 | type.MigrationCronJob.schemaAutotrigger.name=Schema Auto Trigger Enabled
11 | type.MigrationCronJob.schemaAutotrigger.description=
12 |
13 | type.MigrationCronJob.lastStartTime.name=Last Start time For Incremental Job
14 | type.MigrationCronJob.lastStartTime.description=
15 |
16 | type.MigrationCronJob.migrationItems.name=Migration Tables
17 | type.MigrationCronJob.migrationItems.description=
18 |
19 | type.FullMigrationCronJob.fullDatabaseMigration.name=Full Database Migration
20 | type.FullMigrationCronJob.fullDatabaseMigration.description=
21 |
22 | type.MigrationCronJob.maxParallelTableCopy.name=Parallel Tables
23 | type.MigrationCronJob.maxParallelTableCopy.description=Number of tables to be copied in parallel
24 |
25 | type.MigrationCronJob.maxReaderWorkers.name=Reader Workers
26 | type.MigrationCronJob.maxReaderWorkers.description=Number of reader workers to be used for each table
27 |
28 | type.MigrationCronJob.maxWriterWorkers.name=Writer Workers
29 | type.MigrationCronJob.maxWriterWorkers.description=Number of writer workers to be used for each table
30 |
31 | type.MigrationCronJob.batchSize.name=Batch Size
32 | type.MigrationCronJob.batchSize.description=Batch size used to query data
33 |
34 | type.FullMigrationCronJob.resumeMigration.name=Resume Migration
35 | type.FullMigrationCronJob.resumeMigration.description=
36 |
37 | type.FullMigrationCronJob.migrationId.name=Migration ID
38 | type.FullMigrationCronJob.migrationId.description=
39 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_es.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_fr.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_it.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_ja.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_ko.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_pt.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_ru.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/localization/commercedbsync-locales_zh.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsync/resources/sql/transformationFunctions/mssql-general.sql:
--------------------------------------------------------------------------------
1 | CREATE OR ALTER FUNCTION mask_str (@originialvalue nvarchar(255), @maskedvalue nvarchar(255))
2 | RETURNS nvarchar(255)
3 | AS
4 | BEGIN
5 | IF @originialvalue IS NULL
6 | RETURN NULL
7 |
8 | RETURN @maskedvalue
9 | END;
10 |
11 |
12 | CREATE OR ALTER FUNCTION mask_unique_str (@pk bigint, @suffix nvarchar(255))
13 | RETURNS nvarchar(255)
14 | AS
15 | BEGIN
16 | RETURN CONCAT(@pk, @suffix)
17 | END;
18 |
19 | CREATE OR ALTER FUNCTION mask_password (@uid nvarchar(255))
20 | RETURNS nvarchar(255)
21 | AS
22 | BEGIN
23 | IF @uid = 'admin'
24 | RETURN 'nimda'
25 |
26 | RETURN NULL
27 | END;
28 |
29 | CREATE OR ALTER FUNCTION mask_passwordencoding (@uid nvarchar(255))
30 | RETURNS nvarchar(255)
31 | AS
32 | BEGIN
33 | IF @uid = 'admin'
34 | RETURN 'plain'
35 |
36 | RETURN '*'
37 | END;
--------------------------------------------------------------------------------
/commercedbsync/resources/sql/transformationFunctions/mssql-typeinfotable.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS MIGRATIONTOOLKIT_TF_TYPEINFO;
2 |
3 | CREATE TABLE MIGRATIONTOOLKIT_TF_TYPEINFO (
4 | InternalCode NVARCHAR(255) NOT NULL,
5 | PK BIGINT NOT NULL
6 | PRIMARY KEY (InternalCode)
7 | );
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/CommercedbsyncStandalone.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync;
8 |
9 | import de.hybris.platform.core.Registry;
10 | import de.hybris.platform.jalo.JaloSession;
11 | import de.hybris.platform.util.RedeployUtilities;
12 | import de.hybris.platform.util.Utilities;
13 |
14 | /**
15 | * Demonstration of how to write a standalone application that can be run
16 | * directly from within eclipse or from the commandline.
17 | * To run this from commandline, just use the following command:
18 | *
19 | * java -jar bootstrap/bin/ybootstrap.jar "new CommercedbsyncStandalone().run();"
20 | *
From eclipse, just run as Java Application. Note that you maybe need
21 | * to add all other projects like ext-commerce, ext-pim to the Launch
22 | * configuration classpath.
23 | */
24 | public class CommercedbsyncStandalone {
25 | /**
26 | * Main class to be able to run it directly as a java program.
27 | *
28 | * @param args
29 | * the arguments from commandline
30 | */
31 | public static void main(final String[] args) {
32 | new CommercedbsyncStandalone().run();
33 | }
34 |
35 | public void run() {
36 | Registry.activateStandaloneMode();
37 | Registry.activateMasterTenant();
38 |
39 | final JaloSession jaloSession = JaloSession.getCurrentSession();
40 | System.out.println("Session ID: " + jaloSession.getSessionID()); // NOPMD
41 | System.out.println("User: " + jaloSession.getUser()); // NOPMD
42 | Utilities.printAppInfo();
43 |
44 | RedeployUtilities.shutdown();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/adapter/DataRepositoryAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.adapter;
8 |
9 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
10 | import com.sap.cx.boosters.commercedbsync.dataset.DataSet;
11 | import com.sap.cx.boosters.commercedbsync.MarkersQueryDefinition;
12 | import com.sap.cx.boosters.commercedbsync.OffsetQueryDefinition;
13 | import com.sap.cx.boosters.commercedbsync.SeekQueryDefinition;
14 | import java.util.List;
15 |
16 | public interface DataRepositoryAdapter {
17 | long getRowCount(MigrationContext context, String table) throws Exception;
18 |
19 | DataSet getAll(MigrationContext context, String table) throws Exception;
20 |
21 | DataSet getBatchWithoutIdentifier(MigrationContext context, OffsetQueryDefinition queryDefinition) throws Exception;
22 |
23 | DataSet getBatchOrderedByColumn(MigrationContext context, SeekQueryDefinition queryDefinition) throws Exception;
24 |
25 | DataSet getBatchMarkersOrderedByColumn(MigrationContext context, MarkersQueryDefinition queryDefinition)
26 | throws Exception;
27 |
28 | List getPartitions(String table) throws Exception;
29 | }
30 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/AnonymizeFunctions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer;
8 |
9 | import com.sap.cx.boosters.commercedbsync.anonymizer.functions.FunctionEvaluator;
10 | import com.sap.cx.boosters.commercedbsync.anonymizer.functions.impl.GuidFunctionEvaluator;
11 | import com.sap.cx.boosters.commercedbsync.anonymizer.functions.impl.RandomFunctionEvaluator;
12 |
13 | import java.util.List;
14 |
15 | public class AnonymizeFunctions {
16 | private static final List evaluators = List.of(new GuidFunctionEvaluator(),
17 | new RandomFunctionEvaluator());
18 |
19 | public String getForFunction(final String function) {
20 | final String thisFunction = function.replaceAll("[{}]", "").trim();
21 | return evaluators.stream().filter(evaluator1 -> evaluator1.canApply(thisFunction)).findAny()
22 | .map(evaluator -> evaluator.getForFunction(thisFunction)).orElse("");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/AnonymizerConfigurator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer;
8 |
9 | import com.fasterxml.jackson.databind.ObjectMapper;
10 | import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
11 | import com.sap.cx.boosters.commercedbsync.anonymizer.model.AnonymizerConfiguration;
12 | import org.springframework.core.io.ClassPathResource;
13 |
14 | import java.io.IOException;
15 |
16 | public class AnonymizerConfigurator {
17 | private final AnonymizerConfiguration anonymizerConfiguration;
18 |
19 | public AnonymizerConfigurator() {
20 | final ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
21 | try {
22 | anonymizerConfiguration = objectMapper.readValue(new ClassPathResource("./anonymizer/config.yml").getFile(),
23 | AnonymizerConfiguration.class);
24 | } catch (IOException e) {
25 | throw new RuntimeException("Error reading anonymizer configuration", e);
26 | }
27 | }
28 |
29 | public AnonymizerConfiguration getConfiguration() {
30 | return anonymizerConfiguration;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/TextEvaluator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer;
8 |
9 | import java.util.List;
10 | import java.util.stream.Collectors;
11 |
12 | public class TextEvaluator {
13 | private final AnonymizeFunctions anonymizeFunctions;
14 |
15 | public TextEvaluator() {
16 | this.anonymizeFunctions = new AnonymizeFunctions();
17 | }
18 |
19 | public TextEvaluator(AnonymizeFunctions anonymizeFunctions) {
20 | this.anonymizeFunctions = anonymizeFunctions;
21 | }
22 |
23 | public String getForTokens(final List tokens) {
24 | return tokens.stream().map(token -> isTokenFunction(token) ? anonymizeFunctions.getForFunction(token) : token)
25 | .collect(Collectors.joining());
26 | }
27 |
28 | private boolean isTokenFunction(String token) {
29 | return token.startsWith("{") && token.endsWith("}");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/TextTokenizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer;
8 |
9 | import com.sap.cx.boosters.commercedbsync.anonymizer.exception.ValidationException;
10 | import org.apache.commons.lang3.StringUtils;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 | import java.util.regex.Matcher;
15 | import java.util.regex.Pattern;
16 |
17 | public class TextTokenizer {
18 | private static final Pattern TOKEN_PATTERN = Pattern.compile("\\{[^}]*}|[^{}]+");
19 |
20 | public List tokenizeText(final String text) {
21 | checkForErrors(text);
22 | if (StringUtils.isBlank(text)) {
23 | return List.of();
24 | }
25 |
26 | if (!text.contains("{")) {
27 | return List.of(text.trim());
28 | }
29 |
30 | final Matcher matcher = TOKEN_PATTERN.matcher(text);
31 | final List tokens = new ArrayList<>();
32 | while (matcher.find()) {
33 | tokens.add(matcher.group());
34 | }
35 | return tokens;
36 | }
37 |
38 | private void checkForErrors(String text) {
39 | if (StringUtils.countMatches(text, "{") != StringUtils.countMatches(text, "}")
40 | || StringUtils.countMatches(text, "(") != StringUtils.countMatches(text, ")")) {
41 | throw new ValidationException(
42 | "Text " + text + " has invalid defined functions (not closing/opening functions)");
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/exception/ValidationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer.exception;
8 |
9 | public class ValidationException extends RuntimeException {
10 | public ValidationException(String text) {
11 | super(text);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/functions/FunctionEvaluator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer.functions;
8 |
9 | public interface FunctionEvaluator {
10 | boolean canApply(String function);
11 | String getForFunction(String function);
12 | }
13 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/functions/impl/GuidFunctionEvaluator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer.functions.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsync.anonymizer.functions.FunctionEvaluator;
10 |
11 | import java.util.UUID;
12 |
13 | public class GuidFunctionEvaluator implements FunctionEvaluator {
14 | @Override
15 | public boolean canApply(String function) {
16 | return function.equals("GUID");
17 | }
18 |
19 | @Override
20 | public String getForFunction(String function) {
21 | return UUID.randomUUID().toString();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/functions/impl/RandomAddressGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer.functions.impl;
8 |
9 | import org.apache.logging.log4j.LogManager;
10 | import org.apache.logging.log4j.Logger;
11 | import org.json.simple.JSONObject;
12 | import org.json.simple.parser.JSONParser;
13 | import org.json.simple.parser.ParseException;
14 |
15 | import java.io.IOException;
16 | import java.io.InputStream;
17 | import java.io.InputStreamReader;
18 | import java.security.SecureRandom;
19 | import java.util.Collections;
20 | import java.util.HashMap;
21 | import java.util.List;
22 | import java.util.Map;
23 |
24 | public class RandomAddressGenerator {
25 | private static final String CITY = "city";
26 | private static final String STREET = "street";
27 |
28 | private final JSONParser parser;
29 | private final Map> map;
30 | private final SecureRandom random;
31 | private static final Logger LOGGER = LogManager.getLogger(RandomAddressGenerator.class);
32 |
33 | public RandomAddressGenerator() {
34 | this.parser = new JSONParser();
35 | this.map = getAddressMap();
36 | this.random = new SecureRandom();
37 | }
38 |
39 | public String generateRandomCity() {
40 | final List city = map.get(CITY);
41 | return city.get(random.nextInt(city.size()));
42 | }
43 |
44 | public String generateRandomStreet() {
45 | final List streets = map.get(STREET);
46 | return streets.get(random.nextInt(streets.size()));
47 | }
48 |
49 | @SuppressWarnings("unchecked")
50 | private Map> getAddressMap() {
51 | Map> addressMap = new HashMap<>();
52 | try (final InputStream inputStream = RandomAddressGenerator.class.getClassLoader()
53 | .getResourceAsStream("./anonymizer/address.json")) {
54 | if (inputStream == null) {
55 | return Collections.emptyMap();
56 | }
57 | JSONObject jsonObject = (JSONObject) parser.parse(new InputStreamReader(inputStream));
58 | List cityList = (List) jsonObject.get(CITY);
59 | List streetList = (List) jsonObject.get(STREET);
60 | addressMap.put(CITY, cityList);
61 | addressMap.put(STREET, streetList);
62 | } catch (IOException e) {
63 | LOGGER.error("IOException: {}", e.getMessage());
64 | } catch (ParseException e) {
65 | LOGGER.error("ParseException: {} ", e.getMessage());
66 | }
67 | return addressMap;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/model/AnonymizerConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer.model;
8 |
9 | import org.apache.commons.collections4.CollectionUtils;
10 |
11 | import java.util.HashMap;
12 | import java.util.List;
13 | import java.util.Map;
14 |
15 | public class AnonymizerConfiguration {
16 | private List tables;
17 | private final Map tableMap = new HashMap<>();
18 |
19 | public List getTables() {
20 | return tables;
21 | }
22 |
23 | public void setTables(List tables) {
24 | CollectionUtils.emptyIfNull(tables).forEach(table -> tableMap.put(table.getName(), table));
25 | this.tables = tables;
26 | }
27 |
28 | public Table getTable(String tableName) {
29 | return tableMap.get(tableName);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/commercedbsync/src/com/sap/cx/boosters/commercedbsync/anonymizer/model/Column.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsync.anonymizer.model;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 | import java.util.Objects;
12 |
13 | public class Column {
14 | private String name;
15 | private Operation operation;
16 | private String text;
17 | private List
43 |
44 | ">Validate Connection
45 |
46 |
47 |
48 |
49 |
">
50 |
51 |
52 | Property |
53 | Value |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | ">Validate Connection
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/commercedbsynchac/hac/resources/jsp/migrationReports.jsp:
--------------------------------------------------------------------------------
1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
2 | <%@ taglib prefix="hac" uri="/WEB-INF/custom.tld" %>
3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
4 | <%--
5 | ~ Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
6 | ~ License: Apache-2.0
7 | ~
8 | --%>
9 |
10 |
11 |
12 | Copy Schema To SAP Commerce Cloud
13 | " type="text/css" media="screen, projection"/>
14 | " type="text/css"
15 | media="screen, projection"/>
16 | " type="text/css"
17 | media="screen, projection"/>
18 |
19 |
20 | ">
21 | ">
22 | ">
23 |
24 |
25 |
26 |
27 |
28 |
Migration Reports
29 |
" data-downloadUrl="
">
30 |
31 |
32 |
33 | Report id |
34 | Timestamp |
35 | Download |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/commercedbsynchac/hac/resources/static/audio/pling.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/commercedbsynchac/hac/resources/static/audio/pling.mp3
--------------------------------------------------------------------------------
/commercedbsynchac/hac/resources/static/css/dataCopy.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | .placeholder {
8 | color: dimgrey;
9 | }
10 |
11 | .status dd {
12 | font-size: 1rem;
13 | }
14 |
15 | .completed {
16 | color: green;
17 | }
18 |
19 | .failed {
20 | color: red;
21 | }
22 |
23 | #copySummary .total, #copySummary .failed, #copySummary .completed {
24 | font-weight: bold;
25 | }
26 |
27 | #copyStatus .completed {
28 | color: green;
29 | text-transform: uppercase;
30 | font-weight: bolder;
31 | }
32 |
33 | #copyStatus .failed {
34 | text-transform: uppercase;
35 | font-weight: bolder;
36 | }
37 |
38 | #copyLogContainer {
39 | height: 600px;
40 | overflow: auto;
41 | font-family: monospace;
42 | font-size: 1rem;
43 | background-color: #FAFAFF;
44 | padding: 1rem;
45 | margin: 1rem 1rem 1rem 0;
46 | border: 1px grey dashed;
47 | border-radius: 3px;
48 | }
49 |
50 | #copyLogContainer p + p {
51 | text-indent: 0;
52 | }
53 |
54 | #copyLogContainer .failed {
55 | font-weight: bold;
56 | font-size: 1.02em;
57 | }
58 |
59 | #copyLogContainer .completed {
60 | font-weight: bold;
61 | font-size: 1.02em;
62 | }
63 |
64 | button[disabled] {
65 | cursor: default;
66 | opacity: 0.5;
67 | }
68 |
69 | button.control-button {
70 | float:left;
71 | }
72 |
--------------------------------------------------------------------------------
/commercedbsynchac/hac/resources/static/css/database.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | .nobox {
8 | border: 0;
9 | width: 100%;
10 | }
11 |
12 | .textarea {
13 | height: auto;
14 | }
15 |
16 | #spinner {
17 | margin: 100px auto;
18 | opacity: 0.5;
19 | }
20 |
21 | .spinner {
22 | opacity: 0.5;
23 | }
24 |
25 | #spinnerWrapper,#loggingSpinnerWrapper {
26 | text-align: center;
27 | }
28 |
29 | #tableWrapper {
30 | display: none;
31 | padding-bottom: 2em;
32 | }
33 |
34 | #tableCopySchemaWrapper {
35 | display: none;
36 | padding-bottom: 2em;
37 | }
38 |
39 | #tableCopyDataWrapper {
40 | display: none;
41 | padding-bottom: 2em;
42 | }
43 |
44 | #loggingContentWrapper,#downloadLog,#slider-size,#downloadForm,#analyzeResults {
45 | display: none;
46 | }
47 |
48 | #loggingContentWrapper {
49 | margin-bottom: 3em;
50 | }
51 |
52 | #dataSourceInfos legend {
53 | color: #005BBC;
54 | font-size: 16px;
55 | }
56 |
57 | .floatLeft {
58 | float: left;
59 | }
60 | #copyStatusContainer {
61 |
62 | }
63 |
64 | #copyStatusContainer dd {
65 | font-size: 1.2em;
66 | }
67 |
68 | .progress {
69 | font-weight: bolder;
70 | }
71 |
--------------------------------------------------------------------------------
/commercedbsynchac/hac/resources/static/css/schemaCopy.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | .CodeMirror {
8 | height: 100%;
9 | }
10 |
11 | .CodeMirror-line-numbers {
12 | background-color: lightgray;
13 | border-right: 1px solid #eee;
14 | min-width: 2em;
15 | height: 100%;
16 | color: gray;
17 | text-align: right;
18 | padding: .4em .2em .4em .4em;
19 | font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
20 | }
21 |
22 | .border {
23 | background-color: #FAFAFF;
24 | border: 1px solid darkgray;
25 | }
26 |
27 | .textarea-container {
28 | position: relative;
29 | border: 1px dashed #666 !important;
30 | min-height: 300px;
31 | }
32 |
33 | textarea {
34 | width: 100%;
35 | }
36 |
37 | #spinnerWrapper {
38 | display: none;
39 | margin-top: 100px;
40 | width: 100%;
41 | position: absolute;
42 | z-index: 1000;
43 | text-align: center;
44 | }
45 |
46 | textarea {
47 | width: 100%;
48 | }
49 |
50 | button[disabled] {
51 | cursor: default;
52 | opacity: 0.5;
53 | }
54 |
55 | button.control-button {
56 | float:left;
57 | }
58 |
59 | .placeholder {
60 | color: dimgrey;
61 | }
62 |
63 | .status dd {
64 | font-size: 1rem;
65 | }
66 |
67 | .completed {
68 | color: green;
69 | }
70 |
71 | .failed {
72 | color: red;
73 | }
74 |
75 | #schemaPreviewSummary .total, #schemaPreviewSummary .failed, #schemaPreviewSummary .completed {
76 | font-weight: bold;
77 | }
78 |
79 | #schemaPreviewStatus .completed {
80 | color: green;
81 | text-transform: uppercase;
82 | font-weight: bolder;
83 | }
84 |
85 | #schemaPreviewStatus .failed {
86 | text-transform: uppercase;
87 | font-weight: bolder;
88 | }
--------------------------------------------------------------------------------
/commercedbsynchac/hac/resources/static/js/customStatistics.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | $(function() {
8 | $('#statistics').dataTable({
9 | "iDisplayLength" : 50
10 | });
11 | })
--------------------------------------------------------------------------------
/commercedbsynchac/hac/resources/static/js/migrationReports.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | var reportsTable;
8 |
9 | $(document).ready(function () {
10 | reportsTable = $('#reportsTable').dataTable({
11 | "bStateSave": true,
12 | "bAutoWidth": false,
13 | "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'all']]
14 | });
15 | loadMigrationReports();
16 | });
17 |
18 | function loadMigrationReports() {
19 | $('#logsWrapper').fadeOut();
20 | reportsTable.fnClearTable();
21 | const token = $("meta[name='_csrf']").attr("content");
22 | const url = $('#reportsWrapper').attr('data-url');
23 | $.ajax({
24 | url: url,
25 | type: 'GET',
26 | headers: {
27 | 'Accept': 'application/json',
28 | 'X-CSRF-TOKEN': token
29 | },
30 | success: function (data) {
31 | if (data.length > 0) {
32 | data.forEach((report) => {
33 | let strippedMigrationId = report.reportId;
34 | reportsTable.fnAddData([
35 | strippedMigrationId,
36 | report.modifiedTimestamp,
37 | ''
38 | ])
39 | });
40 | }
41 | },
42 | error: hac.global.err
43 | });
44 | }
45 |
46 | function downloadReport(migrationId) {
47 | const token = $("meta[name='_csrf']").attr("content");
48 | const url = $('#reportsWrapper').attr('data-downloadUrl') + '?migrationId=' + migrationId;
49 | $.ajax({
50 | url: url,
51 | type: 'GET',
52 | headers: {
53 | 'X-CSRF-TOKEN': token
54 | },
55 | success: function (data) {
56 | debug.log(data);
57 | var blob = new Blob([data], {type: "text/plain"});
58 | var link = document.createElement("a");
59 | link.href = window.URL.createObjectURL(blob);
60 | link.download = migrationId;
61 | link.click();
62 | },
63 | error: hac.global.err
64 | });
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/commercedbsynchac/hac/testsrc/de/hybris/platform/hac/controller/CommercemigrationhacControllerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package de.hybris.platform.hac.controller;
8 |
9 | import de.hybris.bootstrap.annotations.IntegrationTest;
10 | import org.junit.After;
11 | import org.junit.Before;
12 | import org.junit.Test;
13 |
14 | /**
15 | * Test for {@link CommercemigrationhacController}.
16 | */
17 | @IntegrationTest
18 | public class CommercemigrationhacControllerTest {
19 |
20 | /**
21 | * Code under test.
22 | */
23 | protected CommercemigrationhacController cut;
24 |
25 | /**
26 | * Set up the code under test.
27 | */
28 | @Before
29 | public void setup() {
30 | cut = new CommercemigrationhacController();
31 | }
32 |
33 | /**
34 | * Clean up the code under test.
35 | */
36 | @After
37 | public void teardown() {
38 | cut = null;
39 | }
40 |
41 | @Test
42 | public void testSayHello() {
43 | /*
44 | * final String helloText = cut.sayHello();
45 | *
46 | * assertNotNull(helloText); assertNotEquals(0, helloText.length());
47 | */
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/commercedbsynchac/project.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 | commercedbsynchac.key=value
7 | # Specifies the location of the spring context file putted automatically to the global platform application context.
8 | commercedbsynchac.application-context=commercedbsynchac-spring.xml
9 | migration.from.hac.enabled=true
10 | configuration.view.blacklist.migration=${migration.properties.masked}
11 |
12 | ## fix for Config Panel rendering error due to: "EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed" at static/js/configPanel.js:169
13 | hac.xss.filter.header.Content-Security-Policy=default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'
--------------------------------------------------------------------------------
/commercedbsynchac/resources/com/sap/cx/boosters/commercedbsynchac/dummy.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/commercedbsynchac/resources/com/sap/cx/boosters/commercedbsynchac/dummy.txt
--------------------------------------------------------------------------------
/commercedbsynchac/resources/commercedbsynchac-items.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
13 |
14 |
15 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/commercedbsynchac-tab-config.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "basePath": "/commercedbsynchac",
4 | "mainTabLabel": "Migration",
5 | "subTabs": [
6 | {
7 | "path": "/migrationDataSource",
8 | "label": "Data Sources",
9 | "skipPrefix": false
10 | },
11 | {
12 | "path": "/migrationSchema",
13 | "label": "Schema Migration",
14 | "skipPrefix": false
15 | },
16 | {
17 | "path": "/migrationData",
18 | "label": "Data Migration",
19 | "skipPrefix": false
20 | },
21 | {
22 | "path": "/migrationReports",
23 | "label": "Reports",
24 | "skipPrefix": false
25 | }
26 | ]
27 | }
28 | ]
29 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/commercedbsynchac-without-migration-tab-config.json:
--------------------------------------------------------------------------------
1 | [
2 | ]
3 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_de.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_en.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_es.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_fr.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_it.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_ja.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_ko.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_pt.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_ru.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/resources/localization/i2ihac-locales_zh.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | # License: Apache-2.0
4 | #
5 | #
6 |
7 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/CommercedbsynchacStandalone.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac;
8 |
9 | import de.hybris.platform.core.Registry;
10 | import de.hybris.platform.jalo.JaloSession;
11 | import de.hybris.platform.util.RedeployUtilities;
12 | import de.hybris.platform.util.Utilities;
13 |
14 | /**
15 | * Demonstration of how to write a standalone application that can be run
16 | * directly from within eclipse or from the commandline.
17 | * To run this from commandline, just use the following command:
18 | *
19 | * java -jar bootstrap/bin/ybootstrap.jar "new commercedbsynchac.CommercedbsynchacStandalone().run();"
20 | *
From eclipse, just run as Java Application. Note that you maybe need
21 | * to add all other projects like ext-commerce, ext-pim to the Launch
22 | * configuration classpath.
23 | */
24 | public class CommercedbsynchacStandalone {
25 | /**
26 | * Main class to be able to run it directly as a java program.
27 | *
28 | * @param args
29 | * the arguments from commandline
30 | */
31 | public static void main(final String[] args) {
32 | new CommercedbsynchacStandalone().run();
33 | }
34 |
35 | public void run() {
36 | Registry.activateStandaloneMode();
37 | Registry.activateMasterTenant();
38 |
39 | final JaloSession jaloSession = JaloSession.getCurrentSession();
40 | System.out.println("Session ID: " + jaloSession.getSessionID()); // NOPMD
41 | System.out.println("User: " + jaloSession.getUser()); // NOPMD
42 | Utilities.printAppInfo();
43 |
44 | RedeployUtilities.shutdown();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/constants/YhacextConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.constants;
8 |
9 | /**
10 | * Global class for all Commercedbsynchac constants. You can add global
11 | * constants for your extension into this class.
12 | */
13 | public final class YhacextConstants extends GeneratedYhacextConstants {
14 | public static final String EXTENSIONNAME = "commercedbsynchac";
15 |
16 | private YhacextConstants() {
17 | // empty to avoid instantiating this constant class
18 | }
19 |
20 | // implement here constants used by this extension
21 | }
22 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/MetricService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric;
8 |
9 | import de.hybris.platform.commercedbsynchac.data.MetricData;
10 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
11 |
12 | import java.util.List;
13 |
14 | public interface MetricService {
15 | List getMetrics(MigrationContext context);
16 | }
17 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/impl/DefaultMetricService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.impl;
8 |
9 | import de.hybris.platform.commercedbsynchac.data.MetricData;
10 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
11 | import com.sap.cx.boosters.commercedbsynchac.metric.MetricService;
12 | import com.sap.cx.boosters.commercedbsynchac.metric.populator.MetricPopulator;
13 | import org.slf4j.Logger;
14 | import org.slf4j.LoggerFactory;
15 |
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | public class DefaultMetricService implements MetricService {
20 |
21 | private static final Logger LOG = LoggerFactory.getLogger(DefaultMetricService.class);
22 |
23 | private final List populators;
24 |
25 | public DefaultMetricService(List populators) {
26 | this.populators = populators;
27 | }
28 |
29 | @Override
30 | public List getMetrics(MigrationContext context) {
31 | List dataList = new ArrayList<>();
32 | for (MetricPopulator populator : populators) {
33 | if (populator.canHandle(context)) {
34 | try {
35 | dataList.add(populator.populate(context));
36 | } catch (Exception e) {
37 | LOG.error("Error while populating metric. Populator: " + e.getMessage());
38 | }
39 | }
40 | }
41 | return dataList;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/MetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator;
8 |
9 | import de.hybris.platform.commercedbsynchac.data.MetricData;
10 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
11 |
12 | public interface MetricPopulator {
13 | String PRIMARY_STANDARD_COLOR = "#92cae4";
14 | String PRIMARY_CRITICAL_COLOR = "#de5d70";
15 | String SECONDARY_STANDARD_COLOR = "#d5edf8";
16 | String SECONDARY_CRITICAL_COLOR = "#e8acb5";
17 |
18 | MetricData populate(MigrationContext context) throws Exception;
19 |
20 | default void populateColors(MetricData data) {
21 | data.setPrimaryValueStandardColor(PRIMARY_STANDARD_COLOR);
22 | data.setPrimaryValueCriticalColor(PRIMARY_CRITICAL_COLOR);
23 | data.setSecondaryValueStandardColor(SECONDARY_STANDARD_COLOR);
24 | data.setSecondaryValueCriticalColor(SECONDARY_CRITICAL_COLOR);
25 | }
26 |
27 | default boolean canHandle(MigrationContext context) {
28 | return true;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/CpuMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsynchac.metric.populator.MetricPopulator;
10 | import de.hybris.platform.commercedbsynchac.data.MetricData;
11 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
12 | import org.springframework.beans.factory.annotation.Value;
13 |
14 | import java.lang.management.OperatingSystemMXBean;
15 |
16 | public class CpuMetricPopulator implements MetricPopulator {
17 |
18 | @Value("#{T(java.lang.management.ManagementFactory).getOperatingSystemMXBean()}")
19 | private OperatingSystemMXBean operatingSystemMXBean;
20 |
21 | @Override
22 | public MetricData populate(MigrationContext context) throws Exception {
23 | MetricData data = new MetricData();
24 | double systemLoadAverage = operatingSystemMXBean.getSystemLoadAverage();
25 | int availableProcessors = operatingSystemMXBean.getAvailableProcessors();
26 | int loadAverage = (int) (systemLoadAverage * 100 / availableProcessors);
27 | if (loadAverage > 100) {
28 | loadAverage = 100;
29 | }
30 | data.setMetricId("cpu");
31 | data.setName("CPU");
32 | data.setDescription("The system load in percent");
33 | data.setPrimaryValue((double) loadAverage);
34 | data.setPrimaryValueLabel("Load");
35 | data.setPrimaryValueUnit("%");
36 | data.setPrimaryValueThreshold(90d);
37 | data.setSecondaryValue((double) 100 - loadAverage);
38 | data.setSecondaryValueLabel("Idle");
39 | data.setSecondaryValueUnit("%");
40 | data.setSecondaryValueThreshold(0d);
41 | populateColors(data);
42 | return data;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/DTUMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsync.repository.DataRepository;
10 | import com.sap.cx.boosters.commercedbsync.repository.impl.AzureDataRepository;
11 | import com.sap.cx.boosters.commercedbsynchac.metric.populator.MetricPopulator;
12 | import de.hybris.platform.commercedbsynchac.data.MetricData;
13 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
14 |
15 | import java.util.Optional;
16 |
17 | public class DTUMetricPopulator implements MetricPopulator {
18 | @Override
19 | public MetricData populate(MigrationContext context) throws Exception {
20 | int primaryValue = getAzureDataRepository(context).map(DataRepository::getDatabaseUtilization).orElse(-1f)
21 | .intValue();
22 | if (primaryValue > 100) {
23 | primaryValue = 100;
24 | }
25 | int secondaryValue = 100 - primaryValue;
26 | if (primaryValue < 0) {
27 | primaryValue = -1;
28 | secondaryValue = -1;
29 | }
30 |
31 | MetricData data = new MetricData();
32 |
33 | data.setMetricId("dtu");
34 | data.setName("DTU");
35 | data.setDescription("The current DTU utilization of the azure database");
36 | data.setPrimaryValue((double) primaryValue);
37 | data.setPrimaryValueLabel("Used");
38 | data.setPrimaryValueUnit("%");
39 | data.setPrimaryValueThreshold(90d);
40 | data.setSecondaryValue((double) secondaryValue);
41 | data.setSecondaryValueLabel("Idle");
42 | data.setSecondaryValueUnit("%");
43 | data.setSecondaryValueThreshold(0d);
44 | populateColors(data);
45 |
46 | return data;
47 | }
48 |
49 | private Optional getAzureDataRepository(MigrationContext context) {
50 | if (context.getDataTargetRepository() instanceof AzureDataRepository) {
51 | return Optional.of(context.getDataTargetRepository());
52 | } else if (context.getDataSourceRepository() instanceof AzureDataRepository) {
53 | return Optional.of(context.getDataSourceRepository());
54 | }
55 |
56 | return Optional.empty();
57 | }
58 |
59 | @Override
60 | public boolean canHandle(MigrationContext context) {
61 | return getAzureDataRepository(context).isPresent();
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/HikariConnectionMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsynchac.metric.populator.MetricPopulator;
10 | import com.zaxxer.hikari.HikariDataSource;
11 | import de.hybris.platform.commercedbsynchac.data.MetricData;
12 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
13 |
14 | import javax.sql.DataSource;
15 |
16 | public abstract class HikariConnectionMetricPopulator implements MetricPopulator {
17 |
18 | @Override
19 | public MetricData populate(MigrationContext context) throws Exception {
20 | if (!(getDataSource(context) instanceof HikariDataSource)) {
21 | throw new RuntimeException("Populator cannot be used for non-hikari datasources");
22 | }
23 | MetricData data = new MetricData();
24 | HikariDataSource hikariDS = (HikariDataSource) getDataSource(context);
25 | double activeConnections = hikariDS.getHikariPoolMXBean().getActiveConnections();
26 | double maxConnections = hikariDS.getHikariConfigMXBean().getMaximumPoolSize();
27 | data.setMetricId(getMetricId(context));
28 | data.setName(getName(context));
29 | data.setDescription("The proportion of active and idle hikari connections");
30 | data.setPrimaryValue(activeConnections);
31 | data.setPrimaryValueLabel("Active");
32 | data.setPrimaryValueUnit("#");
33 | data.setPrimaryValueThreshold(maxConnections);
34 | data.setSecondaryValue(maxConnections - activeConnections);
35 | data.setSecondaryValueLabel("Idle");
36 | data.setSecondaryValueUnit("#");
37 | data.setSecondaryValueThreshold(0d);
38 | populateColors(data);
39 | return data;
40 | }
41 |
42 | protected abstract String getMetricId(MigrationContext context);
43 |
44 | protected abstract String getName(MigrationContext context);
45 |
46 | protected abstract DataSource getDataSource(MigrationContext context);
47 | }
48 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/HikariSourceConnectionMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
10 |
11 | import javax.sql.DataSource;
12 |
13 | public class HikariSourceConnectionMetricPopulator extends HikariConnectionMetricPopulator {
14 |
15 | @Override
16 | protected String getMetricId(MigrationContext context) {
17 | return "hikari-source-pool";
18 | }
19 |
20 | @Override
21 | protected String getName(MigrationContext context) {
22 | return "Source DB Pool";
23 | }
24 |
25 | @Override
26 | protected DataSource getDataSource(MigrationContext context) {
27 | return context.getDataSourceRepository().getDataSource();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/HikariTargetConnectionMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
10 |
11 | import javax.sql.DataSource;
12 |
13 | public class HikariTargetConnectionMetricPopulator extends HikariConnectionMetricPopulator {
14 |
15 | @Override
16 | protected String getMetricId(MigrationContext context) {
17 | return "hikari-target-pool";
18 | }
19 |
20 | @Override
21 | protected String getName(MigrationContext context) {
22 | return "Target DB Pool";
23 | }
24 |
25 | @Override
26 | protected DataSource getDataSource(MigrationContext context) {
27 | return context.getDataTargetRepository().getDataSource();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/IOMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import de.hybris.platform.commercedbsynchac.data.MetricData;
10 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
11 | import com.sap.cx.boosters.commercedbsync.performance.PerformanceCategory;
12 | import com.sap.cx.boosters.commercedbsync.performance.PerformanceProfiler;
13 | import com.sap.cx.boosters.commercedbsync.performance.PerformanceUnit;
14 | import com.sap.cx.boosters.commercedbsynchac.metric.populator.MetricPopulator;
15 |
16 | public class IOMetricPopulator implements MetricPopulator {
17 |
18 | private final PerformanceProfiler performanceProfiler;
19 |
20 | public IOMetricPopulator(PerformanceProfiler performanceProfiler) {
21 | this.performanceProfiler = performanceProfiler;
22 | }
23 |
24 | @Override
25 | public MetricData populate(MigrationContext context) throws Exception {
26 | MetricData data = new MetricData();
27 | int avgRowReading = (int) performanceProfiler.getAverageByCategoryAndUnit(PerformanceCategory.DB_READ,
28 | PerformanceUnit.ROWS);
29 | int avgRowWriting = (int) performanceProfiler.getAverageByCategoryAndUnit(PerformanceCategory.DB_WRITE,
30 | PerformanceUnit.ROWS);
31 | int totalIO = avgRowReading + avgRowWriting;
32 | if (avgRowReading < 1 && avgRowWriting < 1) {
33 | avgRowReading = -1;
34 | avgRowWriting = -1;
35 | }
36 | data.setMetricId("db-io");
37 | data.setName("Database I/O");
38 | data.setDescription("The proportion of items read from source compared to items written to target");
39 | data.setPrimaryValue((double) avgRowReading);
40 | data.setPrimaryValueLabel("Read");
41 | data.setPrimaryValueUnit("rows/s");
42 | data.setPrimaryValueThreshold(totalIO * 0.75);
43 | data.setSecondaryValue((double) avgRowWriting);
44 | data.setSecondaryValueLabel("Write");
45 | data.setSecondaryValueUnit("rows/s");
46 | data.setSecondaryValueThreshold(totalIO * 0.75);
47 | populateColors(data);
48 | return data;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/MemoryMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsynchac.metric.populator.MetricPopulator;
10 | import de.hybris.platform.commercedbsynchac.data.MetricData;
11 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
12 |
13 | public class MemoryMetricPopulator implements MetricPopulator {
14 | @Override
15 | public MetricData populate(MigrationContext context) throws Exception {
16 | MetricData data = new MetricData();
17 | Runtime runtime = Runtime.getRuntime();
18 | double freeMemory = runtime.freeMemory() / 1048576L;
19 | double totalMemory = runtime.totalMemory() / 1048576L;
20 | double usedMemory = totalMemory - freeMemory;
21 | data.setMetricId("memory");
22 | data.setName("Memory");
23 | data.setDescription("The proportion of free and used memory");
24 | data.setPrimaryValue(usedMemory);
25 | data.setPrimaryValueLabel("Used");
26 | data.setPrimaryValueUnit("MB");
27 | data.setPrimaryValueThreshold(totalMemory * 0.9);
28 | data.setSecondaryValue(freeMemory);
29 | data.setSecondaryValueLabel("Free");
30 | data.setSecondaryValueUnit("MB");
31 | data.setSecondaryValueThreshold(0d);
32 | populateColors(data);
33 | return data;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/TaskExecutorMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsynchac.metric.populator.MetricPopulator;
10 | import de.hybris.platform.commercedbsynchac.data.MetricData;
11 | import org.apache.commons.lang.StringUtils;
12 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
13 | import org.springframework.core.task.AsyncTaskExecutor;
14 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
15 |
16 | public class TaskExecutorMetricPopulator implements MetricPopulator {
17 |
18 | private final AsyncTaskExecutor executor;
19 | private final String name;
20 |
21 | public TaskExecutorMetricPopulator(AsyncTaskExecutor executor, String name) {
22 | this.executor = executor;
23 | this.name = name;
24 | }
25 |
26 | @Override
27 | public MetricData populate(MigrationContext context) throws Exception {
28 | if (!(executor instanceof ThreadPoolTaskExecutor)) {
29 | throw new RuntimeException("Populator can only be used for " + ThreadPoolTaskExecutor.class.getName());
30 | }
31 | ThreadPoolTaskExecutor taskExecutor = (ThreadPoolTaskExecutor) executor;
32 | MetricData data = new MetricData();
33 | int activeCount = taskExecutor.getActiveCount();
34 | int maxPoolSize = taskExecutor.getMaxPoolSize();
35 | data.setMetricId(name + "-executor");
36 | data.setName(StringUtils.capitalize(name) + " Tasks");
37 | data.setDescription("The tasks running in parallel in the task executor");
38 | data.setPrimaryValue((double) activeCount);
39 | data.setPrimaryValueLabel("Running");
40 | data.setPrimaryValueUnit("#");
41 | data.setPrimaryValueThreshold(-1d);
42 | data.setSecondaryValue((double) maxPoolSize - activeCount);
43 | data.setSecondaryValueLabel("Free");
44 | data.setSecondaryValueUnit("#");
45 | data.setSecondaryValueThreshold(-1d);
46 | populateColors(data);
47 | return data;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/commercedbsynchac/src/com/sap/cx/boosters/commercedbsynchac/metric/populator/impl/ThreadPoolMetricPopulator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright: 2023 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3 | * License: Apache-2.0
4 | *
5 | */
6 |
7 | package com.sap.cx.boosters.commercedbsynchac.metric.populator.impl;
8 |
9 | import com.sap.cx.boosters.commercedbsync.concurrent.DataThreadPoolFactory;
10 | import com.sap.cx.boosters.commercedbsync.context.MigrationContext;
11 | import com.sap.cx.boosters.commercedbsynchac.metric.populator.MetricPopulator;
12 | import de.hybris.platform.commercedbsynchac.data.MetricData;
13 | import org.apache.commons.lang.StringUtils;
14 |
15 | public class ThreadPoolMetricPopulator implements MetricPopulator {
16 |
17 | private final DataThreadPoolFactory factory;
18 | private final String name;
19 |
20 | public ThreadPoolMetricPopulator(DataThreadPoolFactory factory, String name) {
21 | this.factory = factory;
22 | this.name = name;
23 | }
24 |
25 | @Override
26 | public MetricData populate(MigrationContext context) throws Exception {
27 | MetricData data = new MetricData();
28 | double activeCount = factory.getMonitor().getActiveCount();
29 | double maxPoolSize = factory.getMonitor().getMaxPoolSize();
30 | if (maxPoolSize < 1) {
31 | // make primary and secondary value negative to indicate inactive widget
32 | activeCount = -1;
33 | maxPoolSize = -2;
34 | }
35 | data.setMetricId(name + "-executor");
36 | data.setName(StringUtils.capitalize(name) + " Tasks");
37 | data.setDescription("The workers running in parallel in the task executor");
38 | data.setPrimaryValue(activeCount);
39 | data.setPrimaryValueLabel("Running");
40 | data.setPrimaryValueUnit("#");
41 | data.setPrimaryValueThreshold(-1d);
42 | data.setSecondaryValue(maxPoolSize - activeCount);
43 | data.setSecondaryValueLabel("Free");
44 | data.setSecondaryValueUnit("#");
45 | data.setSecondaryValueThreshold(-1d);
46 | populateColors(data);
47 | return data;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/docs/anonymizer/README.md:
--------------------------------------------------------------------------------
1 | ## Anonymizer
2 |
3 | The config.yaml file holds the tables and columns used for anonymization along with the new values.
4 | You can utilize the tool by using the pre-set config file found in the git repository, or by creating your own.
5 | The location where it is found is commercedbsync/resources/anonymizer/config.yml.
6 | During the migration process, if the table and the column that is handled is part of the anonymizer configuration and the value is not part of the exclude list, then the configuration defined config.yml is going to be applied.
7 |
8 | ````
9 | tables:
10 | - name: addresses -> name of the table that will be included in the process
11 | columns:
12 | - name: p_cellphone -> column name
13 | operation: REPLACE -> operation that will be performed
14 | text: "{RANDOM(number,10)}" -> the new value
15 | exclude: ["some_string"] -> values to be excluded (i.e. not changed)
16 | excludeRow: ["some_string"] -> optional, if value is matched for configured column anonymization for entire row is skipped and row is copied unaltered
17 | ````
18 |
19 | The 'exclude' clause is optional. You can use it if you wish to exclude certain values from anonymization. For instance, if there are test users for which you don't want to alter the values.
20 | `name`, `operation` and `text` are mandatory.
21 |
22 | Operations that can be performed on the data:
23 | - REPLACE -> will replace the entire value
24 | - APPEND -> will append a text to the current value
25 | - DELETE -> will delete the value (set it to null)
26 |
27 | Functions available:
28 | - GUID -> generate a guid
29 | - RANDOM -> generate a random value
30 |
31 | The RANDOM function can have two parameters:
32 | 1. the type of random value: "number", "string", "city", "street"
33 | 2. length of the random value (this parameter is needed only for "number" and "string" types)
34 |
35 |
36 | Text that can be used to replace/append to the value:
37 | - simple string
38 | text: "My description"
39 |
40 |
41 | - random number with n digits "{RANDOM(number,n)}"
42 | text: "{RANDOM(number,10)}"
43 |
44 |
45 | - random string with n characters "{RANDOM(string,n)}"
46 | text: "{RANDOM(string,3)}"
47 |
48 |
49 | - GUID value
50 | text: "{GUID}"
51 |
52 |
53 | - any combination
54 | text: "{GUID}-{RANDOM(string,3)}-SOME_TEXT"
55 |
56 |
57 | The absence of text will result in a blank field. If the configuration file is not correct an error will be displayed in the console.
58 |
59 |
--------------------------------------------------------------------------------
/docs/commercedbsync/after_save_listener_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/commercedbsync/after_save_listener_1.png
--------------------------------------------------------------------------------
/docs/commercedbsync/after_save_listener_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/commercedbsync/after_save_listener_2.png
--------------------------------------------------------------------------------
/docs/performance/performance_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/performance/performance_architecture.png
--------------------------------------------------------------------------------
/docs/performance/template_for_scheduled_operational_activity.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/performance/template_for_scheduled_operational_activity.docx
--------------------------------------------------------------------------------
/docs/support/support_groovy_preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/support/support_groovy_preview.png
--------------------------------------------------------------------------------
/docs/user/commerce-db-sync-demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/commerce-db-sync-demo.png
--------------------------------------------------------------------------------
/docs/user/data_migration_architecture.drawio:
--------------------------------------------------------------------------------
1 | 7Vxdc5s4FP01eYwHEGD8GMdJOrtpm1nvZtunjAwyZgPIFXJj99evhCUbkHDMxuBklnTawkV8nXt079GVyAW4TtZ3BC4Xn3GA4gvLCNYXYHJhWaZtuew/btlsLZ7lbA0hiQLRaG+YRr+QMBrCuooClJUaUoxjGi3LRh+nKfJpyQYJwS/lZnMcl++6hCFSDFMfxqr17yigC/kWw739E4rChbyz6Y62RxIoG4s3yRYwwC8FE7i5ANcEY7rdStbXKObgSVy2593WHN09GEEpPeaEr/i3z9/h1ebHt98z9GPy5a/lp5tLcZWfMF6JFxYPSzcSAXYVBjbbGbM3WHKjH+MVu+j4ZRFRNF1CnxtfmP+ZbUGTmO2ZbHMexfE1jjHJrwMCiLy5zy9DCX5GhSOu76HZnB1RX0k+HyIUrQsm8Yp3CCeIkg1rIo46QwG34Jstdl/2znOlbVFwnDsSRigIE+4uvceUbQhYm0B8BMYhwSuOXsbAjNLwHs35YxmNINn1ATiTlzUOQjWsQAVMFSsANFiZZmtYWQpW0z/vFLgYWmmAAgHRKzSEcRSmbDvOQa2ycu7wP1pW5j/8DJzSgn37I+xT8VD8RjGcofgBZxGNML+hz1yG2Elj7qqIhZT7SoMkCgJ+9q7BlXhUivk7hDHMMvGO2TOi/kLuyEhiKJRxtJQ5zMvX+5YgiAzdZ+QHUPhxjZMEEeZ7znY35i6eEbYV8q2r5TJmwOZ4V0mUu+t4+ijelM6aYUpxou28wjIWLSY2s0UJSxlX1Yvm1kctDfJDbC9KQoaZz4IxJJRt3SFInkzLW7O/g2UaVhhpnJ4G4iiwy2FDZYWnIUV78dU+xIkJ6w7GdJP6vf9P5X/TGb4vAjivJ9iddCGYx9SG0sUwHAPNdUnCMMzJ+FpNEvP8p5VgLI9a5eztql6wPNULoDUvuIoXJuNaPwSQwoxigl73RWsIWm4ZQUcjFXVKsTUEh8cKxe40oa3Rz13nfE+B5eGPSa8JW9GEwxoi1WvC8/Nj1GvCU2uC42lQowlVVnQqCSQre03Ykf8VTXhuAhxRdHn3mrC5F6qaUPVCp5pQgn42TdgYwaomtFVV3akmtNSCR+eacFdDFZiYI03OH3oDR8XFNtoCBjQY9KE1z/sBXs1EFATjRmqxpK1qFVhFUwYwW+Q3MHcxQk4ggOMZvPP/0Qy+rKTiS41C28Xdkq+s1nw1UlyDghDJrIQJXeAQpzC+2VsLHuIA7tvcY54Bc+M/iNKNmDKCK4rLXmPAks034Zx85zvfGQBX7k/WxaOTTXHvAZGIvT1PxKqrGzovwyvio0MNhcsoJCE6dEUgBtkcvoNkIChmCvdneRJL59j81CtC4KbQYImjlGaFKz9wQ31EcJwiR15tbo5AhVPbB9gzbPcmb4icallwcvOoELEfNp5g2NggShWjkNXpONFSM0Y/TnzbOKF5dqokJ82MY7fDBLW21KlAbQ6gKYVP/ZxcpwIVqGXfx4cvCoR4ReMoZTFRrtIwihLJOBDZdl1EH9mULlbWbbnfknXIF6cM4EsGBj+X6ZMQwPkNqlH81vEcwDsbOyeI0D5epzgt6xIlftZH2e7k324SX/awoasQxNFrda8lisjs/5Hln+ov81htN/pY2s6urgrxSmKtafuWxJ1a8+3Xibxd3DWfQqsoe6AbbHYr82Qxq5d5/0XmNWfAsFL5P3flF6iV37YkXfOVM8OyeAPnLi8CtUDbz62+gzhqa9YidB1H+6V254yjtmbuptM4aqv19P+RagcfrCJre+UA4hiHS7LV9p2odqApyb7X1GwPz52a1dVgX1lkNR4ISqIMKbAV4KjLfzUVkzw6j6H/HObdVzdjXR+IS5UNS5fXDcMzbpU0Wqr9VAs1Ec6Gg8jHaTZYMDiVqkttpq6VBCdgSHWga2pytGR4aXbdkdWW03NELV9e/VoRnqCnq1nmk2ipzceHCaJhkuJ3hURlt4tambJkYnxza+kKc/yht/8+ZcUHP7rcVp5t7YoSrlulhBo0HE3QAG0RwrbfnLRL4J0wgzuvJPA35Gr3yFwtV5KeLle/zVlO76wDzrLel7Pc3lkH6rHvyldqUaOf+T9DUaP6LYFutrfjteJ9TaPLmoZnlGsauo8FOq1pfKwPxZrjPap0OF0Vscv1v/2XmW11rZFVXm9/9q7V3dd/zb+UNEClX2i+WD1RbYft7n+jx7Zutv+9KODmXw==
2 |
--------------------------------------------------------------------------------
/docs/user/data_migration_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/data_migration_architecture.png
--------------------------------------------------------------------------------
/docs/user/data_replication_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/data_replication_architecture.png
--------------------------------------------------------------------------------
/docs/user/hac_migrate_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/hac_migrate_data.png
--------------------------------------------------------------------------------
/docs/user/hac_report.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/hac_report.png
--------------------------------------------------------------------------------
/docs/user/hac_schema_diff_exec.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/hac_schema_diff_exec.png
--------------------------------------------------------------------------------
/docs/user/hac_schema_diff_prev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/hac_schema_diff_prev.png
--------------------------------------------------------------------------------
/docs/user/hac_validate_ds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/hac_validate_ds.png
--------------------------------------------------------------------------------
/docs/user/proxy_timeout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/sap-commerce-db-sync/00d8f18148102c6f4db3d05910d118a0f2dc892e/docs/user/proxy_timeout.png
--------------------------------------------------------------------------------