From 3cc15f74594612afab42288edfc5a1ee7ec0b6d5 Mon Sep 17 00:00:00 2001 From: valery Date: Thu, 3 Aug 2023 04:45:45 +0300 Subject: [PATCH] ENTAXY-480 release version 1.8.3 --- .../templates/file-adapter/init.private.ftl | 61 + .../ru/entaxy/templates/file-adapter/ref.ftl | 24 + .../impl/TemplateServiceURLResolver.java | 64 + .../objects/factory/EntaxyFactoryUtils.java | 336 ++ .../base/objects/factory/Importer.java | 382 ++ .../NotSupportedForAbstractFactory.java | 38 + .../objects/factory/impl/FactoryRegistry.java | 54 + .../tracker/TrackedFactoryManager.java | 448 +++ .../ru/entaxy/factory/base-object.json | 62 + platform/runtime/base/resources/LICENSE.txt | 201 ++ platform/runtime/base/resources/pom.xml | 18 + .../base/resources/resources-api/LICENSE.txt | 201 ++ .../base/resources/resources-api/pom.xml | 18 + .../entaxy/esb/resources/EntaxyResource.java | 36 + .../esb/resources/EntaxyResourceProvider.java | 27 + .../esb/resources/EntaxyResourceService.java | 26 + .../resources-management/LICENSE.txt | 201 ++ .../resources/resources-management/pom.xml | 33 + .../EntaxyResourceServiceMBean.java | 38 + .../impl/EntaxyResourceServiceMBeanImpl.java | 58 + .../resources/resources-service/LICENSE.txt | 201 ++ .../base/resources/resources-service/pom.xml | 49 + .../impl/EntaxyResourceServiceImpl.java | 80 + .../provider/FileResourceProvider.java | 152 + .../resources/tracker/ResourceProvider.java | 103 + .../tracker/ResourceProviderCustomizer.java | 39 + .../ResourceProviderCustomizerListener.java | 92 + .../esb/resources/tracker/TrackerManager.java | 62 + .../base/src/main/features/support.xml | 54 + .../resolver/resource/ResourceLoader.java | 128 + .../resource/ResourceRegistryURLResolver.java | 93 + .../resource/SchemaRegistryHelper.java | 25 + .../GetResourceInfoListByFullNameRequest.java | 83 + .../GetResourceInfoListByFullPathRequest.java | 83 + .../cxf/GetResourceInfoListByPathRequest.java | 83 + .../016-temp-add-permission-to-universal.xml | 37 + .../api/EntaxyFactoryDataProcessor.java | 28 + .../src/main/config/producing.lifecycles.json | 20 + .../executor/builder/BuiltObject.java | 26 + .../executor/builder/BuiltObjectList.java | 32 + .../executor/builder/DefaultBuiltObject.java | 35 + .../executor/builder/ObjectBuilder.java | 31 + .../deployer/DefaultDeployedObject.java | 35 + .../executor/deployer/DeployedObject.java | 26 + .../executor/deployer/DeployedObjectList.java | 32 + .../executor/deployer/ObjectDeployer.java | 31 + .../installer/DefaultInstalledObject.java | 35 + .../executor/installer/InstalledObject.java | 26 + .../installer/InstalledObjectList.java | 32 + .../executor/installer/ObjectInstaller.java | 31 + .../support/AbstractPrintOutputSupport.java | 53 + .../executor/support/ArtifactSupport.java | 307 ++ .../support/EntaxyObjectPropertiesHelper.java | 87 + .../executor/support/LocalPrintOutput.java | 30 + .../support/ObjectSupportRegistry.java | 88 + .../executor/support/PrintOutputSupport.java | 34 + .../EntaxyFactoryDataProcessorService.java | 62 + .../producer/impl/InstructionsHelper.java | 87 + .../AbstractConsumerAwareMetadataStorage.java | 45 + .../producer/support/ExchangeEnricher.java | 51 + .../producer/support/MetadataStorage.java | 34 + .../support/MetadataStorageConsumer.java | 26 + .../support/MetadataStorageEmpty.java | 47 + .../producer/support/MetadataStorageImpl.java | 68 + .../support/MetadataStorageWrapper.java | 63 + .../wrapper/GenerationProcessorService.java | 224 ++ .../config/BlueprintMergeProcessor.json | 19 + .../LICENSE.txt | 201 ++ .../pom.xml | 85 + .../resources/DeployableResource.java | 37 + .../resources/EntaxyResourceProcessor.java | 31 + .../EntaxyResourceProcessorService.java | 28 + .../EntaxyResourceStringFormatter.java | 28 + .../resources/ProcessResourcesCommand.java | 242 ++ .../resources/ResourceDataProcessor.java | 35 + .../resources/ResourceDescriptor.java | 90 + .../resources/ResourceObjectSupport.java | 113 + .../producer/resources/ResourceProducer.java | 64 + .../resources/StringFormatterService.java | 27 + .../resources/formatters/Base64Formatter.java | 46 + .../generator/GeneratedResourceWrapper.java | 54 + .../generator/ResourceWrapGenerator.java | 131 + .../EntaxyResourceProcessorServiceImpl.java | 84 + .../impl/ResourceDataProcessorImpl.java | 111 + .../impl/StringFormatterServiceImpl.java | 88 + .../processors/MergeResourceProcessor.java | 131 + .../processors/XSLTResourceProcessor.java | 113 + .../XSLTSaxonResourceProcessor.java | 136 + .../ru/entaxy/factory/entaxy-resource.json | 17 + .../producer/shell/FactoryConfiguration.java | 38 + .../producer/shell/FactoryManagerStatus.java | 77 + .../core/producer/shell/FactoryTypeInfo.java | 53 + .../entaxy/factory/abstract-connection.json | 54 + .../templates/abstract-connection/init.ftl | 29 + .../templates/abstract-connection/ref.ftl | 24 + .../standard-connections-pack/LICENSE.txt | 201 ++ .../standard-connections-pack/pom.xml | 54 + .../file/FileConnectionComponent.java | 69 + .../ru/entaxy/factory/file-connection.json | 3201 +++++++++++++++++ .../templates/file-connection/init.body.ftl | 51 + .../entaxy/templates/file-connection/init.ftl | 39 + .../file-connection/init.private.ftl | 23 + .../connector-implementation/LICENSE.txt | 201 ++ .../connector-producing/LICENSE.txt | 201 ++ .../connector-producing/pom.xml | 61 + .../producing/ConnectorProducer.java | 61 + .../entaxy/factory/abstract-connector-in.json | 266 ++ .../factory/abstract-connector-out.json | 280 ++ .../ru/entaxy/factory/abstract-connector.json | 176 + .../abstract-connector-in/pre-route.xml | 7 + .../abstract-connector-out/connector-out.xslt | 42 + .../abstract-connector-out/pre-output.xml | 7 + .../exclusiveSupport.ftl | 25 + .../abstract-connector-in/legacy.ftl | 46 + .../abstract-connector-in/rootRoute.ftl | 36 + .../abstract-connector-out/components.ftl | 42 + .../abstract-connector-out/legacy.ftl | 61 + .../abstract-connector-out/rootRoute.ftl | 28 + .../templates/abstract-connector/meta.ftl | 64 + .../templates/object-commons/common-utils.ftl | 73 + .../object-commons/metadata-storage.ftl | 59 + .../connector-storage/pom.xml | 26 + .../storage/ConnectorObjectStorage.java | 100 + .../connector-implementation/pom.xml | 18 + .../standard-connectors-pack/LICENSE.txt | 201 ++ .../standard-connectors-pack/pom.xml | 34 + .../ru/entaxy/factory/file-connector-in.json | 66 + .../ru/entaxy/factory/file-connector-out.json | 63 + .../templates/file-connector-in/init.ftl | 37 + .../templates/file-connector-out/init.ftl | 38 + .../entaxy/factory/common-system-profile.json | 339 ++ .../ru/entaxy/factory/default-route-2.json | 104 + .../in-flow-pre-route.xml | 7 + .../out-flow-connector-selector.xml | 53 + .../out-flow-connector-selector.xslt | 138 + .../out-flow-pre-route.xml | 7 + .../profile-pre-route.xslt | 57 + .../default-route-2/default-route.xml | 5 + .../default-route-2/default-route.xslt | 47 + .../default-route-2/standard-router.xml | 36 + .../templates/common-system-profile/init.ftl | 133 + .../common-system-profile/legacy.ftl | 61 + .../entaxy/templates/default-route-2/init.ftl | 33 + .../profile-runtime/LICENSE.txt | 201 ++ .../profile-runtime/pom.xml | 25 + .../platform/profiles/runtime/Connector.java | 31 + .../profiles/runtime/InConnector.java | 24 + .../profiles/runtime/OutConnector.java | 24 + .../platform/profiles/runtime/Profile.java | 27 + .../profiles/runtime/SystemProfile.java | 31 + .../runtime/impl/AbstractConnector.java | 93 + .../runtime/impl/AbstractProfile.java | 47 + .../runtime/impl/InConnectorImpl.java | 26 + .../runtime/impl/OutConnectorImpl.java | 26 + .../runtime/impl/SystemProfileImpl.java | 146 + .../runtime/support/ConnectorSelector.java | 316 ++ .../route-implementation/LICENSE.txt | 201 ++ .../route-implementation/pom.xml | 16 + .../route-producing/LICENSE.txt | 201 ++ .../route-producing/pom.xml | 29 + .../routes-common/common-components.xslt | 127 + .../src/main/resources/files/xml100kb.txt | 1 + .../src/main/resources/files/xml10kb.txt | 1 + .../src/main/resources/files/xml1kb.txt | 1 + platform/src/main/features/TO_FIX.txt | 3 + platform/src/main/features/UPDATE_PLAN.txt | 17 + platform/src/main/features/basics.xml | 139 + platform/src/main/features/legacy.xml | 52 + .../src/main/scripts/generated/fragments.xml | 5 + platform/src/update/descriptor/descriptor.xml | 130 + platform/src/update/features/update.xml | 48 + .../scripts/entaxy-platform.1.8.1.update | 1 + .../scripts/entaxy-platform.1.8.2.update | 43 + .../update/scripts/entaxy-platform.1.8.update | 1 + .../update/scripts/entaxy-platform.1.update | 1 + .../src/update/scripts/entaxy-platform.update | 1 + .../update/scripts/generated/fragments.xml | 40 + platform/src/update/tmp/plan.backup | 24 + system/src/main/features/basics.xml | 64 + .../cranberry-red/entaxy-adapter-icon.png | Bin 0 -> 759 bytes .../cranberry-red/entaxy-connections-icon.png | Bin 0 -> 878 bytes .../cranberry-red/entaxy-connectors-icon.png | Bin 0 -> 1031 bytes .../cranberry-red/entaxy-factories-icon.png | Bin 0 -> 757 bytes .../icons/cranberry-red/entaxy-node-icon.png | Bin 0 -> 990 bytes .../cranberry-red/entaxy-platform-icon.png | Bin 0 -> 754 bytes .../cranberry-red/entaxy-profiles-icon.png | Bin 0 -> 929 bytes .../cranberry-red/entaxy-resource-icon.png | Bin 0 -> 877 bytes .../cranberry-red/entaxy-routes-icon.png | Bin 0 -> 712 bytes .../cranberry-red/entaxy-runtime-icon.png | Bin 0 -> 823 bytes .../webapp/codemirror/addon/hint/show-hint.js | 452 +++ .../webapp/codemirror/addon/hint/xml-hint.js | 130 + .../plugin/js/camelBlueprintTagsHelper.js | 30 + .../js/components/draggableModalDirective.js | 48 + .../js/components/modalListWithDescription.js | 77 + .../webapp/plugin/js/components/properties.js | 148 + .../webapp/plugin/js/components/select.js | 193 + .../plugin/js/components/selectFromEnum.js | 58 + .../webapp/plugin/js/components/source.js | 107 + .../main/webapp/plugin/js/components/xml.js | 60 + .../webapp/plugin/js/components/xmlModal.js | 82 + .../main/webapp/plugin/js/entaxyService.js | 301 ++ .../src/main/webapp/plugin/js/healthChecks.js | 102 + .../plugin/js/xmlEditorOptionsHelper.js | 74 + .../src/main/scripts/generated/fragments.xml | 5 + ui/src/main/scripts/generated/fragments.xml | 5 + .../src/main/features/replacements.xml | 63 + .../main/support/generate_replacements.xslt | 49 + update-management/LICENSE.txt | 201 ++ update-management/pom.xml | 17 + .../update-management-components/LICENSE.txt | 201 ++ .../update-management-components/pom.xml | 14 + .../src/main/features/features.xml | 66 + .../etc/scripts/entaxy.update.shell.script | 45 + .../src/main/scripts/generated/fragments.xml | 41 + .../src/main/scripts/scripts/update/executor | 96 + .../main/scripts/scripts/update/operations | 190 + .../scripts/scripts/update/print-update-info | 84 + .../main/scripts/scripts/update/update-get | 42 + .../main/scripts/scripts/update/update-info | 14 + .../scripts/scripts/update/update-install | 271 ++ .../main/scripts/scripts/update/update-list | 18 + .../scripts/scripts/update/update-prepare | 136 + .../src/main/scripts/scripts/update/utils | 38 + .../update-management-support/LICENSE.txt | 201 ++ .../update-management-support/pom.xml | 65 + .../src/main/xslt/component-config.xslt | 44 + .../src/main/xslt/component-descriptor.xslt | 44 + .../src/main/xslt/component-name.xslt | 37 + .../src/main/xslt/components-list.xslt | 37 + .../src/main/xslt/install-plan.xslt | 86 + .../src/main/xslt/repositories-list.xslt | 37 + .../src/main/xslt/version-list.xslt | 37 + update/LICENSE.txt | 201 ++ update/pom.xml | 56 + update/src/update/descriptor/descriptor.xml | 28 + update/src/update/features/update.xml | 33 + 236 files changed, 21106 insertions(+) create mode 100644 platform/runtime/base/connecting/adapter/file-adapter/src/main/resources/ru/entaxy/templates/file-adapter/init.private.ftl create mode 100644 platform/runtime/base/connecting/adapter/file-adapter/src/main/resources/ru/entaxy/templates/file-adapter/ref.ftl create mode 100644 platform/runtime/base/connecting/generator/generator-api/src/main/java/ru/entaxy/base/generator/template/impl/TemplateServiceURLResolver.java create mode 100644 platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/EntaxyFactoryUtils.java create mode 100644 platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/Importer.java create mode 100644 platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/exceptions/NotSupportedForAbstractFactory.java create mode 100644 platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/impl/FactoryRegistry.java create mode 100644 platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/tracker/TrackedFactoryManager.java create mode 100644 platform/runtime/base/objects-base/object-factory/src/main/resources/ru/entaxy/factory/base-object.json create mode 100644 platform/runtime/base/resources/LICENSE.txt create mode 100644 platform/runtime/base/resources/pom.xml create mode 100644 platform/runtime/base/resources/resources-api/LICENSE.txt create mode 100644 platform/runtime/base/resources/resources-api/pom.xml create mode 100644 platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResource.java create mode 100644 platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResourceProvider.java create mode 100644 platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResourceService.java create mode 100644 platform/runtime/base/resources/resources-management/LICENSE.txt create mode 100644 platform/runtime/base/resources/resources-management/pom.xml create mode 100644 platform/runtime/base/resources/resources-management/src/main/java/ru/entaxy/esb/resources/management/EntaxyResourceServiceMBean.java create mode 100644 platform/runtime/base/resources/resources-management/src/main/java/ru/entaxy/esb/resources/management/impl/EntaxyResourceServiceMBeanImpl.java create mode 100644 platform/runtime/base/resources/resources-service/LICENSE.txt create mode 100644 platform/runtime/base/resources/resources-service/pom.xml create mode 100644 platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/impl/EntaxyResourceServiceImpl.java create mode 100644 platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/provider/FileResourceProvider.java create mode 100644 platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProvider.java create mode 100644 platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProviderCustomizer.java create mode 100644 platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProviderCustomizerListener.java create mode 100644 platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/TrackerManager.java create mode 100644 platform/runtime/base/src/main/features/support.xml create mode 100644 platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/ResourceLoader.java create mode 100644 platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/ResourceRegistryURLResolver.java create mode 100644 platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/SchemaRegistryHelper.java create mode 100644 platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByFullNameRequest.java create mode 100644 platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByFullPathRequest.java create mode 100644 platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByPathRequest.java create mode 100644 platform/runtime/core/initializer/storage-initializer/esb_entaxy/src/main/resources/db/changeset/016-temp-add-permission-to-universal.xml create mode 100644 platform/runtime/core/object-producing/object-producer-api/src/main/java/ru/entaxy/platform/core/producer/api/EntaxyFactoryDataProcessor.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/config/producing.lifecycles.json create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/BuiltObject.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/BuiltObjectList.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/DefaultBuiltObject.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/ObjectBuilder.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DefaultDeployedObject.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DeployedObject.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DeployedObjectList.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/ObjectDeployer.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/DefaultInstalledObject.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/InstalledObject.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/InstalledObjectList.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/ObjectInstaller.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/AbstractPrintOutputSupport.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/ArtifactSupport.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/EntaxyObjectPropertiesHelper.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/LocalPrintOutput.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/ObjectSupportRegistry.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/PrintOutputSupport.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/impl/EntaxyFactoryDataProcessorService.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/impl/InstructionsHelper.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/AbstractConsumerAwareMetadataStorage.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/ExchangeEnricher.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorage.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageConsumer.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageEmpty.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageImpl.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageWrapper.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/wrapper/GenerationProcessorService.java create mode 100644 platform/runtime/core/object-producing/object-producer-core/src/main/resources/config/BlueprintMergeProcessor.json create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/LICENSE.txt create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/pom.xml create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/DeployableResource.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceProcessor.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceProcessorService.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceStringFormatter.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ProcessResourcesCommand.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceDataProcessor.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceDescriptor.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceObjectSupport.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceProducer.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/StringFormatterService.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/formatters/Base64Formatter.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/generator/GeneratedResourceWrapper.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/generator/ResourceWrapGenerator.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/EntaxyResourceProcessorServiceImpl.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/ResourceDataProcessorImpl.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/StringFormatterServiceImpl.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/processors/MergeResourceProcessor.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/processors/XSLTResourceProcessor.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/processors/XSLTSaxonResourceProcessor.java create mode 100644 platform/runtime/core/object-producing/object-producing-resources-support/src/main/resources/ru/entaxy/factory/entaxy-resource.json create mode 100644 platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryConfiguration.java create mode 100644 platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryManagerStatus.java create mode 100644 platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryTypeInfo.java create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/factory/abstract-connection.json create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/templates/abstract-connection/init.ftl create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/templates/abstract-connection/ref.ftl create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/LICENSE.txt create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/pom.xml create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/java/ru/entaxy/platform/runtime/connections/file/FileConnectionComponent.java create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/factory/file-connection.json create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.body.ftl create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.ftl create mode 100644 platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.private.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/LICENSE.txt create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/LICENSE.txt create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/pom.xml create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/java/ru/entaxy/platform/base/objects/connector/producing/ConnectorProducer.java create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector-in.json create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector-out.json create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector.json create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-in/pre-route.xml create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-out/connector-out.xslt create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-out/pre-output.xml create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/exclusiveSupport.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/legacy.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/rootRoute.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/components.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/legacy.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/rootRoute.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector/meta.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/object-commons/common-utils.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/object-commons/metadata-storage.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-storage/pom.xml create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/connector-storage/src/main/java/ru/entaxy/platform/base/objects/connector/storage/ConnectorObjectStorage.java create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/pom.xml create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/LICENSE.txt create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/pom.xml create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/factory/file-connector-in.json create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/factory/file-connector-out.json create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/templates/file-connector-in/init.ftl create mode 100644 platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/templates/file-connector-out/init.ftl create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/factory/common-system-profile.json create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/factory/default-route-2.json create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/in-flow-pre-route.xml create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-connector-selector.xml create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-connector-selector.xslt create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-pre-route.xml create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/profile-pre-route.xslt create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/default-route.xml create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/default-route.xslt create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/standard-router.xml create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/common-system-profile/init.ftl create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/common-system-profile/legacy.ftl create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/default-route-2/init.ftl create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/LICENSE.txt create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/pom.xml create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/Connector.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/InConnector.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/OutConnector.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/Profile.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/SystemProfile.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/AbstractConnector.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/AbstractProfile.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/InConnectorImpl.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/OutConnectorImpl.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/SystemProfileImpl.java create mode 100644 platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/support/ConnectorSelector.java create mode 100644 platform/runtime/core/objects-implementations/route-implementation/LICENSE.txt create mode 100644 platform/runtime/core/objects-implementations/route-implementation/pom.xml create mode 100644 platform/runtime/core/objects-implementations/route-implementation/route-producing/LICENSE.txt create mode 100644 platform/runtime/core/objects-implementations/route-implementation/route-producing/pom.xml create mode 100644 platform/runtime/core/objects-implementations/route-implementation/route-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/routes-common/common-components.xslt create mode 100644 platform/runtime/modules/cxf-echo/src/main/resources/files/xml100kb.txt create mode 100644 platform/runtime/modules/cxf-echo/src/main/resources/files/xml10kb.txt create mode 100644 platform/runtime/modules/cxf-echo/src/main/resources/files/xml1kb.txt create mode 100644 platform/src/main/features/TO_FIX.txt create mode 100644 platform/src/main/features/UPDATE_PLAN.txt create mode 100644 platform/src/main/features/basics.xml create mode 100644 platform/src/main/features/legacy.xml create mode 100644 platform/src/main/scripts/generated/fragments.xml create mode 100644 platform/src/update/descriptor/descriptor.xml create mode 100644 platform/src/update/features/update.xml create mode 100644 platform/src/update/scripts/entaxy-platform.1.8.1.update create mode 100644 platform/src/update/scripts/entaxy-platform.1.8.2.update create mode 100644 platform/src/update/scripts/entaxy-platform.1.8.update create mode 100644 platform/src/update/scripts/entaxy-platform.1.update create mode 100644 platform/src/update/scripts/entaxy-platform.update create mode 100644 platform/src/update/scripts/generated/fragments.xml create mode 100644 platform/src/update/tmp/plan.backup create mode 100644 system/src/main/features/basics.xml create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-adapter-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-connections-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-connectors-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-factories-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-node-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-platform-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-profiles-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-resource-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-routes-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-runtime-icon.png create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/codemirror/addon/hint/show-hint.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/codemirror/addon/hint/xml-hint.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/camelBlueprintTagsHelper.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/draggableModalDirective.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/modalListWithDescription.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/properties.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/select.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/selectFromEnum.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/source.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/xml.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/xmlModal.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/entaxyService.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/healthChecks.js create mode 100644 ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/xmlEditorOptionsHelper.js create mode 100644 ui/entaxy-hawtio/src/main/scripts/generated/fragments.xml create mode 100644 ui/src/main/scripts/generated/fragments.xml create mode 100644 underlying/entaxy-underlying-features/src/main/features/replacements.xml create mode 100644 underlying/entaxy-underlying-features/src/main/support/generate_replacements.xslt create mode 100644 update-management/LICENSE.txt create mode 100644 update-management/pom.xml create mode 100644 update-management/update-management-components/LICENSE.txt create mode 100644 update-management/update-management-components/pom.xml create mode 100644 update-management/update-management-components/src/main/features/features.xml create mode 100644 update-management/update-management-components/src/main/scripts/etc/scripts/entaxy.update.shell.script create mode 100644 update-management/update-management-components/src/main/scripts/generated/fragments.xml create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/executor create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/operations create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/print-update-info create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/update-get create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/update-info create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/update-install create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/update-list create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/update-prepare create mode 100644 update-management/update-management-components/src/main/scripts/scripts/update/utils create mode 100644 update-management/update-management-support/LICENSE.txt create mode 100644 update-management/update-management-support/pom.xml create mode 100644 update-management/update-management-support/src/main/xslt/component-config.xslt create mode 100644 update-management/update-management-support/src/main/xslt/component-descriptor.xslt create mode 100644 update-management/update-management-support/src/main/xslt/component-name.xslt create mode 100644 update-management/update-management-support/src/main/xslt/components-list.xslt create mode 100644 update-management/update-management-support/src/main/xslt/install-plan.xslt create mode 100644 update-management/update-management-support/src/main/xslt/repositories-list.xslt create mode 100644 update-management/update-management-support/src/main/xslt/version-list.xslt create mode 100644 update/LICENSE.txt create mode 100644 update/pom.xml create mode 100644 update/src/update/descriptor/descriptor.xml create mode 100644 update/src/update/features/update.xml diff --git a/platform/runtime/base/connecting/adapter/file-adapter/src/main/resources/ru/entaxy/templates/file-adapter/init.private.ftl b/platform/runtime/base/connecting/adapter/file-adapter/src/main/resources/ru/entaxy/templates/file-adapter/init.private.ftl new file mode 100644 index 00000000..d4b00c60 --- /dev/null +++ b/platform/runtime/base/connecting/adapter/file-adapter/src/main/resources/ru/entaxy/templates/file-adapter/init.private.ftl @@ -0,0 +1,61 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + file-adapter + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + [#if properties??] + [#if properties.ext_createResourceProvider??] + [#if properties.ext_createResourceProvider] + + + + + + + + + + + + + [/#if] + [/#if] + [/#if] + + + [#if properties??] + [#list properties as key, value] + [#if !key?starts_with("##") && !key?starts_with("__") && !key?starts_with("ext_")] [#-- we skip additional properties --] + [#if key?starts_with("file_")] [#-- we add parent component properties --] + + [#else] + + [/#if] + [/#if] + [/#list] + [/#if] + \ No newline at end of file diff --git a/platform/runtime/base/connecting/adapter/file-adapter/src/main/resources/ru/entaxy/templates/file-adapter/ref.ftl b/platform/runtime/base/connecting/adapter/file-adapter/src/main/resources/ru/entaxy/templates/file-adapter/ref.ftl new file mode 100644 index 00000000..9c032734 --- /dev/null +++ b/platform/runtime/base/connecting/adapter/file-adapter/src/main/resources/ru/entaxy/templates/file-adapter/ref.ftl @@ -0,0 +1,24 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + file-adapter + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + diff --git a/platform/runtime/base/connecting/generator/generator-api/src/main/java/ru/entaxy/base/generator/template/impl/TemplateServiceURLResolver.java b/platform/runtime/base/connecting/generator/generator-api/src/main/java/ru/entaxy/base/generator/template/impl/TemplateServiceURLResolver.java new file mode 100644 index 00000000..4a3bd890 --- /dev/null +++ b/platform/runtime/base/connecting/generator/generator-api/src/main/java/ru/entaxy/base/generator/template/impl/TemplateServiceURLResolver.java @@ -0,0 +1,64 @@ +/*- + * ~~~~~~licensing~~~~~~ + * generator-api + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.base.generator.template.impl; + +import java.io.IOException; +import java.net.URL; +import java.net.URLConnection; + +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.url.AbstractURLStreamHandlerService; +import org.osgi.service.url.URLStreamHandlerService; + +import ru.entaxy.base.generator.template.Template; +import ru.entaxy.base.generator.template.TemplateService; + +@Component(service = URLStreamHandlerService.class, property = "url.handler.protocol=templates", immediate = true) +public class TemplateServiceURLResolver extends AbstractURLStreamHandlerService { + + @Reference(cardinality = ReferenceCardinality.MANDATORY) + TemplateService templateService; + + @Override + public URLConnection openConnection(URL url) throws IOException { + String templateId = url.toString(); + templateId = templateId.replace("templates:", ""); + templateId = templateId.replace("/", "."); + + Template template = templateService.getTemplateById(templateId); + if (template == null) { + // we'll try without file extension + int index = templateId.lastIndexOf("."); + if (index>0) + templateId = templateId.substring(0, index); + template = templateService.getTemplateById(templateId); + } + + if (template == null) + return null; + + String templateUrl = template.getTemplateLocation().toString() + template.getTemplateFullName(); + URL resultUrl = new URL(templateUrl); + return resultUrl.openConnection(); + } + +} diff --git a/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/EntaxyFactoryUtils.java b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/EntaxyFactoryUtils.java new file mode 100644 index 00000000..b3b171f4 --- /dev/null +++ b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/EntaxyFactoryUtils.java @@ -0,0 +1,336 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-factory + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.base.objects.factory; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.CONFIGURATION.DIRECTIVES; +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.CONFIGURATION.DIRECTIVES.OVERRIDE_MODE; +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.FieldInfo; +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.OutputInfo; +import ru.entaxy.platform.base.objects.factory.Importer.ImportInfo; +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.base.support.JSONUtils; + +public class EntaxyFactoryUtils { + + public static final String PROP_HIERARCHY = "hierarchy"; + + public static Gson gson = new Gson(); + + public static String getEffectiveJson(EntaxyFactory factory) { + JsonObject result = new JsonObject(); + + // factory + JsonObject factoryData = new JsonObject(); + factoryData.addProperty(EntaxyFactory.CONFIGURATION.FACTORY.ID, factory.getId()); + factoryData.addProperty(EntaxyFactory.CONFIGURATION.FACTORY.TYPE, factory.getType()); + factoryData.addProperty(EntaxyFactory.CONFIGURATION.FACTORY.CATEGORY, factory.getCategory()); + factoryData.addProperty(EntaxyFactory.CONFIGURATION.FACTORY.LABEL, factory.getLabel()); + factoryData.addProperty(EntaxyFactory.CONFIGURATION.FACTORY.DESCRIPTION, factory.getDescription()); + result.add(EntaxyFactory.CONFIGURATION.FACTORY_SECTION_NAME, factoryData); + + // typed data + String type = factory.getType(); + JsonElement typeData = gson.toJsonTree(factory.getTypeInfo()); + result.add(type, typeData); + + // fields + JsonObject fieldsData = new JsonObject(); + for (FieldInfo fi: factory.getFields()) { + fieldsData.add(fi.getName(), fi.getJsonOrigin()); + } + result.add(EntaxyFactory.CONFIGURATION.FIELDS_SECTION_NAME, fieldsData); + + // outputs + JsonObject outputsData = new JsonObject(); + for (OutputInfo oi: factory.getOutputs()) { + JsonObject outputData = new JsonObject(); + outputData.addProperty(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.IS_DEFAULT, oi.isDefault()); + outputData.addProperty(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.GENERATOR, oi.getGenerator()); + outputData.add(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.SCOPES + , gson.toJsonTree(oi.getScopes())); + if (oi.getConfig() != null) + outputData.add(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.CONFIG + , gson.toJsonTree(oi.getConfig())); + JsonObject outputFields = new JsonObject(); + for (FieldInfo fi: oi.getFields()) { + outputFields.add(fi.getName(), fi.getJsonOrigin()); + } + outputData.add(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.FIELDS, outputFields); + outputsData.add(oi.getType(), outputData); + } + result.add(EntaxyFactory.CONFIGURATION.OUTPUTS_SECTION_NAME, outputsData); + + return result.toString(); + } + + public static JsonObject cleanJson(JsonObject origin) { + JsonObject result = origin.deepCopy(); + + cleanObject(result, EntaxyFactory.CONFIGURATION.DIRECTIVES.getAllDirectives()); + + return result; + } + + public static void cleanObject(JsonObject origin, Set toRemove) { + for (String name: toRemove) + origin.remove(name); + for (Entry entry: origin.entrySet()) + if (entry.getValue().isJsonObject()) + cleanObject(entry.getValue().getAsJsonObject(), toRemove); + } + + public static interface FactoryConfigurationStorage { + JsonObject getConfiguration(String factoryId); + } + + public static JsonObject calculateEffectiveJson(JsonObject origin, FactoryConfigurationStorage storage) { + JsonObject originCopy = origin.deepCopy(); + JsonObject result = originCopy; + JsonObject error = new JsonObject(); + JsonObject errorData = new JsonObject(); + JsonArray errorReqs = new JsonArray(); + + error.add("#CALC_ERROR", errorData); + errorData.add("#REQS", errorReqs); + + // process imports in originCopy + + Importer importer = new Importer(originCopy); + List imports = importer.findImports(); + if (!imports.isEmpty()) { + final Map factoryJsonMap = new HashMap<>(); + imports.stream() + .forEach(imp-> + imp.importDescriptors.stream() + .filter(id->CommonUtils.isValid(id.factoryId)) + .forEach(id->factoryJsonMap.put(id.factoryId, null)) + ); + boolean inconsistent = false; + for (String factoryId: factoryJsonMap.keySet()) { + JsonObject factoryJson; + if ("#".equals(factoryId)) + factoryJson = origin; + else + factoryJson = storage.getConfiguration(factoryId); + if (factoryJson == null) { + inconsistent = true; + errorReqs.add(factoryId); + } else { + factoryJsonMap.put(factoryId, factoryJson); + } + + } + if (inconsistent) + return error; + + importer.addImportedSources(factoryJsonMap); + importer.processImports(imports); + + } + + // process inheritance + String parent = getParentFromJson(origin); + if (CommonUtils.isValid(parent)) { + JsonObject parentObject = storage.getConfiguration(parent); + if (parentObject == null) { + errorReqs.add(parent); + return error; + } + result = parentObject.deepCopy(); + prepareTypeInfo(result, originCopy); + processObjectOverriding(result, originCopy, OVERRIDE_MODE.UPDATE); + } else { + result = originCopy; + } + + return result; + } + + public static void prepareTypeInfo(JsonObject parent, JsonObject child) { + JsonElement parentTypeE = JSONUtils.findElement(parent, "factory.type"); + JsonElement childTypeE = JSONUtils.findElement(child, "factory.type"); + String parentType = ""; + String childType = ""; + if ((parentTypeE!=null) && parentTypeE.isJsonPrimitive()) + parentType = parentTypeE.getAsString(); + if ((childTypeE!=null) && childTypeE.isJsonPrimitive()) + childType = childTypeE.getAsString(); + + JsonObject parentProperties = getTypeProperties(parent); + JsonObject childProperties = getTypeProperties(child); + if (childProperties==null) + return; + if (!parentType.equals(childType) && CommonUtils.isValid(childType)) { + // copy parent type info with child type + parent.add(childType, getTypeProperties(parent).deepCopy()); + } + JsonElement parentHierarchy = JSONUtils.findElement(parentProperties, PROP_HIERARCHY); + JsonArray childHierarchy = new JsonArray(); + if ((parentHierarchy != null) && parentHierarchy.isJsonArray()) { + childHierarchy.addAll(parentHierarchy.getAsJsonArray()); + } + childHierarchy.add(JSONUtils.findElement(parent, "factory.id")); + childProperties.add(PROP_HIERARCHY, childHierarchy); + } + + public static JsonObject resolveVariants(JsonObject root) { + JsonObject result = root.deepCopy(); + processObjectVariants(result, root); + return result; + } + + public static void processObjectVariants(JsonObject currentObject, JsonObject root) { + JsonObject variants = getVariants(currentObject); + if (variants != null) { + String property = variants.has("property") + ?variants.get("property").getAsString() + :""; + if (CommonUtils.isValid(property)) { + JsonObject values = (variants.has("values") && variants.get("values").isJsonObject()) + ?variants.get("values").getAsJsonObject() + :null; + if (values != null) { + JsonObject typeProperties = getTypeProperties(root); + JsonElement je = JSONUtils.findElement(typeProperties, property); + if (je != null) { + String value = je.getAsString(); + if (values.has(value) && values.get(value).isJsonObject()) { + JsonObject variant = values.get(value).getAsJsonObject(); + for (Entry entry: variant.entrySet()) { + currentObject.remove(entry.getKey()); + currentObject.add(entry.getKey(), entry.getValue().deepCopy()); + } + } + } + } + } + currentObject.remove(DIRECTIVES.VARIANTS); + } + for (Entry entry: currentObject.entrySet()) { + if (entry.getValue().isJsonObject()) + processObjectVariants(entry.getValue().getAsJsonObject(), root); + } + } + + public static JsonObject getVariants(JsonObject currentObject) { + if (currentObject.has(DIRECTIVES.VARIANTS) && currentObject.get(DIRECTIVES.VARIANTS).isJsonObject()) + return currentObject.get(DIRECTIVES.VARIANTS).getAsJsonObject(); + return null; + } + + public static JsonObject getTypeProperties(JsonObject currentObject) { + JsonElement type = JSONUtils.findElement(currentObject, "factory.type"); + if (type == null) + return new JsonObject(); + String typeValue = type.getAsString(); + if (!CommonUtils.isValid(typeValue)) + return new JsonObject(); + JsonElement typeProperties = JSONUtils.findElement(currentObject, typeValue); + if (typeProperties.isJsonObject()) + return typeProperties.getAsJsonObject(); + return new JsonObject(); + } + + public static String getParentFromJson(JsonObject jsonObject) { + if (!jsonObject.has(EntaxyFactory.CONFIGURATION.FACTORY_SECTION_NAME)) + return null; + JsonObject fs = jsonObject.get(EntaxyFactory.CONFIGURATION.FACTORY_SECTION_NAME).getAsJsonObject(); + if (fs.has(EntaxyFactory.CONFIGURATION.FACTORY.PARENT)) + return fs.get(EntaxyFactory.CONFIGURATION.FACTORY.PARENT).getAsString(); + return null; + } + + public static void processObjectOverriding(JsonObject currentObject, JsonObject newObject, OVERRIDE_MODE defaultMode) { + + OVERRIDE_MODE mode = getOverrideMode(currentObject, defaultMode); + + if (OVERRIDE_MODE.IGNORE.equals(mode)) + return; + + if (OVERRIDE_MODE.REPLACE.equals(mode)) { + Set set = new HashSet(currentObject.keySet()); + for (String entry: set) + currentObject.remove(entry); + for (Entry entry: newObject.entrySet()) + currentObject.add(entry.getKey(), entry.getValue().deepCopy()); + return; + } + + if (OVERRIDE_MODE.APPEND.equals(mode)) { + for (Entry entry: newObject.entrySet()) + if (!currentObject.has(entry.getKey())) + currentObject.add(entry.getKey(), entry.getValue().deepCopy()); + return; + } + + if (OVERRIDE_MODE.UPDATE.equals(mode)) { + + + // update existing + Set set = new HashSet(currentObject.keySet()); + for (String key: set) { + if (newObject.has(key)) { + JsonElement currentElement = currentObject.get(key); + JsonElement newElement = newObject.get(key); + if (currentElement.isJsonObject() && newElement.isJsonObject()) { + processObjectOverriding(currentElement.getAsJsonObject(), newElement.getAsJsonObject(), mode); + } else { + currentObject.remove(key); + currentObject.add(key, newElement.deepCopy()); + } + } + } + + // add new + for (Entry entry: newObject.entrySet()) + if (!currentObject.has(entry.getKey())) + currentObject.add(entry.getKey(), entry.getValue().deepCopy()); + + } + + } + + public static EntaxyFactory.CONFIGURATION.DIRECTIVES.OVERRIDE_MODE getOverrideMode(JsonObject object, OVERRIDE_MODE defaultMode) { + OVERRIDE_MODE result = defaultMode; + if (object.has(EntaxyFactory.CONFIGURATION.DIRECTIVES.OVERRIDE)) { + try { + OVERRIDE_MODE mode = OVERRIDE_MODE.valueOfLabel(object.get(EntaxyFactory.CONFIGURATION.DIRECTIVES.OVERRIDE).getAsString()); + if (mode != null) + result = mode; + } catch (Exception e) { + + } + } + return result; + } + +} diff --git a/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/Importer.java b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/Importer.java new file mode 100644 index 00000000..07a5070f --- /dev/null +++ b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/Importer.java @@ -0,0 +1,382 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-factory + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.base.objects.factory; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.CONFIGURATION.DIRECTIVES.OVERRIDE_MODE; +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.base.support.JSONUtils; + +public class Importer { + + protected JsonObject origin; + + protected Map importedSources = new HashMap<>(); + + public Importer(JsonObject origin) { + this.origin = origin; + } + + public List findImports(){ + return findImports(this.origin); + } + + public List findImports(JsonObject object) { + List result = new ArrayList<>(); + if (object.has(EntaxyFactory.CONFIGURATION.DIRECTIVES.IMPORT)) + result.add(new ImportInfo(object)); + for (Entry entry: object.entrySet()) + if (entry.getValue().isJsonObject()) + result.addAll(findImports(entry.getValue().getAsJsonObject())); + return result; + } + + public void processImports(List imports) { + for (ImportInfo ii: imports) { + JsonObject newData = new JsonObject(); + for (ImportDescriptor id: ii.importDescriptors) { + + JsonObject imported = importedSources.get(id.factoryId); + if (imported == null) + continue; + + JsonElement je = JSONUtils.findElement(imported, id.location); + if ((je==null) || !je.isJsonObject()) + continue; + + Filter f; + if (id.origin.has("filter")) + f = CompositeFilter.create(id.origin.get("filter")); + else + f = new NullFilter(); + + List> filteredList = je.getAsJsonObject().entrySet() + .stream() + .filter(e->f.isAccepted(e.getKey(), e.getValue())) + .collect(Collectors.toList()); + + JsonObject idResult = new JsonObject(); + + for (Entry entry: filteredList) + idResult.add(id.prefix + entry.getKey(), entry.getValue()); + + EntaxyFactoryUtils.processObjectOverriding( + newData + , idResult + , OVERRIDE_MODE.UPDATE); + } + + JsonObject current = ii.owner.deepCopy(); + current.remove(EntaxyFactory.CONFIGURATION.DIRECTIVES.IMPORT); + EntaxyFactoryUtils.processObjectOverriding(newData, current, OVERRIDE_MODE.UPDATE); + Set keys = new HashSet<>(ii.owner.keySet()); + for (String key: keys) + ii.owner.remove(key); + for (Entry entry: newData.entrySet()) + ii.owner.add(entry.getKey(), entry.getValue()); + } + } + + // INTERNAL CLASSES + + public static abstract class Filter { + + public static final String ATTRIBUTE_KEY = "$key"; + public static final String ATTRIBUTE_VALUE = "$value"; + + abstract public boolean isAccepted(String key, JsonElement value); + + } + + public static class CompositeFilter extends Filter { + + List filters = new ArrayList<>(); + + @Override + public boolean isAccepted(String key, JsonElement value) { + for (Filter f: filters) + if (!f.isAccepted(key, value)) + return false; + return true; + } + + public static Filter create(JsonElement object) { + + if (!object.isJsonObject()) + return new NullFilter(); + + final CompositeFilter filter = new CompositeFilter(); + + if (object.getAsJsonObject().has(ContainsFilter.FILTER_NAME)) { + JsonElement je = object.getAsJsonObject().get(ContainsFilter.FILTER_NAME); + if (je.isJsonArray()) + je.getAsJsonArray().forEach(e->filter.filters.add(new ContainsFilter(e))); + } + + if (object.getAsJsonObject().has(ContainedFilter.FILTER_NAME)) { + JsonElement je = object.getAsJsonObject().get(ContainedFilter.FILTER_NAME); + if (je.isJsonArray()) + je.getAsJsonArray().forEach(e->filter.filters.add(new ContainedFilter(e))); + } + + return filter; + + } + + } + + public static class NullFilter extends Filter { + + @Override + public boolean isAccepted(String key, JsonElement value) { + return true; + } + + } + + public static abstract class CommonFilter extends Filter { + + String attribute = null; + List values = new ArrayList<>(); + + boolean isInversed = false; + + protected CommonFilter(JsonElement element) { + if (!element.isJsonObject()) + return; + JsonObject jo = element.getAsJsonObject(); + if (jo.has("inverse")) + this.isInversed = jo.get("inverse").getAsBoolean(); + + } + + @Override + public final boolean isAccepted(String key, JsonElement value) { + if (isInversed) + return !calculateAccepted(key, value); + else + return calculateAccepted(key, value); + } + + protected abstract boolean calculateAccepted(String key, JsonElement value); + + } + + public static class ContainedFilter extends CommonFilter { + + public static final String FILTER_NAME = "contained"; + + public ContainedFilter(JsonElement element) { + super(element); + if (!element.isJsonObject()) + return; + JsonObject jo = element.getAsJsonObject(); + if (jo.has("attribute")) + this.attribute = jo.get("attribute").getAsString(); + if (jo.has("values")) { + if (jo.get("values").isJsonPrimitive()) + values.add(jo.get("values").getAsString()); + if (jo.get("values").isJsonArray()) + jo.get("values").getAsJsonArray().forEach(v->values.add(v.getAsString())); + } + } + + @Override + protected boolean calculateAccepted(String key, JsonElement value) { + if (values.isEmpty()) + return true; + String testValue = ""; + if (ATTRIBUTE_KEY.equals(attribute)) + testValue = key; + else if (ATTRIBUTE_VALUE.equals(attribute)) + testValue = value.getAsString(); + else { + if (value.isJsonObject()) { + JsonObject jo = value.getAsJsonObject(); + if (jo.has(attribute)) + testValue = jo.get(attribute).getAsString(); + } + } + if (!CommonUtils.isValid(testValue)) + return false; + + return values.contains(testValue); + } + + + } + + public static class ContainsFilter extends CommonFilter { + + public static final String FILTER_NAME = "contains"; + + String separator = ","; + boolean containsAll = false; + + public ContainsFilter(JsonElement element) { + super(element); + if (!element.isJsonObject()) + return; + JsonObject jo = element.getAsJsonObject(); + if (jo.has("attribute")) + this.attribute = jo.get("attribute").getAsString(); + if (jo.has("separator")) + this.separator = jo.get("separator").getAsString(); + if (jo.has("containsAll")) + this.containsAll = jo.get("containsAll").getAsBoolean(); + if (jo.has("values")) { + if (jo.get("values").isJsonPrimitive()) + values.add(jo.get("values").getAsString()); + if (jo.get("values").isJsonArray()) + jo.get("values").getAsJsonArray().forEach(v->values.add(v.getAsString())); + } + } + + @Override + protected boolean calculateAccepted(String key, JsonElement value) { + if (values.isEmpty()) + return true; + + String testValue = ""; + List vals = new ArrayList<>(); + + if (ATTRIBUTE_KEY.equals(attribute)) + testValue = key; + else if (ATTRIBUTE_VALUE.equals(attribute)) + testValue = value.getAsString(); + else { + if (value.isJsonObject()) { + JsonObject jo = value.getAsJsonObject(); + if (jo.has(attribute)) { + JsonElement je = jo.get(attribute); + if (je.isJsonPrimitive()) { + testValue = jo.get(attribute).getAsString(); + + if (!CommonUtils.isValid(testValue)) + return false; + + String[] arr = testValue.split(separator); + vals = Arrays.asList(arr).stream().map(s->s.trim()).collect(Collectors.toList()); + } else if (je.isJsonArray()) { + JsonArray ja = je.getAsJsonArray(); + for (int i=0; i importDescriptors = new ArrayList<>(); + + public ImportInfo(JsonObject owner) { + + List foundImports = new ArrayList<>(); + + this.owner = owner; + this.importElement = owner.get(EntaxyFactory.CONFIGURATION.DIRECTIVES.IMPORT); + if (this.importElement.isJsonObject()) { + foundImports.add(this.importElement.getAsJsonObject()); + } + if (this.importElement.isJsonArray()) { + JsonArray ja = this.importElement.getAsJsonArray(); + for (int i=0; i getImportedSources() { + return importedSources; + } + + public void addImportedSources(Map importedSources) { + this.importedSources.putAll(importedSources); + } + + public void setImportedSources(Map importedSources) { + this.importedSources = importedSources; + } + + public JsonObject getOrigin() { + return origin; + } + + +} diff --git a/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/exceptions/NotSupportedForAbstractFactory.java b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/exceptions/NotSupportedForAbstractFactory.java new file mode 100644 index 00000000..1ed3a5cd --- /dev/null +++ b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/exceptions/NotSupportedForAbstractFactory.java @@ -0,0 +1,38 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-factory + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.base.objects.factory.exceptions; + +import ru.entaxy.platform.base.objects.factory.EntaxyFactory; +import ru.entaxy.platform.base.objects.factory.EntaxyFactoryException; + +@SuppressWarnings("serial") +public class NotSupportedForAbstractFactory extends EntaxyFactoryException { + + private static String getMessage(EntaxyFactory factory, String operation) { + return String.format("Factory [%s] is abstract, operation [%s] not supported" + , factory.getId() + , operation); + } + + public NotSupportedForAbstractFactory(EntaxyFactory factory, String operation) { + super(getMessage(factory, operation)); + } + +} diff --git a/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/impl/FactoryRegistry.java b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/impl/FactoryRegistry.java new file mode 100644 index 00000000..fc9cc480 --- /dev/null +++ b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/impl/FactoryRegistry.java @@ -0,0 +1,54 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-factory + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.base.objects.factory.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; + +import ru.entaxy.platform.base.objects.factory.EntaxyFactory; + +@Component (service = FactoryRegistry.class, immediate = true) +public class FactoryRegistry { + + protected Map inheritance = new HashMap<>(); + protected Map factories = new HashMap<>(); + + @Reference (unbind = "removeFactory", cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC + , policyOption = ReferencePolicyOption.GREEDY) + public void addFactory(EntaxyFactory entaxyFactory) { + this.inheritance.put(entaxyFactory.getId(), entaxyFactory.getParent()); + this.factories.put(entaxyFactory.getId(), entaxyFactory); + } + + public void removeFactory(EntaxyFactory entaxyFactory) { + this.inheritance.remove(entaxyFactory.getId()); + this.factories.remove(entaxyFactory.getId()); + } + + public String getParentFactory(String factoryId) { + return this.inheritance.get(factoryId); + } +} diff --git a/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/tracker/TrackedFactoryManager.java b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/tracker/TrackedFactoryManager.java new file mode 100644 index 00000000..25c5a2d3 --- /dev/null +++ b/platform/runtime/base/objects-base/object-factory/src/main/java/ru/entaxy/platform/base/objects/factory/tracker/TrackedFactoryManager.java @@ -0,0 +1,448 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-factory + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.base.objects.factory.tracker; + +import java.util.ArrayList; +import java.util.Dictionary; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import ru.entaxy.platform.base.objects.factory.EntaxyFactory; +import ru.entaxy.platform.base.objects.factory.EntaxyFactoryUtils; +import ru.entaxy.platform.base.objects.factory.EntaxyFactoryUtils.FactoryConfigurationStorage; +import ru.entaxy.platform.base.objects.factory.impl.DefaultFactory; +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.base.support.JSONUtils; +import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerCustomizerListener; + +@Component (service = TrackedFactoryManager.class, immediate = true) +public class TrackedFactoryManager implements BundleTrackerCustomizerListener>, FactoryConfigurationStorage { + + private static final Logger log = LoggerFactory.getLogger(TrackedFactoryManager.class); + + public static final String DEFAULT_PARENT = "base-object"; + + protected BundleContext bundleContext; + + protected Map managedFactories = new HashMap<>(); + + @Activate + public void activate(ComponentContext componentContext) { + this.bundleContext = componentContext.getBundleContext(); + } + + @Override + public void added(List managedObject) { + if (managedObject == null) { + log.debug("managedObject is null"); + return; + } + +// List processedFactories = new ArrayList<>(); + + FactoryProcessor factoryProcessor = new FactoryProcessor(); + + for (TrackedFactory tf: managedObject) { + log.info("Added factory: " + tf.getId()); + + TrackedManagedFactory tmf = new TrackedManagedFactory(tf); + + // if we already have factory with the same id + if (managedFactories.containsKey(tmf.factoryId)) { + tmf = managedFactories.get(tmf.factoryId); + + // remove old service + tmf.deactivate(); + + tmf.reload(tf); + + tmf.detachParent(); + + tmf.detachRequirements(); + + } else { + this.managedFactories.put(tmf.factoryId, tmf); + } + + if (!CommonUtils.isValid(tmf.parent) && !DEFAULT_PARENT.equalsIgnoreCase(tmf.factoryId)) { + tmf.setParent(DEFAULT_PARENT); + } + + if (CommonUtils.isValid(tmf.parent)) { + TrackedManagedFactory parentF = managedFactories.get(tmf.parent); + if ((parentF != null) && parentF.isActive) { + tmf.attachParent(parentF); + } else { + tmf.addWaiting(tmf.parent); + } + + } + + for (String requirement: tmf.requirements) { + TrackedManagedFactory req = managedFactories.get(requirement); + if (req != null) + tmf.attachRequirement(req); + else + tmf.addWaiting(requirement); + } + + if (tmf.isConsistent()) + factoryProcessor.add(tmf); + + + +// processedFactories.add(tmf); + + } + + factoryProcessor.process(); + + /*log.debug("Added factory: " + tf.getId()); + if (TrackedFactory.trackedFactoriesMap.containsKey(tf.getId())) { + TrackedFactory.trackedFactoriesMap.get(tf.getId()).unregister(); + } + DefaultFactory defaultFactory = new DefaultFactory(); + defaultFactory.setFactoryId(tf.getId()); + defaultFactory.configure(tf.getConfigString()); + if (defaultFactory.isValid()) { + + tf.setId(defaultFactory.getFactoryId()); + + Dictionary props = new Hashtable(); + props.put(EntaxyFactory.SERVICE.PROP_ID, defaultFactory.getFactoryId()); + props.put(EntaxyFactory.SERVICE.PROP_TYPE, defaultFactory.getFactoryType()); + props.put(EntaxyFactory.SERVICE.PROP_ORIGIN_BUNDLE, tf.getBundle().getBundleId()+""); + + tf.setServiceRegistration( + this.bundleContext.registerService(EntaxyFactory.class, defaultFactory, props) + ); + + TrackedFactory.trackedFactoriesMap.put(tf.getId(), tf); + }*/ + + } + + @Override + public void modified(List managedObject) { + // TODO Auto-generated method stub + + } + + @Override + public void removed(List managedObject) { + if (managedObject == null) + return; + for (TrackedFactory tf: managedObject) { + try { + tf.getServiceRegistration().unregister(); + } catch (Exception e) { + // do nothing + } + TrackedFactory.trackedFactoriesMap.remove(tf.getId()); + } + + } + + // implement FactoryConfigurationStorage + public JsonObject getConfiguration(String factoryId) { + TrackedManagedFactory tmf = managedFactories.get(factoryId); + if (tmf == null) + return null; + if (!tmf.isConsistent() || !tmf.isUpToDate) + return null; + return tmf.jsonEffective; + }; + + public List getManagedFactories() { + return new ArrayList<>(this.managedFactories.values()); + } + + + + + protected class FactoryProcessor { + + List factories = new ArrayList<>(); + + public void add(TrackedManagedFactory tmf) { + synchronized (factories) { + if (!factories.contains(tmf)) + factories.add(tmf); + } + } + + public void process() { + while (!this.factories.isEmpty()) { + + List processed = new ArrayList<>(); + List toProcess = new ArrayList<>(); + + for (TrackedManagedFactory currentFactory: factories) { + processFactory(currentFactory); + if (currentFactory.isActive) { + processed.add(currentFactory); + + for (TrackedManagedFactory waitingFactory: managedFactories.values()) + if (waitingFactory.isWaiting(currentFactory.factoryId)) { + waitingFactory.stopWaiting(currentFactory.factoryId); + if (waitingFactory.isConsistent()) + toProcess.add(waitingFactory); + } + + } + } + + if (processed.isEmpty()) + break; + + for (TrackedManagedFactory tmf: toProcess) + if (!this.factories.contains(tmf)) + this.factories.add(tmf); + + for (TrackedManagedFactory tmf: processed) + this.factories.remove(tmf); + + } + } + + protected void processFactory(TrackedManagedFactory factory) { + if (factory.isConsistent()) { + + if (CommonUtils.isValid(factory.parent)) { + TrackedManagedFactory parentF = managedFactories.get(factory.parent); + factory.attachParent(parentF); + } + + for (String requirement: factory.requirements) { + TrackedManagedFactory req = managedFactories.get(requirement); + factory.attachRequirement(req); + } + + + JsonObject effective = EntaxyFactoryUtils.calculateEffectiveJson(factory.jsonOrigin, TrackedFactoryManager.this); + if (!effective.has("#CALC_ERROR")) { + + factory.jsonEffective = effective.deepCopy(); + JsonObject jsonFinal = EntaxyFactoryUtils.resolveVariants(effective); + + // create factory + factory.updateConfiguration(jsonFinal); + if (createFactory(factory)) { + factory.activate(); + } + + } else { + JsonObject jo = effective.get("#CALC_ERROR").getAsJsonObject(); + if (jo.has("#REQS")) { + JsonArray ja = jo.get("#REQS").getAsJsonArray(); + + final TrackedManagedFactory tmfF = factory; + ja.forEach(item->tmfF.addRequirement(item.getAsString())); + ja.forEach(item->tmfF.addWaiting(item.getAsString())); + } + } + } else { + log.info("Factory {} is inconsistent, waiting for: {}" + , factory.factoryId + , factory.waitingFor.stream().collect(Collectors.joining(","))); + } + + } + + public boolean createFactory(TrackedManagedFactory factory) { + DefaultFactory defaultFactory = new DefaultFactory(); + defaultFactory.setFactoryId(factory.factoryId); + defaultFactory.configure(EntaxyFactoryUtils.cleanJson(factory.jsonFinal)); + if (defaultFactory.isValid()) { + + // to ensure id is correct + factory.trackedFactory.setId(defaultFactory.getId()); + + Dictionary props = new Hashtable(); + props.put(EntaxyFactory.SERVICE.PROP_ID, defaultFactory.getId()); + props.put(EntaxyFactory.SERVICE.PROP_TYPE, defaultFactory.getType()); + props.put(EntaxyFactory.SERVICE.PROP_ORIGIN_BUNDLE, factory.trackedFactory.getBundle().getBundleId()+""); + + factory.trackedFactory.setServiceRegistration( + TrackedFactoryManager.this.bundleContext.registerService(EntaxyFactory.class, defaultFactory, props) + ); + + return true; + } + return false; + } + + + } + + public static class TrackedManagedFactory { + + TrackedFactory trackedFactory; + + // original JSON description + JsonObject jsonOrigin; + // JSON with inheritance & imports resolved + JsonObject jsonEffective; + // JSON with VARIANTS resolved + JsonObject jsonFinal; + + JsonObject jsonFactorySection = null; + + public String factoryId = null; + public String parent = null; + + public List requirements = new ArrayList<>(); + + TrackedManagedFactory parentFactory = null; + List requiredFactories = new ArrayList<>(); + List affectedFactories = new ArrayList<>(); + + public List waitingFor = new ArrayList<>(); + + public boolean isUpToDate = false; + + public boolean isActive = false; + + public TrackedManagedFactory(TrackedFactory factory) { + reload(factory); + } + + public void reload(TrackedFactory factory) { + this.jsonFactorySection = null; + this.factoryId = null; + this.parent = null; + this.requirements = new ArrayList<>(); + this.trackedFactory = factory; + this.waitingFor.clear(); + this.jsonOrigin = JSONUtils.getJsonRootObject(this.trackedFactory.getConfigString()); + if (this.jsonOrigin.has(EntaxyFactory.CONFIGURATION.FACTORY_SECTION_NAME)) { + this.jsonFactorySection = this.jsonOrigin.get(EntaxyFactory.CONFIGURATION.FACTORY_SECTION_NAME).getAsJsonObject(); + if (this.jsonFactorySection.has(EntaxyFactory.CONFIGURATION.FACTORY.ID)) + this.factoryId = this.jsonFactorySection.get(EntaxyFactory.CONFIGURATION.FACTORY.ID).getAsString(); + if (this.jsonFactorySection.has(EntaxyFactory.CONFIGURATION.FACTORY.PARENT)) + this.parent = this.jsonFactorySection.get(EntaxyFactory.CONFIGURATION.FACTORY.PARENT).getAsString(); + if (this.jsonFactorySection.has(EntaxyFactory.CONFIGURATION.FACTORY.REQUIRES)) { + JsonElement je = this.jsonFactorySection.get(EntaxyFactory.CONFIGURATION.FACTORY.REQUIRES); + if (je.isJsonArray()) { + JsonArray ja = je.getAsJsonArray(); + ja.forEach(item->this.requirements.add(item.getAsString())); + } + if (je.isJsonPrimitive()) { + this.requirements.add(je.getAsString()); + } + } + } + } + + public boolean isValid() { + return CommonUtils.isValid(factoryId); + } + + public void setParent(String parentValue) { + this.parent = parentValue; + JsonObject fs = this.jsonOrigin.get(EntaxyFactory.CONFIGURATION.FACTORY_SECTION_NAME).getAsJsonObject(); + fs.remove(EntaxyFactory.CONFIGURATION.FACTORY.PARENT); + fs.addProperty(EntaxyFactory.CONFIGURATION.FACTORY.PARENT, parentValue); + } + + public void attachParent(TrackedManagedFactory parentTmf) { + if (this.parentFactory != parentTmf) + detachParent(); + this.parentFactory = parentTmf; + parentTmf.attachAffected(this); + this.isUpToDate = false; + } + + public void detachParent() { + if (this.parentFactory != null) { + this.parentFactory.detachAffected(this); + this.parentFactory = null; + } + } + + public void addRequirement(String req) { + if (!this.requirements.contains(req)) + this.requirements.add(req); + } + public void attachRequirement(TrackedManagedFactory requiredTmf) { + if (!this.requiredFactories.contains(requiredTmf)) + this.requiredFactories.add(requiredTmf); + requiredTmf.attachAffected(this); + } + public void detachRequirements() { + for (TrackedManagedFactory tmf: requiredFactories) + tmf.detachAffected(this); + this.requiredFactories.clear(); + } + + public void attachAffected(TrackedManagedFactory affectedTmf) { + if (!this.affectedFactories.contains(affectedTmf)) + this.affectedFactories.add(affectedTmf); + } + public void detachAffected(TrackedManagedFactory affectedTmf) { + this.affectedFactories.remove(affectedTmf); + } + + public void addWaiting(String waitFactoryId) { + if (!this.waitingFor.contains(waitFactoryId)) + this.waitingFor.add(waitFactoryId); + } + public boolean isWaiting(String waitFactoryId) { + return this.waitingFor.contains(waitFactoryId); + } + public void stopWaiting(String waitFactoryId) { + this.waitingFor.remove(waitFactoryId); + } + + public boolean isConsistent() { + return this.waitingFor.isEmpty(); + } + + public void updateConfiguration(JsonObject jsonObject) { + this.jsonFinal = jsonObject.deepCopy(); + this.isUpToDate = true; + } + + public void activate() { + this.isActive = true; + } + + public void deactivate() { + this.trackedFactory.unregister(); + this.isActive = false; + } + + } + +} diff --git a/platform/runtime/base/objects-base/object-factory/src/main/resources/ru/entaxy/factory/base-object.json b/platform/runtime/base/objects-base/object-factory/src/main/resources/ru/entaxy/factory/base-object.json new file mode 100644 index 00000000..9fc7efd0 --- /dev/null +++ b/platform/runtime/base/objects-base/object-factory/src/main/resources/ru/entaxy/factory/base-object.json @@ -0,0 +1,62 @@ +{ + "factory": { + "id": "base-object", + "type": "entaxy.runtime.object", + "description": "Abstract object", + "isAbstract": true, + "label": "object" + }, + "entaxy.runtime.object": { + "isEntaxyObject": true + }, + "fields": { + "objectId": { + "displayName": "Object Id", + "type": "String", + "required": true, + "immutable": true, + "addToOutput": "*" + }, + "##publish": { + "type": "Map", + "required": true, + "isHidden": true, + "configurable": false, + "defaultValue":{ + "name": { + "@CALCULATED": { + "expression": "${objectId}", + "lazy": true + } + }, + "factory": { + "@CALCULATED": { + "expression": "${factoryId}", + "lazy": false + } + }, + "label": { + "@CALCULATED": { + "expression": "${#FACTORY#.factory.label}", + "lazy": false + } + }, + "scope": { + "@CALCULATED": { + "expression": "${scope}", + "allowObjects": false, + "lazy": false + } + } + } + } + }, + "outputs": { + "init": { + "isDefault": true, + "fields": { + "##publish": {} + } + } + } +} \ No newline at end of file diff --git a/platform/runtime/base/resources/LICENSE.txt b/platform/runtime/base/resources/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/base/resources/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/base/resources/pom.xml b/platform/runtime/base/resources/pom.xml new file mode 100644 index 00000000..8fe671cd --- /dev/null +++ b/platform/runtime/base/resources/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + ru.entaxy.esb.platform.runtime + base + 1.8.3 + + ru.entaxy.esb.platform.runtime.base + resources + pom + ENTAXY :: PLATFORM :: BASE :: RESOURCES + ENTAXY :: PLATFORM :: BASE :: RESOURCES + + resources-api + resources-service + resources-management + + \ No newline at end of file diff --git a/platform/runtime/base/resources/resources-api/LICENSE.txt b/platform/runtime/base/resources/resources-api/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/base/resources/resources-api/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/base/resources/resources-api/pom.xml b/platform/runtime/base/resources/resources-api/pom.xml new file mode 100644 index 00000000..5120dd3f --- /dev/null +++ b/platform/runtime/base/resources/resources-api/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + ru.entaxy.esb.platform.runtime.base + resources + 1.8.3 + + ru.entaxy.esb.platform.runtime.base.resources + resources-api + bundle + ENTAXY :: PLATFORM :: BASE :: RESOURCES :: API + ENTAXY :: PLATFORM :: BASE :: RESOURCES :: API + + + ru.entaxy.esb.resources + + + \ No newline at end of file diff --git a/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResource.java b/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResource.java new file mode 100644 index 00000000..1c1d20a5 --- /dev/null +++ b/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResource.java @@ -0,0 +1,36 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-api + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources; + +import java.io.InputStream; +import java.net.URL; + +public interface EntaxyResource { + + InputStream getInputStream(); + String getAsString(); + + void save(InputStream inputStream); + + boolean exists(); + + URL getLocation(); + +} diff --git a/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResourceProvider.java b/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResourceProvider.java new file mode 100644 index 00000000..8fe18cb0 --- /dev/null +++ b/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResourceProvider.java @@ -0,0 +1,27 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-api + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources; + +public interface EntaxyResourceProvider { + + String getProtocol(); + EntaxyResource getResource(String location); + +} diff --git a/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResourceService.java b/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResourceService.java new file mode 100644 index 00000000..584bc7f0 --- /dev/null +++ b/platform/runtime/base/resources/resources-api/src/main/java/ru/entaxy/esb/resources/EntaxyResourceService.java @@ -0,0 +1,26 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-api + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources; + +public interface EntaxyResourceService { + + EntaxyResource getResource(String location); + +} diff --git a/platform/runtime/base/resources/resources-management/LICENSE.txt b/platform/runtime/base/resources/resources-management/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/base/resources/resources-management/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/base/resources/resources-management/pom.xml b/platform/runtime/base/resources/resources-management/pom.xml new file mode 100644 index 00000000..c0f87a61 --- /dev/null +++ b/platform/runtime/base/resources/resources-management/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + ru.entaxy.esb.platform.runtime.base + resources + 1.8.3 + + ru.entaxy.esb.platform.runtime.base.resources + resources-management + bundle + ENTAXY :: PLATFORM :: BASE :: RESOURCES :: MANAGEMENT + ENTAXY :: PLATFORM :: BASE :: RESOURCES :: MANAGEMENT + + + ru.entaxy.esb.resources.management + ru.entaxy.esb.resources.management.impl + + + + + ru.entaxy.esb.platform.runtime.base + management-core + ${project.version} + + + ru.entaxy.esb.platform.runtime.base.resources + resources-api + ${project.version} + + + + \ No newline at end of file diff --git a/platform/runtime/base/resources/resources-management/src/main/java/ru/entaxy/esb/resources/management/EntaxyResourceServiceMBean.java b/platform/runtime/base/resources/resources-management/src/main/java/ru/entaxy/esb/resources/management/EntaxyResourceServiceMBean.java new file mode 100644 index 00000000..cd3b4499 --- /dev/null +++ b/platform/runtime/base/resources/resources-management/src/main/java/ru/entaxy/esb/resources/management/EntaxyResourceServiceMBean.java @@ -0,0 +1,38 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-management + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources.management; + +import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated; +import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy; +import ru.entaxy.esb.platform.base.management.core.api.Operation; +import ru.entaxy.esb.platform.base.management.core.api.Parameter; + +@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATED_ONLY) +public interface EntaxyResourceServiceMBean { + + public static final String RESOURCE_SERVICE_KEY = "category"; + + public static final String RESOURCE_SERVICE_KEY_VALUE = "resource"; + + @Operation(desc = "Get resource from location") + String getResource( + @Parameter(name = "location", desc = "Location of the resource") String location) throws Exception; + +} diff --git a/platform/runtime/base/resources/resources-management/src/main/java/ru/entaxy/esb/resources/management/impl/EntaxyResourceServiceMBeanImpl.java b/platform/runtime/base/resources/resources-management/src/main/java/ru/entaxy/esb/resources/management/impl/EntaxyResourceServiceMBeanImpl.java new file mode 100644 index 00000000..1ee2d1fb --- /dev/null +++ b/platform/runtime/base/resources/resources-management/src/main/java/ru/entaxy/esb/resources/management/impl/EntaxyResourceServiceMBeanImpl.java @@ -0,0 +1,58 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-management + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources.management.impl; + +import org.osgi.framework.BundleContext; +import org.osgi.service.component.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ru.entaxy.esb.platform.base.management.core.ManagementCore; +import ru.entaxy.esb.platform.base.management.core.api.AnnotatedMBean; +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.esb.resources.management.EntaxyResourceServiceMBean; + +import javax.management.DynamicMBean; +import javax.management.MBeanRegistration; +import javax.management.NotCompliantMBeanException; + +@Component(service = { EntaxyResourceServiceMBean.class, DynamicMBean.class, MBeanRegistration.class }, property = { + ManagementCore.JMX_OBJECTNAME + "=" + ManagementCore.Q_RUNTIME_S + "," + EntaxyResourceServiceMBean.RESOURCE_SERVICE_KEY + "=" + + EntaxyResourceServiceMBean.RESOURCE_SERVICE_KEY_VALUE }, scope = ServiceScope.SINGLETON, immediate = true) +public class EntaxyResourceServiceMBeanImpl extends AnnotatedMBean + implements EntaxyResourceServiceMBean { + + private static final Logger log = LoggerFactory.getLogger(EntaxyResourceServiceMBeanImpl.class); + + protected BundleContext bundleContext; + + @Reference(cardinality = ReferenceCardinality.MANDATORY + , service = EntaxyResourceService.class + , collectionType = CollectionType.SERVICE) + EntaxyResourceService entaxyResourceService; + + public EntaxyResourceServiceMBeanImpl() throws NotCompliantMBeanException { + super(EntaxyResourceServiceMBean.class); + } + + @Override + public String getResource(String location) throws Exception { + return entaxyResourceService.getResource(location).getAsString(); + } +} diff --git a/platform/runtime/base/resources/resources-service/LICENSE.txt b/platform/runtime/base/resources/resources-service/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/base/resources/resources-service/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/base/resources/resources-service/pom.xml b/platform/runtime/base/resources/resources-service/pom.xml new file mode 100644 index 00000000..5e97e241 --- /dev/null +++ b/platform/runtime/base/resources/resources-service/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + + ru.entaxy.esb.platform.runtime.base + resources + 1.8.3 + + ru.entaxy.esb.platform.runtime.base.resources + resources-service + bundle + ENTAXY :: PLATFORM :: BASE :: RESOURCES :: SERVICE + ENTAXY :: PLATFORM :: BASE :: RESOURCES :: SERVICE + + + ru.entaxy.esb.resources.provider + + ru.entaxy.esb.resources.impl, + ru.entaxy.esb.resources.tracker + + + + + + org.osgi + org.osgi.service.component.annotations + + + org.apache.felix + org.apache.felix.scr + + + commons-io + commons-io + ${commons-io.version} + + + ru.entaxy.esb.platform.runtime.base + base-support + ${project.version} + + + ru.entaxy.esb.platform.runtime.base.resources + resources-api + ${project.version} + + + + + \ No newline at end of file diff --git a/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/impl/EntaxyResourceServiceImpl.java b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/impl/EntaxyResourceServiceImpl.java new file mode 100644 index 00000000..9133650f --- /dev/null +++ b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/impl/EntaxyResourceServiceImpl.java @@ -0,0 +1,80 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-service + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicyOption; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.esb.resources.EntaxyResource; +import ru.entaxy.esb.resources.EntaxyResourceProvider; +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.platform.base.support.CommonUtils; + +@Component (service = EntaxyResourceService.class, immediate = true) +public class EntaxyResourceServiceImpl implements EntaxyResourceService { + + private static final Logger log = LoggerFactory.getLogger(EntaxyResourceServiceImpl.class); + + protected Map providers = new HashMap<>(); + + @Reference (cardinality = ReferenceCardinality.MULTIPLE, collectionType = CollectionType.SERVICE + , policyOption = ReferencePolicyOption.GREEDY + , unbind = "removeProvider") + public void addProvider(EntaxyResourceProvider provider) { + synchronized (providers) { + this.providers.put(provider.getProtocol(), provider); + log.info("RESOURCE PROVIDER ADDED: " + provider.getProtocol()); + } + } + + public void removeProvider(EntaxyResourceProvider provider) { + synchronized (providers) { + this.providers.remove(provider.getProtocol()); + } + } + + + @Override + public EntaxyResource getResource(String location) { + if (!CommonUtils.isValid(location)) + return null; + int index = location.indexOf(":"); + if (index>0) { + String protocol = location.substring(0, index); + String path = location.substring(index+1); + if (providers.containsKey(protocol)) { + return providers.get(protocol).getResource(path); + } else { + log.warn("Provider not found for protocol: [{}]", protocol); + return null; + } + } + return null; + } + +} diff --git a/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/provider/FileResourceProvider.java b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/provider/FileResourceProvider.java new file mode 100644 index 00000000..cdb50917 --- /dev/null +++ b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/provider/FileResourceProvider.java @@ -0,0 +1,152 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-service + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources.provider; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; +import java.nio.channels.FileLock; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.esb.resources.EntaxyResource; +import ru.entaxy.esb.resources.EntaxyResourceProvider; + +public class FileResourceProvider implements EntaxyResourceProvider { + + private static final Logger log = LoggerFactory.getLogger(FileResourceProvider.class); + + private String protocol; + private String rootDirectory; + private File root; + + @Override + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getRootDirectory() { + return rootDirectory; + } + + public void setRootDirectory(String rootDirectory) { + this.rootDirectory = rootDirectory; + root = new File(this.rootDirectory); + if (!root.exists()) + root.mkdirs(); + } + + @Override + public EntaxyResource getResource(String location) { + Path rootPath = root.toPath(); + Path targetPath = Paths.get(rootPath.toString(), location); + log.debug("TARGET PATH :: " + targetPath.toAbsolutePath().toString()); + File targetFile = new File(targetPath.toAbsolutePath().toString()); + log.debug("TARGET FILE :: " + targetFile.getAbsolutePath()); + return new FileResource(targetFile); + } + + public static class FileResource implements EntaxyResource { + + private File file; + + public FileResource(File file) { + this.file = file; + } + + @Override + public InputStream getInputStream() { + if (!exists()) + return null; + try { + return file.toURI().toURL().openStream(); + } catch (IOException e) { + FileResourceProvider.log.error("Error getting resource", e); + return null; + } + } + + @Override + public String getAsString() { + if (!exists()) + return null; + try { + return IOUtils.toString(getInputStream()); + } catch (IOException e) { + FileResourceProvider.log.error("Error getting resource as string", e); + } + return null; + } + + @Override + public void save(InputStream inputStream) { + if (!file.exists()) + try { + log.debug("\nMAKE DIRS", file.getParentFile().getAbsolutePath()); + file.getParentFile().mkdirs(); + // file.createNewFile(); + } catch (Exception e1) { + log.error("Error creating resource", e1); + } + try (FileOutputStream fileOutputStream = new FileOutputStream(file)){ + FileChannel channel = fileOutputStream.getChannel(); + FileLock lock = channel.lock(); + byte[] bytes = IOUtils.toByteArray(inputStream); + channel.write(ByteBuffer.wrap(bytes)); + + lock.release(); + channel.close(); + IOUtils.closeQuietly(fileOutputStream); + + } catch (Exception e) { + log.error("Error saving resource", e); + } + } + + @Override + public boolean exists() { + return file.exists(); + } + + @Override + public URL getLocation() { + try { + return this.file.toURI().toURL(); + } catch (MalformedURLException e) { + return null; + } + } + + } + +} diff --git a/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProvider.java b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProvider.java new file mode 100644 index 00000000..7a6f63ef --- /dev/null +++ b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProvider.java @@ -0,0 +1,103 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-service + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources.tracker; + +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.osgi.framework.Bundle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.platform.base.support.CommonUtils; + +public class ResourceProvider { + + private static final Logger log = LoggerFactory.getLogger(ResourceProvider.class); + + public static final String RESOURCE_PATH = "/ru/entaxy/resource"; + + protected Bundle bundle; + + protected Map> resources = new HashMap<>(); + + public ResourceProvider(Bundle bundle) { + this.bundle = bundle; + } + + public Map> getResources(){ + if (!resources.isEmpty()) + return resources; + + Enumeration foundEntries = bundle.findEntries(ResourceProvider.RESOURCE_PATH, "*.*", true); + while (foundEntries.hasMoreElements()) { + URL entry = foundEntries.nextElement(); + log.debug("FOUND :: " + entry.toString()); + if (entry.toString().endsWith("/")) { + log.debug(":: .. is folder"); + continue; + } + String localPath = entry.toString(); + localPath = localPath.substring(localPath.indexOf(ResourceProvider.RESOURCE_PATH) + ResourceProvider.RESOURCE_PATH.length() + 1); + + String resourceName = localPath.substring(localPath.lastIndexOf("/")+1); + + String path = localPath.lastIndexOf("/")>=0 + ?localPath.substring(0, localPath.lastIndexOf("/")) + :""; + int splitIndex = path.indexOf("/"); + String protocol = splitIndex>0 + ?path.substring(0, splitIndex) + :""; + + if (splitIndex>0) + path = path.substring(splitIndex+1); + + if (!CommonUtils.isValid(protocol) || !CommonUtils.isValid(resourceName)) + continue; + + if (!resources.containsKey(protocol)) + resources.put(protocol, new ArrayList<>()); + + resources.get(protocol).add(new ResourceDescriptor(entry, path + "/" + resourceName)); + + } + + return resources; + + } + + public static class ResourceDescriptor { + + public URL url; + public String location; + + public ResourceDescriptor(URL url, String location) { + this.url = url; + this.location = location; + } + + } + +} diff --git a/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProviderCustomizer.java b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProviderCustomizer.java new file mode 100644 index 00000000..2690e3b9 --- /dev/null +++ b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProviderCustomizer.java @@ -0,0 +1,39 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-service + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources.tracker; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleEvent; + +import ru.entaxy.platform.base.support.osgi.tracker.UniformBundleTrackerCustomizer; + +public class ResourceProviderCustomizer extends UniformBundleTrackerCustomizer> { + + @Override + protected List createManagedObject(Bundle bundle, BundleEvent event, + Map> filterResults) { + return Collections.singletonList(new ResourceProvider(bundle)); + } + +} diff --git a/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProviderCustomizerListener.java b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProviderCustomizerListener.java new file mode 100644 index 00000000..67563a23 --- /dev/null +++ b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/ResourceProviderCustomizerListener.java @@ -0,0 +1,92 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-service + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources.tracker; + +import java.io.IOException; +import java.net.URL; +import java.util.List; +import java.util.Map; + +import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.esb.resources.EntaxyResource; +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.esb.resources.tracker.ResourceProvider.ResourceDescriptor; +import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerCustomizerListener; + +public class ResourceProviderCustomizerListener implements BundleTrackerCustomizerListener> { + + private static final Logger log = LoggerFactory.getLogger(ResourceProviderCustomizerListener.class); + + protected BundleContext bundleContext; + + protected EntaxyResourceService entaxyResourceService; + + public ResourceProviderCustomizerListener(BundleContext context, EntaxyResourceService service) { + this.bundleContext = context; + this.entaxyResourceService = service; + } + + @Override + public void added(List managedObject) { + for (ResourceProvider provider: managedObject) { + Map> resources = provider.getResources(); + String message = ""; + message += "\nFOUND RESOURCES"; + for (String protocol: resources.keySet()) { + message += "\n\tPROTOCOL :: " + protocol; + List list = resources.get(protocol); + for (ResourceDescriptor rd: list) { + message += "\n\t\t :: " + rd.location + " | " + rd.url.toString(); + + EntaxyResource resource = entaxyResourceService.getResource(protocol + ":" + rd.location); + if (resource == null) { + message += "\n\t\t -> NULL"; + } else { + try { + resource.save(rd.url.openStream()); + message += "\n\t\t -> " + resource.getAsString(); + } catch (IOException e) { + log.error("Error saving resource", e); + } + } + + } + } + log.debug(message); + } + + } + + @Override + public void modified(List managedObject) { + // TODO Auto-generated method stub + + } + + @Override + public void removed(List managedObject) { + // TODO Auto-generated method stub + + } + +} diff --git a/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/TrackerManager.java b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/TrackerManager.java new file mode 100644 index 00000000..ad2ffa15 --- /dev/null +++ b/platform/runtime/base/resources/resources-service/src/main/java/ru/entaxy/esb/resources/tracker/TrackerManager.java @@ -0,0 +1,62 @@ +/*- + * ~~~~~~licensing~~~~~~ + * resources-service + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.resources.tracker; + +import java.util.List; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.util.tracker.BundleTracker; + +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerUtils; +import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleHeaderFilter; + +@Component +public class TrackerManager { + + protected BundleContext bundleContext; + + protected BundleTracker> providerTracker; + + @Reference (cardinality = ReferenceCardinality.MANDATORY) + EntaxyResourceService entaxyResourceService; + + @Activate + public void activate(ComponentContext componentContext) { + this.bundleContext = componentContext.getBundleContext(); + providerTracker = BundleTrackerUtils.>createBuilder() + .addFilter( + (new BundleHeaderFilter()).header("Entaxy-Resource-Provider") + ) + .customizer( + (new ResourceProviderCustomizer()) + .listener(new ResourceProviderCustomizerListener(bundleContext, entaxyResourceService)) + ) + .bundleState(Bundle.ACTIVE | Bundle.INSTALLED | Bundle.RESOLVED) + .get(); + providerTracker.open(); } + +} diff --git a/platform/runtime/base/src/main/features/support.xml b/platform/runtime/base/src/main/features/support.xml new file mode 100644 index 00000000..519e0599 --- /dev/null +++ b/platform/runtime/base/src/main/features/support.xml @@ -0,0 +1,54 @@ + + + + + + + mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features + mvn:ru.entaxy.esb.underlying/entaxy-underlying-features/${project.version}/xml/features + + + mvn:ru.entaxy.esb.system/system-parent/${project.version}/xml/basics + + + mvn:ru.entaxy.esb.platform.runtime.base/base-support/${project.version} + + + + base-support + mvn:ru.entaxy.esb.platform.runtime.base.resources/resources-api/${project.version} + mvn:ru.entaxy.esb.platform.runtime.base.resources/resources-service/${project.version} + mvn:ru.entaxy.esb.platform.runtime.base.resources/resources-management/${project.version} + + + + base-support + mvn:ru.entaxy.esb.platform.runtime.base.connecting.generator/generator-api/${project.version} + mvn:ru.entaxy.esb.platform.runtime.base.connecting.generator/generator-factory/${project.version} + mvn:ru.entaxy.esb.platform.runtime.base.connecting.generator/template-service-shell/${project.version} + mvn:ru.entaxy.esb.platform.runtime.base.connecting.generator/ftl-generator/${project.version} + mvn:ru.entaxy.esb.platform.runtime.base.connecting.generator/common-templates-collection/${project.version} + + + diff --git a/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/ResourceLoader.java b/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/ResourceLoader.java new file mode 100644 index 00000000..efaddcc1 --- /dev/null +++ b/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/ResourceLoader.java @@ -0,0 +1,128 @@ +/*- + * ~~~~~~licensing~~~~~~ + * schema-impl + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.platform.runtime.core.infrastructure.schema.resolver.resource; + +import java.io.File; +import java.nio.file.Files; +import java.util.Calendar; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.file.GenericFile; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.esb.platform.runtime.core.infrastructure.schema.api.ResourceService; +import ru.entaxy.esb.platform.runtime.core.infrastructure.schema.api.entity.Resource; +import ru.entaxy.esb.platform.runtime.core.infrastructure.schema.api.entity.ResourceInfo; + +public class ResourceLoader implements Processor { + + private static final Logger log = LoggerFactory.getLogger(ResourceLoader.class); + + protected ResourceService resourceService; + + public ResourceService getResourceService() { + return resourceService; + } + + public void setResourceService(ResourceService resourceService) { + this.resourceService = resourceService; + } + + @Override + public void process(Exchange exchange) throws Exception { + log.info("BODY IS [{}]\nHEADERS ARE:\n{}" + , exchange.getIn().getBody().getClass().getName() + , exchange.getIn().getHeaders().toString()); + String camelFileName = exchange.getIn().getHeader("CamelFilePath", String.class); + String fileNameAndPath = camelFileName;//.substring(0, camelFileName.lastIndexOf(".")); + String fileName = getFileName(camelFileName); + String filePath = getFilePath(camelFileName); + String fileType = camelFileName.substring(camelFileName.lastIndexOf(".")+1); + + Resource resource = null; + + try { + resource = resourceService.getResourceByFullName(fileNameAndPath).orElse(null); + } catch (Exception e) { + + } + if (resource ==null) { + + resource = new Resource(); + resource.setCreatedBy("admin"); + resource.setCreatedDate(Calendar.getInstance().getTime()); + + GenericFile genericFile = exchange.getIn().getBody(GenericFile.class); + log.info("FILE IS {}", genericFile.getFile().getClass().getName()); + + + resource.setResourceValue( + Files.readAllBytes(((File)genericFile.getFile()).toPath()) + ); + + long resourceId = resourceService.loadResource(resource); + + ResourceInfo resourceInfo = new ResourceInfo(); + resourceInfo.setCreatedBy("admin"); + resourceInfo.setCreatedDate(Calendar.getInstance().getTime()); + resourceInfo.setConvertor(false); + resourceInfo.setDescription("Automatically loaded with type [" + fileType + "]"); + + + resourceInfo.setName(fileName); + resourceInfo.setPath(filePath); + + resourceInfo.setVersion("1.0"); + resourceInfo.setResourceId(resourceId); + + long resourceInfoId = resourceService.loadResourceInfo(resourceInfo); + + log.info("ResourceInfo id is [" + resourceInfoId + "]"); + + } else { + GenericFile genericFile = exchange.getIn().getBody(GenericFile.class); + log.info("FILE IS {}", genericFile.getFile().getClass().getName()); + + + resource.setResourceValue( + Files.readAllBytes(((File)genericFile.getFile()).toPath()) + ); + + resourceService.reloadResource(resource); + } + + } + + private String getFileName(String fileNameAndPath) { + String[] splitted = fileNameAndPath.split(File.separator); + return splitted[splitted.length-1]; + } + + private String getFilePath(String fileNameAndPath) { + String[] splitted = fileNameAndPath.split(File.separator); + String path = null; + if (splitted.length>1) { + path = fileNameAndPath.substring(0, fileNameAndPath.length() - splitted[splitted.length-1].length()); + } + return path; + } +} diff --git a/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/ResourceRegistryURLResolver.java b/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/ResourceRegistryURLResolver.java new file mode 100644 index 00000000..43260dd2 --- /dev/null +++ b/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/ResourceRegistryURLResolver.java @@ -0,0 +1,93 @@ +/*- + * ~~~~~~licensing~~~~~~ + * schema-impl + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.platform.runtime.core.infrastructure.schema.resolver.resource; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.url.AbstractURLStreamHandlerService; +import org.osgi.service.url.URLStreamHandlerService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.esb.platform.runtime.core.infrastructure.schema.api.ResourceService; +import ru.entaxy.esb.platform.runtime.core.infrastructure.schema.api.entity.Resource; + +@Component(service = URLStreamHandlerService.class, property = "url.handler.protocol=resource-registry", immediate = true) +public class ResourceRegistryURLResolver extends AbstractURLStreamHandlerService { + + private static final Logger log = LoggerFactory.getLogger(ResourceRegistryURLResolver.class); + + @Reference (collectionType = CollectionType.SERVICE, cardinality = ReferenceCardinality.MANDATORY) + ResourceService resourceService; + + protected static class SchemaRegistryURLConnection extends URLConnection { + + ResourceService resourceService; + + protected String resourceName = null; + protected String resourceVersion = null; + + protected SchemaRegistryURLConnection(URL url, ResourceService resourceService) { + super(url); + this.resourceService = resourceService; + log.info("NEW CONNECTION TO: " + url.toString()); + String remaining = url.toString().substring(url.toString().indexOf(":")+1); + String[] splitted = remaining.split(File.separator); + if (splitted.length>1) { + resourceVersion = splitted[splitted.length - 1]; + resourceName = remaining.substring(0, remaining.length() - resourceVersion.length()); + } else { + resourceName = remaining; + } + } + + @Override + public void connect() throws IOException { + log.info("CONNECTING: " + url.toString()); + } + + @Override + public InputStream getInputStream() throws IOException { + Resource resource = resourceService.getResourceByFullName(resourceName).orElse(null); + log.info("RESOURCE [{}] {} FOUND " + , resourceName + , resource==null?"NOT":""); + if (resource == null) + return super.getInputStream(); + return new ByteArrayInputStream(resource.getResourceValue()); + } + + } + + @Override + public URLConnection openConnection(URL u) throws IOException { + return new SchemaRegistryURLConnection(u, resourceService); + } + +} diff --git a/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/SchemaRegistryHelper.java b/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/SchemaRegistryHelper.java new file mode 100644 index 00000000..c0673819 --- /dev/null +++ b/platform/runtime/core/infrastructure/schema/schema-impl/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/resolver/resource/SchemaRegistryHelper.java @@ -0,0 +1,25 @@ +/*- + * ~~~~~~licensing~~~~~~ + * schema-impl + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.esb.platform.runtime.core.infrastructure.schema.resolver.resource; + + +public class SchemaRegistryHelper { + +} diff --git a/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByFullNameRequest.java b/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByFullNameRequest.java new file mode 100644 index 00000000..07a2e6c3 --- /dev/null +++ b/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByFullNameRequest.java @@ -0,0 +1,83 @@ +/*- + * ~~~~~~licensing~~~~~~ + * schema-soap + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ + +package ru.entaxy.esb.platform.runtime.core.infrastructure.schema.soap.cxf; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="fullName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "fullName" +}) +@XmlRootElement(name = "getResourceInfoListByFullNameRequest") +public class GetResourceInfoListByFullNameRequest { + + @XmlElement(required = true) + protected String fullName; + + /** + * Gets the value of the fullName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFullName() { + return fullName; + } + + /** + * Sets the value of the fullName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFullName(String value) { + this.fullName = value; + } + +} diff --git a/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByFullPathRequest.java b/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByFullPathRequest.java new file mode 100644 index 00000000..9a5491e7 --- /dev/null +++ b/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByFullPathRequest.java @@ -0,0 +1,83 @@ +/*- + * ~~~~~~licensing~~~~~~ + * schema-soap + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ + +package ru.entaxy.esb.platform.runtime.core.infrastructure.schema.soap.cxf; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="path" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "path" +}) +@XmlRootElement(name = "getResourceInfoListByFullPathRequest") +public class GetResourceInfoListByFullPathRequest { + + @XmlElement(required = true) + protected String path; + + /** + * Gets the value of the path property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPath() { + return path; + } + + /** + * Sets the value of the path property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPath(String value) { + this.path = value; + } + +} diff --git a/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByPathRequest.java b/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByPathRequest.java new file mode 100644 index 00000000..c91632e9 --- /dev/null +++ b/platform/runtime/core/infrastructure/schema/schema-soap/src/main/java/ru/entaxy/esb/platform/runtime/core/infrastructure/schema/soap/cxf/GetResourceInfoListByPathRequest.java @@ -0,0 +1,83 @@ +/*- + * ~~~~~~licensing~~~~~~ + * schema-soap + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ + +package ru.entaxy.esb.platform.runtime.core.infrastructure.schema.soap.cxf; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="path" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "path" +}) +@XmlRootElement(name = "getResourceInfoListByPathRequest") +public class GetResourceInfoListByPathRequest { + + @XmlElement(required = true) + protected String path; + + /** + * Gets the value of the path property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPath() { + return path; + } + + /** + * Sets the value of the path property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPath(String value) { + this.path = value; + } + +} diff --git a/platform/runtime/core/initializer/storage-initializer/esb_entaxy/src/main/resources/db/changeset/016-temp-add-permission-to-universal.xml b/platform/runtime/core/initializer/storage-initializer/esb_entaxy/src/main/resources/db/changeset/016-temp-add-permission-to-universal.xml new file mode 100644 index 00000000..5621ef23 --- /dev/null +++ b/platform/runtime/core/initializer/storage-initializer/esb_entaxy/src/main/resources/db/changeset/016-temp-add-permission-to-universal.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + diff --git a/platform/runtime/core/object-producing/object-producer-api/src/main/java/ru/entaxy/platform/core/producer/api/EntaxyFactoryDataProcessor.java b/platform/runtime/core/object-producing/object-producer-api/src/main/java/ru/entaxy/platform/core/producer/api/EntaxyFactoryDataProcessor.java new file mode 100644 index 00000000..a28e97c9 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-api/src/main/java/ru/entaxy/platform/core/producer/api/EntaxyFactoryDataProcessor.java @@ -0,0 +1,28 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-api + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.api; + +public interface EntaxyFactoryDataProcessor { + + default Object processDefaultValue(Object currentValue) { + return currentValue; + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/config/producing.lifecycles.json b/platform/runtime/core/object-producing/object-producer-core/src/main/config/producing.lifecycles.json new file mode 100644 index 00000000..36c16894 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/config/producing.lifecycles.json @@ -0,0 +1,20 @@ +{ + "general": { + "*":{"printOutput":false, "maxCount": 50}, + "add-config":{}, + "process-resources":{}, + "validate":{}, + "generate":{}, + "build":{"artifact.version.policy":"dated-embedded"}, + "install":{"installLocal":false, "update":""}, + "deploy":{"deployLocal":false}, + "store": {} + }, + "local": { + "install":{"installLocal":true}, + "deploy":{"deployLocal":true} + }, + "debug": { + "*":{"printOutput":true} + } +} \ No newline at end of file diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/BuiltObject.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/BuiltObject.java new file mode 100644 index 00000000..e9fab6bd --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/BuiltObject.java @@ -0,0 +1,26 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.builder; + +public interface BuiltObject { + + Object getObject(); + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/BuiltObjectList.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/BuiltObjectList.java new file mode 100644 index 00000000..6ab1f698 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/BuiltObjectList.java @@ -0,0 +1,32 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.builder; + +import java.util.Collections; + +import org.apache.commons.collections4.list.AbstractLinkedList; + +public class BuiltObjectList extends AbstractLinkedList { + + public BuiltObjectList() { + super(Collections.emptyList()); + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/DefaultBuiltObject.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/DefaultBuiltObject.java new file mode 100644 index 00000000..afbf0a79 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/DefaultBuiltObject.java @@ -0,0 +1,35 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.builder; + +public class DefaultBuiltObject implements BuiltObject { + + protected Object object; + + public DefaultBuiltObject(Object object) { + this.object = object; + } + + @Override + public Object getObject() { + return object; + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/ObjectBuilder.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/ObjectBuilder.java new file mode 100644 index 00000000..9ec34961 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/builder/ObjectBuilder.java @@ -0,0 +1,31 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.builder; + +import java.util.Map; + +import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated; + +public interface ObjectBuilder { + + boolean isBuildable(Generated generated); + BuiltObject build(Generated generated, Map instructions) throws Exception; + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DefaultDeployedObject.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DefaultDeployedObject.java new file mode 100644 index 00000000..b83b99a4 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DefaultDeployedObject.java @@ -0,0 +1,35 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.deployer; + +public class DefaultDeployedObject implements DeployedObject { + + protected Object object; + + public DefaultDeployedObject(Object object) { + this.object = object; + } + + @Override + public Object getObject() { + return object; + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DeployedObject.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DeployedObject.java new file mode 100644 index 00000000..7406cd2c --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DeployedObject.java @@ -0,0 +1,26 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.deployer; + +public interface DeployedObject { + + Object getObject(); + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DeployedObjectList.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DeployedObjectList.java new file mode 100644 index 00000000..0959b9e0 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/DeployedObjectList.java @@ -0,0 +1,32 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.deployer; + +import java.util.Collections; + +import org.apache.commons.collections4.list.AbstractLinkedList; + +public class DeployedObjectList extends AbstractLinkedList { + + public DeployedObjectList() { + super(Collections.emptyList()); + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/ObjectDeployer.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/ObjectDeployer.java new file mode 100644 index 00000000..9211e7e2 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/deployer/ObjectDeployer.java @@ -0,0 +1,31 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.deployer; + +import java.util.Map; + +import ru.entaxy.platform.core.producer.executor.builder.BuiltObject; + +public interface ObjectDeployer { + + boolean isDeployable(BuiltObject object); + DeployedObject deploy(BuiltObject object, Map instructions) throws Exception; + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/DefaultInstalledObject.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/DefaultInstalledObject.java new file mode 100644 index 00000000..f9940c8d --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/DefaultInstalledObject.java @@ -0,0 +1,35 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.installer; + +public class DefaultInstalledObject implements InstalledObject { + + protected Object object; + + public DefaultInstalledObject(Object object) { + this.object = object; + } + + @Override + public Object getObject() { + return object; + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/InstalledObject.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/InstalledObject.java new file mode 100644 index 00000000..b16fedb6 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/InstalledObject.java @@ -0,0 +1,26 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.installer; + +public interface InstalledObject { + + Object getObject(); + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/InstalledObjectList.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/InstalledObjectList.java new file mode 100644 index 00000000..63db7f03 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/InstalledObjectList.java @@ -0,0 +1,32 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.installer; + +import java.util.Collections; + +import org.apache.commons.collections4.list.AbstractLinkedList; + +public class InstalledObjectList extends AbstractLinkedList { + + public InstalledObjectList() { + super(Collections.emptyList()); + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/ObjectInstaller.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/ObjectInstaller.java new file mode 100644 index 00000000..558e56ce --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/installer/ObjectInstaller.java @@ -0,0 +1,31 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.installer; + +import java.util.Map; + +import ru.entaxy.platform.core.producer.executor.deployer.DeployedObject; + +public interface ObjectInstaller { + + boolean isInstallable(DeployedObject object); + InstalledObject install(DeployedObject object, Map instructions) throws Exception; + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/AbstractPrintOutputSupport.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/AbstractPrintOutputSupport.java new file mode 100644 index 00000000..96ef9331 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/AbstractPrintOutputSupport.java @@ -0,0 +1,53 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.support; + +import java.util.Map; + +import ru.entaxy.platform.core.producer.api.EntaxyProducerService.INSTRUCTIONS; + +public class AbstractPrintOutputSupport implements PrintOutputSupport{ + + protected boolean isPrintOutput = false; + + @Override + public boolean isPrintOutput() { + return isPrintOutput; + } + + @Override + public void setPrintOutput(boolean isPrintOutput) { + this.isPrintOutput = isPrintOutput; + } + + protected void setPrintOutput(Map parameters) { + if (parameters == null) + return; + if (parameters.containsKey(INSTRUCTIONS.PRINT_OUTPUT)) { + Object val = parameters.get(INSTRUCTIONS.PRINT_OUTPUT); + if (val == null) + return; + if (val instanceof Boolean) + this.isPrintOutput = (Boolean)val; + } + } + + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/ArtifactSupport.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/ArtifactSupport.java new file mode 100644 index 00000000..c5ab552a --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/ArtifactSupport.java @@ -0,0 +1,307 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.support; + +import java.util.Map; + +import org.osgi.framework.Constants; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated; +import ru.entaxy.platform.base.objects.EntaxyObject.FIELDS; +import ru.entaxy.platform.base.objects.EntaxyObject.HEADERS; +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.core.artifact.Artifact; +import ru.entaxy.platform.core.artifact.ArtifactManifest; +import ru.entaxy.platform.core.artifact.Artifacts; +import ru.entaxy.platform.core.artifact.Blueprint; +import ru.entaxy.platform.core.artifact.DeployedArtifact; +import ru.entaxy.platform.core.artifact.Manifested; +import ru.entaxy.platform.core.artifact.capabilities.ManifestCapabilityHelper; +import ru.entaxy.platform.core.artifact.installer.builder.ClusterInstaller; +import ru.entaxy.platform.core.artifact.installer.builder.InstallationResult; +import ru.entaxy.platform.core.artifact.installer.builder.Installer; +import ru.entaxy.platform.core.artifact.installer.builder.LocalInstaller; +import ru.entaxy.platform.core.artifact.installer.builder.typed.BlueprintInstaller; +import ru.entaxy.platform.core.artifact.service.ArtifactService; +import ru.entaxy.platform.core.producer.api.EntaxyProducerService; +import ru.entaxy.platform.core.producer.executor.CommandInstructions; +import ru.entaxy.platform.core.producer.executor.builder.BuiltObject; +import ru.entaxy.platform.core.producer.executor.builder.DefaultBuiltObject; +import ru.entaxy.platform.core.producer.executor.builder.ObjectBuilder; +import ru.entaxy.platform.core.producer.executor.commands.Deploy; +import ru.entaxy.platform.core.producer.executor.commands.Install; +import ru.entaxy.platform.core.producer.executor.deployer.DefaultDeployedObject; +import ru.entaxy.platform.core.producer.executor.deployer.DeployedObject; +import ru.entaxy.platform.core.producer.executor.deployer.ObjectDeployer; +import ru.entaxy.platform.core.producer.executor.generationmodel.GeneratedHeaders; +import ru.entaxy.platform.core.producer.executor.installer.DefaultInstalledObject; +import ru.entaxy.platform.core.producer.executor.installer.InstalledObject; +import ru.entaxy.platform.core.producer.executor.installer.ObjectInstaller; + +@Component (service = { ObjectBuilder.class, ObjectDeployer.class, ObjectInstaller.class}, immediate = true) +public class ArtifactSupport implements ObjectBuilder, ObjectDeployer, ObjectInstaller { + + private static final Logger log = LoggerFactory.getLogger(ArtifactSupport.class); + + @Reference (cardinality = ReferenceCardinality.MANDATORY) + ArtifactService artifactService; + + /* + * ObjectBuilder + */ + + @Override + public boolean isBuildable(Generated generated) { + Artifact artifact = Artifacts.fromGenerated(generated); + if ((artifact == null) || Artifact.ARTIFACT_CATEGORY_UNKNOWN.equals(artifact.getCategory()) + || !CommonUtils.isValid(artifact.getCategory())) { + return false; + } + return true; + } + + @Override + public BuiltObject build(Generated generated, Map instructions) throws Exception { + + LocalPrintOutput printer = new LocalPrintOutput(instructions); + + Artifact artifact = Artifacts.fromGenerated(generated); + if ((artifact == null) || Artifact.ARTIFACT_CATEGORY_UNKNOWN.equals(artifact.getCategory()) + || !CommonUtils.isValid(artifact.getCategory())) { + log.info("Artifact is not buildable"); + return null; + } + log.info("Built artifact of category [{}]", artifact.getCategory()); + Map headers = GeneratedHeaders.getHeaders( + //generated.getProperties() + EntaxyObjectPropertiesHelper.getMainObjectProperties(generated.getProperties()) + ).getAsStringMap(); + + String mainObjectValue = headers.get(HEADERS.MAIN_OBJECT); + if (!CommonUtils.isValid(mainObjectValue)) + throw new Exception("Main object not found"); + String[] mainObjectData = mainObjectValue.split(":"); + if (mainObjectData.length<2) + throw new Exception("Main object not complete: [" + mainObjectValue + "]"); + + String versionPolicy = generated.getProperties().getOrDefault( + EntaxyProducerService.INSTRUCTIONS.ARTIFACT.VERSION_POLICY, + instructions.getOrDefault( + EntaxyProducerService.INSTRUCTIONS.ARTIFACT.VERSION_POLICY + , "")) + .toString(); + String timestamp = generated.getProperties().getOrDefault( + EntaxyProducerService.INSTRUCTIONS.ARTIFACT.TIMESTAMP, + instructions.getOrDefault( + EntaxyProducerService.INSTRUCTIONS.ARTIFACT.TIMESTAMP + , "")) + .toString(); + artifact.getCoordinates() + .groupId(mainObjectData[1]) + .artifactId(mainObjectData[0]) + .version("1") + .versionPolicy(versionPolicy) + .timestamp(timestamp); + + if (artifact instanceof Manifested) { + ArtifactManifest manifest = ((Manifested)artifact).getManifest(); + manifest.getCustomAttributes().putAll(headers); + + // Generate provided capabilities for every included object + ManifestCapabilityHelper helper = new ManifestCapabilityHelper(manifest); + + String objectsValue = headers.getOrDefault(HEADERS.GENERATED_OBJECTS, ""); + if (CommonUtils.isValid(objectsValue)) { + String[] objects = objectsValue.split(","); + + for (int i=0; i attributes = null; + Map objectProperties = EntaxyObjectPropertiesHelper + .getPropertiesFor(objectId, objectType, generated.getProperties()); + if (objectProperties.containsKey(FIELDS.FIELDS_TO_PUBLISH)) { + Object map = objectProperties.get(FIELDS.FIELDS_TO_PUBLISH); + if (map != null) { + attributes = (Map)((Map)map).get(objectId); + } + } + helper.provideCapability(objectType).attributes(attributes); + } + + helper.save(); + + } + } + artifact.getProperties().putAll(generated.getProperties()); + // TODO get value from manifest + // ArtifactManifest must be improved to provide read access to all attributes + if (!artifact.getProperties().containsKey(Constants.BUNDLE_SYMBOLICNAME)) { + artifact.getProperties().put(Constants.BUNDLE_SYMBOLICNAME + , artifact.getCoordinates().getGroupId() + + "." + artifact.getCoordinates().getArtifactId()); + } + printer.printOutput("\n\t == " + artifact.getCoordinates().toString() + " ==\n"); + printer.printOutput(new String(artifact.asByteArray())); + printer.printOutput("\n\t == \n"); + return new DefaultBuiltObject(artifact); + } + + /* + * ObjectDeployer + */ + + @Override + public boolean isDeployable(BuiltObject object) { + return object.getObject() instanceof Artifact; + } + + @Override + public DeployedObject deploy(BuiltObject object, Map instructions) throws Exception { + + if (!(object.getObject() instanceof Artifact)) { + return null; + } + + LocalPrintOutput printer = new LocalPrintOutput(instructions); + + boolean deployLocal = false; + + Object deployLocalValue = instructions.get(Deploy.DEPLOY_LOCAL_INSTRUCTION); + if (deployLocalValue != null) + if (deployLocalValue instanceof Boolean) + deployLocal = (Boolean)deployLocalValue; + + Artifact artifact = (Artifact)object.getObject(); + + DeployedArtifact da = deployLocal + ?artifactService.deployLocal(artifact) + :artifactService.deployShared(artifact); + + printer.printOutput("DEPLOYED: [" + + da.getLocation() + + "]"); + + return new DefaultDeployedObject(da); + } + + /* + * ObjectInstaller + */ + + @Override + public boolean isInstallable(DeployedObject object) { + return object.getObject() instanceof DeployedArtifact; + } + + @Override + public InstalledObject install(DeployedObject object, Map instructions) throws Exception { + + if (!isInstallable(object)) + return null; + + LocalPrintOutput printer = new LocalPrintOutput(instructions); + + CommandInstructions commandInstructions = new CommandInstructions(instructions); + + boolean installLocal = + commandInstructions.has(Install.INSTALL_LOCAL_INSTRUCTION) + ?commandInstructions.getBoolean(Install.INSTALL_LOCAL_INSTRUCTION) + :false; + + boolean installOnlyIfMissing = + commandInstructions.has(Install.INSTALL_ONLY_IF_MISSING_INSTRUCTION) + ?commandInstructions.getBoolean(Install.INSTALL_ONLY_IF_MISSING_INSTRUCTION) + :false; + + String update = + commandInstructions.has(Install.UPDATE_INSTRUCTION) + ?commandInstructions.getString(Install.UPDATE_INSTRUCTION) + :null; + + DeployedArtifact da = (DeployedArtifact)object.getObject(); + + InstallationResult result = null; + + Installer installer = null; + + String artifactUpdate = update; + + printer.printOutput("-> Installing artifact: [" + da.getArtifact().getCoordinates().toString() + "]"); + if (installLocal) { + LocalInstaller localInstaller = artifactService.installers().local() + .artifact(da); + installer = localInstaller; + printer.printOutput("-> Installing locally"); + } else { + ClusterInstaller clusterInstaller = artifactService.installers().cluster() + .artifact(da); + installer = clusterInstaller; + printer.printOutput("-> Installing clustered"); + } + + // TODO add support for other types when they appear + if (da.getArtifact().getCategory().equals(Blueprint.ARTIFACT_CATEGORY_BLUEPRINT)) { + // we're installing blueprint + printer.printOutput("-> Installing: " + da.getArtifact().getCategory()); + BlueprintInstaller blueprintInstaller = installer.typed(BlueprintInstaller.class); + if (installOnlyIfMissing) + blueprintInstaller.installOnlyIfMissing(); + if (artifactUpdate != null) { + if (!CommonUtils.isValid(artifactUpdate)) { + artifactUpdate = da + .getArtifact().getProperties() + .getOrDefault(Constants.BUNDLE_SYMBOLICNAME, "") + .toString(); + } + blueprintInstaller.update(artifactUpdate); + } + result = blueprintInstaller.start().install(); + } else { + printer.printOutput("-> Unknown category: " + da.getArtifact().getCategory()); + } + + if (result != null) { + for (String key: da.getArtifact().getProperties().keySet()) + result.getProperties().putIfAbsent(key, da.getArtifact().getProperties().get(key)); + // TODO imrove Coordinates: add "asMap" method + result.getProperties().put("artifact.artifactId", da.getArtifact().getCoordinates().getArtifactId()); + result.getProperties().put("artifact.groupId", da.getArtifact().getCoordinates().getGroupId()); + result.getProperties().put("artifact.version", da.getArtifact().getCoordinates().getVersion()); + result.getProperties().put("artifact.type", da.getArtifact().getCoordinates().getType()); + result.getProperties().put("artifact.classifier", da.getArtifact().getCoordinates().getClassifier()); + } + + + return new DefaultInstalledObject(result); + } +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/EntaxyObjectPropertiesHelper.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/EntaxyObjectPropertiesHelper.java new file mode 100644 index 00000000..7609c707 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/EntaxyObjectPropertiesHelper.java @@ -0,0 +1,87 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.support; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import ru.entaxy.platform.base.objects.EntaxyObject.FIELDS; +import ru.entaxy.platform.base.support.CommonUtils; + +public class EntaxyObjectPropertiesHelper { + + public static final String PROP_IS_MERGED = "###MERGED"; + public static final String PROP_MAIN_OBJECT_DATA = "###MAIN"; + + public static boolean isMerged(Map properties) { + return (properties!=null) && (properties.containsKey(PROP_IS_MERGED)); + } + + public static Map merge(Map source, Map target){ + Map result = new HashMap<>(); + result.put(PROP_IS_MERGED, true); + result.putAll(extractObjects(target)); + result.putAll(extractObjects(source)); + result.put(PROP_MAIN_OBJECT_DATA, getMainObjectProperties(target)); + return result; + } + + public static Map getPropertiesFor(String objectId, String objectType, Map data){ + Map> extracted = extractObjects(data); + return extracted.getOrDefault(createKey(objectId, objectType), new HashMap<>()); + } + + public static Map getMainObjectProperties(Map data){ + Map> extracted = extractObjects(data); + if (extracted.containsKey(PROP_MAIN_OBJECT_DATA)) + return (Map)extracted.get(PROP_MAIN_OBJECT_DATA); + if (extracted.size() >= 1) + return (Map)extracted.values().iterator().next(); + return new HashMap<>(); + } + + private static String createKey(String objectId, String objectType) { + return CommonUtils.getValid(objectId, "") + ":" + CommonUtils.getValid(objectType, ""); + } + + private static Map> extractObjects(Map source){ + Map> result = new HashMap<>(); + if (isMerged(source)) { + for (Entry entry: source.entrySet()) { + if (PROP_IS_MERGED.equals(entry.getKey())) + continue; + if (entry.getValue() instanceof Map) { + result.put(entry.getKey(), (Map)entry.getValue()); + } + } + } else { + String objectId = source.getOrDefault(FIELDS.OBJECT_ID, "").toString(); + String objectType = source.getOrDefault(FIELDS.OBJECT_TYPE, "").toString(); + if (CommonUtils.isValid(objectId) && CommonUtils.isValid(objectType)) { + String key = createKey(objectId, objectType); + result.put(key, source); + } + } + + return result; + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/LocalPrintOutput.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/LocalPrintOutput.java new file mode 100644 index 00000000..de091a96 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/LocalPrintOutput.java @@ -0,0 +1,30 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.support; + +import java.util.Map; + +public class LocalPrintOutput extends AbstractPrintOutputSupport { + + public LocalPrintOutput(Map instructions) { + setPrintOutput(instructions); + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/ObjectSupportRegistry.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/ObjectSupportRegistry.java new file mode 100644 index 00000000..638ea665 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/ObjectSupportRegistry.java @@ -0,0 +1,88 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.support; + +import java.util.List; + +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; + +import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated; +import ru.entaxy.platform.core.producer.executor.builder.BuiltObject; +import ru.entaxy.platform.core.producer.executor.builder.ObjectBuilder; +import ru.entaxy.platform.core.producer.executor.deployer.DeployedObject; +import ru.entaxy.platform.core.producer.executor.deployer.ObjectDeployer; +import ru.entaxy.platform.core.producer.executor.installer.ObjectInstaller; + +@Component (service = ObjectSupportRegistry.class, immediate = true) +public class ObjectSupportRegistry { + + private static ObjectSupportRegistry INSTANCE = null; + + public static ObjectSupportRegistry getInstance() { + return INSTANCE; + } + + @Reference (cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY) + volatile List objectBuilders; + + @Reference (cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY) + volatile List objectDeployers; + + @Reference (cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY) + volatile List objectInstallers; + + @Activate + public void activate() { + INSTANCE = this; + } + + public ObjectBuilder findBuilder(Generated generated) { + synchronized (this.objectBuilders) { + for (ObjectBuilder ob: this.objectBuilders) + if (ob.isBuildable(generated)) + return ob; + } + return null; + } + + public ObjectDeployer findDeployer(BuiltObject object) { + synchronized (this.objectDeployers) { + for (ObjectDeployer od: this.objectDeployers) + if (od.isDeployable(object)) + return od; + } + return null; + } + + public ObjectInstaller findInstaller(DeployedObject object) { + synchronized (this.objectInstallers) { + for (ObjectInstaller oi: this.objectInstallers) + if (oi.isInstallable(object)) + return oi; + } + return null; + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/PrintOutputSupport.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/PrintOutputSupport.java new file mode 100644 index 00000000..09c37966 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/support/PrintOutputSupport.java @@ -0,0 +1,34 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.executor.support; + +public interface PrintOutputSupport { + + void setPrintOutput(boolean printOutput); + + boolean isPrintOutput(); + + default void printOutput(String message) { + if (isPrintOutput()) + // OUTPUT TO CONSOLE + System.out.println(message); + }; + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/impl/EntaxyFactoryDataProcessorService.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/impl/EntaxyFactoryDataProcessorService.java new file mode 100644 index 00000000..84b04d7a --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/impl/EntaxyFactoryDataProcessorService.java @@ -0,0 +1,62 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.impl; + +import java.util.List; + +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.FieldOption; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; + +import ru.entaxy.platform.core.producer.api.EntaxyFactoryDataProcessor; + +@Component (service = EntaxyFactoryDataProcessorService.class, immediate = true) +public class EntaxyFactoryDataProcessorService implements EntaxyFactoryDataProcessor { + + private static EntaxyFactoryDataProcessorService _INSTANCE = null; + + public static EntaxyFactoryDataProcessorService getInstance() { + return _INSTANCE; + } + + @Reference (cardinality = ReferenceCardinality.MULTIPLE, collectionType = CollectionType.SERVICE, fieldOption = FieldOption.UPDATE, + policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY, service = EntaxyFactoryDataProcessor.class) + List processors; + + @Activate + public void activate() { + _INSTANCE = this; + } + + @Override + public Object processDefaultValue(Object currentValue) { + Object result = currentValue; + for (EntaxyFactoryDataProcessor p: processors) { + result = p.processDefaultValue(result); + } + return result; + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/impl/InstructionsHelper.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/impl/InstructionsHelper.java new file mode 100644 index 00000000..153feb78 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/impl/InstructionsHelper.java @@ -0,0 +1,87 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.CONFIGURATION.DIRECTIVES.OVERRIDE_MODE; +import ru.entaxy.platform.base.objects.factory.EntaxyFactoryUtils; +import ru.entaxy.platform.base.support.JSONUtils; +import ru.entaxy.platform.core.producer.api.EntaxyProducerService; + +public class InstructionsHelper { + + public static final String DEFAULT_INSTRUCTIONS = "{'validate':{}}"; + public static final String LIFECYCLE_DIRECTIVE = EntaxyProducerService.DIRECTIVES.LIFECYCLE; + + protected JsonObject lifecyclesOrigin; + + protected Map lifecycles = new HashMap<>(); + + public InstructionsHelper(JsonObject lifecycles) { + super(); + this.lifecyclesOrigin = lifecycles.deepCopy(); + fillMap(this.lifecyclesOrigin); + } + + protected void fillMap(JsonObject origin) { + for (Entry entry: origin.entrySet()) + if (entry.getValue().isJsonObject()) + this.lifecycles.put(entry.getKey(), entry.getValue().getAsJsonObject().deepCopy()); + } + + public String prepareInstructions(String originalInstructions) { + JsonObject origin = JSONUtils.getJsonRootObject(originalInstructions); + JsonObject result = new JsonObject(); + if (origin.has(LIFECYCLE_DIRECTIVE)) { + JsonElement directiveValue = origin.get(LIFECYCLE_DIRECTIVE); + List lcIdToApply = new ArrayList<>(); + List lcToApply = new ArrayList<>(); + if (directiveValue.isJsonPrimitive()) + lcIdToApply.add(directiveValue.getAsString()); + if (directiveValue.isJsonArray()) { + JsonArray ja = directiveValue.getAsJsonArray(); + for (int i=0; i map = new HashMap<>(); + + @Override + public void addStrorage(String prefix, MetadataStorage storage) { + this.map.put(storage, prefix); + } + + @Override + public void process(Exchange exchange) throws Exception { + + for (MetadataStorage ms: map.keySet()) { + Map allData = ms.getAllData(); + String prefix = map.get(ms); + for (Entry entry: allData.entrySet()) { + exchange.getIn().setHeader(prefix + entry.getKey(), entry.getValue()); + } + } + + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorage.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorage.java new file mode 100644 index 00000000..8961a7a7 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorage.java @@ -0,0 +1,34 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.support; + +import java.util.Map; + +public interface MetadataStorage { + + Map getStrings(); + + Map getBooleans(); + + Map getNumbers(); + + Map getAllData(); + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageConsumer.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageConsumer.java new file mode 100644 index 00000000..2185816b --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageConsumer.java @@ -0,0 +1,26 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.support; + +public interface MetadataStorageConsumer { + + public void addStrorage(String prefix, MetadataStorage storage); + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageEmpty.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageEmpty.java new file mode 100644 index 00000000..ec0f3ce0 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageEmpty.java @@ -0,0 +1,47 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.support; + +import java.util.Collections; +import java.util.Map; + +public class MetadataStorageEmpty implements MetadataStorage { + + @Override + public Map getStrings() { + return Collections.emptyMap(); + } + + @Override + public Map getBooleans() { + return Collections.emptyMap(); + } + + @Override + public Map getNumbers() { + return Collections.emptyMap(); + } + + @Override + public Map getAllData() { + return Collections.emptyMap(); + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageImpl.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageImpl.java new file mode 100644 index 00000000..190529f8 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageImpl.java @@ -0,0 +1,68 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.support; + +import java.util.HashMap; +import java.util.Map; + +public class MetadataStorageImpl extends AbstractConsumerAwareMetadataStorage implements MetadataStorage { + + protected Map strings; + protected Map booleans; + protected Map numbers; + + @Override + public Map getStrings() { + return strings; + } + + public void setStrings(Map strings) { + this.strings = strings; + } + + @Override + public Map getBooleans() { + return booleans; + } + + public void setBooleans(Map booleans) { + this.booleans = booleans; + } + + @Override + public Map getNumbers() { + return numbers; + } + + public void setNumbers(Map numbers) { + this.numbers = numbers; + } + + @Override + public Map getAllData() { + Map result = new HashMap<>(); + + result.putAll(strings); + result.putAll(booleans); + result.putAll(numbers); + + return result; + } +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageWrapper.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageWrapper.java new file mode 100644 index 00000000..9c604dfe --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/support/MetadataStorageWrapper.java @@ -0,0 +1,63 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.support; + +import java.util.Map; + +public class MetadataStorageWrapper extends AbstractConsumerAwareMetadataStorage implements MetadataStorage { + + protected MetadataStorage origin; + protected MetadataStorage empty = new MetadataStorageEmpty(); + + public MetadataStorage getOrigin() { + return origin; + } + + public void setOrigin(MetadataStorage origin) { + this.origin = origin; + } + + protected MetadataStorage getStorage() { + if (origin != null) + return origin; + return empty; + } + + @Override + public Map getStrings() { + return getStorage().getStrings(); + } + + @Override + public Map getBooleans() { + return getStorage().getBooleans(); + } + + @Override + public Map getNumbers() { + return getStorage().getNumbers(); + } + + @Override + public Map getAllData() { + return getStorage().getAllData(); + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/wrapper/GenerationProcessorService.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/wrapper/GenerationProcessorService.java new file mode 100644 index 00000000..c4c24917 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/wrapper/GenerationProcessorService.java @@ -0,0 +1,224 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producer-core + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.wrapper; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +import org.osgi.framework.ServiceReference; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.platform.base.objects.factory.EntaxyFactory; +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.core.producer.wrapper.AbstractFactoryWrapper.GenerationProcessor; + +@Component(service = GenerationProcessorService.class, immediate = true) +public class GenerationProcessorService { + + private static final Logger log = LoggerFactory.getLogger(GenerationProcessorService.class); + + public static final String FACTORY_PLUGIN_FIELD = "generation.plugins"; + + private static GenerationProcessorService INSTANCE; + + public static GenerationProcessorService getInstance() { + return INSTANCE; + } + + protected static enum PLUGIN_STATUS { + DENIED, + ALLOWED, + UNDEFINED + } + + protected static class GenerationProcessorHelper { + + ServiceReference ref; + + String id; + List factoryTypes = new ArrayList<>(); + + public GenerationProcessorHelper(ServiceReference ref) { + this.ref = ref; + + this.id = getId(ref); + if (!CommonUtils.isValid(this.id)) + return; + + Object obj = ref.getProperty(GenerationProcessor.PROP_FACTORY_TYPE); + + if (obj == null) + return; + + if (obj instanceof String) { + factoryTypes.add(obj.toString()); + return; + } + + if (obj instanceof String[]) { + String[] data = (String[])obj; + factoryTypes.addAll(Arrays.asList(data)); + } + + if (obj instanceof List) { + for (Object item: (List)obj) + if (item!=null) + factoryTypes.add(item.toString()); + } + } + + public static String getId(ServiceReference ref) { + Object obj = ref.getProperty(GenerationProcessor.PROP_PROCESSOR_ID); + if (obj != null) + return obj.toString(); + return null; + + } + + public PLUGIN_STATUS getStatusForType(String factoryType) { + + PLUGIN_STATUS result = PLUGIN_STATUS.UNDEFINED; + + for (String type: factoryTypes) { + boolean denied = type.startsWith("!"); + if (denied) + type = type.substring(1); + + if (matches(factoryType, type)) { + if (denied) + return PLUGIN_STATUS.DENIED; + else + result = PLUGIN_STATUS.ALLOWED; + } + } + + return result; + } + + protected boolean matches(String value, String template) { + + String expression = template.replaceAll("\\*", ".*"); + return Pattern.matches(expression, value); + + } + + } + + Map processors = new HashMap<>(); + + @Activate + public void activate() { + INSTANCE = this; + } + + @Reference (unbind = "removeProcessor", cardinality = ReferenceCardinality.MULTIPLE + , policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY + , service = GenerationProcessor.class, collectionType = CollectionType.REFERENCE) + public void addProcessor(ServiceReference ref) { + String id = GenerationProcessorHelper.getId(ref); + if (!CommonUtils.isValid(id)) + return; + processors.put(id, new GenerationProcessorHelper(ref)); + } + + public void removeProcessor(ServiceReference ref) { + String id = GenerationProcessorHelper.getId(ref); + if (!CommonUtils.isValid(id)) + return; + processors.remove(id); + } + + protected PLUGIN_STATUS getEffectiveStatus(PLUGIN_STATUS st1, PLUGIN_STATUS st2) { + List list = new ArrayList<>() {{ + add(st1); + add(st2); + }}; + if (list.contains(PLUGIN_STATUS.DENIED)) + return PLUGIN_STATUS.DENIED; + if (list.contains(PLUGIN_STATUS.ALLOWED)) + return PLUGIN_STATUS.ALLOWED; + return PLUGIN_STATUS.UNDEFINED; + } + + public List> getProcessorsRefs(EntaxyFactory factory){ + List> result = new ArrayList<>(); + + Map factoryData = getStatusFromFactory(factory); + String type = factory.getType(); + + for (String pluginId: processors.keySet()) { + GenerationProcessorHelper helper = processors.get(pluginId); + PLUGIN_STATUS status = getEffectiveStatus(factoryData.get(pluginId) + , helper.getStatusForType(type)); + if (PLUGIN_STATUS.ALLOWED.equals(status)) + result.add(helper.ref); + + } + + return result; + } + + protected Map getStatusFromFactory(EntaxyFactory factory) { + + Map result = new HashMap<>(); + + Map typeInfo = factory.getTypeInfo(); + if (typeInfo.containsKey(FACTORY_PLUGIN_FIELD)) { + List plugins = new ArrayList<>(); + Object obj = typeInfo.get(FACTORY_PLUGIN_FIELD); + if (obj != null) { + if (obj instanceof String) + plugins.add(obj.toString()); + else if (obj instanceof Object[]) { + List objList = Arrays.asList((Object[])obj); + for (Object item: objList) + if (item!=null) + plugins.add(item.toString()); + } else if (obj instanceof List) + for (Object item: (List)obj) + if (item != null) + plugins.add(item.toString()); + } + for (String plugin: plugins) { + if (plugin.startsWith("!")) { + plugin = plugin.substring(1); + result.put(plugin, PLUGIN_STATUS.DENIED); + } else { + result.put(plugin, PLUGIN_STATUS.ALLOWED); + } + } + } + + return result; + } + +} diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/resources/config/BlueprintMergeProcessor.json b/platform/runtime/core/object-producing/object-producer-core/src/main/resources/config/BlueprintMergeProcessor.json new file mode 100644 index 00000000..264d612e --- /dev/null +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/resources/config/BlueprintMergeProcessor.json @@ -0,0 +1,19 @@ +{ + "*": { + "position": "inside_first" + }, + "fragment": { + "isTransparent": true + }, + "reference": { + "position": "inside_first", + "unique": ["id"], + "conflict": "ignore" /*[ignore, replace]*/ + }, + "route": { + "targetNodeName": "camelContext", + "position": "inside_last", + "createTargetNode": true, + "targetNodeXML": "" + } +} \ No newline at end of file diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/LICENSE.txt b/platform/runtime/core/object-producing/object-producing-resources-support/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/pom.xml b/platform/runtime/core/object-producing/object-producing-resources-support/pom.xml new file mode 100644 index 00000000..ade54abb --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/pom.xml @@ -0,0 +1,85 @@ + + 4.0.0 + + ru.entaxy.esb.platform.runtime.core + object-producing + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.object-producing + object-producing-resources-support + bundle + ENTAXY :: PLATFORM :: CORE :: OBJECT PRODUCING :: RESOURCES SUPPORT + ENTAXY :: PLATFORM :: CORE :: OBJECT PRODUCING :: RESOURCES SUPPORT + + + ru.entaxy.platform.core.producer.resources* + + + + + + ru.entaxy.esb.platform.runtime.core.object-producing + + object-producer-api + ${project.version} + + + + ru.entaxy.esb.platform.runtime.core.object-producing + + object-producer-core + ${project.version} + + + + ru.entaxy.esb.platform.runtime.base.resources + + resources-api + ${project.version} + + + com.google.code.gson + gson + + + + ru.entaxy.esb.platform.runtime.base.connecting.generator + + generator-api + ${project.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + commons-io + commons-io + ${commons-io.version} + + + org.apache.servicemix.bundles + org.apache.servicemix.bundles.saxon + ${servicemix-saxon-version} + + + + + + + org.apache.felix + maven-bundle-plugin + ${maven-bundle-plugin.version} + true + + + true + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/DeployableResource.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/DeployableResource.java new file mode 100644 index 00000000..e5f6a872 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/DeployableResource.java @@ -0,0 +1,37 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +import java.util.Map; + +import ru.entaxy.platform.core.producer.resources.generator.GeneratedResourceWrapper; + +public class DeployableResource extends ResourceDescriptor { + + public Object resourceData; + public String resourceType; + + public DeployableResource(Map properties) { + super(properties); + resourceData = properties.get(GeneratedResourceWrapper.OBJECT_KEY); + resourceType = properties.getOrDefault("type", "unknown").toString(); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceProcessor.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceProcessor.java new file mode 100644 index 00000000..947c8fd2 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceProcessor.java @@ -0,0 +1,31 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +import java.util.Map; + +public interface EntaxyResourceProcessor { + + String PROP_PROCESSOR = "processor"; + + String getName(); + Object process(Object value, Map properties); + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceProcessorService.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceProcessorService.java new file mode 100644 index 00000000..ae6451b8 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceProcessorService.java @@ -0,0 +1,28 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +import java.util.Map; + +public interface EntaxyResourceProcessorService { + + Object process(Object value, Map properties); + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceStringFormatter.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceStringFormatter.java new file mode 100644 index 00000000..97439588 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/EntaxyResourceStringFormatter.java @@ -0,0 +1,28 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +public interface EntaxyResourceStringFormatter { + + String getName(); + String format(String value); + String unformat(String value); + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ProcessResourcesCommand.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ProcessResourcesCommand.java new file mode 100644 index 00000000..63b1a10f --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ProcessResourcesCommand.java @@ -0,0 +1,242 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated; +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.platform.base.objects.EntaxyObject; +import ru.entaxy.platform.base.objects.EntaxyObject.FIELDS; +import ru.entaxy.platform.base.objects.factory.EntaxyFactory; +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.CONFIGURATION.FACTORY; +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.CONFIGURATION.OUTPUTS; +import ru.entaxy.platform.base.objects.factory.EntaxyFactory.FieldInfo; +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.base.support.JSONUtils; +import ru.entaxy.platform.core.producer.api.EntaxyProducerService; +import ru.entaxy.platform.core.producer.api.ExecutionPlan.ExecutionPlanUpdate; +import ru.entaxy.platform.core.producer.api.ProducerResult; +import ru.entaxy.platform.core.producer.api.ProducerResult.CommandResult; +import ru.entaxy.platform.core.producer.api.ProducingCommandExecutor; +import ru.entaxy.platform.core.producer.executor.AbstractCommandExecutor; +import ru.entaxy.platform.core.producer.executor.CommandExecutor; +import ru.entaxy.platform.core.producer.executor.objectmodel.Calculation; +import ru.entaxy.platform.core.producer.executor.objectmodel.FactoredObject; +import ru.entaxy.platform.core.producer.executor.objectmodel.FactoredObjectProxy; +import ru.entaxy.platform.core.producer.executor.objectmodel.ObjectModel; + +@Component(service = ProducingCommandExecutor.class, immediate = true) +@CommandExecutor(id = "process-resources", predecessors = {"enrich"}, descendants = {"validate"}) +public class ProcessResourcesCommand extends AbstractCommandExecutor implements ProducingCommandExecutor { + + private static final Logger log = LoggerFactory.getLogger(ProcessResourcesCommand.class); + + @Reference(cardinality = ReferenceCardinality.MANDATORY) + EntaxyProducerService entaxyProducerServiceLocal; + + @Reference(cardinality = ReferenceCardinality.MANDATORY) + EntaxyResourceService entaxyResourceService; + + @Reference(cardinality = ReferenceCardinality.MANDATORY) + ResourceDataProcessor resourceDataProcessor; + + public ProcessResourcesCommand() { + super(null); + } + + protected ProcessResourcesCommand(EntaxyProducerService entaxyProducerService) { + super(entaxyProducerService); + } + + @Activate + public void activate(ComponentContext componentContext) { + this.entaxyProducerService = this.entaxyProducerServiceLocal; + this.entaxyProducerService.registerCommand(this); + } + + @Override + protected boolean doExecute(ProducerResult currentResult, CommandResult commandResult, + Map instructions) throws Exception { + + ObjectModel objectModel = currentResult.findResultObject(ObjectModel.class); + objectModel.startTracking(); + + JsonObject incomingJson = objectModel.getJsonCurrent().deepCopy(); + + for (FactoredObject fo: objectModel.objects) { + + // skip proxies + if (fo instanceof FactoredObjectProxy) + continue; + + String factoryId = fo.factoryId; + + EntaxyFactory factory = entaxyProducerService.findFactoryById(factoryId); + + JsonObject objectOrigin = fo.origin; + + + if (JSONUtils.setValue(objectOrigin, FIELDS.PROPERTIES, new JsonObject(), true)) { + printOutput("[DIRTY] CREATED 'properties' for [" + fo.getObjectId() + "/" + fo.getObjectType() + "]"); + objectModel.setDirty(); + } + + JsonObject objectProperties = objectOrigin.get(FIELDS.PROPERTIES).getAsJsonObject(); + + String outputType = CommonUtils.isValid(fo.getOutputType()) + ?fo.getOutputType() + :factory.getDefaultOutput()!=null + ?factory.getDefaultOutput().getType() + :OUTPUTS.OUTPUT_TYPE_INIT; + + List factoryFields = factory.getFields(outputType); + + log.debug("\n FIELDS FOR " + factory.getId() + "/" + outputType + ":" + factoryFields.size()); + + // if the value is JsonObject + // and represents some resource + // we first resolve it to actual value + JsonObject newProperties = new JsonObject(); + for (Entry entry: objectProperties.entrySet()) { + + if (entry.getValue().isJsonObject()) + if (entry.getValue().getAsJsonObject().has(ResourceDataProcessor.ENTAXY_RESOURCE_KEY)) { + JsonElement jsonDescriptor = entry.getValue().getAsJsonObject().get(ResourceDataProcessor.ENTAXY_RESOURCE_KEY); + ResourceDescriptor resourceDescriptor = ResourceDescriptor.fromJson(jsonDescriptor); + if (resourceDescriptor == null) + continue; + Object newData = resourceDataProcessor.getResourceDataFromDescriptor(resourceDescriptor); + JsonElement newValue = (new Gson()).toJsonTree(newData); + + newProperties.add(entry.getKey(), newValue); + } + } + for (Entry entry: newProperties.entrySet()) { + if (JSONUtils.setValue(objectProperties, entry.getKey(), entry.getValue().deepCopy(), false)) { + printOutput("[DIRTY] UPDATED " + entry.getKey() + " for [" + fo.getObjectId() + "/" + fo.getObjectType() + "]"); + objectModel.setDirty(); + } + + } + + + // for the field defined as a resource + // we must make an object + for (FieldInfo fi: factoryFields) { + log.debug("\n--> FIELD :: " + fi.getName()); + log.debug("\n" + objectProperties.toString()); + JsonObject jsonFi = fi.getJsonOrigin(); + if (!objectProperties.has(fi.getName())) + continue; + log.debug("\nORIGIN:\n" + fi.getJsonOrigin().toString()); + if (jsonFi.has(ResourceDataProcessor.ENTAXY_RESOURCE_KEY)) { + log.debug("\n--> FIELD :: " + fi.getName() + " IS A RESOURCE"); + ResourceDescriptor descriptor = ResourceDescriptor.fromJson(jsonFi.get(ResourceDataProcessor.ENTAXY_RESOURCE_KEY)); + if (descriptor == null) + continue; + JsonElement currentValue = objectProperties.get(fi.getName()); + if (currentValue.isJsonObject()) { + JsonObject currentObject = currentValue.getAsJsonObject(); + if (currentObject.has("isRef")) { + continue; + } + } + JsonElement newValueElement = jsonFi.get(ResourceDataProcessor.ENTAXY_RESOURCE_KEY); + if (!newValueElement.isJsonObject()) + continue; + JsonObject properties = newValueElement.getAsJsonObject().deepCopy(); + + // add default location if not set + if (!properties.has(ResourceDataProcessor.PROP_LOCATION)) { + JsonObject locationData = new JsonObject(); + locationData.addProperty(Calculation.FIELD_IS_CALCULATED, true); + locationData.addProperty("lazy", true); + locationData.addProperty("expression" + , "object-resources/${#OWNER#.objectId}/" + fi.getName() + "." + fi.getType().split(":")[0]); + properties.add(ResourceDataProcessor.PROP_LOCATION, locationData); + } + + properties.add("content", currentValue); + properties.addProperty("type", fi.getType()); + JsonObject newValue = new JsonObject(); + newValue.addProperty(FACTORY.TYPE, "entaxy.resource"); + newValue.addProperty(EntaxyObject.FIELDS.FACTORY_ID, "entaxy-resource"); + + JsonObject refConfig = new JsonObject(); + refConfig.addProperty(EntaxyObject.FIELDS.REF_FIELD, "content"); + refConfig.addProperty("generated.targetType", Generated.GENERATED_TYPE_BLUEPRINT_FRAGMENT); + newValue.add("refConfig", refConfig); + + // newValue.addProperty("__skip", true); + newValue.add(FIELDS.PROPERTIES, properties); + if (jsonFi.has("config") && jsonFi.get("config").isJsonObject()) { + JsonObject configObject = jsonFi.get("config").getAsJsonObject(); + for (Entry entry: configObject.entrySet()) { + if (!newValue.has(entry.getKey())) + newValue.add(entry.getKey(), entry.getValue().deepCopy()); + } + } + JSONUtils.setValue(objectProperties, fi.getName(), newValue, false); + objectModel.setDirty(); + } + } + + } + + if (objectModel.stopTracking()) { + + // remove ##embedded + for (FactoredObject fo: objectModel.objects) + fo.origin.remove(FactoredObject.EMBEDDED_FIELD); + + + commandResult.planUpdate = ExecutionPlanUpdate.create() +// .updateInstructions().target("enrich").value("skip", true).complete() + .reset().target("analyze").complete(); + } + + JsonObject outgoingJson = objectModel.getJsonCurrent(); + + printOutput("\n== INCOMING JSON ==\n"); + printOutput(incomingJson.toString()); + printOutput("\n== OUTGOING JSON ==\n"); + printOutput(outgoingJson.toString()); + + commandResult.resultObject(outgoingJson); + + return true; + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceDataProcessor.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceDataProcessor.java new file mode 100644 index 00000000..4f37562d --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceDataProcessor.java @@ -0,0 +1,35 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +import ru.entaxy.platform.core.producer.api.EntaxyFactoryDataProcessor; + +public interface ResourceDataProcessor extends EntaxyFactoryDataProcessor { + + String ENTAXY_RESOURCE_KEY = ResourceProducer.DIRECTIVES.RESOURCE; + + String PROP_PROVIDER = "provider"; + String PROP_LOCATION = "location"; + String PROP_END_TYPE = "endType"; + String PROP_FORMAT = "format"; + + Object getResourceDataFromDescriptor(ResourceDescriptor descriptor); + +} \ No newline at end of file diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceDescriptor.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceDescriptor.java new file mode 100644 index 00000000..13c24f85 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceDescriptor.java @@ -0,0 +1,90 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +import java.util.Map; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import ru.entaxy.platform.base.support.CommonUtils; + +public class ResourceDescriptor { + + static public final String RESOURCE_TYPE_PREFIX = "resource:"; + + public static ResourceDescriptor fromJson(JsonElement element) { + if (element == null) + return null; + if (!element.isJsonObject()) + return null; + return new ResourceDescriptor(element.getAsJsonObject()); + } + + public static ResourceDescriptor fromMap(Map properties) { + return new ResourceDescriptor(properties); + } + + + protected JsonObject origin; + + public String provider; + public String location; + public String endType; + public String format; + + public ResourceDescriptor(JsonObject jsonObject) { + this.origin = jsonObject; + loadData(); + } + + public ResourceDescriptor(Map properties) { + this.origin = new JsonObject(); + loadDataFromMap(properties); + } + + protected void loadData() { + if (this.origin.has(ResourceDataProcessor.PROP_PROVIDER)) + this.provider = this.origin.get(ResourceDataProcessor.PROP_PROVIDER).getAsString(); + if (this.origin.has(ResourceDataProcessor.PROP_LOCATION)) + if (this.origin.get(ResourceDataProcessor.PROP_LOCATION).isJsonPrimitive()) + this.location = this.origin.get(ResourceDataProcessor.PROP_LOCATION).getAsString(); + if (this.origin.has(ResourceDataProcessor.PROP_END_TYPE)) + this.endType = this.origin.get(ResourceDataProcessor.PROP_END_TYPE).getAsString(); + if (this.origin.has(ResourceDataProcessor.PROP_FORMAT)) + this.format = this.origin.get(ResourceDataProcessor.PROP_FORMAT).getAsString(); + } + + protected void loadDataFromMap(Map properties) { + this.provider = properties.getOrDefault(ResourceDataProcessor.PROP_PROVIDER, "default").toString(); + this.location = properties.getOrDefault(ResourceDataProcessor.PROP_LOCATION, "").toString(); + this.endType = properties.getOrDefault(ResourceDataProcessor.PROP_END_TYPE, "").toString(); + this.format = properties.getOrDefault(ResourceDataProcessor.PROP_FORMAT, "").toString(); + }; + + public String getResourceUrl() { + return (CommonUtils.isValid(provider)?provider+":":"") + location; + } + + public boolean isReturnResource() { + return !CommonUtils.isValid(endType) || "resource".equalsIgnoreCase(endType); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceObjectSupport.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceObjectSupport.java new file mode 100644 index 00000000..e0edec52 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceObjectSupport.java @@ -0,0 +1,113 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +import java.io.InputStream; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.commons.io.IOUtils; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; + +import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated; +import ru.entaxy.esb.resources.EntaxyResource; +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.platform.core.producer.executor.builder.BuiltObject; +import ru.entaxy.platform.core.producer.executor.builder.DefaultBuiltObject; +import ru.entaxy.platform.core.producer.executor.builder.ObjectBuilder; +import ru.entaxy.platform.core.producer.executor.deployer.DeployedObject; +import ru.entaxy.platform.core.producer.executor.deployer.ObjectDeployer; +import ru.entaxy.platform.core.producer.executor.support.LocalPrintOutput; + +@Component(service = {ObjectBuilder.class, ObjectDeployer.class}) +public class ResourceObjectSupport implements ObjectBuilder, ObjectDeployer { + + @Reference (cardinality = ReferenceCardinality.MANDATORY) + EntaxyResourceService entaxyResourceService; + + /* + * ObjectBuilder + */ + @Override + public boolean isBuildable(Generated generated) { + return generated.getType().startsWith(ResourceDescriptor.RESOURCE_TYPE_PREFIX); + } + + @Override + public BuiltObject build(Generated generated, Map instructions) throws Exception { + if (!isBuildable(generated)) + return null; + + LocalPrintOutput printer = new LocalPrintOutput(instructions); + printer.printOutput(" = GENERATED PROPERTIES"); + for (Entry entry: generated.getProperties().entrySet()) { + printer.printOutput(" :: " + entry.getKey() + " = [\n" + + (entry.getValue()==null?"":entry.getValue().toString()) + + "\n]"); + } + printer.printOutput(" = /GENERATED PROPERTIES"); + return new DefaultBuiltObject(new DeployableResource(generated.getProperties())); + + } + + /* + * ObjectDeployer + */ + + @Override + public boolean isDeployable(BuiltObject object) { + return object.getObject() instanceof DeployableResource; + } + + @Override + public DeployedObject deploy(BuiltObject object, Map instructions) throws Exception { + if (!isDeployable(object)) + return null; + LocalPrintOutput printer = new LocalPrintOutput(instructions); + + DeployableResource dr = (DeployableResource)object.getObject(); + printer.printOutput(" = RESOURCE TO DEPLOY"); + printer.printOutput(dr.getResourceUrl() + " [" + dr.resourceType + "/" + dr.endType + "]"); + + EntaxyResource resource = entaxyResourceService.getResource(dr.getResourceUrl()); + resource.save(getInputStream(dr)); + + printer.printOutput(" :: DEPLOYED"); + + // nothing to do with resource in further phases + return null; + } + + protected InputStream getInputStream(DeployableResource res) { + if ((res==null) || (res.resourceData == null)) + return getDefaultInputStream(); + if ("String".equals(res.endType)) + return IOUtils.toInputStream(res.resourceData.toString()); + // TODO support other resource types + return getDefaultInputStream(); + + } + + protected InputStream getDefaultInputStream() { + return IOUtils.toInputStream(""); + } +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceProducer.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceProducer.java new file mode 100644 index 00000000..c0676b65 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/ResourceProducer.java @@ -0,0 +1,64 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; + +import ru.entaxy.platform.base.objects.factory.EntaxyFactory; +import ru.entaxy.platform.core.producer.api.EntaxyProducer; +import ru.entaxy.platform.core.producer.impl.CommonObjectProducer; +import ru.entaxy.platform.core.producer.impl.EntaxyProducerInfo; +import ru.entaxy.platform.core.producer.wrapper.AbstractFactoryWrapper; +import ru.entaxy.platform.core.producer.wrapper.DefaultFactoryWrapper; + +@Component(service = {EntaxyProducer.class}, immediate = true) +@EntaxyProducerInfo(supportedTypes = {"entaxy.resource"}) +public class ResourceProducer extends CommonObjectProducer implements EntaxyProducer { + + public static interface DIRECTIVES { + String RESOURCE = "@RESOURCE"; + } + + public static final String PROP_CONTENT = "content"; + public static final String PROP_PREPROCESS = "preprocess"; + + @Reference(bind = "addFactory", unbind = "removeFactory", cardinality = ReferenceCardinality.MULTIPLE + , collectionType = CollectionType.SERVICE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY) + public void addFactory(EntaxyFactory factory) { + doAddFactory(factory); + } + + // WE MUST DECLARE IT for @Reference annotation processor + @Override + public void removeFactory(EntaxyFactory factory) { + super.removeFactory(factory); + } + + @Override + protected AbstractFactoryWrapper doAddFactory(EntaxyFactory factory) { + return super.doAddFactory(factory, DefaultFactoryWrapper.class); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/StringFormatterService.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/StringFormatterService.java new file mode 100644 index 00000000..96757626 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/StringFormatterService.java @@ -0,0 +1,27 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources; + +public interface StringFormatterService { + + String format(String value, String[] formatters); + String unformat(String value, String[] formatters); + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/formatters/Base64Formatter.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/formatters/Base64Formatter.java new file mode 100644 index 00000000..616d3d7e --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/formatters/Base64Formatter.java @@ -0,0 +1,46 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources.formatters; + +import java.util.Base64; + +import org.osgi.service.component.annotations.Component; + +import ru.entaxy.platform.core.producer.resources.EntaxyResourceStringFormatter; + +@Component (service = EntaxyResourceStringFormatter.class, immediate = true) +public class Base64Formatter implements EntaxyResourceStringFormatter { + + @Override + public String getName() { + return "base64"; + } + + @Override + public String format(String value) { + return new String(Base64.getEncoder().encode(value.getBytes())); + } + + @Override + public String unformat(String value) { + return new String(Base64.getDecoder().decode(value)); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/generator/GeneratedResourceWrapper.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/generator/GeneratedResourceWrapper.java new file mode 100644 index 00000000..f95d3e5f --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/generator/GeneratedResourceWrapper.java @@ -0,0 +1,54 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources.generator; + +import java.util.HashMap; +import java.util.Map; + +import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated; +import ru.entaxy.platform.core.producer.resources.ResourceDescriptor; + +public class GeneratedResourceWrapper implements Generated { + + public static final String OBJECT_KEY = "#_object"; + + protected Map properties = new HashMap<>(); + + public GeneratedResourceWrapper (Map props) { + this.properties.putAll(props); + } + + @Override + public String getType() { + return this.properties.getOrDefault("generated.targetType", + ResourceDescriptor.RESOURCE_TYPE_PREFIX + properties.getOrDefault("type", "unknown")).toString(); + } + + @Override + public Object getObject() { + return this.properties.get(OBJECT_KEY); + } + + @Override + public Map getProperties() { + return this.properties; + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/generator/ResourceWrapGenerator.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/generator/ResourceWrapGenerator.java new file mode 100644 index 00000000..7a059bf1 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/generator/ResourceWrapGenerator.java @@ -0,0 +1,131 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources.generator; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.ArrayUtils; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; + +import ru.entaxy.esb.platform.runtime.base.connecting.generator.AbstractSelfPublishGenerator; +import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated; +import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generator; +import ru.entaxy.esb.platform.runtime.base.connecting.generator.GeneratorService; +import ru.entaxy.esb.platform.runtime.base.connecting.generator.factory.GeneratorFactory; +import ru.entaxy.esb.resources.EntaxyResource; +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.platform.core.producer.resources.EntaxyResourceProcessorService; +import ru.entaxy.platform.core.producer.resources.ResourceDataProcessor; +import ru.entaxy.platform.core.producer.resources.ResourceDescriptor; +import ru.entaxy.platform.core.producer.resources.ResourceProducer; +import ru.entaxy.platform.core.producer.resources.StringFormatterService; + +@Component( + service = {GeneratorService.class}, + property = {GeneratorService.PROP_GENERATOR_TYPE + "=" + ResourceWrapGenerator.GENERATOR_NAME}, + immediate = true +) +public class ResourceWrapGenerator extends AbstractSelfPublishGenerator + implements Generator { + + public static final String GENERATOR_NAME = "resource-wrap"; + + protected static EntaxyResourceService ENTAXY_RESOURCE_SERVICE; + + protected static StringFormatterService STRING_FORMATTER_SERVICE; + + protected static EntaxyResourceProcessorService RESOURCE_PROCESSOR_SERVICE; + + @Reference (cardinality = ReferenceCardinality.MANDATORY) + EntaxyResourceService entaxyResourceService; + + @Reference (cardinality = ReferenceCardinality.MANDATORY) + StringFormatterService stringFormatterService; + + @Reference (cardinality = ReferenceCardinality.MANDATORY) + EntaxyResourceProcessorService entaxyResourceProcessorService; + + @Activate + public void activate() { + GeneratorFactory.register(ResourceWrapGenerator.GENERATOR_NAME, this); + ResourceWrapGenerator.ENTAXY_RESOURCE_SERVICE = entaxyResourceService; + ResourceWrapGenerator.STRING_FORMATTER_SERVICE = stringFormatterService; + ResourceWrapGenerator.RESOURCE_PROCESSOR_SERVICE = entaxyResourceProcessorService; + } + + @Deactivate + public void deactivate() { + GeneratorFactory.unregister(GENERATOR_NAME); + } + + @Override + public Generated generate(Map properties) throws Exception { + ResourceDescriptor descriptor = ResourceDescriptor.fromMap(properties); + String content = null; + String object = null; + if (properties.containsKey(ResourceProducer.PROP_CONTENT)) { + content = properties.get(ResourceProducer.PROP_CONTENT).toString(); + String[] formatters = descriptor.format.split(","); + ArrayUtils.reverse(formatters); + object = STRING_FORMATTER_SERVICE.unformat(content, formatters); + if (properties.containsKey(ResourceProducer.PROP_PREPROCESS)) { + Object pp = properties.get(ResourceProducer.PROP_PREPROCESS); + if (pp instanceof List) { + List list = (List)pp; + for (Object obj: list) { + if (obj instanceof Map) { + Object result = RESOURCE_PROCESSOR_SERVICE.process(object, (Map)obj); + if (result != null) + object = result.toString(); + else + object = ""; + } + } + } + } + } else { + EntaxyResource resource = ENTAXY_RESOURCE_SERVICE.getResource(descriptor.getResourceUrl()); + if (resource.exists()) { + object = resource.getAsString(); + content = STRING_FORMATTER_SERVICE.format(object, descriptor.format.split(",")); + } + } + if (object == null) + return null; + Map resultMap = new HashMap<>(); + resultMap.putAll(properties); + resultMap.put(ResourceProducer.PROP_CONTENT, content); + resultMap.put("#_object", object); + return new GeneratedResourceWrapper(resultMap); + } + + @Override + public boolean isGeneratable(Map properties) throws Exception { + return properties.containsKey(ResourceDataProcessor.PROP_PROVIDER) + && properties.containsKey(ResourceDataProcessor.PROP_LOCATION); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/EntaxyResourceProcessorServiceImpl.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/EntaxyResourceProcessorServiceImpl.java new file mode 100644 index 00000000..4b05eb15 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/EntaxyResourceProcessorServiceImpl.java @@ -0,0 +1,84 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ru.entaxy.platform.core.producer.resources.EntaxyResourceProcessor; +import ru.entaxy.platform.core.producer.resources.EntaxyResourceProcessorService; + +@Component (service = EntaxyResourceProcessorService.class, immediate = true) +public class EntaxyResourceProcessorServiceImpl implements EntaxyResourceProcessorService { + + private static final Logger log = LoggerFactory.getLogger(EntaxyResourceProcessorServiceImpl.class); + + protected static EntaxyResourceProcessorService _INSTANCE; + + public static EntaxyResourceProcessorService getInstance() { + return _INSTANCE; + } + + protected Map processorsMap = new HashMap<>(); + + @Activate + public void activate() { + _INSTANCE = this; + } + + @Reference (cardinality = ReferenceCardinality.MULTIPLE, collectionType = CollectionType.SERVICE, policy = ReferencePolicy.DYNAMIC + , policyOption = ReferencePolicyOption.GREEDY, unbind = "removeProcessor") + public void addProcessor(EntaxyResourceProcessor processor) { + synchronized (processorsMap) { + this.processorsMap.put(processor.getName(), processor); + } + } + + public void removeProcessor(EntaxyResourceProcessor processor) { + synchronized (processorsMap) { + this.processorsMap.remove(processor.getName()); + } + } + + + @Override + public Object process(Object value, Map properties) { + Object val = properties.get(EntaxyResourceProcessor.PROP_PROCESSOR); + if (val == null) + return value; + String processorName = val.toString(); + if (!processorsMap.containsKey(processorName)) { + log.warn("Unknown processor [{}] in [{}]", processorName, properties); + return value; + } + return processorsMap.get(processorName).process(value, properties); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/ResourceDataProcessorImpl.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/ResourceDataProcessorImpl.java new file mode 100644 index 00000000..34043801 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/ResourceDataProcessorImpl.java @@ -0,0 +1,111 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources.impl; + +import java.util.Map; + +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import ru.entaxy.esb.resources.EntaxyResource; +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.core.producer.api.EntaxyFactoryDataProcessor; +import ru.entaxy.platform.core.producer.resources.ResourceDataProcessor; +import ru.entaxy.platform.core.producer.resources.ResourceDescriptor; +import ru.entaxy.platform.core.producer.resources.StringFormatterService; + +@Component (service = {EntaxyFactoryDataProcessor.class, ResourceDataProcessor.class}, immediate = true) +public class ResourceDataProcessorImpl implements EntaxyFactoryDataProcessor, ResourceDataProcessor { + + private static final Logger log = LoggerFactory.getLogger(ResourceDataProcessorImpl.class); + + @Reference (cardinality = ReferenceCardinality.MANDATORY) + EntaxyResourceService entaxyResourceService; + + @Reference (cardinality = ReferenceCardinality.MANDATORY) + StringFormatterService stringFormatterService; + + @Override + public Object processDefaultValue(Object currentValue) { +// log.info("\n-->> PROCESSING :: " + (currentValue==null?"NULL":currentValue.getClass().getName())); + if (currentValue == null) + return currentValue; + ResourceDescriptor descriptor = null; + if (currentValue instanceof JsonElement) { +// log.info("\n-->> PROCESSING :: JsonElement"); + if (((JsonElement) currentValue).isJsonObject()) { +// log.info("\n-->> PROCESSING :: JsonObject"); + JsonObject jsonObject = ((JsonElement) currentValue).getAsJsonObject(); + if (jsonObject.has(ENTAXY_RESOURCE_KEY)) { +// log.info("\n-->> PROCESSING :: entaxy-resource"); + descriptor = ResourceDescriptor.fromJson(jsonObject.get(ENTAXY_RESOURCE_KEY)); + } + } + } else if (currentValue instanceof Map) { +// log.info("\n-->> PROCESSING :: MAP"); + if (((Map)currentValue).containsKey(ENTAXY_RESOURCE_KEY)) { + Object current = ((Map)currentValue).get(ENTAXY_RESOURCE_KEY); +// log.info("\n-->> PROCESSING :: SUBMAP :: " + current.getClass().getName()); + if (current instanceof Map) { + JsonElement je = (new Gson()).toJsonTree(current); +// log.info("\n-->> PROCESSING :: JE :: " + je.toString()); + descriptor = ResourceDescriptor.fromJson(je); + } + } + } else { +// log.info("\n-->> PROCESSING :: NOT KNOWN"); + } + if (descriptor != null) { + Object result = getResourceDataFromDescriptor(descriptor); + return result==null?currentValue:result; + } + return currentValue; + } + + @Override + public Object getResourceDataFromDescriptor(ResourceDescriptor descriptor) { + EntaxyResource resource = entaxyResourceService.getResource(descriptor.getResourceUrl()); + if (resource == null) + return null; + if (descriptor.isReturnResource()) + return resource; + if (!resource.exists()) + return null; + if ("String".equalsIgnoreCase(descriptor.endType)) { + String resourceData = resource.getAsString(); + String format = descriptor.format; + if (CommonUtils.isValid(format)) { + log.info("\n FORMAT :: " + format); + resourceData = stringFormatterService.format(resourceData, format.split(",")); + } + return resourceData; + } + return resource.getLocation(); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/StringFormatterServiceImpl.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/StringFormatterServiceImpl.java new file mode 100644 index 00000000..5cb102f1 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/impl/StringFormatterServiceImpl.java @@ -0,0 +1,88 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; + +import ru.entaxy.platform.core.producer.resources.EntaxyResourceStringFormatter; +import ru.entaxy.platform.core.producer.resources.StringFormatterService; + +@Component (service = StringFormatterService.class, immediate = true) +public class StringFormatterServiceImpl implements StringFormatterService { + + protected static StringFormatterService _INSTANCE; + + public static StringFormatterService getInstance() { + return _INSTANCE; + } + + protected Map formattersMap = new HashMap<>(); + + @Activate + public void activate() { + _INSTANCE = this; + } + + @Reference (cardinality = ReferenceCardinality.MULTIPLE, collectionType = CollectionType.SERVICE, policy = ReferencePolicy.DYNAMIC + , policyOption = ReferencePolicyOption.GREEDY, unbind = "removeFormatter") + public void addFormatter(EntaxyResourceStringFormatter formatter) { + synchronized (formattersMap) { + this.formattersMap.put(formatter.getName(), formatter); + } + } + + public void removeFormatter(EntaxyResourceStringFormatter formatter) { + synchronized (formattersMap) { + this.formattersMap.remove(formatter.getName()); + } + } + + @Override + public String format(String value, String[] formatters) { + String current = value; + for (int i=0; i properties) { + if (value == null) + return value; + + Object valueToReturn = null; + + String sourceLocation = properties.getOrDefault(PROP_SOURCE, "").toString(); + if (!CommonUtils.isValid(sourceLocation)) { + log.warn("'source' not defined in [{}]", properties); + return value; + } + + EntaxyResource resource = entaxyResourceService.getResource(sourceLocation); + if (!resource.exists()) { + log.warn("Source [{}] not found, was defined in [{}]", sourceLocation, properties); + return value; + } + + String sourceElement = properties.getOrDefault(PROP_SOURCE_ELEMENT, "").toString(); + if (!CommonUtils.isValid(sourceElement)) { + log.warn("Source element not defined in [{}]", properties); + return value; + } + + String targetElement = properties.getOrDefault(PROP_TARGET_ELEMENT, "").toString(); + if (!CommonUtils.isValid(targetElement)) { + log.warn("Source element not defined in [{}]", properties); + return value; + } + + String targetXMLString = value.toString(); + String sourceXMLString = resource.getAsString(); + + try { + Document targetDocument = CommonXMLUtils.parseString(false, targetXMLString); + Document sourceDocument = CommonXMLUtils.parseString(false, sourceXMLString); + + NodeList nodesToReplace = targetDocument.getElementsByTagName(targetElement); + if (nodesToReplace.getLength() == 0) + return value; + + NodeList replacements = sourceDocument.getElementsByTagName(sourceElement); + if (replacements.getLength() == 0) + return value; + + Node replacement = replacements.item(0); + NodeList replacementChildren = replacement.getChildNodes(); + + List toRemove = new ArrayList<>(); + + for (int i=0; i properties) { + log.info("XSLT :: processing [{}]", value); + + if (value == null) + return value; + + String xsltLocation = properties.getOrDefault(PROP_SOURCE, "").toString(); + if (!CommonUtils.isValid(xsltLocation)) { + log.warn("XSL not defined in [{}]", properties); + return value; + } + + EntaxyResource resource = entaxyResourceService.getResource(xsltLocation); + if (!resource.exists()) { + log.warn("XSL [{}] not found, was defined in [{}]", xsltLocation, properties); + return value; + } + + System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl"); + TransformerFactory factory = TransformerFactory.newInstance(); + Source xslt = new StreamSource(resource.getInputStream()); + Transformer transformer; + try { + transformer = factory.newTransformer(xslt); + } catch (TransformerConfigurationException e) { + log.error("Error creating transformer for [" + xsltLocation + "]", e); + return value; + } + + if (properties.containsKey(PROP_PARAMETERS)) { + Object obj = properties.get(PROP_PARAMETERS); + if (obj instanceof Map) { + Map map = (Map)obj; + for (Map.Entry entry: map.entrySet()) { + transformer.setParameter(entry.getKey(), entry.getValue()); + } + } + } + + Source xml = new StreamSource(new StringReader(value.toString())); + StringWriter result = new StringWriter(); + try { + transformer.transform(xml, new StreamResult(result)); + } catch (TransformerException e) { + log.error("Error transforming [" + value.toString() + "] with [" + xsltLocation + "]", e); + return value; + } + + return result.toString(); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/processors/XSLTSaxonResourceProcessor.java b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/processors/XSLTSaxonResourceProcessor.java new file mode 100644 index 00000000..26dc026d --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/java/ru/entaxy/platform/core/producer/resources/processors/XSLTSaxonResourceProcessor.java @@ -0,0 +1,136 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-resources-support + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.resources.processors; + +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Map; + +import javax.xml.transform.ErrorListener; +import javax.xml.transform.Source; +import javax.xml.transform.TransformerException; +import javax.xml.transform.stream.StreamSource; + +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import net.sf.saxon.s9api.Processor; +import net.sf.saxon.s9api.QName; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.Serializer; +import net.sf.saxon.s9api.XdmAtomicValue; +import net.sf.saxon.s9api.XsltCompiler; +import net.sf.saxon.s9api.XsltExecutable; +import net.sf.saxon.s9api.XsltTransformer; +import ru.entaxy.esb.resources.EntaxyResource; +import ru.entaxy.esb.resources.EntaxyResourceService; +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.core.producer.resources.EntaxyResourceProcessor; + +@Component (service = EntaxyResourceProcessor.class, immediate = true) +public class XSLTSaxonResourceProcessor implements EntaxyResourceProcessor { + + public static final String PROP_SOURCE = "source"; + public static final String PROP_PARAMETERS = "parameters"; + + private static final Logger log = LoggerFactory.getLogger(XSLTSaxonResourceProcessor.class); + + @Reference(cardinality = ReferenceCardinality.MANDATORY) + EntaxyResourceService entaxyResourceService; + + @Override + public String getName() { + return "saxon"; + } + + @Override + public Object process(Object value, Map properties) { + + log.info("SAXON :: processing [{}]", value); + + if (value == null) + return value; + + String xsltLocation = properties.getOrDefault(PROP_SOURCE, "").toString(); + if (!CommonUtils.isValid(xsltLocation)) { + log.warn("XSL not defined in [{}]", properties); + return value; + } + + EntaxyResource resource = entaxyResourceService.getResource(xsltLocation); + if (!resource.exists()) { + log.warn("XSL [{}] not found, was defined in [{}]", xsltLocation, properties); + return value; + } + + + Processor processor = new Processor(false); + XsltCompiler compiler = processor.newXsltCompiler(); + XsltExecutable stylesheet; + StringWriter result = new StringWriter(); + try { + compiler.setErrorListener(new ErrorListener() { + + @Override + public void warning(TransformerException exception) throws TransformerException { + log.warn("SAXON COMPILER:", exception); + } + + @Override + public void fatalError(TransformerException exception) throws TransformerException { + log.error("SAXON COMPILER:", exception); + } + + @Override + public void error(TransformerException exception) throws TransformerException { + log.error("SAXON COMPILER:", exception); + } + }); + stylesheet = compiler.compile(new StreamSource(resource.getInputStream())); + Serializer out = processor.newSerializer(result); + out.setOutputProperty(Serializer.Property.METHOD, "xml"); + out.setOutputProperty(Serializer.Property.INDENT, "yes"); + XsltTransformer transformer = stylesheet.load(); + Source xml = new StreamSource(new StringReader(value.toString())); + transformer.setSource(xml); + transformer.setDestination(out); + if (properties.containsKey(PROP_PARAMETERS)) { + Object obj = properties.get(PROP_PARAMETERS); + if (obj instanceof Map) { + Map map = (Map)obj; + for (Map.Entry entry: map.entrySet()) { + transformer.setParameter( + new QName(entry.getKey()) + , new XdmAtomicValue(entry.getValue().toString())); + } + } + } + transformer.transform(); + } catch (SaxonApiException e) { + log.error("Error transforming [" + value.toString() + "] with [" + xsltLocation + "]", e); + return value; + } + return result.toString(); + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-resources-support/src/main/resources/ru/entaxy/factory/entaxy-resource.json b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/resources/ru/entaxy/factory/entaxy-resource.json new file mode 100644 index 00000000..e72447cc --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-resources-support/src/main/resources/ru/entaxy/factory/entaxy-resource.json @@ -0,0 +1,17 @@ +{ + "factory": { + "id": "entaxy-resource", + "type": "entaxy.resource" + }, + "entaxy.resource": {}, + "outputs": { + "init": { + "isDefault": true, + "generator": "resource-wrap" + }, + "ref": { + "generator": "resource-wrap", + "scopes": ["private", "public"] + } + } +} \ No newline at end of file diff --git a/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryConfiguration.java b/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryConfiguration.java new file mode 100644 index 00000000..0a705236 --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryConfiguration.java @@ -0,0 +1,38 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-shell + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.shell; + +import org.apache.karaf.shell.api.action.Command; +import org.apache.karaf.shell.api.action.lifecycle.Service; + +@Service +@Command(scope = EntaxyProducerServiceSupport.SCOPE, name = "factory-configuration") +public class FactoryConfiguration extends FactoryAwareCommand { + + @Override + protected Object doExecute() throws Exception { + + // OUTPUT TO SHELL + System.out.println(entaxyFactory.getJsonConfiguration()); + + return null; + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryManagerStatus.java b/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryManagerStatus.java new file mode 100644 index 00000000..8896a57f --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryManagerStatus.java @@ -0,0 +1,77 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-shell + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.shell; + +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.karaf.shell.api.action.Action; +import org.apache.karaf.shell.api.action.Command; +import org.apache.karaf.shell.api.action.lifecycle.Reference; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.apache.karaf.shell.support.table.ShellTable; +import ru.entaxy.platform.base.objects.factory.tracker.TrackedFactoryManager; +import ru.entaxy.platform.base.objects.factory.tracker.TrackedFactoryManager.TrackedManagedFactory; + +@Service +@Command(scope = EntaxyProducerServiceSupport.SCOPE, name = "factory-manager-status") +public class FactoryManagerStatus implements Action { + + @Reference + TrackedFactoryManager factoryManager; + + @Override + public Object execute() throws Exception { + + ShellTable table = new ShellTable(); + table.column("ID"); + table.column("Active"); + table.column("Consistent"); + table.column("Up2date"); + table.column("Parent"); + table.column("Requires"); + + for (TrackedManagedFactory tmf: factoryManager.getManagedFactories()) { + final List waiting = tmf.waitingFor; + table.addRow().addContent( + tmf.factoryId + , tmf.isActive?"*":"" + , tmf.isConsistent()?"*":"" + , tmf.isUpToDate?"*":"" + , decorate(tmf.parent, waiting) + , tmf.requirements.stream().map(s -> decorate(s, waiting)) + .collect(Collectors.joining(",")) + ); + + } + + // OUTPUT TO SHELL + table.print(System.out); + + return null; + } + + protected String decorate(String test, List values) { + if (values.contains(test)) + return "*" + test; + return test; + } + +} diff --git a/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryTypeInfo.java b/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryTypeInfo.java new file mode 100644 index 00000000..a4f3378c --- /dev/null +++ b/platform/runtime/core/object-producing/object-producing-shell/src/main/java/ru/entaxy/platform/core/producer/shell/FactoryTypeInfo.java @@ -0,0 +1,53 @@ +/*- + * ~~~~~~licensing~~~~~~ + * object-producing-shell + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.core.producer.shell; + +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.karaf.shell.api.action.Command; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.apache.karaf.shell.support.table.ShellTable; + +@Service +@Command(scope = EntaxyProducerServiceSupport.SCOPE, name = "factory-type-info") +public class FactoryTypeInfo extends FactoryAwareCommand { + + @Override + protected Object doExecute() throws Exception { + + ShellTable table = new ShellTable(); + table.column("Name"); + table.column("Value"); + + Map typeInfo = entaxyFactory.getTypeInfo(); + + for (Entry entry: typeInfo.entrySet()) { + table.addRow().addContent( + entry.getKey(), + entry.getValue()==null?"":entry.getValue().toString() + ); + } + + table.print(System.out); + return null; + } + +} diff --git a/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/factory/abstract-connection.json b/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/factory/abstract-connection.json new file mode 100644 index 00000000..d72c7e1d --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/factory/abstract-connection.json @@ -0,0 +1,54 @@ +{ + "factory": { + "id": "abstract-connection", + "type": "entaxy.runtime.connection", + "isAbstract": true, + "description": "Factory abstract-connection of entaxy.runtime.connection" + }, + "entaxy.runtime.connection": { + /* BOTH, CONSUMER_ONLY, PRODUCER_ONLY */ + "modeSupported": "BOTH" + }, + "fields": { + "##publishRelation": { + "type": "String", + "isHidden": true, + "required": true, + "defaultValue": { + "@CALCULATED": { + "expression": "${#OWNER#.objectId}:${#OWNER#.type}:connection:connections", + "targetPath": "$.properties.##publish.relation", + "removeResolved": true, + "lazy": true + } + } + } + }, + "outputs": { + "init": { + "isDefault": false, + "fields": { + "##publishRelation": { + "@SCOPED": ["private"] + } + }, + "config": { + "configurable": false + }, + "scopes": [ + "public", + "private" + ] + }, + "ref": { + "isDefault": false, + "config": { + "configurable": false + }, + "scopes": [ + "public", + "private" + ] + } + } +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/templates/abstract-connection/init.ftl b/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/templates/abstract-connection/init.ftl new file mode 100644 index 00000000..b6542357 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/templates/abstract-connection/init.ftl @@ -0,0 +1,29 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connection-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + diff --git a/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/templates/abstract-connection/ref.ftl b/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/templates/abstract-connection/ref.ftl new file mode 100644 index 00000000..f4587c62 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/connection-producing/src/main/resources/ru/entaxy/templates/abstract-connection/ref.ftl @@ -0,0 +1,24 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connection-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + diff --git a/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/LICENSE.txt b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/pom.xml b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/pom.xml new file mode 100644 index 00000000..6bca8707 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + ru.entaxy.esb.platform.runtime.core.objects-implementations + connection-implementation + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.objects-implementations.connection-implementation + standard-connections-pack + bundle + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTION :: STANDARD PACK + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTION :: STANDARD PACK + + + + ru.entaxy.platform.runtime.connections.* + + + + + + org.apache.camel + camel-file + ${camel.version} + + + org.apache.camel + camel-util + ${camel.version} + + + ru.entaxy.esb.platform.runtime.base + base-support + ${project.version} + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + true + true + + + + + + diff --git a/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/java/ru/entaxy/platform/runtime/connections/file/FileConnectionComponent.java b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/java/ru/entaxy/platform/runtime/connections/file/FileConnectionComponent.java new file mode 100644 index 00000000..0c59bc1b --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/java/ru/entaxy/platform/runtime/connections/file/FileConnectionComponent.java @@ -0,0 +1,69 @@ +/*- + * ~~~~~~licensing~~~~~~ + * file-adapter + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.runtime.connections.file; + +import java.io.File; +import java.util.Map; + +import org.apache.camel.component.file.FileComponent; +import org.apache.camel.component.file.GenericFileEndpoint; +import org.apache.camel.util.StringHelper; + +import ru.entaxy.platform.base.support.CommonUtils; + +public class FileConnectionComponent extends FileComponent { + + protected String rootDirectory = ""; + + @Override + protected GenericFileEndpoint buildFileEndpoint(String uri, String remaining, Map parameters) + throws Exception { + + // copied from parent + if (StringHelper.hasStartToken(remaining, "simple")) { + throw new IllegalArgumentException("Invalid directory: " + remaining + ". Dynamic expressions with ${ } placeholders is not allowed." + + " Use the fileName option to set the dynamic expression."); + } + + String current = remaining; + if (CommonUtils.isValid(rootDirectory)) { + current = rootDirectory; + if (CommonUtils.isValid(remaining) && !".".equals(remaining)) { + if (!current.endsWith("/")) + current += "/"; + if (remaining.startsWith("/")) + current += remaining.substring(1); + else + current += remaining; + } + } + log.debug("CREATING ENDPOINT FOR [{}]", current); + return super.buildFileEndpoint(uri, current, parameters); + } + + public String getRootDirectory() { + return rootDirectory; + } + + public void setRootDirectory(String rootDirectory) { + this.rootDirectory = rootDirectory; + } + +} diff --git a/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/factory/file-connection.json b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/factory/file-connection.json new file mode 100644 index 00000000..d3dc585d --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/factory/file-connection.json @@ -0,0 +1,3201 @@ +{ + "factory": { + "id": "file-connection", + "type": "entaxy.runtime.connection", + "parent": "abstract-connection", + "isAbstract": false, + "camelOriginComponent": "file", + "label": "file,core", + "description": "Read and write files.", + "camelOrigin": "camel-file", + "camelOriginJavaType": "org.apache.camel.component.file.FileComponent", + "category": "adapter" + }, + "entaxy.runtime.connection": {}, + "fields": { + "bridgeErrorHandler": { + "displayName": "Bridge Error Handler", + "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.", + "label": "consumer", + "type": "boolean", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer", + "##origin": "camel", + "kind": [ + "property", + "parameter" + ], + "##camelDiff": { + "old": { + "javaType": "boolean", + "deprecated": false + }, + "new": { + "javaType": "boolean", + "deprecated": false + } + } + }, + "lazyStartProducer": { + "displayName": "Lazy Start Producer", + "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel\u0027s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.", + "label": "producer", + "type": "boolean", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "producer", + "##origin": "camel", + "kind": [ + "property", + "parameter" + ], + "##camelDiff": { + "old": { + "javaType": "boolean", + "deprecated": false + }, + "new": { + "javaType": "boolean", + "deprecated": false + } + } + }, + "basicPropertyBinding": { + "displayName": "Basic Property Binding", + "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities", + "label": "advanced", + "type": "boolean", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "advanced", + "##origin": "camel", + "kind": [ + "property", + "parameter" + ], + "##camelDiff": { + "old": { + "javaType": "boolean", + "deprecated": false + }, + "new": { + "javaType": "boolean", + "deprecated": false + } + } + }, + "directoryName": { + "displayName": "Directory Name", + "description": "The starting directory", + "label": "", + "type": "string", + "kind": "path", + "required": true, + "hidden": false, + "group": "common", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.io.File", + "deprecated": false, + "deprecationNote": "" + } + }, + "charset": { + "displayName": "Charset", + "description": "This option is used to specify the encoding of the file. You can use this on the consumer, to specify the encodings of the files, which allow Camel to know the charset it should load the file content in case the file content is being accessed. Likewise when writing a file, you can use this option to specify which charset to write the file as well. Do mind that when writing the file Camel may have to read the message content into memory to be able to convert the data into the configured charset, so do not use this if you have big messages.", + "label": "", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "common", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "doneFileName": { + "displayName": "Done File Name", + "description": "Producer: If provided, then Camel will write a 2nd done file when the original file has been written. The done file will be empty. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The done file will always be written in the same folder as the original file. Consumer: If provided, Camel will only consume files if a done file exists. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders.The done file is always expected in the same folder as the original file. Only ${file.name} and ${file.name.next} is supported as dynamic placeholders.", + "label": "", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "common", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "fileName": { + "displayName": "File Name", + "description": "Use Expression such as File Language to dynamically set the filename. For consumers, it\u0027s used as a filename filter. For producers, it\u0027s used to evaluate the filename to write. If an expression is set, it take precedence over the CamelFileName header. (Note: The header itself can also be an Expression). The expression options support both String and Expression types. If the expression is a String type, it is always evaluated using the File Language. If the expression is an Expression type, the specified Expression type is used - this allows you, for instance, to use OGNL expressions. For the consumer, you can use it to filter filenames, so you can for instance consume today\u0027s file using the File Language syntax: mydata-${date:now:yyyyMMdd}.txt. The producers support the CamelOverruleFileName header which takes precedence over any existing CamelFileName header; the CamelOverruleFileName is a header that is used only once, and makes it easier as this avoids to temporary store CamelFileName and have to restore it afterwards.", + "label": "", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "common", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "delete": { + "displayName": "Delete", + "description": "If true, the file will be deleted after it is processed successfully.", + "label": "consumer", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "moveFailed": { + "displayName": "Move Failed", + "description": "Sets the move failure expression based on Simple language. For example, to move files into a .error subdirectory use: .error. Note: When moving the files to the fail location Camel will handle the error and will not pick up the file again.", + "label": "consumer", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "noop": { + "displayName": "Noop", + "description": "If true, the file is not moved or deleted in any way. This option is good for readonly data, or for ETL type requirements. If noop\u003dtrue, Camel will set idempotent\u003dtrue as well, to avoid consuming the same files over and over again.", + "label": "consumer", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "preMove": { + "displayName": "Pre Move", + "description": "Expression (such as File Language) used to dynamically set the filename when moving it before processing. For example to move in-progress files into the order directory set this value to order.", + "label": "consumer", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "preSort": { + "displayName": "Pre Sort", + "description": "When pre-sort is enabled then the consumer will sort the file and directory names during polling, that was retrieved from the file system. You may want to do this in case you need to operate on the files in a sorted order. The pre-sort is executed before the consumer starts to filter, and accept files to process by Camel. This option is default\u003dfalse meaning disabled.", + "label": "consumer", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "recursive": { + "displayName": "Recursive", + "description": "If a directory, will look for files in all the sub-directories as well.", + "label": "consumer", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "sendEmptyMessageWhenIdle": { + "displayName": "Send Empty Message When Idle", + "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.", + "label": "consumer", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "directoryMustExist": { + "displayName": "Directory Must Exist", + "description": "Similar to the startingDirectoryMustExist option but this applies during polling (after starting the consumer).", + "label": "consumer,advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "exceptionHandler": { + "displayName": "Exception Handler", + "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.", + "label": "consumer,advanced", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.spi.ExceptionHandler", + "optionalPrefix": "consumer.", + "deprecated": false + } + }, + "exchangePattern": { + "displayName": "Exchange Pattern", + "description": "Sets the exchange pattern when the consumer creates an exchange.", + "label": "consumer,advanced", + "type": "String", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer (advanced)", + "@TYPEINFO": { + "type": "enum", + "values": [ + "InOnly", + "InOut", + "InOptionalOut" + ] + }, + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.ExchangePattern", + "deprecated": false + } + }, + "extendedAttributes": { + "displayName": "Extended Attributes", + "description": "To define which file attributes of interest. Like posix:permissions,posix:owner,basic:lastAccessTime, it supports basic wildcard like posix:, basic:lastAccessTime", + "label": "consumer,advanced", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "inProgressRepository": { + "displayName": "In Progress Repository", + "description": "A pluggable in-progress repository org.apache.camel.spi.IdempotentRepository. The in-progress repository is used to account the current in progress files being consumed. By default a memory based repository is used.", + "label": "consumer,advanced", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.spi.IdempotentRepository", + "deprecated": false + } + }, + "localWorkDirectory": { + "displayName": "Local Work Directory", + "description": "When consuming, a local work directory can be used to store the remote file content directly in local files, to avoid loading the content into memory. This is beneficial, if you consume a very big remote file and thus can conserve memory.", + "label": "consumer,advanced", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "onCompletionExceptionHandler": { + "displayName": "On Completion Exception Handler", + "description": "To use a custom org.apache.camel.spi.ExceptionHandler to handle any thrown exceptions that happens during the file on completion process where the consumer does either a commit or rollback. The default implementation will log any exception at WARN level and ignore.", + "label": "consumer,advanced", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.spi.ExceptionHandler", + "deprecated": false + } + }, + "pollStrategy": { + "displayName": "Poll Strategy", + "description": "A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.", + "label": "consumer,advanced", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.spi.PollingConsumerPollStrategy", + "deprecated": false + } + }, + "probeContentType": { + "displayName": "Probe Content Type", + "description": "Whether to enable probing of the content type. If enable then the consumer uses Files#probeContentType(java.nio.file.Path) to determine the content-type of the file, and store that as a header with key Exchange#FILE_CONTENT_TYPE on the Message.", + "label": "consumer,advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "processStrategy": { + "displayName": "Process Strategy", + "description": "A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply.", + "label": "consumer,advanced", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.component.file.GenericFileProcessStrategy\u003cjava.io.File\u003e", + "deprecated": false + } + }, + "startingDirectoryMustExist": { + "displayName": "Starting Directory Must Exist", + "description": "Whether the starting directory must exist. Mind that the autoCreate option is default enabled, which means the starting directory is normally auto created if it doesn\u0027t exist. You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn\u0027t exist.", + "label": "consumer,advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "startingDirectoryMustHaveAccess": { + "displayName": "Starting Directory Must Have Access", + "description": "Whether the starting directory has access permissions. Mind that the startingDirectoryMustExist parameter must be set to true in order to verify that the directory exists. Will thrown an exception if the directory doesn\u0027t have read and write permissions.", + "label": "consumer,advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "consumer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "appendChars": { + "displayName": "Append Chars", + "description": "Used to append characters (text) after writing files. This can for example be used to add new lines or other separators when writing and appending to existing files. To specify new-line (slash-n or slash-r) or tab (slash-t) characters then escape with an extra slash, eg slash-slash-n.", + "label": "producer", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "producer", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "fileExist": { + "displayName": "File Exist", + "description": "What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile can be used to control what to do if an moving the file, and there exists already an existing file, otherwise causing the move operation to fail. The Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName option is in use. This allows to try renaming the file from the temporary name to the actual name, without doing any exists check. This check may be faster on some file systems and especially FTP servers.", + "label": "producer", + "type": "String", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": "Override", + "group": "producer", + "@TYPEINFO": { + "type": "enum", + "values": [ + "Override", + "Append", + "Fail", + "Ignore", + "Move", + "TryRename" + ] + }, + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.component.file.GenericFileExist", + "deprecated": false + } + }, + "flatten": { + "displayName": "Flatten", + "description": "Flatten is used to flatten the file name path to strip any leading paths, so it\u0027s just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths.", + "label": "producer", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "producer", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "jailStartingDirectory": { + "displayName": "Jail Starting Directory", + "description": "Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders.", + "label": "producer", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "producer", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "moveExisting": { + "displayName": "Move Existing", + "description": "Expression (such as File Language) used to compute file name to use when fileExist\u003dMove is configured. To move files into a backup subdirectory just enter backup. This option only supports the following File Language tokens: file:name, file:name.ext, file:name.noext, file:onlyname, file:onlyname.noext, file:ext, and file:parent. Notice the file:parent is not supported by the FTP component, as the FTP component can only move any existing files to a relative directory based on current dir as base.", + "label": "producer", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "producer", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "tempFileName": { + "displayName": "Temp File Name", + "description": "The same as tempPrefix option but offering a more fine grained control on the naming of the temporary filename as it uses the File Language. The location for tempFilename is relative to the final file location in the option \u0027fileName\u0027, not the target directory in the base uri. For example if option fileName includes a directory prefix: dir/finalFilename then tempFileName is relative to that subdirectory dir.", + "label": "producer", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "producer", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "tempPrefix": { + "displayName": "Temp Prefix", + "description": "This option is used to write the file using a temporary name and then, after the write is complete, rename it to the real name. Can be used to identify files being written and also avoid consumers (not using exclusive read locks) reading in progress files. Is often used by FTP when uploading big files.", + "label": "producer", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "producer", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "allowNullBody": { + "displayName": "Allow Null Body", + "description": "Used to specify if a null body is allowed during file writing. If set to true then an empty file will be created, when set to false, and attempting to send a null body to the file component, a GenericFileWriteException of \u0027Cannot write null body to file.\u0027 will be thrown. If the fileExist option is set to \u0027Override\u0027, then the file will be truncated, and if set to append the file will remain unchanged.", + "label": "producer,advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "producer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "chmod": { + "displayName": "Chmod", + "description": "Specify the file permissions which is sent by the producer, the chmod value must be between 000 and 777; If there is a leading digit like in 0755 we will ignore it.", + "label": "producer,advanced", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "producer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "chmodDirectory": { + "displayName": "Chmod Directory", + "description": "Specify the directory permissions used when the producer creates missing directories, the chmod value must be between 000 and 777; If there is a leading digit like in 0755 we will ignore it.", + "label": "producer,advanced", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "producer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "eagerDeleteTargetFile": { + "displayName": "Eager Delete Target File", + "description": "Whether or not to eagerly delete any existing target file. This option only applies when you use fileExists\u003dOverride and the tempFileName option as well. You can use this to disable (set it to false) deleting the target file before the temp file is written. For example you may write big files and want the target file to exists during the temp file is being written. This ensure the target file is only deleted until the very last moment, just before the temp file is being renamed to the target filename. This option is also used to control whether to delete any existing files when fileExist\u003dMove is enabled, and an existing file exists. If this option copyAndDeleteOnRenameFails false, then an exception will be thrown if an existing file existed, if its true, then the existing file is deleted before the move operation.", + "label": "producer,advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "producer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "forceWrites": { + "displayName": "Force Writes", + "description": "Whether to force syncing writes to the file system. You can turn this off if you do not want this level of guarantee, for example if writing to logs / audit logs etc; this would yield better performance.", + "label": "producer,advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "producer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "keepLastModified": { + "displayName": "Keep Last Modified", + "description": "Will keep the last modified timestamp from the source file (if any). Will use the Exchange.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.util.Date or long with the timestamp. If the timestamp exists and the option is enabled it will set this timestamp on the written file. Note: This option only applies to the file producer. You cannot use this option with any of the ftp producers.", + "label": "producer,advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "producer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "moveExistingFileStrategy": { + "displayName": "Move Existing File Strategy", + "description": "Strategy (Custom Strategy) used to move file with special naming token to use when fileExist\u003dMove is configured. By default, there is an implementation used if no custom strategy is provided", + "label": "producer,advanced", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "producer (advanced)", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.component.file.strategy.FileMoveExistingStrategy", + "deprecated": false + } + }, + "autoCreate": { + "displayName": "Auto Create", + "description": "Automatically create missing directories in the file\u0027s pathname. For the file consumer, that means creating the starting directory. For the file producer, it means the directory the files should be written to.", + "label": "advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "advanced", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "bufferSize": { + "displayName": "Buffer Size", + "description": "Buffer size in bytes used for writing files (or in case of FTP for downloading and uploading files).", + "label": "advanced", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 131072, + "group": "advanced", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "copyAndDeleteOnRenameFail": { + "displayName": "Copy And Delete On Rename Fail", + "description": "Whether to fallback and do a copy and delete file, in case the file could not be renamed directly. This option is not available for the FTP component.", + "label": "advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "advanced", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "renameUsingCopy": { + "displayName": "Rename Using Copy", + "description": "Perform rename operations using a copy and delete strategy. This is primarily used in environments where the regular rename operation is unreliable (e.g. across different file systems or networks). This option takes precedence over the copyAndDeleteOnRenameFail parameter that will automatically fall back to the copy and delete strategy, but only after additional delays.", + "label": "advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "advanced", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "synchronous": { + "displayName": "Synchronous", + "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).", + "label": "advanced", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "advanced", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "antExclude": { + "displayName": "Ant Exclude", + "description": "Ant style filter exclusion. If both antInclude and antExclude are used, antExclude takes precedence over antInclude. Multiple exclusions may be specified in comma-delimited format.", + "label": "consumer,filter", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "antFilterCaseSensitive": { + "displayName": "Ant Filter Case Sensitive", + "description": "Sets case sensitive flag on ant filter.", + "label": "consumer,filter", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "antInclude": { + "displayName": "Ant Include", + "description": "Ant style filter inclusion. Multiple inclusions may be specified in comma-delimited format.", + "label": "consumer,filter", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "eagerMaxMessagesPerPoll": { + "displayName": "Eager Max Messages Per Poll", + "description": "Allows for controlling whether the limit from maxMessagesPerPoll is eager or not. If eager then the limit is during the scanning of files. Where as false would scan all files, and then perform sorting. Setting this option to false allows for sorting all files first, and then limit the poll. Mind that this requires a higher memory usage as all file details are in memory to perform the sorting.", + "label": "consumer,filter", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "exclude": { + "displayName": "Exclude", + "description": "Is used to exclude files, if filename matches the regex pattern (matching is case in-senstive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring this as an endpoint uri. See more details at configuring endpoint uris", + "label": "consumer,filter", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "filter": { + "displayName": "Filter", + "description": "Pluggable filter as a org.apache.camel.component.file.GenericFileFilter class. Will skip files if filter returns false in its accept() method.", + "label": "consumer,filter", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.component.file.GenericFileFilter\u003cjava.io.File\u003e", + "deprecated": false + } + }, + "filterDirectory": { + "displayName": "Filter Directory", + "description": "Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}", + "label": "consumer,filter", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "filterFile": { + "displayName": "Filter File", + "description": "Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000", + "label": "consumer,filter", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "idempotent": { + "displayName": "Idempotent", + "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop\u003dtrue then idempotent will be enabled as well to avoid consuming the same files over and over again.", + "label": "consumer,filter", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.Boolean", + "deprecated": false + } + }, + "idempotentKey": { + "displayName": "Idempotent Key", + "description": "To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey\u003d${file:name}-${file:size}", + "label": "consumer,filter", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "idempotentRepository": { + "displayName": "Idempotent Repository", + "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryMessageIdRepository if none is specified and idempotent is true.", + "label": "consumer,filter", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.spi.IdempotentRepository", + "deprecated": false + } + }, + "include": { + "displayName": "Include", + "description": "Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring this as an endpoint uri. See more details at configuring endpoint uris", + "label": "consumer,filter", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "maxDepth": { + "displayName": "Max Depth", + "description": "The maximum depth to traverse when recursively processing a directory.", + "label": "consumer,filter", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 2147483647, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "maxMessagesPerPoll": { + "displayName": "Max Messages Per Poll", + "description": "To define a maximum messages to gather per poll. By default no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it. Notice: If this option is in use then the File and FTP components will limit before any sorting. For example if you have 100000 files and use maxMessagesPerPoll\u003d500, then only the first 500 files will be picked up, and then sorted. You can use the eagerMaxMessagesPerPoll option and set this to false to allow to scan all files first and then sort afterwards.", + "label": "consumer,filter", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "minDepth": { + "displayName": "Min Depth", + "description": "The minimum depth to start processing when recursively processing a directory. Using minDepth\u003d1 means the base directory. Using minDepth\u003d2 means the first sub directory.", + "label": "consumer,filter", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "move": { + "displayName": "Move", + "description": "Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done.", + "label": "consumer,filter", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "filter", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "exclusiveReadLockStrategy": { + "displayName": "Exclusive Read Lock Strategy", + "description": "Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation.", + "label": "consumer,lock", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy\u003cjava.io.File\u003e", + "deprecated": false + } + }, + "readLock": { + "displayName": "Read Lock", + "description": "Used by consumer, to only poll the files if it has exclusive read-lock on the file (i.e. the file is not in-progress or being written). Camel will wait until the file lock is granted. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed is using file length/modification timestamp to detect whether the file is currently being copied or not. Will at least use 1 sec to determine this, so this option cannot consume files as fast as the others, but can be more reliable as the JDK IO API cannot always determine whether a file is currently being used by another process. The option readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that.Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan.", + "label": "consumer,lock", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": "none", + "group": "lock", + "@TYPEINFO": { + "type": "enum", + "values": [ + "none", + "markerFile", + "fileLock", + "rename", + "changed", + "idempotent", + "idempotent-changed", + "idempotent-rename" + ] + }, + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "readLockCheckInterval": { + "displayName": "Read Lock Check Interval", + "description": "Interval in millis for the read-lock, if supported by the read lock. This interval is used for sleeping between attempts to acquire the read lock. For example when using the changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit.", + "label": "consumer,lock", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 1000, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "long", + "deprecated": false + } + }, + "readLockDeleteOrphanLockFiles": { + "displayName": "Read Lock Delete Orphan Lock Files", + "description": "Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory.", + "label": "consumer,lock", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "readLockIdempotentReleaseAsync": { + "displayName": "Read Lock Idempotent Release Async", + "description": "Whether the delayed release task should be synchronous or asynchronous. See more details at the readLockIdempotentReleaseDelay option.", + "label": "consumer,lock", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "readLockIdempotentReleaseAsyncPoolSize": { + "displayName": "Read Lock Idempotent Release Async Pool Size", + "description": "The number of threads in the scheduled thread pool when using asynchronous release tasks. Using a default of 1 core threads should be sufficient in almost all use-cases, only set this to a higher value if either updating the idempotent repository is slow, or there are a lot of files to process. This option is not in-use if you use a shared thread pool by configuring the readLockIdempotentReleaseExecutorService option. See more details at the readLockIdempotentReleaseDelay option.", + "label": "consumer,lock", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "readLockIdempotentReleaseDelay": { + "displayName": "Read Lock Idempotent Release Delay", + "description": "Whether to delay the release task for a period of millis. This can be used to delay the release tasks to expand the window when a file is regarded as read-locked, in an active/active cluster scenario with a shared idempotent repository, to ensure other nodes cannot potentially scan and acquire the same file, due to race-conditions. By expanding the time-window of the release tasks helps prevents these situations. Note delaying is only needed if you have configured readLockRemoveOnCommit to true.", + "label": "consumer,lock", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "readLockIdempotentReleaseExecutorService": { + "displayName": "Read Lock Idempotent Release Executor Service", + "description": "To use a custom and shared thread pool for asynchronous release tasks. See more details at the readLockIdempotentReleaseDelay option.", + "label": "consumer,lock", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.util.concurrent.ScheduledExecutorService", + "deprecated": false + } + }, + "readLockLoggingLevel": { + "displayName": "Read Lock Logging Level", + "description": "Logging level used when a read lock could not be acquired. By default a DEBUG is logged. You can change this level, for example to OFF to not have any logging. This option is only applicable for readLock of types: changed, fileLock, idempotent, idempotent-changed, idempotent-rename, rename.", + "label": "consumer,lock", + "type": "String", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": "DEBUG", + "group": "lock", + "@TYPEINFO": { + "type": "enum", + "values": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "OFF" + ] + }, + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.LoggingLevel", + "deprecated": false + } + }, + "readLockMarkerFile": { + "displayName": "Read Lock Marker File", + "description": "Whether to use marker file with the changed, rename, or exclusive read lock types. By default a marker file is used as well to guard against other processes picking up the same files. This behavior can be turned off by setting this option to false. For example if you do not want to write marker files to the file systems by the Camel application.", + "label": "consumer,lock", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "readLockMinAge": { + "displayName": "Read Lock Min Age", + "description": "This option is applied only for readLock\u003dchanged. It allows to specify a minimum age the file must be before attempting to acquire the read lock. For example use readLockMinAge\u003d300s to require the file is at last 5 minutes old. This can speedup the changed read lock as it will only attempt to acquire files which are at least that given age.", + "label": "consumer,lock", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 0, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "long", + "deprecated": false + } + }, + "readLockMinLength": { + "displayName": "Read Lock Min Length", + "description": "This option is applied only for readLock\u003dchanged. It allows you to configure a minimum file length. By default Camel expects the file to contain data, and thus the default value is 1. You can set this option to zero, to allow consuming zero-length files.", + "label": "consumer,lock", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 1, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "long", + "deprecated": false + } + }, + "readLockRemoveOnCommit": { + "displayName": "Read Lock Remove On Commit", + "description": "This option is applied only for readLock\u003didempotent. It allows to specify whether to remove the file name entry from the idempotent repository when processing the file is succeeded and a commit happens. By default the file is not removed which ensures that any race-condition do not occur so another active node may attempt to grab the file. Instead the idempotent repository may support eviction strategies that you can configure to evict the file name entry after X minutes - this ensures no problems with race conditions. See more details at the readLockIdempotentReleaseDelay option.", + "label": "consumer,lock", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "readLockRemoveOnRollback": { + "displayName": "Read Lock Remove On Rollback", + "description": "This option is applied only for readLock\u003didempotent. It allows to specify whether to remove the file name entry from the idempotent repository when processing the file failed and a rollback happens. If this option is false, then the file name entry is confirmed (as if the file did a commit).", + "label": "consumer,lock", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "readLockTimeout": { + "displayName": "Read Lock Timeout", + "description": "Optional timeout in millis for the read-lock, if supported by the read-lock. If the read-lock could not be granted and the timeout triggered, then Camel will skip the file. At next poll Camel, will try the file again, and this time maybe the read-lock could be granted. Use a value of 0 or lower to indicate forever. Currently fileLock, changed and rename support the timeout. Notice: For FTP the default readLockTimeout value is 20000 instead of 10000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit.", + "label": "consumer,lock", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 10000, + "group": "lock", + "##origin": "camel", + "##camelDiff": { + "javaType": "long", + "deprecated": false + } + }, + "backoffErrorThreshold": { + "displayName": "Backoff Error Threshold", + "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.", + "label": "consumer,scheduler", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "backoffIdleThreshold": { + "displayName": "Backoff Idle Threshold", + "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.", + "label": "consumer,scheduler", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "backoffMultiplier": { + "displayName": "Backoff Multiplier", + "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.", + "label": "consumer,scheduler", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "int", + "deprecated": false + } + }, + "delay": { + "displayName": "Delay", + "description": "Milliseconds before the next poll.", + "label": "consumer,scheduler", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 500, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "long", + "deprecated": false + } + }, + "greedy": { + "displayName": "Greedy", + "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.", + "label": "consumer,scheduler", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "initialDelay": { + "displayName": "Initial Delay", + "description": "Milliseconds before the first poll starts.", + "label": "consumer,scheduler", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 1000, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "long", + "deprecated": false + } + }, + "repeatCount": { + "displayName": "Repeat Count", + "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.", + "label": "consumer,scheduler", + "type": "number", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": 0, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "long", + "deprecated": false + } + }, + "runLoggingLevel": { + "displayName": "Run Logging Level", + "description": "The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.", + "label": "consumer,scheduler", + "type": "String", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": "TRACE", + "group": "scheduler", + "@TYPEINFO": { + "type": "enum", + "values": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "OFF" + ] + }, + "##origin": "camel", + "##camelDiff": { + "javaType": "org.apache.camel.LoggingLevel", + "deprecated": false + } + }, + "scheduledExecutorService": { + "displayName": "Scheduled Executor Service", + "description": "Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.", + "label": "consumer,scheduler", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.util.concurrent.ScheduledExecutorService", + "deprecated": false + } + }, + "scheduler": { + "displayName": "Scheduler", + "description": "To use a cron scheduler from either camel-spring or camel-quartz component", + "label": "consumer,scheduler", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": "none", + "group": "scheduler", + "@TYPEINFO": { + "type": "enum", + "values": [ + "none", + "spring", + "quartz" + ] + }, + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "schedulerProperties": { + "displayName": "Scheduler Properties", + "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.", + "label": "consumer,scheduler", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.util.Map\u003cjava.lang.String, java.lang.Object\u003e", + "prefix": "scheduler.", + "multiValue": true, + "deprecated": false + } + }, + "startScheduler": { + "displayName": "Start Scheduler", + "description": "Whether the scheduler should be auto started.", + "label": "consumer,scheduler", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "timeUnit": { + "displayName": "Time Unit", + "description": "Time unit for initialDelay and delay options.", + "label": "consumer,scheduler", + "type": "String", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": "MILLISECONDS", + "group": "scheduler", + "@TYPEINFO": { + "type": "enum", + "values": [ + "NANOSECONDS", + "MICROSECONDS", + "MILLISECONDS", + "SECONDS", + "MINUTES", + "HOURS", + "DAYS" + ] + }, + "##origin": "camel", + "##camelDiff": { + "javaType": "java.util.concurrent.TimeUnit", + "deprecated": false + } + }, + "useFixedDelay": { + "displayName": "Use Fixed Delay", + "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.", + "label": "consumer,scheduler", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": true, + "group": "scheduler", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "shuffle": { + "displayName": "Shuffle", + "description": "To shuffle the list of files (sort in random order)", + "label": "consumer,sort", + "type": "boolean", + "kind": "parameter", + "required": false, + "hidden": false, + "defaultValue": false, + "group": "sort", + "##origin": "camel", + "##camelDiff": { + "javaType": "boolean", + "deprecated": false + } + }, + "sortBy": { + "displayName": "Sort By", + "description": "Built-in sort by using the File Language. Supports nested sorts, so you can have a sort by file name and as a 2nd group sort by modified date.", + "label": "consumer,sort", + "type": "string", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "sort", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.lang.String", + "deprecated": false + } + }, + "sorter": { + "displayName": "Sorter", + "description": "Pluggable sorter as a java.util.Comparator class.", + "label": "consumer,sort", + "type": "object", + "kind": "parameter", + "required": false, + "hidden": false, + "group": "sort", + "##origin": "camel", + "##camelDiff": { + "javaType": "java.util.Comparator\u003corg.apache.camel.component.file.GenericFile\u003cjava.io.File\u003e\u003e", + "deprecated": false + } + }, + "rootDirectory": { + "type": "String", + "group": "entaxy", + "required": true + }, + "createResourceProvider": { + "type": "Boolean", + "group": "entaxy", + "required": true, + "defaultValue": false + } + }, + "##camel": { + "settings": { + "import": { + "factory": { + "attributes": { + "name": [ + "id", + "camelOriginComponent" + ], + "label": { + "target": "label", + "replaceIfEmpty": true + }, + "description": { + "target": "description", + "policy": "firstOnly", + "replaceIfEmpty": true + }, + "artifactId": "camelOrigin", + "javaType": "camelOriginJavaType" + } + }, + "fileds": { + "attributes": { + "displayName": "displayName", + "description": { + "target": "description", + "policy": "firstOnly" + }, + "label": "label", + "type": { + "target": "type", + "map": { + "integer": "number" + } + }, + "kind": { + "target": "kind", + "policy": "both" + }, + "required": "required", + "secret": "hidden", + "defaultValue": { + "target": "defaultValue", + "convertTo": "@type" + }, + "group": "group", + "enum": { + "target": "@TYPEINFO/values", + "targetObject": { + "@TYPEINFO": { + "type": "enum" + } + } + } + } + }, + "outputs": { + "init": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "property" + ] + } + ] + } + } + ] + } + }, + "path": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "path" + ] + } + ] + } + } + ] + } + }, + "consumer": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "parameter" + ] + }, + { + "attribute": "label", + "inverse": true, + "values": [ + "producer" + ] + } + ] + } + } + ] + } + }, + "producer": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "parameter" + ] + }, + { + "attribute": "label", + "inverse": true, + "values": [ + "consumer" + ] + } + ] + } + } + ] + } + }, + "__objects": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "", + "filter": { + "contains": [ + { + "attribute": "type", + "values": [ + "Object", + "object" + ] + } + ] + } + } + ] + } + } + } + } + }, + "origin": { + "component": { + "kind": "component", + "name": "file", + "title": "File", + "description": "Read and write files.", + "deprecated": false, + "firstVersion": "1.0.0", + "label": "file,core", + "javaType": "org.apache.camel.component.file.FileComponent", + "supportLevel": "Stable", + "groupId": "org.apache.camel", + "artifactId": "camel-file", + "version": "3.4.5", + "scheme": "file", + "extendsScheme": "", + "syntax": "file:directoryName", + "async": false, + "consumerOnly": false, + "producerOnly": false, + "lenientProperties": false + }, + "componentProperties": { + "bridgeErrorHandler": { + "kind": "property", + "displayName": "Bridge Error Handler", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." + }, + "lazyStartProducer": { + "kind": "property", + "displayName": "Lazy Start Producer", + "group": "producer", + "label": "producer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel\u0027s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." + }, + "basicPropertyBinding": { + "kind": "property", + "displayName": "Basic Property Binding", + "group": "advanced", + "label": "advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" + } + }, + "properties": { + "directoryName": { + "kind": "path", + "displayName": "Directory Name", + "group": "common", + "label": "", + "required": true, + "type": "string", + "javaType": "java.io.File", + "deprecated": false, + "deprecationNote": "", + "secret": false, + "description": "The starting directory" + }, + "charset": { + "kind": "parameter", + "displayName": "Charset", + "group": "common", + "label": "", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "This option is used to specify the encoding of the file. You can use this on the consumer, to specify the encodings of the files, which allow Camel to know the charset it should load the file content in case the file content is being accessed. Likewise when writing a file, you can use this option to specify which charset to write the file as well. Do mind that when writing the file Camel may have to read the message content into memory to be able to convert the data into the configured charset, so do not use this if you have big messages." + }, + "doneFileName": { + "kind": "parameter", + "displayName": "Done File Name", + "group": "common", + "label": "", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Producer: If provided, then Camel will write a 2nd done file when the original file has been written. The done file will be empty. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The done file will always be written in the same folder as the original file. Consumer: If provided, Camel will only consume files if a done file exists. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders.The done file is always expected in the same folder as the original file. Only ${file.name} and ${file.name.next} is supported as dynamic placeholders." + }, + "fileName": { + "kind": "parameter", + "displayName": "File Name", + "group": "common", + "label": "", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Use Expression such as File Language to dynamically set the filename. For consumers, it\u0027s used as a filename filter. For producers, it\u0027s used to evaluate the filename to write. If an expression is set, it take precedence over the CamelFileName header. (Note: The header itself can also be an Expression). The expression options support both String and Expression types. If the expression is a String type, it is always evaluated using the File Language. If the expression is an Expression type, the specified Expression type is used - this allows you, for instance, to use OGNL expressions. For the consumer, you can use it to filter filenames, so you can for instance consume today\u0027s file using the File Language syntax: mydata-${date:now:yyyyMMdd}.txt. The producers support the CamelOverruleFileName header which takes precedence over any existing CamelFileName header; the CamelOverruleFileName is a header that is used only once, and makes it easier as this avoids to temporary store CamelFileName and have to restore it afterwards." + }, + "bridgeErrorHandler": { + "kind": "parameter", + "displayName": "Bridge Error Handler", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." + }, + "delete": { + "kind": "parameter", + "displayName": "Delete", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "If true, the file will be deleted after it is processed successfully." + }, + "moveFailed": { + "kind": "parameter", + "displayName": "Move Failed", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Sets the move failure expression based on Simple language. For example, to move files into a .error subdirectory use: .error. Note: When moving the files to the fail location Camel will handle the error and will not pick up the file again." + }, + "noop": { + "kind": "parameter", + "displayName": "Noop", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "If true, the file is not moved or deleted in any way. This option is good for readonly data, or for ETL type requirements. If noop\u003dtrue, Camel will set idempotent\u003dtrue as well, to avoid consuming the same files over and over again." + }, + "preMove": { + "kind": "parameter", + "displayName": "Pre Move", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Expression (such as File Language) used to dynamically set the filename when moving it before processing. For example to move in-progress files into the order directory set this value to order." + }, + "preSort": { + "kind": "parameter", + "displayName": "Pre Sort", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "When pre-sort is enabled then the consumer will sort the file and directory names during polling, that was retrieved from the file system. You may want to do this in case you need to operate on the files in a sorted order. The pre-sort is executed before the consumer starts to filter, and accept files to process by Camel. This option is default\u003dfalse meaning disabled." + }, + "recursive": { + "kind": "parameter", + "displayName": "Recursive", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "If a directory, will look for files in all the sub-directories as well." + }, + "sendEmptyMessageWhenIdle": { + "kind": "parameter", + "displayName": "Send Empty Message When Idle", + "group": "consumer", + "label": "consumer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." + }, + "directoryMustExist": { + "kind": "parameter", + "displayName": "Directory Must Exist", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Similar to the startingDirectoryMustExist option but this applies during polling (after starting the consumer)." + }, + "exceptionHandler": { + "kind": "parameter", + "displayName": "Exception Handler", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "object", + "javaType": "org.apache.camel.spi.ExceptionHandler", + "optionalPrefix": "consumer.", + "deprecated": false, + "secret": false, + "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." + }, + "exchangePattern": { + "kind": "parameter", + "displayName": "Exchange Pattern", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "object", + "javaType": "org.apache.camel.ExchangePattern", + "enum": [ + "InOnly", + "InOut", + "InOptionalOut" + ], + "deprecated": false, + "secret": false, + "description": "Sets the exchange pattern when the consumer creates an exchange." + }, + "extendedAttributes": { + "kind": "parameter", + "displayName": "Extended Attributes", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "To define which file attributes of interest. Like posix:permissions,posix:owner,basic:lastAccessTime, it supports basic wildcard like posix:, basic:lastAccessTime" + }, + "inProgressRepository": { + "kind": "parameter", + "displayName": "In Progress Repository", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "object", + "javaType": "org.apache.camel.spi.IdempotentRepository", + "deprecated": false, + "secret": false, + "description": "A pluggable in-progress repository org.apache.camel.spi.IdempotentRepository. The in-progress repository is used to account the current in progress files being consumed. By default a memory based repository is used." + }, + "localWorkDirectory": { + "kind": "parameter", + "displayName": "Local Work Directory", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "When consuming, a local work directory can be used to store the remote file content directly in local files, to avoid loading the content into memory. This is beneficial, if you consume a very big remote file and thus can conserve memory." + }, + "onCompletionExceptionHandler": { + "kind": "parameter", + "displayName": "On Completion Exception Handler", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "object", + "javaType": "org.apache.camel.spi.ExceptionHandler", + "deprecated": false, + "secret": false, + "description": "To use a custom org.apache.camel.spi.ExceptionHandler to handle any thrown exceptions that happens during the file on completion process where the consumer does either a commit or rollback. The default implementation will log any exception at WARN level and ignore." + }, + "pollStrategy": { + "kind": "parameter", + "displayName": "Poll Strategy", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "object", + "javaType": "org.apache.camel.spi.PollingConsumerPollStrategy", + "deprecated": false, + "secret": false, + "description": "A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel." + }, + "probeContentType": { + "kind": "parameter", + "displayName": "Probe Content Type", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Whether to enable probing of the content type. If enable then the consumer uses Files#probeContentType(java.nio.file.Path) to determine the content-type of the file, and store that as a header with key Exchange#FILE_CONTENT_TYPE on the Message." + }, + "processStrategy": { + "kind": "parameter", + "displayName": "Process Strategy", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "object", + "javaType": "org.apache.camel.component.file.GenericFileProcessStrategy\u003cjava.io.File\u003e", + "deprecated": false, + "secret": false, + "description": "A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply." + }, + "startingDirectoryMustExist": { + "kind": "parameter", + "displayName": "Starting Directory Must Exist", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Whether the starting directory must exist. Mind that the autoCreate option is default enabled, which means the starting directory is normally auto created if it doesn\u0027t exist. You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn\u0027t exist." + }, + "startingDirectoryMustHaveAccess": { + "kind": "parameter", + "displayName": "Starting Directory Must Have Access", + "group": "consumer (advanced)", + "label": "consumer,advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Whether the starting directory has access permissions. Mind that the startingDirectoryMustExist parameter must be set to true in order to verify that the directory exists. Will thrown an exception if the directory doesn\u0027t have read and write permissions." + }, + "appendChars": { + "kind": "parameter", + "displayName": "Append Chars", + "group": "producer", + "label": "producer", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Used to append characters (text) after writing files. This can for example be used to add new lines or other separators when writing and appending to existing files. To specify new-line (slash-n or slash-r) or tab (slash-t) characters then escape with an extra slash, eg slash-slash-n." + }, + "fileExist": { + "kind": "parameter", + "displayName": "File Exist", + "group": "producer", + "label": "producer", + "required": false, + "type": "object", + "javaType": "org.apache.camel.component.file.GenericFileExist", + "enum": [ + "Override", + "Append", + "Fail", + "Ignore", + "Move", + "TryRename" + ], + "deprecated": false, + "secret": false, + "defaultValue": "Override", + "description": "What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile can be used to control what to do if an moving the file, and there exists already an existing file, otherwise causing the move operation to fail. The Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName option is in use. This allows to try renaming the file from the temporary name to the actual name, without doing any exists check. This check may be faster on some file systems and especially FTP servers." + }, + "flatten": { + "kind": "parameter", + "displayName": "Flatten", + "group": "producer", + "label": "producer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Flatten is used to flatten the file name path to strip any leading paths, so it\u0027s just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths." + }, + "jailStartingDirectory": { + "kind": "parameter", + "displayName": "Jail Starting Directory", + "group": "producer", + "label": "producer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders." + }, + "lazyStartProducer": { + "kind": "parameter", + "displayName": "Lazy Start Producer", + "group": "producer", + "label": "producer", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel\u0027s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." + }, + "moveExisting": { + "kind": "parameter", + "displayName": "Move Existing", + "group": "producer", + "label": "producer", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Expression (such as File Language) used to compute file name to use when fileExist\u003dMove is configured. To move files into a backup subdirectory just enter backup. This option only supports the following File Language tokens: file:name, file:name.ext, file:name.noext, file:onlyname, file:onlyname.noext, file:ext, and file:parent. Notice the file:parent is not supported by the FTP component, as the FTP component can only move any existing files to a relative directory based on current dir as base." + }, + "tempFileName": { + "kind": "parameter", + "displayName": "Temp File Name", + "group": "producer", + "label": "producer", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "The same as tempPrefix option but offering a more fine grained control on the naming of the temporary filename as it uses the File Language. The location for tempFilename is relative to the final file location in the option \u0027fileName\u0027, not the target directory in the base uri. For example if option fileName includes a directory prefix: dir/finalFilename then tempFileName is relative to that subdirectory dir." + }, + "tempPrefix": { + "kind": "parameter", + "displayName": "Temp Prefix", + "group": "producer", + "label": "producer", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "This option is used to write the file using a temporary name and then, after the write is complete, rename it to the real name. Can be used to identify files being written and also avoid consumers (not using exclusive read locks) reading in progress files. Is often used by FTP when uploading big files." + }, + "allowNullBody": { + "kind": "parameter", + "displayName": "Allow Null Body", + "group": "producer (advanced)", + "label": "producer,advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Used to specify if a null body is allowed during file writing. If set to true then an empty file will be created, when set to false, and attempting to send a null body to the file component, a GenericFileWriteException of \u0027Cannot write null body to file.\u0027 will be thrown. If the fileExist option is set to \u0027Override\u0027, then the file will be truncated, and if set to append the file will remain unchanged." + }, + "chmod": { + "kind": "parameter", + "displayName": "Chmod", + "group": "producer (advanced)", + "label": "producer,advanced", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Specify the file permissions which is sent by the producer, the chmod value must be between 000 and 777; If there is a leading digit like in 0755 we will ignore it." + }, + "chmodDirectory": { + "kind": "parameter", + "displayName": "Chmod Directory", + "group": "producer (advanced)", + "label": "producer,advanced", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Specify the directory permissions used when the producer creates missing directories, the chmod value must be between 000 and 777; If there is a leading digit like in 0755 we will ignore it." + }, + "eagerDeleteTargetFile": { + "kind": "parameter", + "displayName": "Eager Delete Target File", + "group": "producer (advanced)", + "label": "producer,advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Whether or not to eagerly delete any existing target file. This option only applies when you use fileExists\u003dOverride and the tempFileName option as well. You can use this to disable (set it to false) deleting the target file before the temp file is written. For example you may write big files and want the target file to exists during the temp file is being written. This ensure the target file is only deleted until the very last moment, just before the temp file is being renamed to the target filename. This option is also used to control whether to delete any existing files when fileExist\u003dMove is enabled, and an existing file exists. If this option copyAndDeleteOnRenameFails false, then an exception will be thrown if an existing file existed, if its true, then the existing file is deleted before the move operation." + }, + "forceWrites": { + "kind": "parameter", + "displayName": "Force Writes", + "group": "producer (advanced)", + "label": "producer,advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Whether to force syncing writes to the file system. You can turn this off if you do not want this level of guarantee, for example if writing to logs / audit logs etc; this would yield better performance." + }, + "keepLastModified": { + "kind": "parameter", + "displayName": "Keep Last Modified", + "group": "producer (advanced)", + "label": "producer,advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Will keep the last modified timestamp from the source file (if any). Will use the Exchange.FILE_LAST_MODIFIED header to located the timestamp. This header can contain either a java.util.Date or long with the timestamp. If the timestamp exists and the option is enabled it will set this timestamp on the written file. Note: This option only applies to the file producer. You cannot use this option with any of the ftp producers." + }, + "moveExistingFileStrategy": { + "kind": "parameter", + "displayName": "Move Existing File Strategy", + "group": "producer (advanced)", + "label": "producer,advanced", + "required": false, + "type": "object", + "javaType": "org.apache.camel.component.file.strategy.FileMoveExistingStrategy", + "deprecated": false, + "secret": false, + "description": "Strategy (Custom Strategy) used to move file with special naming token to use when fileExist\u003dMove is configured. By default, there is an implementation used if no custom strategy is provided" + }, + "autoCreate": { + "kind": "parameter", + "displayName": "Auto Create", + "group": "advanced", + "label": "advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Automatically create missing directories in the file\u0027s pathname. For the file consumer, that means creating the starting directory. For the file producer, it means the directory the files should be written to." + }, + "basicPropertyBinding": { + "kind": "parameter", + "displayName": "Basic Property Binding", + "group": "advanced", + "label": "advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" + }, + "bufferSize": { + "kind": "parameter", + "displayName": "Buffer Size", + "group": "advanced", + "label": "advanced", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "defaultValue": "131072", + "description": "Buffer size in bytes used for writing files (or in case of FTP for downloading and uploading files)." + }, + "copyAndDeleteOnRenameFail": { + "kind": "parameter", + "displayName": "Copy And Delete On Rename Fail", + "group": "advanced", + "label": "advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Whether to fallback and do a copy and delete file, in case the file could not be renamed directly. This option is not available for the FTP component." + }, + "renameUsingCopy": { + "kind": "parameter", + "displayName": "Rename Using Copy", + "group": "advanced", + "label": "advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Perform rename operations using a copy and delete strategy. This is primarily used in environments where the regular rename operation is unreliable (e.g. across different file systems or networks). This option takes precedence over the copyAndDeleteOnRenameFail parameter that will automatically fall back to the copy and delete strategy, but only after additional delays." + }, + "synchronous": { + "kind": "parameter", + "displayName": "Synchronous", + "group": "advanced", + "label": "advanced", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "false", + "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." + }, + "antExclude": { + "kind": "parameter", + "displayName": "Ant Exclude", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Ant style filter exclusion. If both antInclude and antExclude are used, antExclude takes precedence over antInclude. Multiple exclusions may be specified in comma-delimited format." + }, + "antFilterCaseSensitive": { + "kind": "parameter", + "displayName": "Ant Filter Case Sensitive", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Sets case sensitive flag on ant filter." + }, + "antInclude": { + "kind": "parameter", + "displayName": "Ant Include", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Ant style filter inclusion. Multiple inclusions may be specified in comma-delimited format." + }, + "eagerMaxMessagesPerPoll": { + "kind": "parameter", + "displayName": "Eager Max Messages Per Poll", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Allows for controlling whether the limit from maxMessagesPerPoll is eager or not. If eager then the limit is during the scanning of files. Where as false would scan all files, and then perform sorting. Setting this option to false allows for sorting all files first, and then limit the poll. Mind that this requires a higher memory usage as all file details are in memory to perform the sorting." + }, + "exclude": { + "kind": "parameter", + "displayName": "Exclude", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Is used to exclude files, if filename matches the regex pattern (matching is case in-senstive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring this as an endpoint uri. See more details at configuring endpoint uris" + }, + "filter": { + "kind": "parameter", + "displayName": "Filter", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "object", + "javaType": "org.apache.camel.component.file.GenericFileFilter\u003cjava.io.File\u003e", + "deprecated": false, + "secret": false, + "description": "Pluggable filter as a org.apache.camel.component.file.GenericFileFilter class. Will skip files if filter returns false in its accept() method." + }, + "filterDirectory": { + "kind": "parameter", + "displayName": "Filter Directory", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}" + }, + "filterFile": { + "kind": "parameter", + "displayName": "Filter File", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000" + }, + "idempotent": { + "kind": "parameter", + "displayName": "Idempotent", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "boolean", + "javaType": "java.lang.Boolean", + "deprecated": false, + "secret": false, + "defaultValue": "false", + "description": "Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop\u003dtrue then idempotent will be enabled as well to avoid consuming the same files over and over again." + }, + "idempotentKey": { + "kind": "parameter", + "displayName": "Idempotent Key", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey\u003d${file:name}-${file:size}" + }, + "idempotentRepository": { + "kind": "parameter", + "displayName": "Idempotent Repository", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "object", + "javaType": "org.apache.camel.spi.IdempotentRepository", + "deprecated": false, + "secret": false, + "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryMessageIdRepository if none is specified and idempotent is true." + }, + "include": { + "kind": "parameter", + "displayName": "Include", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring this as an endpoint uri. See more details at configuring endpoint uris" + }, + "maxDepth": { + "kind": "parameter", + "displayName": "Max Depth", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "defaultValue": "2147483647", + "description": "The maximum depth to traverse when recursively processing a directory." + }, + "maxMessagesPerPoll": { + "kind": "parameter", + "displayName": "Max Messages Per Poll", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "description": "To define a maximum messages to gather per poll. By default no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it. Notice: If this option is in use then the File and FTP components will limit before any sorting. For example if you have 100000 files and use maxMessagesPerPoll\u003d500, then only the first 500 files will be picked up, and then sorted. You can use the eagerMaxMessagesPerPoll option and set this to false to allow to scan all files first and then sort afterwards." + }, + "minDepth": { + "kind": "parameter", + "displayName": "Min Depth", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "description": "The minimum depth to start processing when recursively processing a directory. Using minDepth\u003d1 means the base directory. Using minDepth\u003d2 means the first sub directory." + }, + "move": { + "kind": "parameter", + "displayName": "Move", + "group": "filter", + "label": "consumer,filter", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done." + }, + "exclusiveReadLockStrategy": { + "kind": "parameter", + "displayName": "Exclusive Read Lock Strategy", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "object", + "javaType": "org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy\u003cjava.io.File\u003e", + "deprecated": false, + "secret": false, + "description": "Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation." + }, + "readLock": { + "kind": "parameter", + "displayName": "Read Lock", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "enum": [ + "none", + "markerFile", + "fileLock", + "rename", + "changed", + "idempotent", + "idempotent-changed", + "idempotent-rename" + ], + "deprecated": false, + "secret": false, + "defaultValue": "none", + "description": "Used by consumer, to only poll the files if it has exclusive read-lock on the file (i.e. the file is not in-progress or being written). Camel will wait until the file lock is granted. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed is using file length/modification timestamp to detect whether the file is currently being copied or not. Will at least use 1 sec to determine this, so this option cannot consume files as fast as the others, but can be more reliable as the JDK IO API cannot always determine whether a file is currently being used by another process. The option readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that.Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan." + }, + "readLockCheckInterval": { + "kind": "parameter", + "displayName": "Read Lock Check Interval", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "integer", + "javaType": "long", + "deprecated": false, + "secret": false, + "defaultValue": "1000", + "description": "Interval in millis for the read-lock, if supported by the read lock. This interval is used for sleeping between attempts to acquire the read lock. For example when using the changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit." + }, + "readLockDeleteOrphanLockFiles": { + "kind": "parameter", + "displayName": "Read Lock Delete Orphan Lock Files", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory." + }, + "readLockIdempotentReleaseAsync": { + "kind": "parameter", + "displayName": "Read Lock Idempotent Release Async", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "Whether the delayed release task should be synchronous or asynchronous. See more details at the readLockIdempotentReleaseDelay option." + }, + "readLockIdempotentReleaseAsyncPoolSize": { + "kind": "parameter", + "displayName": "Read Lock Idempotent Release Async Pool Size", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "description": "The number of threads in the scheduled thread pool when using asynchronous release tasks. Using a default of 1 core threads should be sufficient in almost all use-cases, only set this to a higher value if either updating the idempotent repository is slow, or there are a lot of files to process. This option is not in-use if you use a shared thread pool by configuring the readLockIdempotentReleaseExecutorService option. See more details at the readLockIdempotentReleaseDelay option." + }, + "readLockIdempotentReleaseDelay": { + "kind": "parameter", + "displayName": "Read Lock Idempotent Release Delay", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "description": "Whether to delay the release task for a period of millis. This can be used to delay the release tasks to expand the window when a file is regarded as read-locked, in an active/active cluster scenario with a shared idempotent repository, to ensure other nodes cannot potentially scan and acquire the same file, due to race-conditions. By expanding the time-window of the release tasks helps prevents these situations. Note delaying is only needed if you have configured readLockRemoveOnCommit to true." + }, + "readLockIdempotentReleaseExecutorService": { + "kind": "parameter", + "displayName": "Read Lock Idempotent Release Executor Service", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "object", + "javaType": "java.util.concurrent.ScheduledExecutorService", + "deprecated": false, + "secret": false, + "description": "To use a custom and shared thread pool for asynchronous release tasks. See more details at the readLockIdempotentReleaseDelay option." + }, + "readLockLoggingLevel": { + "kind": "parameter", + "displayName": "Read Lock Logging Level", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "object", + "javaType": "org.apache.camel.LoggingLevel", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "OFF" + ], + "deprecated": false, + "secret": false, + "defaultValue": "DEBUG", + "description": "Logging level used when a read lock could not be acquired. By default a DEBUG is logged. You can change this level, for example to OFF to not have any logging. This option is only applicable for readLock of types: changed, fileLock, idempotent, idempotent-changed, idempotent-rename, rename." + }, + "readLockMarkerFile": { + "kind": "parameter", + "displayName": "Read Lock Marker File", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Whether to use marker file with the changed, rename, or exclusive read lock types. By default a marker file is used as well to guard against other processes picking up the same files. This behavior can be turned off by setting this option to false. For example if you do not want to write marker files to the file systems by the Camel application." + }, + "readLockMinAge": { + "kind": "parameter", + "displayName": "Read Lock Min Age", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "integer", + "javaType": "long", + "deprecated": false, + "secret": false, + "defaultValue": "0", + "description": "This option is applied only for readLock\u003dchanged. It allows to specify a minimum age the file must be before attempting to acquire the read lock. For example use readLockMinAge\u003d300s to require the file is at last 5 minutes old. This can speedup the changed read lock as it will only attempt to acquire files which are at least that given age." + }, + "readLockMinLength": { + "kind": "parameter", + "displayName": "Read Lock Min Length", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "integer", + "javaType": "long", + "deprecated": false, + "secret": false, + "defaultValue": "1", + "description": "This option is applied only for readLock\u003dchanged. It allows you to configure a minimum file length. By default Camel expects the file to contain data, and thus the default value is 1. You can set this option to zero, to allow consuming zero-length files." + }, + "readLockRemoveOnCommit": { + "kind": "parameter", + "displayName": "Read Lock Remove On Commit", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "This option is applied only for readLock\u003didempotent. It allows to specify whether to remove the file name entry from the idempotent repository when processing the file is succeeded and a commit happens. By default the file is not removed which ensures that any race-condition do not occur so another active node may attempt to grab the file. Instead the idempotent repository may support eviction strategies that you can configure to evict the file name entry after X minutes - this ensures no problems with race conditions. See more details at the readLockIdempotentReleaseDelay option." + }, + "readLockRemoveOnRollback": { + "kind": "parameter", + "displayName": "Read Lock Remove On Rollback", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "This option is applied only for readLock\u003didempotent. It allows to specify whether to remove the file name entry from the idempotent repository when processing the file failed and a rollback happens. If this option is false, then the file name entry is confirmed (as if the file did a commit)." + }, + "readLockTimeout": { + "kind": "parameter", + "displayName": "Read Lock Timeout", + "group": "lock", + "label": "consumer,lock", + "required": false, + "type": "integer", + "javaType": "long", + "deprecated": false, + "secret": false, + "defaultValue": "10000", + "description": "Optional timeout in millis for the read-lock, if supported by the read-lock. If the read-lock could not be granted and the timeout triggered, then Camel will skip the file. At next poll Camel, will try the file again, and this time maybe the read-lock could be granted. Use a value of 0 or lower to indicate forever. Currently fileLock, changed and rename support the timeout. Notice: For FTP the default readLockTimeout value is 20000 instead of 10000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit." + }, + "backoffErrorThreshold": { + "kind": "parameter", + "displayName": "Backoff Error Threshold", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." + }, + "backoffIdleThreshold": { + "kind": "parameter", + "displayName": "Backoff Idle Threshold", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." + }, + "backoffMultiplier": { + "kind": "parameter", + "displayName": "Backoff Multiplier", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "integer", + "javaType": "int", + "deprecated": false, + "secret": false, + "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured." + }, + "delay": { + "kind": "parameter", + "displayName": "Delay", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "integer", + "javaType": "long", + "deprecated": false, + "secret": false, + "defaultValue": "500", + "description": "Milliseconds before the next poll." + }, + "greedy": { + "kind": "parameter", + "displayName": "Greedy", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." + }, + "initialDelay": { + "kind": "parameter", + "displayName": "Initial Delay", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "integer", + "javaType": "long", + "deprecated": false, + "secret": false, + "defaultValue": "1000", + "description": "Milliseconds before the first poll starts." + }, + "repeatCount": { + "kind": "parameter", + "displayName": "Repeat Count", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "integer", + "javaType": "long", + "deprecated": false, + "secret": false, + "defaultValue": "0", + "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." + }, + "runLoggingLevel": { + "kind": "parameter", + "displayName": "Run Logging Level", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "object", + "javaType": "org.apache.camel.LoggingLevel", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "OFF" + ], + "deprecated": false, + "secret": false, + "defaultValue": "TRACE", + "description": "The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that." + }, + "scheduledExecutorService": { + "kind": "parameter", + "displayName": "Scheduled Executor Service", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "object", + "javaType": "java.util.concurrent.ScheduledExecutorService", + "deprecated": false, + "secret": false, + "description": "Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." + }, + "scheduler": { + "kind": "parameter", + "displayName": "Scheduler", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "enum": [ + "none", + "spring", + "quartz" + ], + "deprecated": false, + "secret": false, + "defaultValue": "none", + "description": "To use a cron scheduler from either camel-spring or camel-quartz component" + }, + "schedulerProperties": { + "kind": "parameter", + "displayName": "Scheduler Properties", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "object", + "javaType": "java.util.Map\u003cjava.lang.String, java.lang.Object\u003e", + "prefix": "scheduler.", + "multiValue": true, + "deprecated": false, + "secret": false, + "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler." + }, + "startScheduler": { + "kind": "parameter", + "displayName": "Start Scheduler", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Whether the scheduler should be auto started." + }, + "timeUnit": { + "kind": "parameter", + "displayName": "Time Unit", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "object", + "javaType": "java.util.concurrent.TimeUnit", + "enum": [ + "NANOSECONDS", + "MICROSECONDS", + "MILLISECONDS", + "SECONDS", + "MINUTES", + "HOURS", + "DAYS" + ], + "deprecated": false, + "secret": false, + "defaultValue": "MILLISECONDS", + "description": "Time unit for initialDelay and delay options." + }, + "useFixedDelay": { + "kind": "parameter", + "displayName": "Use Fixed Delay", + "group": "scheduler", + "label": "consumer,scheduler", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": "true", + "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." + }, + "shuffle": { + "kind": "parameter", + "displayName": "Shuffle", + "group": "sort", + "label": "consumer,sort", + "required": false, + "type": "boolean", + "javaType": "boolean", + "deprecated": false, + "secret": false, + "defaultValue": false, + "description": "To shuffle the list of files (sort in random order)" + }, + "sortBy": { + "kind": "parameter", + "displayName": "Sort By", + "group": "sort", + "label": "consumer,sort", + "required": false, + "type": "string", + "javaType": "java.lang.String", + "deprecated": false, + "secret": false, + "description": "Built-in sort by using the File Language. Supports nested sorts, so you can have a sort by file name and as a 2nd group sort by modified date." + }, + "sorter": { + "kind": "parameter", + "displayName": "Sorter", + "group": "sort", + "label": "consumer,sort", + "required": false, + "type": "object", + "javaType": "java.util.Comparator\u003corg.apache.camel.component.file.GenericFile\u003cjava.io.File\u003e\u003e", + "deprecated": false, + "secret": false, + "description": "Pluggable sorter as a java.util.Comparator class." + } + } + } + }, + "outputs": { + "init": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "property" + ] + } + ] + } + } + ], + "rootDirectory": {}, + "createResourceProvider": {} + } + }, + "path": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "path" + ] + } + ] + } + } + ] + } + }, + "consumer": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "parameter" + ] + }, + { + "attribute": "label", + "inverse": true, + "values": [ + "producer" + ] + } + ] + } + }, + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "path" + ] + } + ] + } + } + ] + } + }, + "producer": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "parameter" + ] + }, + { + "attribute": "label", + "inverse": true, + "values": [ + "consumer" + ] + } + ] + } + }, + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "camel_", + "filter": { + "contains": [ + { + "attribute": "kind", + "values": [ + "path" + ] + } + ] + } + } + ] + } + }, + "__objects": { + "fields": { + "@IMPORT": [ + { + "sourceFactoryId": "#", + "location": "fields", + "prefix": "", + "filter": { + "contains": [ + { + "attribute": "type", + "values": [ + "Object", + "object" + ] + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.body.ftl b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.body.ftl new file mode 100644 index 00000000..3f97b42c --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.body.ftl @@ -0,0 +1,51 @@ +[#ftl] +[#-- + + ~~~~~~licensing~~~~~~ + standard-connections-pack + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + [#if properties??] + [#if properties.createResourceProvider??] + [#if properties.createResourceProvider] + + + + + + + + + + + + + [/#if] + [/#if] + [/#if] + + + [#if properties??] + [#list properties as key, value] + [#if key?starts_with("camel_")] [#-- we add parent Camel component properties --] + + [/#if] + [/#list] + [/#if] + + diff --git a/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.ftl b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.ftl new file mode 100644 index 00000000..8f39bd9a --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.ftl @@ -0,0 +1,39 @@ +[#ftl attributes={"generated.type":"blueprint"}] +[#-- + + ~~~~~~licensing~~~~~~ + standard-connections-pack + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + +[#include "templates:file-connection/init.body.ftl"] + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.private.ftl b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.private.ftl new file mode 100644 index 00000000..bd70f66b --- /dev/null +++ b/platform/runtime/core/objects-implementations/connection-implementation/standard-connections-pack/src/main/resources/ru/entaxy/templates/file-connection/init.private.ftl @@ -0,0 +1,23 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + standard-connections-pack + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] +[#include "templates:file-connection/init.body.ftl"] \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/LICENSE.txt b/platform/runtime/core/objects-implementations/connector-implementation/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/LICENSE.txt b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/pom.xml b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/pom.xml new file mode 100644 index 00000000..ab829500 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/pom.xml @@ -0,0 +1,61 @@ + + 4.0.0 + + ru.entaxy.esb.platform.runtime.core.objects-implementations + connector-implementation + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.objects-implementations.connector-implementation + connector-producing + bundle + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR :: PRODUCING + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR :: PRODUCING + + + **/ru/entaxy/resource/**/*.xml + + + + + + ru.entaxy.esb.platform.runtime.core.object-producing + + object-producer-api + ${project.version} + + + + ru.entaxy.esb.platform.runtime.core.object-producing + + object-producer-core + ${project.version} + + + + ru.entaxy.esb.platform.runtime.base.objects-base + + object-factory + ${project.version} + + + + + + + org.apache.felix + maven-bundle-plugin + ${maven-bundle-plugin.version} + true + + + true + true + true + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/java/ru/entaxy/platform/base/objects/connector/producing/ConnectorProducer.java b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/java/ru/entaxy/platform/base/objects/connector/producing/ConnectorProducer.java new file mode 100644 index 00000000..d7c4744b --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/java/ru/entaxy/platform/base/objects/connector/producing/ConnectorProducer.java @@ -0,0 +1,61 @@ +/*- + * ~~~~~~licensing~~~~~~ + * connector-producing + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.base.objects.connector.producing; + +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; + +import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_TYPES; +import ru.entaxy.platform.base.objects.factory.EntaxyFactory; +import ru.entaxy.platform.core.producer.api.EntaxyProducer; +import ru.entaxy.platform.core.producer.impl.CommonObjectProducer; +import ru.entaxy.platform.core.producer.impl.EntaxyProducerInfo; +import ru.entaxy.platform.core.producer.wrapper.AbstractFactoryWrapper; +import ru.entaxy.platform.core.producer.wrapper.DefaultFactoryWrapper; + +@Component(service = {EntaxyProducer.class}, immediate = true) +@EntaxyProducerInfo(supportedTypes = {OBJECT_TYPES.CONNECTOR}) +public class ConnectorProducer extends CommonObjectProducer implements EntaxyProducer { + + @Reference(bind = "addFactory", unbind = "removeFactory", cardinality = ReferenceCardinality.MULTIPLE + , collectionType = CollectionType.SERVICE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY) + public void addFactory(EntaxyFactory factory) { + doAddFactory(factory); + } + + // WE MUST DECLARE IT for @Reference annotation processor + @Override + public void removeFactory(EntaxyFactory factory) { + super.removeFactory(factory); + } + + @Override + protected AbstractFactoryWrapper doAddFactory(EntaxyFactory factory) { + AbstractFactoryWrapper wrapper = super.doAddFactory(factory, DefaultFactoryWrapper.class); + if (wrapper != null) + wrapper.setGenerationProcessor(this); + return wrapper; + } + +} diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector-in.json b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector-in.json new file mode 100644 index 00000000..4aa9a545 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector-in.json @@ -0,0 +1,266 @@ +{ + "factory": { + "id": "abstract-connector-in", + "type": "entaxy.runtime.connector", + "description": "Abstract IN-connector factory", + "isAbstract": true, + "parent": "abstract-connector" + }, + "entaxy.runtime.connector": { + "direction": "in", + /* BOTH, EXCLUSIVE_ONLY, NON_EXCLUSIVE_ONLY */ + "exclusiveMode": "BOTH", + "generation.plugins": ["config-support"] + }, + "fields": { + "runExclusive": { + "displayName": "Run Exclusive", + "type": "Boolean", + "immutable": true, + "required": true, + "@VARIANTS": { + "property": "exclusiveMode", + "values": { + "BOTH": { + "defaultValue": false + }, + "EXCLUSIVE_ONLY": { + "isHidden": true, + "fixedValue": true, + "defaultValue": true + }, + "NON_EXCLUSIVE_ONLY": { + "isHidden": true, + "fixedValue": false, + "defaultValue": false + } + } + } + }, + "pre-route": { + "displayName": "Pre-Route", + "type": "xml:route", + "required": true, + "@RESOURCE": { + "provider": "entaxy-file-internal", + "endType": "String", + "format": "base64", + "preprocess":[ + { + "processor": "xslt", + "source":"entaxy-file-internal:routes-common/common-components.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + } + + ] + + }, + "defaultValue": { + "@RESOURCE": { + "provider": "entaxy-file-internal", + "location": "factories/abstract-connector-in/pre-route.xml", + "endType": "String", + "format": "base64" + } + }, + "config": { + "scope": "public" + } + }, + "__legacy": { + "type": "entaxy.runtime.connector", + "isRef": true, + "required": true, + "isHidden": true, + "isRefByValueOnly": true, + "@INTERNAL": true, + "defaultValue": { + "type": "entaxy.runtime.connector", + "factoryId": "#OWNER#", + "outputType": "legacy", + "scope": "private", + "properties": { + "systemName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.profile}", + "lazy": false, + "allowObjects": false + } + }, + "type": { + "@CALCULATED": { + "expression": "${#OWNER#.#FACTORY#.#TYPEINFO#.type}", + "lazy": false + } + }, + "classifier": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.classifier}", + "lazy": false + } + }, + "protocol": { + "@CALCULATED": { + "expression": "${#OWNER#.#FACTORY#.#TYPEINFO#.protocol}", + "lazy": false + } + } + + } + } + }, + "__rootRoute": { + "type": "entaxy.runtime.connector", + "isRef": true, + "required": true, + "isHidden": true, + "isRefByValueOnly": true, + "@INTERNAL": true, + "defaultValue": { + "type": "entaxy.runtime.connector", + "factoryId": "#OWNER#", + "outputType": "rootRoute", + "scope": "private", + "properties": { + "connectorId": { + "@CALCULATED": { + "expression": "${#OWNER#.objectId}", + "lazy": true + } + }, + "profile": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.profile}", + "lazy": true + } + }, + "classifier": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.classifier}", + "lazy": true + } + } + } + } + }, + "__clusterService": { + "type": "entaxy.runtime.connection", + "isRef": true, + "required": true, + "isHidden": true, + "@INTERNAL": true, + "condition": "${runExclusive}", + "defaultValue": { + "type": "entaxy.runtime.connector", + "factoryId": "#OWNER#", + "outputType": "exclusiveSupport", + "scope": "private", + "properties": { + "connectorId": { + "@CALCULATED": { + "expression": "${#OWNER#.objectId}", + "lazy": true + } + }, + "fileStorage": { + "type": "entaxy.runtime.connection", + "isRef": true, + "refField": "rootDirectory", + "targetId": "entaxy-file-internal", + "targetType": "entaxy.runtime.connection" + } + } + } + }, + "exclusivePrefix": { + "type": "String", + "isHidden": true, + "condition": "${runExclusive}", + "required": true, + "defaultValue": { + "@CALCULATED": { + "expression": "master:${objectId}:", + "lazy": true + } + } + }, + "objectId": { + "isHidden": true + } + }, + "outputs": { + "init": { + "isDefault": true, + "fields": { + "runExclusive": {}, + "pre-route": {}, + "__rootRoute": {}, + "__legacy": {}, + "__clusterService": {}, + "exclusivePrefix": {}, + "objectId": {} + }, + "config": { + "configurable": false + } + + }, + "legacy": { + "fields": { + "systemName": { + "type": "String", + "required": true + }, + "classifier": {}, + "type": { + "type": "String", + "required": true + }, + "protocol": { + "type": "String", + "required": true + } + }, + "scopes": ["private"], + "config": { + "configurable": false, + "@SKIP_PUBLISH": {} + } + }, + "rootRoute": { + "fields": { + "classifier": {}, + "connectorId": {}, + "profile": {} + }, + "scopes": ["private"], + "config": { + "@SKIP_PUBLISH": {}, + "configurable": false + } + }, + "exclusiveSupport": { + "fields": { + "connectorId": { + "type": "String" + }, + "fileStorage": { + "type": "String" + } + }, + "scopes": ["private", "public"], + "config": { + "@SKIP_PUBLISH": {}, + "configurable": false + } + } + + } +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector-out.json b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector-out.json new file mode 100644 index 00000000..aecd49e8 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector-out.json @@ -0,0 +1,280 @@ +{ + "factory": { + "id": "abstract-connector-out", + "type": "entaxy.runtime.connector", + "description": "Factory abstract-connector-out of entaxy.runtime.connector", + "parent": "abstract-connector", + "isAbstract": true + }, + "entaxy.runtime.connector": { + "direction": "out", + "generation.plugins": ["config-support"] + }, + "fields": { + "pre-output": { + "displayName": "Pre-Output", + "type": "xml:route", + "required": true, + "@RESOURCE": { + "provider": "entaxy-file-internal", + "endType": "String", + "format": "base64", + "preprocess":[ + { + "processor": "xslt", + "source":"entaxy-file-internal:factories/abstract-connector-out/connector-out.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + }, + { + "processor": "xslt", + "source":"entaxy-file-internal:routes-common/common-components.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + } + + ] + + }, + "defaultValue": { + "@RESOURCE": { + "provider": "entaxy-file-internal", + "location": "factories/abstract-connector-out/pre-output.xml", + "endType": "String", + "format": "base64" + } + }, + "config": { + "scope": "public" + } + }, + "__legacy": { + "type": "entaxy.runtime.connector", + "isRef": true, + "required": true, + "isHidden": true, + "isRefByValueOnly": true, + "@INTERNAL": true, + "defaultValue": { + "type": "entaxy.runtime.connector", + "factoryId": "#OWNER#", + "outputType": "legacy", + "scope": "private", + "properties": { + "connectorId": { + "@CALCULATED": { + "expression": "${#OWNER#.objectId}", + "lazy": true + } + }, + "systemName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.profile}", + "lazy": false, + "allowObjects": false + } + }, + "type": { + "@CALCULATED": { + "expression": "${#OWNER#.#FACTORY#.#TYPEINFO#.type}", + "lazy": false + } + }, + "classifier": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.classifier}", + "lazy": false + } + }, + "protocol": { + "@CALCULATED": { + "expression": "${#OWNER#.#FACTORY#.#TYPEINFO#.protocol}", + "lazy": false + } + } + + } + } + }, + "__rootRoute": { + "type": "entaxy.runtime.connector", + "isRef": true, + "required": true, + "isHidden": true, + "isRefByValueOnly": true, + "@INTERNAL": true, + "defaultValue": { + "type": "entaxy.runtime.connector", + "factoryId": "#OWNER#", + "outputType": "rootRoute", + "scope": "private", + "properties": { + "connectorId": { + "@CALCULATED": { + "expression": "${#OWNER#.objectId}", + "lazy": true + } + }, + "profile": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.profile}", + "lazy": true + } + }, + "classifier": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.classifier}", + "lazy": true + } + } + } + } + }, + "__components": { + "type": "entaxy.runtime.connector", + "isRef": true, + "required": true, + "isHidden": true, + "isRefByValueOnly": true, + "@INTERNAL": true, + "defaultValue": { + "type": "entaxy.runtime.connector", + "factoryId": "#OWNER#", + "outputType": "components", + "scope": "private", + "properties": { + "connectorId": { + "@CALCULATED": { + "expression": "${#OWNER#.objectId}", + "lazy": true + } + }, + "systemName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.profile}", + "lazy": true + } + }, + "classifier": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.classifier}", + "lazy": true + } + }, + "type": { + "@CALCULATED": { + "expression": "${#OWNER#.#FACTORY#.#TYPEINFO#.type}", + "lazy": true + } + }, + "protocol": { + "@CALCULATED": { + "expression": "${#OWNER#.#FACTORY#.#TYPEINFO#.protocol}", + "lazy": true + } + } + } + } + }, + "objectId": { + "isHidden": true + }, + "__meta": { + "defaultValue": { + "properties": { + "prefixClassifier": "TARGET" + } + } + } + }, + "outputs": { + "init": { + "isDefault": true, + "fields": { + "pre-output": {}, + "__rootRoute": {}, + "__legacy": {}, + "__components": {}, + "objectId": {} + }, + "config": { + "configurable": false + } + }, + "legacy": { + "fields": { + "systemName": { + "type": "String", + "required": true + }, + "classifier": {}, + "type": { + "type": "String", + "required": true + }, + "protocol": { + "type": "String", + "required": true + } + }, + "scopes": ["private"], + "config": { + "@SKIP_PUBLISH": {}, + "configurable": false + } + }, + "components": { + "fields": { + "connectorId": { + "type": "String", + "required": true + }, + "systemName": { + "type": "String", + "required": true + }, + "classifier": { + "type": "String", + "required": true + }, + "type": { + "type": "String", + "required": true + }, + "protocol": { + "type": "String", + "required": true + } + }, + "scopes": ["private"], + "config": { + "@SKIP_PUBLISH": {}, + "configurable": false + } + }, + "rootRoute": { + "fields": { + "classifier": {}, + "connectorId": {}, + "profile": {} + }, + "scopes": ["private"], + "config": { + "@SKIP_PUBLISH": {}, + "configurable": false + } + } + } +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector.json b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector.json new file mode 100644 index 00000000..98319c65 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/factory/abstract-connector.json @@ -0,0 +1,176 @@ +{ + "factory": { + "id": "abstract-connector", + "type": "entaxy.runtime.connector", + "description": "Abstract connector factory", + "isAbstract": true + }, + "entaxy.runtime.connector": { + "type": "unknown", + "protocol": "unknown", + /* BOTH, SYNC_ONLY, ASYNC_ONLY */ + "syncMode": "ASYNC_ONLY" + }, + "fields": { + "__entaxyContainerId": { + "type": "String", + "isHidden": true + }, + "profile": { + "type": "String", + "required": true, + "isHidden": true, + "defaultValue": { + "@CALCULATED": { + "expression": "${properties.__entaxyContainerId}", + "lazy": false + } + } + }, + "__objectId": { + "type": "String", + "required": true, + "isHidden": true, + "defaultValue": { + "@CALCULATED": { + "expression": "${properties.profile}.${factoryId}.${properties.classifier}", + "targetPath": "$.objectId", + "removeResolved": true, + "lazy": false + } + } + }, + "classifier": { + "displayName": "Classifier", + "type": "String", + "required": true, + "defaultValue": "main", + "@UNIQUE": { + "filterProperties": ["direction"] + } + }, + "__meta": { + "type": "entaxy.runtime.connector", + "isRef": true, + "required": true, + "isHidden": true, + "isRefByValueOnly": true, + "@INTERNAL": true, + "defaultValue": { + "type": "entaxy.runtime.connector", + "factoryId": "#OWNER#", + "outputType": "meta", + "scope": "private", + "properties": { + "prefixClassifier": "SOURCE", + "connectorId": { + "@CALCULATED": { + "expression": "${#OWNER#.objectId}", + "lazy": true + } + }, + "profile": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.profile}", + "lazy": true + } + }, + "connectorProperties": { + "@CALCULATED": { + "expression": "${#OWNER#.#FACTORY#.#TYPEINFO#}", + "resultType": "list_or_single", + "lazy": false + } + }, + "connectorInstanceProperties": { + "profile": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.profile}", + "lazy": true + } + }, + "classifier": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.classifier}", + "lazy": true + } + }/*, + "type": { + "@CALCULATED": { + "expression": "${#OWNER#.factoryId}", + "lazy": true + } + }*/ + } + } + } + }, + "##publish": { + "type": "Map", + "required": true, + "isHidden": true, + "defaultValue":{ + "bundleName": { + "@CALCULATED": { + "expression": "${objectId}", + "lazy": true + } + }, + "system": { + "@CALCULATED": { + "expression": "${properties.profile}", + "lazy": false, + "allowObjects": false + } + }, + "classifier": { + "@CALCULATED": { + "expression": "${properties.classifier}", + "lazy": false + } + }, + "direction": { + "@CALCULATED": { + "expression": "${#FACTORY#.#TYPEINFO#.direction}", + "lazy": false + } + } + } + } + }, + "outputs": { + "init": { + "isDefault": true, + "fields": { + "__entaxyContainerId": {}, + "__objectId": {}, + "__meta": {}, + "classifier": {}, + "profile": {}, + "##publish": {} + }, + "config": { + "configurable": false + } + + }, + "meta": { + "fields": { + "connectorProperties": { + "required": true, + "type": "Map" + }, + "connectorId": { + "type": "String" + }, + "profile": {} + }, + "scopes": ["private", "public"], + "config": { + "@SKIP_PUBLISH": {}, + "configurable": false + } + } + + } +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-in/pre-route.xml b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-in/pre-route.xml new file mode 100644 index 00000000..6bd6af21 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-in/pre-route.xml @@ -0,0 +1,7 @@ + + + + + true + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-out/connector-out.xslt b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-out/connector-out.xslt new file mode 100644 index 00000000..6cecf09b --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-out/connector-out.xslt @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + generated from 'pre-output-start' + + + + + + + + + + diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-out/pre-output.xml b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-out/pre-output.xml new file mode 100644 index 00000000..b2000645 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/abstract-connector-out/pre-output.xml @@ -0,0 +1,7 @@ + + + + + true + + diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/exclusiveSupport.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/exclusiveSupport.ftl new file mode 100644 index 00000000..ee801e0e --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/exclusiveSupport.ftl @@ -0,0 +1,25 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/legacy.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/legacy.ftl new file mode 100644 index 00000000..e3d20741 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/legacy.ftl @@ -0,0 +1,46 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/rootRoute.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/rootRoute.ftl new file mode 100644 index 00000000..273874ca --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-in/rootRoute.ftl @@ -0,0 +1,36 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + + + + + ${headers.ENTAXY_MessageUUID} == null + + ${bean:uuidGenerator.toString} + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/components.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/components.ftl new file mode 100644 index 00000000..f655df94 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/components.ftl @@ -0,0 +1,42 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + + + + + + + + + + + diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/legacy.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/legacy.ftl new file mode 100644 index 00000000..a5ef3e7d --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/legacy.ftl @@ -0,0 +1,61 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/rootRoute.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/rootRoute.ftl new file mode 100644 index 00000000..2a814ea7 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector-out/rootRoute.ftl @@ -0,0 +1,28 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector/meta.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector/meta.ftl new file mode 100644 index 00000000..787473e6 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/abstract-connector/meta.ftl @@ -0,0 +1,64 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] +[#import "templates:object-commons/metadata-storage.ftl" as ms] + + + + + + + + + + +[#if properties.connectorProperties??] +[@ms.metadata_storage id=properties.connectorId+".metadataStorage" data=properties.connectorProperties prefix="NTX_"+properties.prefixClassifier+"_connector_" consumer=properties.connectorId+".metadataEnricher" /] +[/#if] + +[#if properties.connectorInstanceProperties??] +[@ms.metadata_storage id=properties.connectorId+".instanceMetadataStorage" data=properties.connectorInstanceProperties prefix="NTX_"+properties.prefixClassifier+"_connector_" consumer=properties.connectorId+".metadataEnricher" /] +[/#if] + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/object-commons/common-utils.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/object-commons/common-utils.ftl new file mode 100644 index 00000000..f1c18052 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/object-commons/common-utils.ftl @@ -0,0 +1,73 @@ +[#ftl] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] +[#function createQueryString data prefix removePrefix excludes] + [#assign queryString=""] + + [#if excludes??] + [#assign toExclude=excludes] + [#else] + [#assign toExclude=[]] + [/#if] + + [#if properties??] + [#assign queryString=""] + [#list properties as key, value] + [#assign keyAllowed=false] + [#assign newKey=key] + [#if prefix??] + [#if prefix?length>0] + [#if key?starts_with(prefix)] + [#if removePrefix] + [#assign newKey=key[prefix?length..]] + [/#if] + [#assign keyAllowed=true] + [/#if] + [/#if] + [#else] + [#assign keyAllowed=true] + [/#if] + [#if !keyAllowed] + [#continue] + [/#if] + [#if keyAllowed && !toExclude?seq_contains(key)] + [#if value?is_boolean || value?is_number] + [#assign qsAppend=newKey+"="+value?c] + [#elseif value?is_string] + [#assign qsAppend=newKey+"="+value] + [#else] + [#assign qsAppend=""] + [/#if] + [#if qsAppend?length>0] + [#if queryString?length>0] + [#assign queryString=queryString+"&"] + [/#if] + [#assign queryString=queryString+qsAppend] + [/#if] + [/#if] + [/#list] + [#if queryString?length>0] + [#assign queryString="?" + queryString] + [/#if] + [/#if] + [#return queryString] +[/#function] diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/object-commons/metadata-storage.ftl b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/object-commons/metadata-storage.ftl new file mode 100644 index 00000000..6b4500e4 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-producing/src/main/resources/ru/entaxy/templates/object-commons/metadata-storage.ftl @@ -0,0 +1,59 @@ +[#ftl] +[#-- + + ~~~~~~licensing~~~~~~ + connector-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] +[#macro metadata_storage id data prefix consumer=""] + [#if data??] + + + + + [#list data as key, value] + [#if value?is_string] + + [/#if] + [/#list] + + + + + [#list data as key, value] + [#if value?is_boolean] + + [/#if] + [/#list] + + + + + [#list data as key, value] + [#if value?is_number] + + [/#if] + [/#list] + + + [#if consumer?has_content] + + [/#if] + + [/#if] +[/#macro] \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-storage/pom.xml b/platform/runtime/core/objects-implementations/connector-implementation/connector-storage/pom.xml new file mode 100644 index 00000000..8e02c3a7 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-storage/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + connector-implementation + ru.entaxy.esb.platform.runtime.core.objects-implementations + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.objects-implementations.connector-implementation + connector-storage + bundle + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR :: STORAGE + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR :: STORAGE + + + ru.entaxy.platform.base.objects.connector.storage + + + + + ru.entaxy.esb.system.registry.connector + connector-impl + ${project.version} + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/connector-storage/src/main/java/ru/entaxy/platform/base/objects/connector/storage/ConnectorObjectStorage.java b/platform/runtime/core/objects-implementations/connector-implementation/connector-storage/src/main/java/ru/entaxy/platform/base/objects/connector/storage/ConnectorObjectStorage.java new file mode 100644 index 00000000..8825a224 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/connector-storage/src/main/java/ru/entaxy/platform/base/objects/connector/storage/ConnectorObjectStorage.java @@ -0,0 +1,100 @@ +/*- + * ~~~~~~licensing~~~~~~ + * connector-storage + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.base.objects.connector.storage; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import org.osgi.service.component.annotations.CollectionType; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ru.entaxy.esb.system.connector.impl.ConnectorService; +import ru.entaxy.esb.system.jpa.SystemService; +import ru.entaxy.esb.system.management.bundle.jpa.entity.BundleEntity; +import ru.entaxy.platform.base.objects.EntaxyObject; +import ru.entaxy.platform.base.objects.EntaxyObjectStorage; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Component(service = EntaxyObjectStorage.class, immediate = true) +public class ConnectorObjectStorage implements EntaxyObjectStorage { + + private static final Logger log = LoggerFactory.getLogger(ConnectorObjectStorage.class); + + @Reference(cardinality = ReferenceCardinality.MANDATORY, collectionType = CollectionType.SERVICE) + protected ConnectorService connectorService; + + @Reference(cardinality = ReferenceCardinality.MANDATORY, collectionType = CollectionType.SERVICE) + protected SystemService systemService; + + @SuppressWarnings("serial") + protected Map fieldMap = new HashMap<>() {{ + put("name", "objectId"); + put("version", "artifact.version"); + }}; + + protected Map fieldBundleMap = new HashMap<>() {{ + put("name", "bundleId"); + put("type", "artifact.type"); + put("status", "artifact.status"); + put("version", "artifact.version"); + put("url", "bundleLocation"); + }}; + + @Override + public String[] getObjectTypes() { + return new String[]{EntaxyObject.OBJECT_TYPES.CONNECTOR}; + } + + @Override + public Object store(Map data) { + + JsonObject jsonObject = new JsonObject(); + Gson gson = new Gson(); + + for (Map.Entry entry : fieldMap.entrySet()) { + if (data.containsKey(entry.getValue())) + jsonObject.add(entry.getKey(), gson.toJsonTree(data.get(entry.getValue()))); + } + JsonObject bundleJsonObject = new JsonObject(); + for (Map.Entry entry : fieldBundleMap.entrySet()) { + if (data.containsKey(entry.getValue())) + bundleJsonObject.add(entry.getKey(), gson.toJsonTree(data.get(entry.getValue()))); + } + + log.debug("JSON :: " + jsonObject.toString()); + ru.entaxy.esb.system.connector.entity.Connector connector = gson.fromJson(jsonObject, ru.entaxy.esb.system.connector.entity.Connector.class); + connector.setTemplateName(data.get("factoryId").toString()); + connector.setCreateDate(new Date()); + connector.setCreatedBy("admin"); + + log.debug("JSON Bundle :: " + bundleJsonObject.toString()); + BundleEntity bundleEntity = gson.fromJson(bundleJsonObject, BundleEntity.class); + connector.setBundleEntity(bundleEntity); + ru.entaxy.esb.system.jpa.entity.System system = systemService.getByUuid(data.get("profile").toString()); + connectorService.addNewConnector(system, connector); + + return null; + } +} diff --git a/platform/runtime/core/objects-implementations/connector-implementation/pom.xml b/platform/runtime/core/objects-implementations/connector-implementation/pom.xml new file mode 100644 index 00000000..7a0036e2 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + ru.entaxy.esb.platform.runtime.core + objects-implementations + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.objects-implementations + connector-implementation + pom + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR + + connector-producing + standard-connectors-pack + connector-storage + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/LICENSE.txt b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/pom.xml b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/pom.xml new file mode 100644 index 00000000..aead1d41 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + ru.entaxy.esb.platform.runtime.core.objects-implementations + connector-implementation + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.objects-implementations.connector-implementation + standard-connectors-pack + bundle + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR :: STANDARD PACK + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR :: STANDARD PACK + + + + + org.apache.felix + maven-bundle-plugin + ${maven-bundle-plugin.version} + true + + + true + true + + + + + + + + + diff --git a/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/factory/file-connector-in.json b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/factory/file-connector-in.json new file mode 100644 index 00000000..5bede306 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/factory/file-connector-in.json @@ -0,0 +1,66 @@ +{ + "factory": { + "id": "file-connector-in", + "type": "entaxy.runtime.connector", + "description": "File IN-connector factory", + "isAbstract": false, + "label": "connector,file", + "parent": "abstract-connector-in", + "requires": [ + "file-connection" + ] + }, + "entaxy.runtime.connector": { + "type": "file", + "protocol": "file" + }, + "fields": { + "entaxyOriginConnection": { + "displayName": "File Connection", + "type": "entaxy.runtime.connection", + "filter": { + "label": "file" + }, + /* "importPrefix": "camel_", */ + "required": true, + "immutable": true, + "isRef": true, + "isRefByValueOnly": false, + "resolveAlways": true, + "refField": "objectId" + } + }, + "outputs": { + "init": { + "isDefault": true, + "fields": { + "entaxyOriginConnection": {}, + "camel_directoryName": { + "group": "general", + "defaultValue": { + "@CALCULATED": { + "expression": "${objectId}" + } + } + }, + "@IMPORT": [ + { + "sourceFactoryId": "file-connection", + "location": "outputs.consumer.fields", + "prefix": "", + "filter": { + "contained": [{ + "attribute": "##origin", + "values": ["camel"] + } + ] + } + } + ] + }, + "config": { + "configurable": false + } + } + } +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/factory/file-connector-out.json b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/factory/file-connector-out.json new file mode 100644 index 00000000..b4fbe3f9 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/factory/file-connector-out.json @@ -0,0 +1,63 @@ +{ + "factory": { + "id": "file-connector-out", + "type": "entaxy.runtime.connector", + "parent": "abstract-connector-out", + "description": "File OUT-connector factory", + "label": "connector,file", + "isAbstract": false, + "requires": ["file-connection"] + }, + "entaxy.runtime.connector": { + "type": "file", + "protocol": "file" + }, + "fields": { + "entaxyOriginConnection": { + "displayName": "File Connection", + "type": "entaxy.runtime.connection", + "filter": { + "label": "file" + }, + /* "importPrefix": "camel_", */ + "required": true, + "immutable": true, + "isRef": true, + "isRefByValueOnly": false, + "resolveAlways": true, + "refField": "objectId" + } + }, + "outputs": { + "init": { + "isDefault": true, + "fields": { + "entaxyOriginConnection": {}, + "camel_directoryName": { + "group": "general", + "defaultValue": { + "@CALCULATED": { + "expression": "${objectId}" + } + } + }, + "@IMPORT": [{ + "sourceFactoryId": "file-connection", + "location": "outputs.producer.fields", + "prefix": "", + "filter": { + "contained": [{ + "attribute": "##origin", + "values": ["camel"] + } + ] + } + } + ] + }, + "config": { + "configurable": false + } + } + } +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/templates/file-connector-in/init.ftl b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/templates/file-connector-in/init.ftl new file mode 100644 index 00000000..3992e47b --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/templates/file-connector-in/init.ftl @@ -0,0 +1,37 @@ +[#ftl attributes={"generated.type":"blueprint"}] +[#-- + + ~~~~~~licensing~~~~~~ + standard-connectors-pack + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + +[#import "templates:object-commons/common-utils.ftl" as utils] + + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/templates/file-connector-out/init.ftl b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/templates/file-connector-out/init.ftl new file mode 100644 index 00000000..120ed4c3 --- /dev/null +++ b/platform/runtime/core/objects-implementations/connector-implementation/standard-connectors-pack/src/main/resources/ru/entaxy/templates/file-connector-out/init.ftl @@ -0,0 +1,38 @@ +[#ftl attributes={"generated.type":"blueprint"}] +[#-- + + ~~~~~~licensing~~~~~~ + standard-connectors-pack + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + +[#import "templates:object-commons/common-utils.ftl" as utils] + + + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/factory/common-system-profile.json b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/factory/common-system-profile.json new file mode 100644 index 00000000..926e69dd --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/factory/common-system-profile.json @@ -0,0 +1,339 @@ +{ + "factory": { + "id": "common-system-profile", + "type": "entaxy.runtime.profile", + "description": "Factory common-system-profile of entaxy.runtime.profile", + "displayName": "System profile", + "isAbstract": false + }, + "entaxy.runtime.profile": { + "profileType": "SYSTEM" + }, + "fields": { + "__objectId": { + "type": "String", + "required": true, + "isHidden": true, + "defaultValue": { + "@CALCULATED": { + "expression": "${properties.systemName}", + "targetPath": "$.objectId", + "removeResolved": true, + "lazy": false + } + } + }, + "systemName": { + "displayName": "System Name", + "type": "String", + "required": true, + "immutable": true, + "group": "general" + }, + "description": { + "displayName": "Description", + "type": "String", + "group": "general" + }, + "profileProperties": { + "type": "Map", + "required": true, + "isHidden": true, + "defaultValue": { + "profile": { + "@CALCULATED": { + "expression": "${properties.systemName}", + "lazy": true + } + } + } + }, + "in-flow-pre-route": { + "displayName": "In-flow pre-route", + "type": "xml:route", + "required": true, + "group": "in-flow", + "@RESOURCE": { + "provider": "entaxy-file-internal", + "endType": "String", + "format": "base64", + "preprocess":[ + { + "processor": "xslt", + "source":"entaxy-file-internal:factories/common-system-profile/profile-pre-route.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + }, + { + "processor": "xslt", + "source":"entaxy-file-internal:routes-common/common-components.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + } + + ] + + }, + "defaultValue": { + "@RESOURCE": { + "provider": "entaxy-file-internal", + "location": "factories/common-system-profile/in-flow-pre-route.xml", + "endType": "String", + "format": "base64" + } + }, + "config": { + "scope": "public" + } + }, + "out-flow-pre-route": { + "displayName": "Out-flow pre-route", + "type": "xml:route", + "required": true, + "group": "out-flow", + "@RESOURCE": { + "provider": "entaxy-file-internal", + "endType": "String", + "format": "base64", + "preprocess":[ + { + "processor": "xslt", + "source":"entaxy-file-internal:factories/common-system-profile/profile-pre-route.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + }, + { + "processor": "xslt", + "source":"entaxy-file-internal:routes-common/common-components.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + } + + ] + + }, + "defaultValue": { + "@RESOURCE": { + "provider": "entaxy-file-internal", + "location": "factories/common-system-profile/out-flow-pre-route.xml", + "endType": "String", + "format": "base64" + } + }, + "config": { + "scope": "public" + } + }, + "connector-selector": { + "displayName": "Output connector selector", + "type": "xml:route", + "required": true, + "group": "out-flow", + "@RESOURCE": { + "provider": "entaxy-file-internal", + "endType": "String", + "format": "base64", + "preprocess":[ + { + "processor": "saxon", + "source":"entaxy-file-internal:factories/common-system-profile/out-flow-connector-selector.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + } + ] + + }, + "defaultValue": { + "@RESOURCE": { + "provider": "entaxy-file-internal", + "location": "factories/common-system-profile/out-flow-connector-selector.xml", + "endType": "String", + "format": "base64" + } + }, + "config": { + "scope": "public" + } + }, + /* TO_REMOVE */ + "useDefaultRoute": { + "displayName": "Use Default Route", + "type": "Boolean", + "required": true, + "isHidden": true, + "defaultValue": true, + "fixedValue": true, + "group": "in-flow" + }, + + "defaultRouteContent": { + "displayName": "Default profile route", + "type": "xml:route", + "required": true, + "group": "in-flow", + "defaultValue": { + "@RESOURCE": { + "provider": "entaxy-file-internal", + "location": "factories/default-route-2/default-route.xml", + "endType": "String", + "format": "base64" + } + }, + "@FACADE": { + "useFacade": true, + "type": "String", + "value": "Go to routes to view or edit this value" + }, + "config": { + "scope": "public" + } + }, + "defaultRoute": { + "type": "entaxy.runtime.default-route", + "isRef": true, + /* actually there's no reference, but the object must be in a model */ + /* so while producing we must check the defaultRoute is found */ + "isBackRef": true, + /* but only if useDefaultRoute is set to true */ + "condition": "${useDefaultRoute}", + "required": true, + "immutable": true, + "defaultValue": { + "type": "entaxy.runtime.default-route", + "factoryId": "default-route-2", + "properties": { + "systemName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + }, + "description": { + "@CALCULATED": { + "expression": "Default route for ${#OWNER#.properties.systemName}", + "lazy": false + } + }, + "routeContent": { + "@CALCULATED": { + "expression": "${#OWNER_OF_TYPE:entaxy.runtime.profile#.properties.defaultRouteContent}", + "lazy": false, + "allowObjects": false + } + } + } + } + + }, + "__legacyComponents": { + "type": "entaxy.runtime.profile", + "isRef": true, + "required": true, + "isHidden": true, + "isRefByValueOnly": true, + "@INTERNAL": true, + "defaultValue": { + "factoryId": "common-system-profile", + "type": "entaxy.runtime.profile", + "outputType": "legacy", + "scope": "private", + "properties": { + "systemName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + } + }, + "profileType": { + "type": "String", + "required": true, + "isHidden": true, + "defaultValue": { + "@CALCULATED": { + "expression": "${#FACTORY#.#TYPEINFO#.profileType}", + "lazy": false + } + } + }, + "##publish": { + "defaultValue": { + "profileType": { + "@CALCULATED": { + "expression": "${#FACTORY#.#TYPEINFO#.profileType}", + "lazy": false + } + } + } + } + }, + "outputs": { + "init": { + "isDefault": true, + "fields": { + "objectId": { + "isHidden": true + }, + "__objectId": {}, + "systemName": {}, + "description": {}, + "useDefaultRoute": {}, + "defaultRoute": { + "isHidden": true + }, + "defaultRouteContent": {}, + "profileProperties": {}, + "in-flow-pre-route": {}, + "out-flow-pre-route": {}, + "connector-selector": {}, + "profileType": {}, + "__legacyComponents": {} + }, + "config": { + "configurable": false + } + }, + "legacy": { + "fields": { + "systemName": {} + }, + "scopes": ["private"], + "config": { + "@SKIP_PUBLISH": {}, + "configurable": false + } + } + } +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/factory/default-route-2.json b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/factory/default-route-2.json new file mode 100644 index 00000000..e784294d --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/factory/default-route-2.json @@ -0,0 +1,104 @@ +{ + "factory": { + "id": "default-route-2", + "type": "entaxy.runtime.default-route", + "label": "route,default", + "isAbstract": false + }, + "entaxy.runtime.default-route": { + "displayName": "Default route for system profile" + }, + "fields": { + "__objectId": { + "type": "String", + "required": true, + "isHidden": true, + "defaultValue": { + "@CALCULATED": { + "expression": "${properties.systemName}-default-route", + "targetPath": "$.objectId", + "removeResolved": true, + "lazy": false + } + } + }, + "systemName": { + "type": "entaxy.runtime.profile", + "isRef": true, + "required": true, + "immutable": true, + "refField": "systemName", + "isRefByValueOnly": true + }, + "description": { + "type": "String" + }, + "routeContent": { + "displayName": "Route", + "type": "xml:route", + "required": true, + "@RESOURCE": { + "provider": "entaxy-file-internal", + "endType": "String", + "format": "base64", + "preprocess":[ + { + "processor": "xslt", + "source":"entaxy-file-internal:factories/default-route-2/default-route.xslt", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + }, + { + "processor": "merge", + "source":"entaxy-file-internal:factories/default-route-2/standard-router.xml", + "sourceElement": "standard-router", + "targetElement": "standard-router", + "parameters": { + "profileName": { + "@CALCULATED": { + "expression": "${#OWNER#.properties.systemName}", + "lazy": false + } + } + } + } + ] + + } + }, + "##publish": { + "defaultValue":{ + "profile": { + "@CALCULATED": { + "expression": "${properties.systemName}", + "lazy": true + } + }, + "relation": { + "@CALCULATED": { + "expression": "${properties.systemName}:${#OWNER#.#FACTORY#.type}:default-route:routes", + "lazy": false + } + } + } + } + }, + "outputs": { + "init": { + "isDefault": true, + "fields": { + "systemName": {}, + "description": {}, + "routeContent": {}, + "__objectId": {} + } + } + } + +} \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/in-flow-pre-route.xml b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/in-flow-pre-route.xml new file mode 100644 index 00000000..b9e36574 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/in-flow-pre-route.xml @@ -0,0 +1,7 @@ + + + + + true + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-connector-selector.xml b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-connector-selector.xml new file mode 100644 index 00000000..7455c9f8 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-connector-selector.xml @@ -0,0 +1,53 @@ + + + + + ${headers.in} == null + + + connector.type + connector.protocol + connector.classifier + + + =:=:= + =:=:* + =:*:* + *:=:= + *:=:* + + + + + + false + false + + + + + + + connector.type + connector.protocol + connector.classifier + + + =:=:= + =:=:* + =:*:* + *:=:= + *:=:* + *:*:* + + + + + false + false + false + + + + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-connector-selector.xslt b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-connector-selector.xslt new file mode 100644 index 00000000..f5835ee7 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-connector-selector.xslt @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + generated from 'connector-selector' + + + bean:selector- + + + + + + + + selector- + + + + + + + + + + + + + + {"_end":true} + + + + + + + + + + + + + + "properties":[ + + "" + , + + ], + + + + "patterns":[ + + "" + , + + ], + + + + "options":{ + + "": + + + + + + , + + + "", + + + + + true, + + + + "_end":true}, + + + + + + + + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-pre-route.xml b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-pre-route.xml new file mode 100644 index 00000000..564ed730 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/out-flow-pre-route.xml @@ -0,0 +1,7 @@ + + + + + true + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/profile-pre-route.xslt b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/profile-pre-route.xslt new file mode 100644 index 00000000..8d687981 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/common-system-profile/profile-pre-route.xslt @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + direct:profile--in-flow-pre-route + + generated from 'in-flow-pre-route-start' + + + + + + + + direct:profile--out-flow-pre-route + + generated from 'out-flow-pre-route-start' + + + + + + + + + + + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/default-route.xml b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/default-route.xml new file mode 100644 index 00000000..ee5831f3 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/default-route.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/default-route.xslt b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/default-route.xslt new file mode 100644 index 00000000..4a766ca9 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/default-route.xslt @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + direct-vm:profile--default-route + + generated from 'default-route-start' + + + + + + + + + + + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/standard-router.xml b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/standard-router.xml new file mode 100644 index 00000000..41db922c --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/factories/default-route-2/standard-router.xml @@ -0,0 +1,36 @@ + + + + + ${headers.ENTAXY_Destination} == 'nsi' + && ${headers.ENTAXY_DestinationType} == null + + + true + + + + + + + ${headers.ENTAXY_DestinationType} == 'system.name' + + + + ${headers.ENTAXY_DestinationType} == 'system-group.name' + + + + ${headers.ENTAXY_DestinationType} == 'queue.name' + + + + ${headers.ENTAXY_DestinationType} == 'topic.name' + + + + + + + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/common-system-profile/init.ftl b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/common-system-profile/init.ftl new file mode 100644 index 00000000..395901c9 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/common-system-profile/init.ftl @@ -0,0 +1,133 @@ +[#ftl attributes={"generated.type":"blueprint"}] +[#-- + + ~~~~~~licensing~~~~~~ + profile-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + + +[#import "templates:object-commons/metadata-storage.ftl" as ms] + +[#if properties.profileProperties??] +[@ms.metadata_storage id=properties.systemName+".metadataStorage" data=properties.profileProperties prefix="NTX_profile_" consumer=null /] +[/#if] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [=systemName] + + + + ${headers.NTX_NextPoint} != null + + ${headers.NTX_NextPoint} + + + + + + + + + + + + + + + + ${headers.NTX_Origin} == null + + + + + + + + + + + + + + + + + + ${headers.NTX_target_connector} != null + + + + + + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/common-system-profile/legacy.ftl b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/common-system-profile/legacy.ftl new file mode 100644 index 00000000..c5d2f780 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/common-system-profile/legacy.ftl @@ -0,0 +1,61 @@ +[#ftl attributes={"generated.type":"blueprint.fragment"}] +[#-- + + ~~~~~~licensing~~~~~~ + profile-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/default-route-2/init.ftl b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/default-route-2/init.ftl new file mode 100644 index 00000000..1c2f28bc --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-producing/src/main/resources/ru/entaxy/templates/default-route-2/init.ftl @@ -0,0 +1,33 @@ +[#ftl attributes={"generated.type":"blueprint"}] +[#-- + + ~~~~~~licensing~~~~~~ + profile-producing + ========== + Copyright (C) 2020 - 2023 EmDev LLC + ========== + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ~~~~~~/licensing~~~~~~ + +--] + + + + + + + + diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/LICENSE.txt b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/pom.xml b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/pom.xml new file mode 100644 index 00000000..465d6c2c --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + ru.entaxy.esb.platform.runtime.core.objects-implementations + profile-implementation + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation + profile-runtime + bundle + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME + + + ru.entaxy.platform.profiles.runtime* + + + + + org.apache.camel + camel-core + ${camel.version} + + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/Connector.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/Connector.java new file mode 100644 index 00000000..28dabfcd --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/Connector.java @@ -0,0 +1,31 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime; + +public interface Connector { + + String getId(); + String getType(); + String getProtocol(); + String getClassifier(); + + String getProperty(String propertyName); + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/InConnector.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/InConnector.java new file mode 100644 index 00000000..48567ba9 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/InConnector.java @@ -0,0 +1,24 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime; + +public interface InConnector extends Connector { + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/OutConnector.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/OutConnector.java new file mode 100644 index 00000000..cb427d34 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/OutConnector.java @@ -0,0 +1,24 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime; + +public interface OutConnector extends Connector { + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/Profile.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/Profile.java new file mode 100644 index 00000000..d7803fc6 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/Profile.java @@ -0,0 +1,27 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime; + +public interface Profile { + + String getId(); + String getType(); + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/SystemProfile.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/SystemProfile.java new file mode 100644 index 00000000..dc23f8ed --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/SystemProfile.java @@ -0,0 +1,31 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime; + +import java.util.List; + +public interface SystemProfile extends Profile { + + List getInConnectors(); + List getOutConnectors(); + + OutConnector getDefaultOutConnector(); + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/AbstractConnector.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/AbstractConnector.java new file mode 100644 index 00000000..0a147b3c --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/AbstractConnector.java @@ -0,0 +1,93 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime.impl; + +import ru.entaxy.platform.profiles.runtime.Connector; + +public abstract class AbstractConnector implements Connector { + + public static final String PROP_ID = "id"; + public static final String PROP_TYPE = "type"; + public static final String PROP_PROTOCOL = "protocol"; + public static final String PROP_CLASSIFIER = "classifier"; + + public static final String CONNECTOR_PREFIX = "connector."; + + protected String id; + protected String type; + protected String protocol; + protected String classifier; + + + @Override + public String getId() { + return this.id; + } + + @Override + public String getType() { + return this.type; + } + + @Override + public String getProtocol() { + return this.protocol; + } + + @Override + public String getClassifier() { + return this.classifier; + } + + @Override + public String getProperty(String propertyName) { + String name = propertyName; + if (name.startsWith(CONNECTOR_PREFIX)) + name = name.substring(CONNECTOR_PREFIX.length()); + if (PROP_ID.equals(name)) + return getId(); + if (PROP_TYPE.equals(name)) + return getType(); + if (PROP_PROTOCOL.equals(name)) + return getProtocol(); + if (PROP_CLASSIFIER.equals(name)) + return getClassifier(); + return null; + } + + public void setId(String id) { + this.id = id; + } + + public void setType(String type) { + this.type = type; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public void setClassifier(String classifier) { + this.classifier = classifier; + } + + + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/AbstractProfile.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/AbstractProfile.java new file mode 100644 index 00000000..338a7146 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/AbstractProfile.java @@ -0,0 +1,47 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime.impl; + +import ru.entaxy.platform.profiles.runtime.Profile; + +public abstract class AbstractProfile implements Profile { + + protected String id; + protected String type; + + @Override + public String getId() { + return this.id; + } + + @Override + public String getType() { + return this.type; + } + + public void setId(String id) { + this.id = id; + } + + public void setType(String type) { + this.type = type; + } + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/InConnectorImpl.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/InConnectorImpl.java new file mode 100644 index 00000000..ddedf69f --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/InConnectorImpl.java @@ -0,0 +1,26 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime.impl; + +import ru.entaxy.platform.profiles.runtime.InConnector; + +public class InConnectorImpl extends AbstractConnector implements InConnector { + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/OutConnectorImpl.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/OutConnectorImpl.java new file mode 100644 index 00000000..2773eaf0 --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/OutConnectorImpl.java @@ -0,0 +1,26 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime.impl; + +import ru.entaxy.platform.profiles.runtime.OutConnector; + +public class OutConnectorImpl extends AbstractConnector implements OutConnector { + +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/SystemProfileImpl.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/SystemProfileImpl.java new file mode 100644 index 00000000..0b21ff5c --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/impl/SystemProfileImpl.java @@ -0,0 +1,146 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime.impl; + +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.jline.utils.Log; +import org.osgi.framework.BundleContext; +import org.osgi.framework.Constants; +import org.osgi.framework.Filter; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; +import org.osgi.util.tracker.ServiceTracker; +import org.osgi.util.tracker.ServiceTrackerCustomizer; + +import ru.entaxy.platform.profiles.runtime.Connector; +import ru.entaxy.platform.profiles.runtime.InConnector; +import ru.entaxy.platform.profiles.runtime.OutConnector; +import ru.entaxy.platform.profiles.runtime.SystemProfile; + +public class SystemProfileImpl extends AbstractProfile implements SystemProfile { + + protected BundleContext bundleContext; + + protected ConnectorServiceTracker inConnectorsTracker; + protected ConnectorServiceTracker outConnectorsTracker; + + public void activate() { + inConnectorsTracker = new ConnectorServiceTracker<>(InConnector.class); + outConnectorsTracker = new ConnectorServiceTracker<>(OutConnector.class); + } + + @Override + public List getInConnectors() { + return inConnectorsTracker.getServices(); + } + + @Override + public List getOutConnectors() { + return outConnectorsTracker.getServices(); + } + + @Override + public OutConnector getDefaultOutConnector() { + // TODO implement + return null; + } + + public void setBundleContext(BundleContext bundleContext) { + this.bundleContext = bundleContext; + } + + protected class ConnectorServiceTracker{ + + ServiceTracker serviceTracker; + + Class serviceClass; + + public ConnectorServiceTracker(Class clazz) { + + this.serviceClass = clazz; + + try { + + Filter filter = createFilter(clazz); + serviceTracker = new ServiceTracker<>( + bundleContext + , filter + , new ConnectorServiceTrackerCustomizer()); + serviceTracker.open(true); + + } catch (Exception e) { + Log.error("Error creating service tracker for [" + SystemProfileImpl.this.getId() + "]", e); + } + } + + protected Filter createFilter(Class clazz) throws InvalidSyntaxException { + return SystemProfileImpl.this.bundleContext.createFilter( + + String.format("(&(%s=%s)(system=%s))" + , Constants.OBJECTCLASS + , clazz.getName() + , SystemProfileImpl.this.getId()) + ); + } + + public List getServices(){ + if (serviceTracker.getServices() == null) + return Collections.emptyList(); + return Arrays.asList((Object[])serviceTracker.getServices()) + .stream().map(service->(T)service) + .collect(Collectors.toList()); + } + + } + + protected class ConnectorServiceTrackerCustomizer implements ServiceTrackerCustomizer{ + + protected Map storage = new LinkedHashMap<>(); + + @Override + synchronized public T addingService(ServiceReference reference) { + T service = SystemProfileImpl.this.bundleContext.getService(reference); + synchronized (storage) { + storage.put(service.getId(), service); + } + return service; + } + + @Override + synchronized public void modifiedService(ServiceReference reference, T service) { + // TODO Auto-generated method stub + + } + + @Override + synchronized public void removedService(ServiceReference reference, T service) { + synchronized (storage) { + storage.remove(service.getId()); + } + } + + } +} diff --git a/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/support/ConnectorSelector.java b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/support/ConnectorSelector.java new file mode 100644 index 00000000..0a1622ec --- /dev/null +++ b/platform/runtime/core/objects-implementations/profile-implementation/profile-runtime/src/main/java/ru/entaxy/platform/profiles/runtime/support/ConnectorSelector.java @@ -0,0 +1,316 @@ +/*- + * ~~~~~~licensing~~~~~~ + * profile-runtime + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +package ru.entaxy.platform.profiles.runtime.support; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +import ru.entaxy.platform.base.support.CommonUtils; +import ru.entaxy.platform.base.support.JSONUtils; +import ru.entaxy.platform.profiles.runtime.OutConnector; +import ru.entaxy.platform.profiles.runtime.Profile; +import ru.entaxy.platform.profiles.runtime.SystemProfile; + +public class ConnectorSelector implements Processor { + + private static final Logger log = LoggerFactory.getLogger(ConnectorSelector.class); + + public static final String PROP_TARGET_CONNECTOR = "NTX_target_connector"; + public static final String PROP_PREFERED_CONNECTOR = "NTX_prefered_connector"; + + public static final String PROP_SOURCE_PREFIX = "NTX_SOURCE_"; + + public static final String PATTERN_ANY = "*"; + public static final String PATTERN_EQUAL = "="; + + protected SystemProfile profile; + + protected String config; + + protected SelectorConfig selectorConfig; + + @Override + public void process(Exchange exchange) throws Exception { + log.info("--> SELECTING CONNECTOR !!!"); + exchange.getIn().removeHeader(PROP_TARGET_CONNECTOR); + SelectionExecutor executor = new SelectionExecutor(selectorConfig, profile); + OutConnector result = executor.findConnector(exchange); + if (result != null) + exchange.getIn().setHeader(PROP_TARGET_CONNECTOR, result.getId()); + } + + public SystemProfile getProfile() { + return profile; + } + + public void setProfile(SystemProfile profile) { + this.profile = profile; + } + + public String getConfig() { + return config; + } + + public void setConfig(String config) { + this.config = config; + processConfig(); + } + + protected void processConfig() { + if (!CommonUtils.isValid(config)) { + selectorConfig = new SelectorConfig(); + } else { + selectorConfig = new SelectorConfig(this.config); + } + } + + protected static class SelectionExecutor { + + protected SelectorConfig selectorConfig; + protected SystemProfile profile; + + public SelectionExecutor(SelectorConfig selectorConfig, SystemProfile profile) { + this.selectorConfig = selectorConfig; + this.profile = profile; + } + + public OutConnector findConnector(Exchange exchange) { + OutConnector result = null; + + if (selectorConfig.useTheOnlyConnector && (profile.getOutConnectors().size()==1)) + return profile.getOutConnectors().get(0); + + Object value = exchange.getIn().getHeader(PROP_PREFERED_CONNECTOR); + if (value != null) { + try { + SelectorConfig preferedConfig = createConfigForPreferedConnector(value); + List resolvedPatters = new ArrayList<>(preferedConfig.patterns); + result = findConnectorByPatterns(preferedConfig, resolvedPatters); + if (result != null) + return result; + } catch (Exception e) { + log.warn("Invalid prefered connector format", e); + } + } + + List resolvedPatterns = resolvePatternsForExchange(selectorConfig, exchange); + result = findConnectorByPatterns(selectorConfig, resolvedPatterns); + + if ((result == null) && selectorConfig.useDefaultConnector) + result = profile.getDefaultOutConnector(); + + return result; + } + + protected List resolvePatternsForExchange(SelectorConfig config, Exchange exchange) { + List result = new ArrayList<>(); + List values = new ArrayList<>(); + for (String property: config.properties) { + String headerName = PROP_SOURCE_PREFIX + property.replace('.', '_'); + Object value = exchange.getIn().getHeader(headerName); + if (value == null) { + if (config.treatNoPropertyAsAny) + values.add(PATTERN_ANY); + else + values.add(""); + continue; + } + values.add(value.toString()); + } + for (String pattern: config.patterns) + result.add(resolvePattern(pattern, values)); + return result; + } + + protected String resolvePattern(String pattern, List values) { + String[] splitted = pattern.split(":"); + for (int i=0; i resolvedPatterns) { + for (String resolvedPattern: resolvedPatterns) { + if (!config.allowAllStarsPattern && isAllStarsPattern(resolvedPattern)) + continue; + String[] pattern = resolvedPattern.split(":"); + for (OutConnector connector: profile.getOutConnectors()) { + String[] connectorInfo = getConnectorInfo(config, connector); + boolean found = false; + for (int i=0; i info = new ArrayList<>(); + for (String property: config.properties) { + info.add(connector.getProperty(property)); + } + return info.toArray(new String[] {}); + } + + protected SelectorConfig createConfigForPreferedConnector(Object descriptor) throws Exception { + + JsonObject preferedConnectorDescriptor = JSONUtils.getJsonRootObject(descriptor.toString()); + SelectorConfig result = new SelectorConfig(); + List patternItems = new ArrayList<>(); + for (Entry entry: preferedConnectorDescriptor.entrySet()) { + if (!entry.getValue().isJsonPrimitive()) + continue; + result.properties.add(entry.getKey()); + patternItems.add(entry.getValue().getAsJsonPrimitive().getAsString()); + } + String pattern = patternItems.stream().collect(Collectors.joining(":")); + if (!CommonUtils.isValid(pattern)) + return null; + result.patterns.add(pattern); + result.failBackToLLegacyRouter = false; + result.useDefaultConnector = false; + result.useTheOnlyConnector = false; + result.allowAllStarsPattern = false; + result.treatNoPropertyAsAny = false; + + return result; + } + } + + protected static class SelectorConfig { + + public interface FIELDS { + String PROPERTIES = "properties"; + String PATTERNS = "patterns"; + String OPTIONS = "options"; + String OPTION_FAIL_BACK_TO_LEGACY = "fail-back-to-legacy-router"; + String OPTION_USE_THE_ONLY_CONNECTOR = "use-the-only-connector"; + String OPTION_USE_DEFAULT_CONNECTOR = "use-default-connector"; + String OPTION_ALLOW_ALL_STARS_PATTERN = "allow-all-stars-pattern"; + String OPTION_TREAT_NO_PROPERTY_AS_ANY = "treat-no-property-as-any"; + } + + List properties; + List patterns; + + boolean failBackToLLegacyRouter = true; + boolean useTheOnlyConnector = true; + boolean useDefaultConnector = true; + boolean allowAllStarsPattern = true; + boolean treatNoPropertyAsAny = true; + + public SelectorConfig() { + super(); + properties = new ArrayList<>(); + patterns = new ArrayList<>(); + } + + public SelectorConfig(String jsonData) { + JsonObject config = JSONUtils.getJsonRootObject(jsonData); + Gson gson = new Gson(); + Type listType = new TypeToken>(){}.getType(); + if (config.has(FIELDS.PROPERTIES)) + try { + properties = gson.fromJson(config.get(FIELDS.PROPERTIES), listType); + } catch (Exception e) { + // NOOP + } + if (config.has(FIELDS.PATTERNS)) + try { + patterns = gson.fromJson(config.get(FIELDS.PATTERNS), listType); + } catch (Exception e) { + // NOOP + } + + if (config.has(FIELDS.OPTIONS)) { + + JsonElement je = config.get(FIELDS.OPTIONS); + if (je.isJsonObject()) { + + JsonObject options = je.getAsJsonObject(); + + if (options.has(FIELDS.OPTION_FAIL_BACK_TO_LEGACY)) + try { + failBackToLLegacyRouter = options.get(FIELDS.OPTION_FAIL_BACK_TO_LEGACY).getAsBoolean(); + } catch (Exception e) { + // NOOP + } + if (options.has(FIELDS.OPTION_USE_DEFAULT_CONNECTOR)) + try { + useDefaultConnector = options.get(FIELDS.OPTION_USE_DEFAULT_CONNECTOR).getAsBoolean(); + } catch (Exception e) { + // NOOP + } + if (options.has(FIELDS.OPTION_USE_THE_ONLY_CONNECTOR)) + try { + useTheOnlyConnector = options.get(FIELDS.OPTION_USE_THE_ONLY_CONNECTOR).getAsBoolean(); + } catch (Exception e) { + // NOOP + } + if (options.has(FIELDS.OPTION_ALLOW_ALL_STARS_PATTERN)) + try { + allowAllStarsPattern = options.get(FIELDS.OPTION_ALLOW_ALL_STARS_PATTERN).getAsBoolean(); + } catch (Exception e) { + // NOOP + } + if (options.has(FIELDS.OPTION_TREAT_NO_PROPERTY_AS_ANY)) + try { + treatNoPropertyAsAny = options.get(FIELDS.OPTION_TREAT_NO_PROPERTY_AS_ANY).getAsBoolean(); + } catch (Exception e) { + // NOOP + } + } + } + + } + } +} diff --git a/platform/runtime/core/objects-implementations/route-implementation/LICENSE.txt b/platform/runtime/core/objects-implementations/route-implementation/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/core/objects-implementations/route-implementation/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/core/objects-implementations/route-implementation/pom.xml b/platform/runtime/core/objects-implementations/route-implementation/pom.xml new file mode 100644 index 00000000..3c14e085 --- /dev/null +++ b/platform/runtime/core/objects-implementations/route-implementation/pom.xml @@ -0,0 +1,16 @@ + + 4.0.0 + + ru.entaxy.esb.platform.runtime.core + objects-implementations + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.objects-implementations + route-implementation + pom + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: ROUTE + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: ROUTE + + route-producing + + \ No newline at end of file diff --git a/platform/runtime/core/objects-implementations/route-implementation/route-producing/LICENSE.txt b/platform/runtime/core/objects-implementations/route-implementation/route-producing/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/platform/runtime/core/objects-implementations/route-implementation/route-producing/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/runtime/core/objects-implementations/route-implementation/route-producing/pom.xml b/platform/runtime/core/objects-implementations/route-implementation/route-producing/pom.xml new file mode 100644 index 00000000..0372d117 --- /dev/null +++ b/platform/runtime/core/objects-implementations/route-implementation/route-producing/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + ru.entaxy.esb.platform.runtime.core.objects-implementations + route-implementation + 1.8.3 + + ru.entaxy.esb.platform.runtime.core.objects-implementations.route-implementation + route-producing + bundle + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: ROUTE :: PRODUCING + ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: ROUTE :: PRODUCING + + + + org.apache.felix + maven-bundle-plugin + true + + + true + true + + + + + + diff --git a/platform/runtime/core/objects-implementations/route-implementation/route-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/routes-common/common-components.xslt b/platform/runtime/core/objects-implementations/route-implementation/route-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/routes-common/common-components.xslt new file mode 100644 index 00000000..8eda2368 --- /dev/null +++ b/platform/runtime/core/objects-implementations/route-implementation/route-producing/src/main/resources/ru/entaxy/resource/entaxy-file-internal/routes-common/common-components.xslt @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + generated from 'set-destination' + + + + + + + + + + + + + + + + + + + + generated from 'default-destination' + + + ${headers.ENTAXY_Destination} == null + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + false + + + + + + + direct + -vm + + + + seda + vm + + + + + + + + + generated from 'next-route' + + : + + + + + + + + + + + diff --git a/platform/runtime/modules/cxf-echo/src/main/resources/files/xml100kb.txt b/platform/runtime/modules/cxf-echo/src/main/resources/files/xml100kb.txt new file mode 100644 index 00000000..115a5325 --- /dev/null +++ b/platform/runtime/modules/cxf-echo/src/main/resources/files/xml100kb.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/platform/runtime/modules/cxf-echo/src/main/resources/files/xml10kb.txt b/platform/runtime/modules/cxf-echo/src/main/resources/files/xml10kb.txt new file mode 100644 index 00000000..ffffae10 --- /dev/null +++ b/platform/runtime/modules/cxf-echo/src/main/resources/files/xml10kb.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/platform/runtime/modules/cxf-echo/src/main/resources/files/xml1kb.txt b/platform/runtime/modules/cxf-echo/src/main/resources/files/xml1kb.txt new file mode 100644 index 00000000..75881f0f --- /dev/null +++ b/platform/runtime/modules/cxf-echo/src/main/resources/files/xml1kb.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/platform/src/main/features/TO_FIX.txt b/platform/src/main/features/TO_FIX.txt new file mode 100644 index 00000000..06ec3b89 --- /dev/null +++ b/platform/src/main/features/TO_FIX.txt @@ -0,0 +1,3 @@ +[entaxy-artifact-management/1.8.3, entaxy-platform-core/1.8.3, entaxy-blueprint-generator/1.8.3, entaxy-object-producing/1.8.3, generator/1.8.3, objects-base/1.8.3, entaxy-management/1.8.3, entaxy-datasources-initializer/1.8.3, entaxy-platform-base/1.8.3] + +[entaxy-artifact-management/1.8.3, entaxy-platform-core/1.8.3, entaxy-object-producing/1.8.3, generator/1.8.3, objects-base/1.8.3, entaxy-management/1.8.3, entaxy-datasources-initializer/1.8.3, entaxy-init-manager/1.8.3, entaxy-platform-base/1.8.3] \ No newline at end of file diff --git a/platform/src/main/features/UPDATE_PLAN.txt b/platform/src/main/features/UPDATE_PLAN.txt new file mode 100644 index 00000000..9cf17a28 --- /dev/null +++ b/platform/src/main/features/UPDATE_PLAN.txt @@ -0,0 +1,17 @@ +repo-add entaxy-underlying-features-1.8.3 + feature:install -r -v -u entaxy-underlying-configuration/1.8.3 +repo-add mvn:ru.entaxy.esb/platform/1.8.3/xml/basics + feature:install -r -v -u entaxy-karaf-basic/1.8.3 + feature:install -r -v -u entaxy-karaf-runtime/1.8.3 +repo-add mvn:ru.entaxy.esb/platform/1.8.3/xml/legacy + feature:install -r -v -u entaxy-legacy/1.8.3 +repo-add mvn:ru.entaxy.esb.platform.runtime/base/1.8.3/xml/support + feature:install -r -v -u base-support/1.8.3 + feature:install -r -v -u generator/1.8.3 +repo-add mvn:ru.entaxy.esb.platform.runtime/base/1.8.3/xml/features + feature:install -r -v -u entaxy-platform-base/1.8.3 +repo-add mvn:ru.entaxy.esb.platform.runtime/core/1.8.3/xml/features + feature:install -r -v -u entaxy-platform-core/1.8.3 +repo-add mvn:ru.entaxy.esb/platform/1.8.3/xml/features + feature:install -r -v -u entaxy-platform/1.8.3 + \ No newline at end of file diff --git a/platform/src/main/features/basics.xml b/platform/src/main/features/basics.xml new file mode 100644 index 00000000..98d4985f --- /dev/null +++ b/platform/src/main/features/basics.xml @@ -0,0 +1,139 @@ + + + + + + mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features + mvn:org.apache.activemq/artemis-features/${activemq.version}/xml/features + mvn:org.hibernate/hibernate-osgi/${hibernate.version}/xml/karaf + mvn:org.apache.karaf.cellar/apache-karaf-cellar/${cellar.version}/xml/features + mvn:org.apache.ignite/ignite-osgi-karaf/${ignite.version}/xml/features + mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features + mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.4/xml/features + mvn:org.apache.karaf.features/spring/4.2.9/xml/features + mvn:org.apache.karaf.cave/apache-karaf-cave/${cave.version}/xml/features + + + mvn:ru.entaxy.esb.underlying/entaxy-underlying-features/${project.version}/xml/features + + + + entaxy-underlying-configuration + wrap + + shell + feature + jaas + ssh + management + bundle + config + deployer + diagnostic + feature + instance + kar + log + package + service + system + + + + entaxy-underlying-configuration + entaxy-karaf-basic + scheduler + eventadmin + aries-blueprint + + entaxy-karaf-healthcheck + + cellar + cellar-eventadmin + cxf + + + camel + camel-blueprint + camel-jaxb + camel-cxf + camel-amqp + camel-core + camel-http + + hibernate + jdbc + pax-jdbc-pool-dbcp2 + jndi + + camel-eventadmin + camel-quartz + camel-jsonpath + camel-gson + camel-ognl + + entaxy-karaf-commons-support + entaxy-karaf-liquibase-support + + entaxy-karaf-artemis-jms-support + artemis-jms-client + camel-jms + + + + spring + spring-tx + spring-jdbc + jpa + + + ignite-core + entaxy-karaf-ignite-support + camel-ignite + camel-sql + + entaxy-karaf-jaxb-support + + cave-repository + cave-repository-api + + wrapper + shell-compat + camel-jpa + camel-jaxb + camel-base64 + camel-zip-deflater + camel-zipfile + entaxy-freemarker-support + + + + mvn:org.freemarker/freemarker/${freemarker.version} + + + + diff --git a/platform/src/main/features/legacy.xml b/platform/src/main/features/legacy.xml new file mode 100644 index 00000000..acac9d4a --- /dev/null +++ b/platform/src/main/features/legacy.xml @@ -0,0 +1,52 @@ + + + + + + mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features + mvn:org.apache.activemq/artemis-features/${activemq.version}/xml/features + mvn:org.hibernate/hibernate-osgi/${hibernate.version}/xml/karaf + mvn:org.apache.karaf.cellar/apache-karaf-cellar/${cellar.version}/xml/features + mvn:org.apache.ignite/ignite-osgi-karaf/${ignite.version}/xml/features + mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features + mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.4/xml/features + mvn:org.apache.karaf.features/spring/4.2.9/xml/features + mvn:org.apache.karaf.cave/apache-karaf-cave/${cave.version}/xml/features + + + mvn:ru.entaxy.esb.underlying/entaxy-underlying-features/${project.version}/xml/features + + + mvn:ru.entaxy.esb.system/system-parent/${project.version}/xml/basics + + + entaxy-karaf-basic + entaxy-karaf-runtime + + mvn:ru.entaxy.esb.system/system-parent/${project.version}/cfg/ru.entaxy.esb + + entaxy-legacy-main + + + diff --git a/platform/src/main/scripts/generated/fragments.xml b/platform/src/main/scripts/generated/fragments.xml new file mode 100644 index 00000000..ee0dbcdf --- /dev/null +++ b/platform/src/main/scripts/generated/fragments.xml @@ -0,0 +1,5 @@ + + + mvn:ru.entaxy.esb/platform/1.8.3/install/entaxy-platform + + \ No newline at end of file diff --git a/platform/src/update/descriptor/descriptor.xml b/platform/src/update/descriptor/descriptor.xml new file mode 100644 index 00000000..1b172f64 --- /dev/null +++ b/platform/src/update/descriptor/descriptor.xml @@ -0,0 +1,130 @@ + + + + ${project.artifactId} + 1.8.1,1.8.2 + entaxy-platform + + + + ${project.groupId}/${project.artifactId}/${project.version}/kar/basics + ${project.groupId}/${project.artifactId}/${project.version}/kar/features + ${project.groupId}/${project.artifactId}/${project.version}/kar/legacy + ${project.groupId}/${project.artifactId}/${project.version}/kar/update + + ru.entaxy.esb.underlying/entaxy-underlying-features/${project.version}/kar/features + ru.entaxy.esb.underlying/entaxy-underlying-features/${project.version}/kar/replacements + + ru.entaxy.esb.platform.runtime/base/${project.version}/kar/features + ru.entaxy.esb.platform.runtime/base/${project.version}/kar/support + + ru.entaxy.esb.platform.runtime/core/${project.version}/kar/features + + ru.entaxy.esb.platform.runtime/modules/${project.version}/kar/features + + ru.entaxy.esb.platform.runtime.modules/uniform-service/${project.version}/kar/features + + + + + + + true + mvn:ru.entaxy.esb/platform/${_version}/xml/basics + entaxy-karaf-basic + 10 + + + true + mvn:ru.entaxy.esb/platform/${_version}/xml/basics + entaxy-karaf-runtime + + + true + mvn:ru.entaxy.esb/platform/${_version}/xml/legacy + entaxy-legacy + + + + + + + true + mvn:ru.entaxy.esb.underlying/entaxy-underlying-features/${_version}/xml/features + entaxy-underlying-configuration + + + true + mvn:ru.entaxy.esb/platform/${_version}/xml/basics + entaxy-karaf-basic + + + true + mvn:ru.entaxy.esb/platform/${_version}/xml/basics + entaxy-karaf-runtime + + + true + mvn:ru.entaxy.esb/platform/${_version}/xml/legacy + entaxy-legacy + + + true + mvn:ru.entaxy.esb.platform.runtime/base/${_version}/xml/support + base-support + + + true + mvn:ru.entaxy.esb.platform.runtime/base/${_version}/xml/support + generator + + + true + mvn:ru.entaxy.esb.platform.runtime/base/${_version}/xml/features + entaxy-platform-base + + + create + ${karafEtc}/${mvnCfg} + false + + + true + mvn:ru.entaxy.esb.platform.runtime/core/${_version}/xml/features + entaxy-platform-core + + + restore + ${karafEtc}/${mvnCfg} + + + true + mvn:ru.entaxy.esb/platform/${_version}/xml/features + entaxy-platform + + + clean + ${karafEtc}/${mvnCfg} + + + + + \ No newline at end of file diff --git a/platform/src/update/features/update.xml b/platform/src/update/features/update.xml new file mode 100644 index 00000000..fc0b1d64 --- /dev/null +++ b/platform/src/update/features/update.xml @@ -0,0 +1,48 @@ + + + + + + + + mvn:ru.entaxy.esb/platform/1.8.3/update/entaxy-platform + + + mvn:ru.entaxy.esb/platform/1.8.3/update/entaxy-platform.1.8.1 + + + + mvn:ru.entaxy.esb/platform/1.8.3/update/entaxy-platform.1.8.2 + + + + mvn:ru.entaxy.esb/platform/1.8.3/update/entaxy-platform.1.8 + + + + mvn:ru.entaxy.esb/platform/1.8.3/update/entaxy-platform.1 + + + + diff --git a/platform/src/update/scripts/entaxy-platform.1.8.1.update b/platform/src/update/scripts/entaxy-platform.1.8.1.update new file mode 100644 index 00000000..2bf7b2f8 --- /dev/null +++ b/platform/src/update/scripts/entaxy-platform.1.8.1.update @@ -0,0 +1 @@ +echo "entaxy-platform.1.8.1.update" \ No newline at end of file diff --git a/platform/src/update/scripts/entaxy-platform.1.8.2.update b/platform/src/update/scripts/entaxy-platform.1.8.2.update new file mode 100644 index 00000000..894dda5e --- /dev/null +++ b/platform/src/update/scripts/entaxy-platform.1.8.2.update @@ -0,0 +1,43 @@ +_version=1.8.3 + +karafRoot = ((($.context bundle) loadClass java.lang.System) getProperty 'karaf.home') +cd $karafRoot + +source scripts/update/utils +source scripts/update/operations +source scripts/update/executor + +karafEtc = ((($.context bundle) loadClass java.lang.System) getProperty 'karaf.etc') +mvnCfg = "org.ops4j.pax.url.mvn.cfg" + + +# BEGIN PLAN + +${platform.1.8.2.plan} + +#END PLAN + +initManagerPid = "ru.entaxy.esb.initializer" +skipAllProp = "skip.all" + +echo "*****" +echo "** Installing updates with version ${_version}" +echo "*****" + +echo +# disable all initializations during updates +config:edit $initManagerPid +config:property-set "${skipAllProp}" "true" +config:update +echo "\>\> Initializers set to be skipped during update" + +__EXEC_PLAN $installPlan + +# enable all initializations during updates +config:edit $initManagerPid +config:property-set "${skipAllProp}" "false" +config:update + +echo +echo "\>\> Initializers restored" + diff --git a/platform/src/update/scripts/entaxy-platform.1.8.update b/platform/src/update/scripts/entaxy-platform.1.8.update new file mode 100644 index 00000000..06b4694e --- /dev/null +++ b/platform/src/update/scripts/entaxy-platform.1.8.update @@ -0,0 +1 @@ +echo "entaxy-platform.1.8.update" \ No newline at end of file diff --git a/platform/src/update/scripts/entaxy-platform.1.update b/platform/src/update/scripts/entaxy-platform.1.update new file mode 100644 index 00000000..3446adbb --- /dev/null +++ b/platform/src/update/scripts/entaxy-platform.1.update @@ -0,0 +1 @@ +echo "entaxy-platform.1.update" \ No newline at end of file diff --git a/platform/src/update/scripts/entaxy-platform.update b/platform/src/update/scripts/entaxy-platform.update new file mode 100644 index 00000000..6c15ef11 --- /dev/null +++ b/platform/src/update/scripts/entaxy-platform.update @@ -0,0 +1 @@ +echo "entaxy-platform.update" \ No newline at end of file diff --git a/platform/src/update/scripts/generated/fragments.xml b/platform/src/update/scripts/generated/fragments.xml new file mode 100644 index 00000000..04f5f301 --- /dev/null +++ b/platform/src/update/scripts/generated/fragments.xml @@ -0,0 +1,40 @@ + + + + mvn:ru.entaxy.esb/platform/1.8.3-SNAPSHOT/update/entaxy-platform.1.8.1 + + + + mvn:ru.entaxy.esb/platform/1.8.3-SNAPSHOT/update/entaxy-platform.1.8.2 + + + + mvn:ru.entaxy.esb/platform/1.8.3-SNAPSHOT/update/entaxy-platform.1.8 + + + + mvn:ru.entaxy.esb/platform/1.8.3-SNAPSHOT/update/entaxy-platform.1 + + + + mvn:ru.entaxy.esb/platform/1.8.3-SNAPSHOT/update/entaxy-platform + + diff --git a/platform/src/update/tmp/plan.backup b/platform/src/update/tmp/plan.backup new file mode 100644 index 00000000..1ff54c43 --- /dev/null +++ b/platform/src/update/tmp/plan.backup @@ -0,0 +1,24 @@ + +installPlan = new java.util.ArrayList +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb.underlying/entaxy-underlying-features/${_version}/xml/features" feature="entaxy-underlying-configuration" reboot="force" sleep=10] +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb/platform/${_version}/xml/basics" feature="entaxy-karaf-basic" reboot="false"] +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb/platform/${_version}/xml/basics" feature="entaxy-karaf-runtime" reboot="false"] +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb/platform/${_version}/xml/legacy" feature="entaxy-legacy" reboot="false"] +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb.platform.runtime/base/${_version}/xml/support" feature="base-support" reboot="false"] +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb.platform.runtime/base/${_version}/xml/support" feature="generator" reboot="false"] +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb.platform.runtime/base/${_version}/xml/features" feature="entaxy-platform-base" reboot="false"] + + +# need this due to issue of loosing etc/org.ops4j.pax.url.mvn.cfg +# while updating artifact-manager +$installPlan add [operation=backup action=create source="${karafEtc}/${mvnCfg}" overwrite=(__FALSE__)] + +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb.platform.runtime/core/${_version}/xml/features" feature="entaxy-platform-core" reboot="false"] + +$installPlan add [operation=backup action=restore source="${karafEtc}/${mvnCfg}"] + +$installPlan add [operation=feature upgrade=(__TRUE__) repo="mvn:ru.entaxy.esb/platform/${_version}/xml/features" feature="entaxy-platform" reboot="false" sleep=10] + +$installPlan add [operation=backup action=clean source="${karafEtc}/${mvnCfg}"] + +#$installPlan add [operation=empty reboot="false"] \ No newline at end of file diff --git a/system/src/main/features/basics.xml b/system/src/main/features/basics.xml new file mode 100644 index 00000000..e530a769 --- /dev/null +++ b/system/src/main/features/basics.xml @@ -0,0 +1,64 @@ + + + + + + mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features + mvn:org.apache.activemq/artemis-features/${activemq.version}/xml/features + mvn:org.hibernate/hibernate-osgi/${hibernate.version}/xml/karaf + mvn:org.apache.karaf.cellar/apache-karaf-cellar/${cellar.version}/xml/features + mvn:org.apache.ignite/ignite-osgi-karaf/${ignite.version}/xml/features + mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features + mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.4/xml/features + mvn:org.apache.karaf.features/spring/4.2.9/xml/features + + + + mvn:ru.entaxy.esb.underlying/entaxy-underlying-features/${project.version}/xml/features + + + + entaxy-karaf-basic + entaxy-karaf-runtime + entaxy-legacy-system + + + + entaxy-karaf-basic + entaxy-karaf-runtime + entaxy-legacy-esb-config + + mvn:ru.entaxy.esb.system/system-parent/${project.version}/cfg/org.apache.felix.hc.generalchecks.BundlesStartedCheck-system + + mvn:ru.entaxy.esb.system.commons/system-commons/${project.version} + mvn:ru.entaxy.esb.system.core/template/${project.version} + + + + + mvn:ru.entaxy.esb.system/system-parent/${project.version}/cfg/ru.entaxy.esb + + + + diff --git a/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-adapter-icon.png b/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-adapter-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d68d0f82c12ae1edb2ad695941a7fc753158deb5 GIT binary patch literal 759 zcmVpF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10)$CK zK~zYI)s@SO&0!eFKi~KFn@K`8!cYct%;cJt$mM4tHtbxoVxGP&`IO&y_WU$7-2ea{d{j^^-5&*=pvq5_zbFGlK>% znd5R&O3&3)K`HV{FbeBS>8&=&bt$*pW52aj)O|_pRd-%Z2SKNS+6)4!7d!=6Me_`k zKdP~2rok6LD@^Fd24+{nzZi6C!3sHBiL9^A4|c4!w|xK`>~#;YF)JB>$xImdM*n?) zf|}Qu3;PnE?vR<$Cb`5lwHxdmEuEeaY} zX&nX|&iZ2<2Cilr0Bh|{nuOv8iEV;UV;b~^^fc%~1=bs!?HvB9e~NXb^jZ{tvCnaA9VgiXPnyt#oI~AZf0@ssimP#It5&;#4=k1(5c)a7jf2%W&GhD p2(_;Z>G7KH!QYDi|0a*S!A~pt3HccQKC=J-002ovPDHLkV1h_9R}}yN literal 0 HcmV?d00001 diff --git a/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-connections-icon.png b/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-connections-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..05245d4c357a2370bf6dee7a7af6a44a4d38fcea GIT binary patch literal 878 zcmV-!1CjiRP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10{cls zK~zYIwUte1oK+NtpL4&-q)D49XxzA}nJ-LiK*1jbtMl1{Kaho>P(@ILiktYmk&0Sf zX}XXq{^24;7g~+D(ONC0Gi_3e(2Xl=XWAIhg=uU3X_`zk_r5Nij?-kunSprVF1~Z$ z^SfC(E;UllDr zBDvm$pxyVV_-CiGhiq^tIPC?>A^5vD>*Op{d(iJLd?4BTpj|x?-*ie2;GG@=HUL@Y zQuki;SDUPn8dBUcW%0F*Nb+3+Tg+^yncZ|S%8VVhY~O@gREP$j0v-aJ2Tl{LmZVAI zpo=GEY_9sw01HURaJDDqFMPg9vuE?E!TU^_0IU`a$7K9L;Ad1BJ;mDJu3?RC(9xxf zm=r)+dN6Ia9n|APv~!x{KP9Pw9Kjw~a_JoKut{U}eD{A#~lx3;x_uY3#Kb=b0f%`#eUi9h~=i6d!ues@cOL^HnwpDsDy za*@MX(n>) z2YcM$8E^Usn#{qZ4PB9Pm3L&e0WqEm_j|`&9nD{f zFRpL6aJJ}&GdW+}iucb#$oi-&0qA4RMqmgq7uZ@KbDN5%Fuwb@Qoeu|OFz+xX`r^X z=IHspU*)gOxLHo`F2^r;?(A{)D5m*2-~D0JCt6MW8~7|`qr0&?AOHXW07*qoM6N<$ Eg7Au@@c;k- literal 0 HcmV?d00001 diff --git a/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-connectors-icon.png b/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-connectors-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b7d0395d5166952ba515e4f35000eec0dcf529c7 GIT binary patch literal 1031 zcmV+i1o-=jP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H11C&Wb zK~zYI)m2?+Ttyf?-#2$nv?fI%)IOw`?%qw*M5(F&+wR>I3kt!4Z5q)R9|Uc|hl0=- zl@8p}~Tc&DM`Mi5GJv#6d>(ZMaz z^s)H7)ZRf}{G?HQMq<_(9@eORB48m}jl3Y~M?`r1Dfh02njfh+<&?h^jQ>Gp&cT({x&A&*e-8i#?joEGoJDcP39g!j7limJ zh%S6xJLzlKQxhrBmBDd%l7b(92lkc5!MRzzHm^y@JCjsQO|+S{@L z3(-mGYJo-*5IhTk56V#J`On7%M#XO;P_7Cr`Ox$th~820TLFOJ9@wTQ13UBncAmQi z0A(+F0zi8mo8xnFfo9-Q5I+DlsUqOiRRH|}@VRu~(xz2xc@L4fBMbcFy6 zQcx3G=mr4DOXtH*bwr_wN=VKY_o;Jfad;dq>epF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10)k0I zK~zYI?UheRR8bVhf9JkY5|Sp&3JpSL#zL?~N)RpPX;Q18MYgCY2oiT~qBgmZq@ZmQ zNVKS}A#RKoqcesDQ9^+g>Zlb7B_^6RNWJ$?i}~Y_J|`CvL>CUccfRxI`_6s$T~Spw za+wXS{!cUr6bcxSNXRmB8MH~!5|Aa3$F8S059|1wLiuYdNCd*ijp30e-jhWyRcpJ+ z3OuJqMEfkGJ@G*JY(WXCx~j#f+Ltil(SE8cSHt5}Z;PAo$N-^3el=9pe?*p8?Fg3| zb#yvmMXmsK%czXmI(9W7p;lv=>p*l}BN~?aA`uSExXFjm42|_h~|N^g2e$ucB0N~LK*@ACQAWQ1b-aSSKq-$ zfvrnIhbb2TY<@(DX#$%vS%-#woZM*Oy6)!@tk9d=ZZ~gwvYl4)1k(@9g~pV zq!Sl@hli!UNGz`lxR&ik0Do>-%c(*Uf z6$(ToVTDhj1Tp5KXE+UDgw8=LQl_dO5UI2*Qi^uiZn8I*>UsCon2(vag`7Y8yKWaT zwh7-+I1k_<9gXf-TQ)EuRY4cC-JxXmsE*97#d?K;ZV@YLB6k%%mm3k@=lnohr{+n2 zT@0G)J~g@{!|-0zP2P$J!YzWd0N}~I?Tt0%8kCz*CwawDdP_Cf<;O}z8&FEpq4F}_ zNNUNRc3Hl}GMg-CvJO%0Db+0}>-5FXKOMtbE4#^U0`0(q%^GYiR9w+sQOW_t@GPV1 nxp>3?1it1G{(mR`pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H118Ye{ zK~zYIwU$qaRaG3vKi_kolUX7osKhi-GjDVp#xllT(!3eLO$BX?Oa@zox(W%RBx-O~ zZrVjdw99lMA#S1&=FJQw{V^~oY`oKxfwUB9!m=9Qz31Cv-jny9Z*-GiIB?JTet&<@ zJ?CE8=3b)EZn3JLz;vN+%%(?TAX@!Wd?)7Na)KO__>kbW2)_k$R-!VTr5^)KC4EPMJ+(w8 zR1U@Kz-j>D7|}VQlal9cdV~iITYv`z3m^k)ZT>Q@NcvWyVta$p?tr%%g(ZJn512Fc z@+^H#^efmyQCt=5GwhUuK;1@<86G!u1G%K_f_+h31#JyMZ&>=~mOpc*@Q-eA#{2)m<@8~tbY%o~T72{vAo+Qx`0Oj$J&6_2sUp2o)EeK@4 zRNe7?uy@s#Hex<0<>~Q8-L(3iwb-k;q_ceCrm3|0YkLGnI>-xgp}o4P{cli*Mjblc$)cm)Z(qcC6*^PJrK8wXn-S+^lm`N#8-?w?P+UOkN!E zPqS?Ul#}8yq22X)h#Gjx7tY@)!zpckgpgGL0bov*V*1=IA5G=dj(8n;ZKLmmoY<;K z8YfL;i197NcfcRO;Sr}l-Yvim&sKm#HJfv}dA%v=d;M2&&p$Z-0iw>+6rhk(CIA2c M07*qoM6N<$g2Ru^kpKVy literal 0 HcmV?d00001 diff --git a/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-platform-icon.png b/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-platform-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1069633e91386c3b633bac9ae12da0f8767c3edf GIT binary patch literal 754 zcmVpF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10)I(F zK~zYI-IdL6Oi>udf6sewnG^}#khBXQotZXl#KJ=8Ai+i?Y$!H}?!?wgtSzyq5b+0y z1z~}jHv9)9+L`)T(D;a;XsdJ2YhkADWhzLz;H>WXdVcS7?s?BEcV{k}&8hl-0f^I` zvhp2>3y4mE{zS;ZaUPpTeVhEzlcoSk{chn>NTPdN7RL3xw8c@hF_2sWN{zY95xK%zlIV^pTr5*4BI#~Re*2IL-I1cRa`n6Ge9orM z45`pP(30NXh zb&!Xj{}@p6yS3M$a=@iMA=rAH?=a^|2&|KQcTcDuIq4q0(Im(g7^Mr&V4NRxbh=a< z$wUq?pklks_Z#?B2$#2c_0^AS2IIm$58hh}m6;2X0Su{YMNra@Sot@vsa(T}>*y9A ke%=%?7wzA#X#YOoD;!b*@$en|ssI2007*qoM6N<$g0(kYmH+?% literal 0 HcmV?d00001 diff --git a/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-profiles-icon.png b/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-profiles-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c76139322dd9fe6faa6b2fcf365c59b5501ddffb GIT binary patch literal 929 zcmV;S177@zP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H111?EK zK~zYIwU*CsR8z6bS`1Hbw(6rEjJc6g3E@7)u8ugt#&d=$~O+uyIS=7&q#M zg~o*mi5j;WLOZX@SQ7(6By~ESS(us{)4CAFQfA)$x}YAY277SXRo-Me5hjNNHyPcRzU?17Tz@MApqfgOMi>h3`M}hCfjea{m4CO zX6O5STuv;GyGoFRBub1%iHol$e&E#>w$>V_|M8L=s9a&NH;YgB{8-7w*FNRowk)1; z%#S2Kp4^ChvsJSA(s&e~%wp{pIUgRCsBSj24aGF=#J(()-9=_tSe-{PGB@|G%ngIq z+Rl>relhgCaYi@quB6#82w5YOM9CN4bEpCw4(N9uct4HofCawVENPjI6`R#B0KTz& z-x53iKB*hGTY3lJjHv)`ft@le{6>8q+0GT4g=&cQl|${!n5*q%XAGdHq|Ml+p>oZSK2zMiwe zU7zOKRZT|m>1Jv_zogkVw(eP!^LBWJd>ONkfe$;g6>Lj=^ZC!reBul5NOr+HT~4C- zwXOh(^>0tCe^2W@;0!=w8HJjl4*b=bNI>=o1CNOy;8K9MO&sfL5kB|26b=CA0DPMM z7@S)+V;9(YTc<^&TpLks4mdaI3m2Se@p!ZLL3aS;4a>FOMpU1ju>3*idDftdU!XMQ zhZCyRv(;F~UWis5!mlPbmQ|k6Y@K_p`B!2_A*Ak;EY_aEoz#tE?3;|@(^-SE4fQ5I zt|XS^>qFJ_6deRZ4Ioq{~EFbqqU9_Mo5#)8`AJ z=ebVut_s$Ym0RrFM)0RzR%L!e<27W{0RLCE{IB94)wsFDyVUk500000NkvXXu0mjf Dt5dMj literal 0 HcmV?d00001 diff --git a/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-resource-icon.png b/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-resource-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fec53a58b4be19b6fe55e3e0140166e777a2557c GIT binary patch literal 877 zcmV-z1CsoSP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10{Tfr zK~zYIy_QXAT~!o?zjf}dKYbFbP%9WQ81750KLs1qfhD(vs#v9>wF4!J0}-SMBIrzK zf)gi#gQ%#W*oiu@*dIvlYr!JeBGrldUaNuzO@(4LQR2I2IY{1564MvZxJUQwyU$u@ z?Y+3?$~LPRVO7!p4}x?hMMYYDNO-TzhUIDurQq{2md|eY>F-;4^_oGER(HzYzv3g~ z?`C7=hC6(68djnpdava&Sie}T1)|KXM}!AjkLOizv3T3!wY;pq1W>4YYr@b}?yrsm z_ZLa_ZX!-XToz|p1xGZrRe{S};B#w_$50*{SGEb@Xl#rE4dWLDlWhSg_9SqKyFhON z)HHazL;M)109Ph~i9*@+FW6Bq78G^>mvjhdJLh~e=r2o7?blUn3E@CD0I)%U4*?L3 zXm2+3b%Cygz-N`P{vQ80WBD0F?0Q)uKMxRLJ@5vm=qONc0!xML`vA5z8)Fhr%#)Oo zM)PK4AAq7C1C1i`)?Q)tBv9G^0kFA9t2+VmX8m=EN0E1rG{1Qdph&Y_NCN>+(WNj# zn_yXc<u-@MoKd*b2Vb4p-*6}FCkteg-ym6uyF7l_4uigvhm6i1rr*&B?Jydvo64--G2@G z;S0eP0LEV_EGr7P0X$k297fIqj{tM`Nqy5`h^-KS6_nkv6eK0Se00000NkvXXu0mjf DU^j>u literal 0 HcmV?d00001 diff --git a/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-routes-icon.png b/ui/entaxy-hawtio/entaxy-branding-plugin/src/main/webapp/plugin/img/icons/cranberry-red/entaxy-routes-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5e55071498ef945d4f40da49e72c4112833eb4b0 GIT binary patch literal 712 zcmV;(0yq7MP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10#!*w zK~zYI?Ul_-RACgxpXc0Z6e)0F7FfaL%#<{=sut77Tn!g4%1!83%wQgqHn02zZk4r(X&H1U_xE z>~#Ql%iHq3s%ynpB?QT`MzwR$5+Q= zW3eM}*5zwzG8V9AAv;gVc!^*?ob3Tz0frz}p>xNC)Dp}MLYSlRv7(M4UqKz%xXB*d zNbYkEMPE}@1HQzn2Oy-Dd`(S$b2u6)x(&gHw=fbi)4HjHMizMaYbKo*v`!2`Cu-P_ zW*%(L$z3(@Kq;EOkO=r43)!85EqwH&N?YQljxt*`L$T2w(5YO~>=*zHv5?*gq>@=ZY1GIQfHdkE@ABEW#XaWMkYX{>Y% zu~2O{Toh~()Vy;#-=mr5i2%UWlTHRYJ?QR{YpF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10>nu~ zK~zYI)t1d`oK+OYf6sZ}F{RdzQYdjFf|*WJL9{q0Z3=PBTeDTfkbE?ecDn67pVj%rhEn2VlwEmDq`b<_O19a$)UiRI z!LtV(ul@Uj^PCK|lqV9J<|Y@dyYE)|R&BNxnT`|FB`(mz+RDq@N-^*HbM$ z3I2Z2CA-d27`ZAWtx$BImHo;_27WOwl^zHF=#%1YvBub@z5-cp*xe5b{%*Iu11N0} z3|0OA1nN86%p;u&;v|4zJr%s4MX?CnH7dQa)-~c#A|1Mx>1_&{W5o>;G&P^Y&vS%! z0c%EU 1) return; + // By default, don't allow completion when something is selected. + // A hint function can have a `supportsSelection` property to + // indicate that it can handle selections. + if (this.somethingSelected()) { + if (!options.hint.supportsSelection) return; + // Don't try with cross-line selections + for (var i = 0; i < selections.length; i++) + if (selections[i].head.line != selections[i].anchor.line) return; + } + + if (this.state.completionActive) this.state.completionActive.close(); + var completion = this.state.completionActive = new Completion(this, options); + if (!completion.options.hint) return; + + CodeMirror.signal(this, "startCompletion", this); + completion.update(true); + }); + + function Completion(cm, options) { + this.cm = cm; + this.options = options; + this.widget = null; + this.debounce = 0; + this.tick = 0; + this.startPos = this.cm.getCursor("start"); + this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length; + + var self = this; + cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); + } + + var requestAnimationFrame = window.requestAnimationFrame || function(fn) { + return setTimeout(fn, 1000/60); + }; + var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; + + Completion.prototype = { + close: function() { + if (!this.active()) return; + this.cm.state.completionActive = null; + this.tick = null; + this.cm.off("cursorActivity", this.activityFunc); + + if (this.widget && this.data) CodeMirror.signal(this.data, "close"); + if (this.widget) this.widget.close(); + CodeMirror.signal(this.cm, "endCompletion", this.cm); + }, + + active: function() { + return this.cm.state.completionActive == this; + }, + + pick: function(data, i) { + var completion = data.list[i]; + if (completion.hint) completion.hint(this.cm, data, completion); + else this.cm.replaceRange(getText(completion), completion.from || data.from, + completion.to || data.to, "complete"); + CodeMirror.signal(data, "pick", completion); + this.close(); + }, + + cursorActivity: function() { + if (this.debounce) { + cancelAnimationFrame(this.debounce); + this.debounce = 0; + } + + var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line); + if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || + pos.ch < this.startPos.ch || this.cm.somethingSelected() || + (pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { + this.close(); + } else { + var self = this; + this.debounce = requestAnimationFrame(function() {self.update();}); + if (this.widget) this.widget.disable(); + } + }, + + update: function(first) { + if (this.tick == null) return + var self = this, myTick = ++this.tick + fetchHints(this.options.hint, this.cm, this.options, function(data) { + if (self.tick == myTick) self.finishUpdate(data, first) + }) + }, + + finishUpdate: function(data, first) { + if (this.data) CodeMirror.signal(this.data, "update"); + + var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle); + if (this.widget) this.widget.close(); + + this.data = data; + + if (data && data.list.length) { + if (picked && data.list.length == 1) { + this.pick(data, 0); + } else { + this.widget = new Widget(this, data); + CodeMirror.signal(data, "shown"); + } + } + } + }; + + function parseOptions(cm, pos, options) { + var editor = cm.options.hintOptions; + var out = {}; + for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; + if (editor) for (var prop in editor) + if (editor[prop] !== undefined) out[prop] = editor[prop]; + if (options) for (var prop in options) + if (options[prop] !== undefined) out[prop] = options[prop]; + if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos) + return out; + } + + function getText(completion) { + if (typeof completion == "string") return completion; + else return completion.text; + } + + function buildKeyMap(completion, handle) { + var baseMap = { + Up: function() {handle.moveFocus(-1);}, + Down: function() {handle.moveFocus(1);}, + PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);}, + PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);}, + Home: function() {handle.setFocus(0);}, + End: function() {handle.setFocus(handle.length - 1);}, + Enter: handle.pick, + Tab: handle.pick, + Esc: handle.close + }; + var custom = completion.options.customKeys; + var ourMap = custom ? {} : baseMap; + function addBinding(key, val) { + var bound; + if (typeof val != "string") + bound = function(cm) { return val(cm, handle); }; + // This mechanism is deprecated + else if (baseMap.hasOwnProperty(val)) + bound = baseMap[val]; + else + bound = val; + ourMap[key] = bound; + } + if (custom) + for (var key in custom) if (custom.hasOwnProperty(key)) + addBinding(key, custom[key]); + var extra = completion.options.extraKeys; + if (extra) + for (var key in extra) if (extra.hasOwnProperty(key)) + addBinding(key, extra[key]); + return ourMap; + } + + function getHintElement(hintsElement, el) { + while (el && el != hintsElement) { + if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; + el = el.parentNode; + } + } + + function Widget(completion, data) { + this.completion = completion; + this.data = data; + this.picked = false; + var widget = this, cm = completion.cm; + + var hints = this.hints = document.createElement("ul"); + hints.className = "CodeMirror-hints"; + this.selectedHint = data.selectedHint || 0; + + var completions = data.list; + for (var i = 0; i < completions.length; ++i) { + var elt = hints.appendChild(document.createElement("li")), cur = completions[i]; + var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); + if (cur.className != null) className = cur.className + " " + className; + elt.className = className; + if (cur.render) cur.render(elt, data, cur); + else elt.appendChild(document.createTextNode(cur.displayText || getText(cur))); + elt.hintId = i; + } + + var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); + var left = pos.left, top = pos.bottom, below = true; + hints.style.left = left + "px"; + hints.style.top = top + "px"; + // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. + var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); + var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); + (completion.options.container || document.body).appendChild(hints); + var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; + var scrolls = hints.scrollHeight > hints.clientHeight + 1 + var startScroll = cm.getScrollInfo(); + + if (overlapY > 0) { + var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); + if (curTop - height > 0) { // Fits above cursor + hints.style.top = (top = pos.top - height) + "px"; + below = false; + } else if (height > winH) { + hints.style.height = (winH - 5) + "px"; + hints.style.top = (top = pos.bottom - box.top) + "px"; + var cursor = cm.getCursor(); + if (data.from.ch != cursor.ch) { + pos = cm.cursorCoords(cursor); + hints.style.left = (left = pos.left) + "px"; + box = hints.getBoundingClientRect(); + } + } + } + var overlapX = box.right - winW; + if (overlapX > 0) { + if (box.right - box.left > winW) { + hints.style.width = (winW - 5) + "px"; + overlapX -= (box.right - box.left) - winW; + } + hints.style.left = (left = pos.left - overlapX) + "px"; + } + if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling) + node.style.paddingRight = cm.display.nativeBarWidth + "px" + + cm.addKeyMap(this.keyMap = buildKeyMap(completion, { + moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); }, + setFocus: function(n) { widget.changeActive(n); }, + menuSize: function() { return widget.screenAmount(); }, + length: completions.length, + close: function() { completion.close(); }, + pick: function() { widget.pick(); }, + data: data + })); + + if (completion.options.closeOnUnfocus) { + var closingOnBlur; + cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); }); + cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); }); + } + + cm.on("scroll", this.onScroll = function() { + var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect(); + var newTop = top + startScroll.top - curScroll.top; + var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop); + if (!below) point += hints.offsetHeight; + if (point <= editor.top || point >= editor.bottom) return completion.close(); + hints.style.top = newTop + "px"; + hints.style.left = (left + startScroll.left - curScroll.left) + "px"; + }); + + CodeMirror.on(hints, "dblclick", function(e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();} + }); + + CodeMirror.on(hints, "click", function(e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) { + widget.changeActive(t.hintId); + if (completion.options.completeOnSingleClick) widget.pick(); + } + }); + + CodeMirror.on(hints, "mousedown", function() { + setTimeout(function(){cm.focus();}, 20); + }); + + CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]); + return true; + } + + Widget.prototype = { + close: function() { + if (this.completion.widget != this) return; + this.completion.widget = null; + this.hints.parentNode.removeChild(this.hints); + this.completion.cm.removeKeyMap(this.keyMap); + + var cm = this.completion.cm; + if (this.completion.options.closeOnUnfocus) { + cm.off("blur", this.onBlur); + cm.off("focus", this.onFocus); + } + cm.off("scroll", this.onScroll); + }, + + disable: function() { + this.completion.cm.removeKeyMap(this.keyMap); + var widget = this; + this.keyMap = {Enter: function() { widget.picked = true; }}; + this.completion.cm.addKeyMap(this.keyMap); + }, + + pick: function() { + this.completion.pick(this.data, this.selectedHint); + }, + + changeActive: function(i, avoidWrap) { + if (i >= this.data.list.length) + i = avoidWrap ? this.data.list.length - 1 : 0; + else if (i < 0) + i = avoidWrap ? 0 : this.data.list.length - 1; + if (this.selectedHint == i) return; + var node = this.hints.childNodes[this.selectedHint]; + node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); + node = this.hints.childNodes[this.selectedHint = i]; + node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; + if (node.offsetTop < this.hints.scrollTop) + this.hints.scrollTop = node.offsetTop - 3; + else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) + this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3; + CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); + }, + + screenAmount: function() { + return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; + } + }; + + function applicableHelpers(cm, helpers) { + if (!cm.somethingSelected()) return helpers + var result = [] + for (var i = 0; i < helpers.length; i++) + if (helpers[i].supportsSelection) result.push(helpers[i]) + return result + } + + function fetchHints(hint, cm, options, callback) { + if (hint.async) { + hint(cm, callback, options) + } else { + var result = hint(cm, options) + if (result && result.then) result.then(callback) + else callback(result) + } + } + + function resolveAutoHints(cm, pos) { + var helpers = cm.getHelpers(pos, "hint"), words + if (helpers.length) { + var resolved = function(cm, callback, options) { + var app = applicableHelpers(cm, helpers); + function run(i) { + if (i == app.length) return callback(null) + fetchHints(app[i], cm, options, function(result) { + if (result && result.list.length > 0) callback(result) + else run(i + 1) + }) + } + run(0) + } + resolved.async = true + resolved.supportsSelection = true + return resolved + } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { + return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) } + } else if (CodeMirror.hint.anyword) { + return function(cm, options) { return CodeMirror.hint.anyword(cm, options) } + } else { + return function() {} + } + } + + CodeMirror.registerHelper("hint", "auto", { + resolve: resolveAutoHints + }); + + CodeMirror.registerHelper("hint", "fromList", function(cm, options) { + var cur = cm.getCursor(), token = cm.getTokenAt(cur); + var to = CodeMirror.Pos(cur.line, token.end); + if (token.string && /\w/.test(token.string[token.string.length - 1])) { + var term = token.string, from = CodeMirror.Pos(cur.line, token.start); + } else { + var term = "", from = to; + } + var found = []; + for (var i = 0; i < options.words.length; i++) { + var word = options.words[i]; + if (word.slice(0, term.length) == term) + found.push(word); + } + + if (found.length) return {list: found, from: from, to: to}; + }); + + CodeMirror.commands.autocomplete = CodeMirror.showHint; + + var defaultOptions = { + hint: CodeMirror.hint.auto, + completeSingle: true, + alignWithWord: true, + closeCharacters: /[\s()\[\]{};:>,]/, + closeOnUnfocus: true, + completeOnSingleClick: true, + container: null, + customKeys: null, + extraKeys: null + }; + + CodeMirror.defineOption("hintOptions", null); +}); diff --git a/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/codemirror/addon/hint/xml-hint.js b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/codemirror/addon/hint/xml-hint.js new file mode 100644 index 00000000..5ecc04ee --- /dev/null +++ b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/codemirror/addon/hint/xml-hint.js @@ -0,0 +1,130 @@ +/*- + * ~~~~~~licensing~~~~~~ + * entaxy-management-plugin + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ + +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var Pos = CodeMirror.Pos; + + function getHints(cm, options) { + var tags = options && options.schemaInfo; + var quote = (options && options.quoteChar) || '"'; + if (!tags) return; + var cur = cm.getCursor(), token = cm.getTokenAt(cur); + if (token.end > cur.ch) { + token.end = cur.ch; + token.string = token.string.slice(0, cur.ch - token.start); + } + var inner = CodeMirror.innerMode(cm.getMode(), token.state); + if (inner.mode.name != "xml") return; + var result = [], replaceToken = false, prefix; + var tag = /\btag\b/.test(token.type) && !/>$/.test(token.string); + var tagName = tag && /^\w/.test(token.string), tagStart; + + if (tagName) { + var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start); + var tagType = /<\/$/.test(before) ? "close" : /<$/.test(before) ? "open" : null; + if (tagType) tagStart = token.start - (tagType == "close" ? 2 : 1); + } else if (tag && token.string == "<") { + tagType = "open"; + } else if (tag && token.string == ""); + } else { + // Attribute completion + var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs; + var globalAttrs = tags["!attrs"]; + if (!attrs && !globalAttrs) return; + if (!attrs) { + attrs = globalAttrs; + } else if (globalAttrs) { // Combine tag-local and global attributes + var set = {}; + for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm]; + for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm]; + attrs = set; + } + if (token.type == "string" || token.string == "=") { // A value + var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)), + Pos(cur.line, token.type == "string" ? token.start : token.end)); + var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues; + if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return; + if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget + if (token.type == "string") { + prefix = token.string; + var n = 0; + if (/['"]/.test(token.string.charAt(0))) { + quote = token.string.charAt(0); + prefix = token.string.slice(1); + n++; + } + var len = token.string.length; + if (/['"]/.test(token.string.charAt(len - 1))) { + quote = token.string.charAt(len - 1); + prefix = token.string.substr(n, len - 2); + } + replaceToken = true; + } + for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].lastIndexOf(prefix, 0) == 0) + result.push(quote + atValues[i] + quote); + } else { // An attribute name + if (token.type == "attribute") { + prefix = token.string; + replaceToken = true; + } + for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.lastIndexOf(prefix, 0) == 0)) + result.push(attr); + } + } + return { + list: result, + from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur, + to: replaceToken ? Pos(cur.line, token.end) : cur + }; + } + + CodeMirror.registerHelper("hint", "xml", getHints); +}); diff --git a/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/camelBlueprintTagsHelper.js b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/camelBlueprintTagsHelper.js new file mode 100644 index 00000000..385d5f12 --- /dev/null +++ b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/camelBlueprintTagsHelper.js @@ -0,0 +1,30 @@ +/*- + * ~~~~~~licensing~~~~~~ + * entaxy-management-plugin + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +var Entaxy; +(function (Entaxy) { + + function getCamelBlueprintTags() { + return JSON.parse(camelBlueprintTags); + } + Entaxy.getCamelBlueprintTags = getCamelBlueprintTags; + + let camelBlueprintTags = '{"!top":["route"],"aggregate":{"attrs":{"parallelProcessing":null,"optimisticLocking":null,"executorServiceRef":null,"timeoutCheckerExecutorServiceRef":null,"aggregationRepositoryRef":null,"strategyRef":null,"strategyMethodName":null,"strategyMethodAllowNull":null,"completionSize":null,"completionInterval":null,"completionTimeout":null,"completionTimeoutCheckerInterval":null,"completionFromBatchConsumer":null,"completionOnNewCorrelationGroup":null,"eagerCheckCompletion":null,"ignoreInvalidCorrelationKeys":null,"closeCorrelationKeyOnCompletion":null,"discardOnCompletionTimeout":null,"discardOnAggregationFailure":null,"forceCompletionOnStop":null,"completeAllOnStop":null,"aggregateControllerRef":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","correlationExpression","completionPredicate","completionTimeoutExpression","completionSizeExpression","optimisticLockRetryPolicy","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"correlationExpression":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"completionPredicate":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"completionTimeoutExpression":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"completionSizeExpression":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"any23":{"attrs":{"outputFormat":null,"baseURI":null,"contentTypeHeader":null,"id":null},"children":["configuration","extractors"]},"configuration":{"attrs":{"key":null,"value":null}},"extractors":{},"apiKey":{"attrs":{"name":null,"inHeader":null,"inQuery":null,"key":null,"description":null}},"asn1":{"attrs":{"usingIterator":null,"clazzName":null,"contentTypeHeader":null,"id":null}},"avro":{"attrs":{"instanceClassName":null,"contentTypeHeader":null,"id":null}},"barcode":{"attrs":{"width":null,"height":null,"imageType":null,"barcodeFormat":null,"contentTypeHeader":null,"id":null}},"base64":{"attrs":{"lineLength":null,"lineSeparator":null,"urlSafe":null,"contentTypeHeader":null,"id":null}},"basicAuth":{"attrs":{"key":null,"description":null}},"batch-config":{"attrs":{"batchSize":null,"batchTimeout":null,"allowDuplicates":null,"reverse":null,"ignoreInvalidExchanges":null}},"bean":{"attrs":{"ref":null,"method":null,"beanType":null,"cache":null,"scope":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"beanio":{"attrs":{"mapping":null,"streamName":null,"ignoreUnidentifiedRecords":null,"ignoreUnexpectedRecords":null,"ignoreInvalidRecords":null,"encoding":null,"beanReaderErrorHandlerType":null,"unmarshalSingleObject":null,"contentTypeHeader":null,"id":null}},"bindy":{"attrs":{"type":null,"classType":null,"locale":null,"unwrapSingleInstance":null,"allowEmptyStream":null,"contentTypeHeader":null,"id":null}},"blacklistServiceFilter":{"attrs":{"id":null},"children":["properties","servers"]},"properties":{"attrs":{"key":null,"value":null}},"servers":{},"cachingServiceDiscovery":{"attrs":{"timeout":null,"units":null,"id":null},"children":["properties","consulServiceDiscovery","dnsServiceDiscovery","etcdServiceDiscovery","kubernetesServiceDiscovery","combinedServiceDiscovery","staticServiceDiscovery"]},"camelContext":{"attrs":{"depends-on":null,"trace":null,"backlogTrace":null,"tracePattern":null,"debug":null,"messageHistory":null,"logMask":null,"logExhaustedMessageBody":null,"streamCache":null,"delayer":null,"errorHandlerRef":null,"autoStartup":null,"useMDCLogging":null,"mdcLoggingKeysPattern":null,"useDataType":null,"useBreadcrumb":null,"allowUseOriginalMessage":null,"caseInsensitiveHeaders":null,"runtimeEndpointRegistryEnabled":null,"managementNamePattern":null,"threadNamePattern":null,"useBlueprintPropertyResolver":null,"shutdownRoute":["Default","Defer"],"shutdownRunningTask":["CompleteCurrentTaskOnly","CompleteAllTasks"],"loadTypeConverters":null,"typeConverterStatisticsEnabled":null,"inflightRepositoryBrowseEnabled":null,"typeConverterExists":["Override","Ignore","Fail"],"typeConverterExistsLoggingLevel":["TRACE","DEBUG","INFO","WARN","ERROR","OFF"],"id":null},"children":["globalOptions","propertyPlaceholder","package","packageScan","contextScan","jmxAgent","streamCaching","routeController","export","defaultServiceCallConfiguration","serviceCallConfiguration","defaultHystrixConfiguration","hystrixConfiguration","defaultResilience4jConfiguration","resilience4jConfiguration","defaultFaultToleranceConfiguration","faultToleranceConfiguration","routeBuilder","routeContextRef","restContextRef","threadPoolProfile","threadPool","endpoint","dataFormats","transformers","validators","redeliveryPolicyProfile","onException","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","restConfiguration","rest","route","template","fluentTemplate","consumerTemplate","proxy","errorHandler"]},"package":{},"defaultServiceCallConfiguration":{"attrs":{"uri":null,"component":null,"pattern":null,"serviceDiscoveryRef":null,"serviceFilterRef":null,"serviceChooserRef":null,"loadBalancerRef":null,"expressionRef":null,"id":null},"children":["expression","cachingServiceDiscovery","combinedServiceDiscovery","consulServiceDiscovery","dnsServiceDiscovery","etcdServiceDiscovery","kubernetesServiceDiscovery","staticServiceDiscovery","zookeeperServiceDiscovery","blacklistServiceFilter","combinedServiceFilter","customServiceFilter","healthyServiceFilter","passThroughServiceFilter","ribbonLoadBalancer","defaultLoadBalancer"]},"expression":{"attrs":{"hostHeader":null,"portHeader":null,"id":null},"children":["properties","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"defaultHystrixConfiguration":{"attrs":{"groupKey":null,"threadPoolKey":null,"circuitBreakerEnabled":null,"circuitBreakerErrorThresholdPercentage":null,"circuitBreakerForceClosed":null,"circuitBreakerForceOpen":null,"circuitBreakerRequestVolumeThreshold":null,"circuitBreakerSleepWindowInMilliseconds":null,"executionIsolationSemaphoreMaxConcurrentRequests":null,"executionIsolationStrategy":null,"executionIsolationThreadInterruptOnTimeout":null,"executionTimeoutInMilliseconds":null,"executionTimeoutEnabled":null,"fallbackIsolationSemaphoreMaxConcurrentRequests":null,"fallbackEnabled":null,"metricsHealthSnapshotIntervalInMilliseconds":null,"metricsRollingPercentileBucketSize":null,"metricsRollingPercentileEnabled":null,"metricsRollingPercentileWindowInMilliseconds":null,"metricsRollingPercentileWindowBuckets":null,"metricsRollingStatisticalWindowInMilliseconds":null,"metricsRollingStatisticalWindowBuckets":null,"requestLogEnabled":null,"corePoolSize":null,"maximumSize":null,"keepAliveTime":null,"maxQueueSize":null,"queueSizeRejectionThreshold":null,"threadPoolRollingNumberStatisticalWindowInMilliseconds":null,"threadPoolRollingNumberStatisticalWindowBuckets":null,"allowMaximumSizeToDivergeFromCoreSize":null,"id":null}},"defaultResilience4jConfiguration":{"attrs":{"circuitBreakerRef":null,"configRef":null,"failureRateThreshold":null,"permittedNumberOfCallsInHalfOpenState":null,"slidingWindowSize":null,"slidingWindowType":null,"minimumNumberOfCalls":null,"writableStackTraceEnabled":null,"waitDurationInOpenState":null,"automaticTransitionFromOpenToHalfOpenEnabled":null,"slowCallRateThreshold":null,"slowCallDurationThreshold":null,"id":null},"children":["bulkheadEnabled","bulkheadMaxConcurrentCalls","bulkheadMaxWaitDuration","timeoutEnabled","timeoutExecutorServiceRef","timeoutDuration","timeoutCancelRunningFuture"]},"bulkheadEnabled":{},"bulkheadMaxConcurrentCalls":{},"bulkheadMaxWaitDuration":{},"timeoutEnabled":{},"timeoutExecutorServiceRef":{},"timeoutDuration":{},"timeoutCancelRunningFuture":{},"defaultFaultToleranceConfiguration":{"attrs":{"circuitBreakerRef":null,"delay":null,"successThreshold":null,"requestVolumeThreshold":null,"failureRatio":null,"timeoutEnabled":null,"timeoutDuration":null,"timeoutPoolSize":null,"timeoutScheduledExecutorServiceRef":null,"bulkheadEnabled":null,"bulkheadMaxConcurrentCalls":null,"bulkheadWaitingTaskQueue":null,"bulkheadExecutorServiceRef":null,"id":null}},"cbor":{"attrs":{"objectMapper":null,"useDefaultObjectMapper":null,"unmarshalTypeName":null,"collectionTypeName":null,"useList":null,"allowUnmarshallType":null,"prettyPrint":null,"allowJmsType":null,"enableFeatures":null,"disableFeatures":null,"contentTypeHeader":null,"id":null}},"choice":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","otherwise","when","whenSkipSendToEndpoint"]},"circuitBreaker":{"attrs":{"configurationRef":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","hystrixConfiguration","resilience4jConfiguration","faultToleranceConfiguration","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"claimCheck":{"attrs":{"operation":null,"key":null,"filter":null,"strategyRef":null,"strategyMethodName":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"combinedServiceDiscovery":{"attrs":{"id":null},"children":["properties","consulServiceDiscovery","dnsServiceDiscovery","etcdServiceDiscovery","kubernetesServiceDiscovery","staticServiceDiscovery","cachingServiceDiscovery"]},"combinedServiceFilter":{"attrs":{"id":null},"children":["properties","blacklistServiceFilter","customServiceFilter","healthyServiceFilter","passThroughServiceFilter"]},"constant":{"attrs":{"id":null,"trim":null}},"consulServiceDiscovery":{"attrs":{"url":null,"datacenter":null,"aclToken":null,"userName":null,"password":null,"connectTimeoutMillis":null,"readTimeoutMillis":null,"writeTimeoutMillis":null,"blockSeconds":null,"id":null},"children":["properties"]},"consumerTemplate":{"attrs":{"maximumCacheSize":null,"camelContextId":null,"id":null}},"contextScan":{"attrs":{"includeNonSingletons":null},"children":["excludes","includes"]},"excludes":{},"includes":{},"convertBodyTo":{"attrs":{"type":null,"charset":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"crypto":{"attrs":{"algorithm":null,"cryptoProvider":null,"keyRef":null,"initVectorRef":null,"algorithmParameterRef":null,"buffersize":null,"macAlgorithm":null,"shouldAppendHMAC":null,"inline":null,"contentTypeHeader":null,"id":null}},"csv":{"attrs":{"formatRef":null,"formatName":null,"commentMarkerDisabled":null,"commentMarker":null,"delimiter":null,"escapeDisabled":null,"escape":null,"headerDisabled":null,"allowMissingColumnNames":null,"ignoreEmptyLines":null,"ignoreSurroundingSpaces":null,"nullStringDisabled":null,"nullString":null,"quoteDisabled":null,"quote":null,"recordSeparatorDisabled":null,"recordSeparator":null,"skipHeaderRecord":null,"quoteMode":null,"ignoreHeaderCase":null,"trim":null,"trailingDelimiter":null,"marshallerFactoryRef":null,"lazyLoad":null,"useMaps":null,"useOrderedMaps":null,"recordConverterRef":null,"contentTypeHeader":null,"id":null},"children":["header"]},"header":{},"customDataFormat":{"attrs":{"ref":null,"contentTypeHeader":null,"id":null}},"customLoadBalancer":{"attrs":{"ref":null,"id":null}},"customServiceFilter":{"attrs":{"ref":null,"id":null},"children":["properties"]},"dataFormats":{"children":["any23","asn1","avro","barcode","base64","beanio","bindy","cbor","crypto","csv","custom","fhirJson","fhirXml","flatpack","grok","gzip","hl7","ical","jacksonxml","jaxb","json","jsonApi","lzf","mimeMultipart","protobuf","rss","secureXML","soapjaxb","syslog","tarfile","thrift","tidyMarkup","univocity-csv","univocity-fixed","univocity-tsv","xmlrpc","xstream","pgp","yaml","zip","zipfile"]},"custom":{"attrs":{"ref":null,"contentTypeHeader":null,"id":null}},"gzip":{"attrs":{"contentTypeHeader":null,"id":null}},"mimeMultipart":{"attrs":{"multipartSubType":null,"multipartWithoutAttachment":null,"headersInline":null,"includeHeaders":null,"binaryContent":null,"contentTypeHeader":null,"id":null}},"zip":{"attrs":{"compressionLevel":null,"contentTypeHeader":null,"id":null}},"defaultLoadBalancer":{"attrs":{"id":null},"children":["properties"]},"delay":{"attrs":{"executorServiceRef":null,"asyncDelayed":null,"callerRunsWhenRejected":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"delete":{"attrs":{"method":null,"uri":null,"consumes":null,"produces":null,"bindingMode":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"type":null,"outType":null,"routeId":null,"apiDocs":null,"customId":null,"id":null},"children":["description","param","responseMessage","security","to","toD","route"]},"description":{"attrs":{"lang":null}},"dnsServiceDiscovery":{"attrs":{"proto":null,"domain":null,"id":null},"children":["properties"]},"doCatch":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","exception","onWhen","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"exception":{},"onWhen":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"doFinally":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"doTry":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"dynamicRouter":{"attrs":{"uriDelimiter":null,"ignoreInvalidEndpoints":null,"cacheSize":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"endpoint":{"attrs":{"uri":null,"camelContextId":null,"id":null},"children":["property"]},"enrich":{"attrs":{"strategyRef":null,"strategyMethodName":null,"strategyMethodAllowNull":null,"aggregateOnException":null,"shareUnitOfWork":null,"cacheSize":null,"ignoreInvalidEndpoint":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"errorHandler":{"attrs":{"type":["DefaultErrorHandler","DeadLetterChannel","NoErrorHandler"],"deadLetterUri":null,"deadLetterHandleNewException":null,"useOriginalMessage":null,"useOriginalBody":null,"onRedeliveryRef":null,"onPrepareFailureRef":null,"onExceptionOccurredRef":null,"retryWhileRef":null,"executorServiceRef":null,"redeliveryPolicyRef":null,"camelContextId":null,"id":null},"children":["redeliveryPolicy"]},"etcdServiceDiscovery":{"attrs":{"uris":null,"userName":null,"password":null,"timeout":null,"servicePath":null,"type":null,"id":null},"children":["properties"]},"exchangeProperty":{"attrs":{"id":null,"trim":null}},"export":{"attrs":{"uri":null,"serviceRef":null,"method":null,"serviceInterface":null,"camelContextId":null,"id":null}},"expression":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"expressionDefinition":{"attrs":{"id":null,"trim":null}},"failover":{"attrs":{"roundRobin":null,"sticky":null,"maximumFailoverAttempts":null,"id":null},"children":["exception"]},"exception":{},"faultToleranceConfiguration":{"attrs":{"circuitBreakerRef":null,"delay":null,"successThreshold":null,"requestVolumeThreshold":null,"failureRatio":null,"timeoutEnabled":null,"timeoutDuration":null,"timeoutPoolSize":null,"timeoutScheduledExecutorServiceRef":null,"bulkheadEnabled":null,"bulkheadMaxConcurrentCalls":null,"bulkheadWaitingTaskQueue":null,"bulkheadExecutorServiceRef":null,"id":null}},"fhirJson":{"attrs":{"fhirVersion":null,"prettyPrint":null,"serverBaseUrl":null,"omitResourceId":null,"encodeElementsAppliesToChildResourcesOnly":null,"encodeElements":null,"dontEncodeElements":null,"stripVersionsFromReferences":null,"overrideResourceIdWithBundleEntryFullUrl":null,"summaryMode":null,"suppressNarratives":null,"dontStripVersionsFromReferencesAtPaths":null,"contentTypeHeader":null,"id":null}},"fhirXml":{"attrs":{"fhirVersion":null,"prettyPrint":null,"serverBaseUrl":null,"omitResourceId":null,"encodeElementsAppliesToChildResourcesOnly":null,"encodeElements":null,"dontEncodeElements":null,"stripVersionsFromReferences":null,"overrideResourceIdWithBundleEntryFullUrl":null,"summaryMode":null,"suppressNarratives":null,"dontStripVersionsFromReferencesAtPaths":null,"contentTypeHeader":null,"id":null}},"filter":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"flatpack":{"attrs":{"definition":null,"fixed":null,"ignoreFirstRecord":null,"textQualifier":null,"delimiter":null,"allowShortLines":null,"ignoreExtraColumns":null,"parserFactoryRef":null,"contentTypeHeader":null,"id":null}},"fluentTemplate":{"attrs":{"defaultEndpoint":null,"maximumCacheSize":null,"camelContextId":null,"id":null}},"from":{"attrs":{"uri":null,"customId":null,"id":null},"children":["description"]},"get":{"attrs":{"method":null,"uri":null,"consumes":null,"produces":null,"bindingMode":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"type":null,"outType":null,"routeId":null,"apiDocs":null,"customId":null,"id":null},"children":["description","param","responseMessage","security","to","toD","route"]},"globalOption":{"attrs":{"key":null,"value":null}},"globalOptions":{"children":["globalOption"]},"grok":{"attrs":{"pattern":null,"flattened":null,"allowMultipleMatchesPerLine":null,"namedOnly":null,"contentTypeHeader":null,"id":null}},"groovy":{"attrs":{"id":null,"trim":null}},"gzipdeflater":{"attrs":{"contentTypeHeader":null,"id":null}},"head":{"attrs":{"method":null,"uri":null,"consumes":null,"produces":null,"bindingMode":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"type":null,"outType":null,"routeId":null,"apiDocs":null,"customId":null,"id":null},"children":["description","param","responseMessage","security","to","toD","route"]},"header":{"attrs":{"id":null,"trim":null}},"healthyServiceFilter":{"attrs":{"id":null},"children":["properties"]},"hl7":{"attrs":{"validate":null,"contentTypeHeader":null,"id":null}},"hl7terser":{"attrs":{"id":null,"trim":null}},"hystrixConfiguration":{"attrs":{"groupKey":null,"threadPoolKey":null,"circuitBreakerEnabled":null,"circuitBreakerErrorThresholdPercentage":null,"circuitBreakerForceClosed":null,"circuitBreakerForceOpen":null,"circuitBreakerRequestVolumeThreshold":null,"circuitBreakerSleepWindowInMilliseconds":null,"executionIsolationSemaphoreMaxConcurrentRequests":null,"executionIsolationStrategy":null,"executionIsolationThreadInterruptOnTimeout":null,"executionTimeoutInMilliseconds":null,"executionTimeoutEnabled":null,"fallbackIsolationSemaphoreMaxConcurrentRequests":null,"fallbackEnabled":null,"metricsHealthSnapshotIntervalInMilliseconds":null,"metricsRollingPercentileBucketSize":null,"metricsRollingPercentileEnabled":null,"metricsRollingPercentileWindowInMilliseconds":null,"metricsRollingPercentileWindowBuckets":null,"metricsRollingStatisticalWindowInMilliseconds":null,"metricsRollingStatisticalWindowBuckets":null,"requestLogEnabled":null,"corePoolSize":null,"maximumSize":null,"keepAliveTime":null,"maxQueueSize":null,"queueSizeRejectionThreshold":null,"threadPoolRollingNumberStatisticalWindowInMilliseconds":null,"threadPoolRollingNumberStatisticalWindowBuckets":null,"allowMaximumSizeToDivergeFromCoreSize":null,"id":null}},"ical":{"attrs":{"validating":null,"contentTypeHeader":null,"id":null}},"idempotentConsumer":{"attrs":{"messageIdRepositoryRef":null,"eager":null,"completionEager":null,"skipDuplicate":null,"removeOnFailure":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"inOnly":{"attrs":{"uri":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"inOut":{"attrs":{"uri":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"inputType":{"attrs":{"urn":null,"validate":null,"customId":null,"id":null},"children":["description"]},"intercept":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"interceptFrom":{"attrs":{"uri":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"interceptSendToEndpoint":{"attrs":{"uri":null,"skipSendToOriginalEndpoint":null,"afterUri":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"jacksonxml":{"attrs":{"xmlMapper":null,"prettyPrint":null,"unmarshalTypeName":null,"jsonView":null,"include":null,"allowJmsType":null,"collectionTypeName":null,"useList":null,"enableJaxbAnnotationModule":null,"moduleClassNames":null,"moduleRefs":null,"enableFeatures":null,"disableFeatures":null,"allowUnmarshallType":null,"contentTypeHeader":null,"id":null}},"jaxb":{"attrs":{"contextPath":null,"contextPathIsClassName":null,"schema":null,"schemaSeverityLevel":null,"prettyPrint":null,"objectFactory":null,"ignoreJAXBElement":null,"mustBeJAXBElement":null,"filterNonXmlChars":null,"encoding":null,"fragment":null,"partClass":null,"partNamespace":null,"namespacePrefixRef":null,"xmlStreamWriterWrapper":null,"schemaLocation":null,"noNamespaceSchemaLocation":null,"jaxbProviderProperties":null,"contentTypeHeader":null,"id":null}},"jmxAgent":{"attrs":{"disabled":null,"onlyRegisterProcessorWithCustomId":null,"mbeanServerDefaultDomain":null,"mbeanObjectDomainName":null,"usePlatformMBeanServer":null,"registerAlways":null,"registerNewRoutes":null,"statisticsLevel":null,"loadStatisticsEnabled":null,"endpointRuntimeStatisticsEnabled":null,"includeHostName":null,"useHostIPAddress":null,"mask":null,"id":null}},"json":{"attrs":{"objectMapper":null,"useDefaultObjectMapper":null,"prettyPrint":null,"library":["XStream","Jackson","Johnzon","Gson","Fastjson"],"unmarshalTypeName":null,"jsonView":null,"include":null,"allowJmsType":null,"collectionTypeName":null,"useList":null,"moduleClassNames":null,"moduleRefs":null,"enableFeatures":null,"disableFeatures":null,"permissions":null,"allowUnmarshallType":null,"timezone":null,"autoDiscoverObjectMapper":null,"dropRootNode":null,"contentTypeHeader":null,"id":null}},"jsonApi":{"attrs":{"dataFormatTypes":null,"mainFormatType":null,"contentTypeHeader":null,"id":null}},"jsonpath":{"attrs":{"resultType":null,"suppressExceptions":null,"allowSimple":null,"allowEasyPredicate":null,"writeAsString":null,"headerName":null,"id":null,"trim":null}},"keyStoreParameters":{"attrs":{"type":null,"password":null,"provider":null,"resource":null,"camelContextId":null,"id":null}},"kubernetesServiceDiscovery":{"attrs":{"lookup":null,"dnsDomain":null,"portName":null,"portProtocol":null,"namespace":null,"apiVersion":null,"masterUrl":null,"username":null,"password":null,"oauthToken":null,"caCertData":null,"caCertFile":null,"clientCertData":null,"clientCertFile":null,"clientKeyAlgo":null,"clientKeyData":null,"clientKeyFile":null,"clientKeyPassphrase":null,"trustCerts":null,"id":null},"children":["properties"]},"language":{"attrs":{"language":null,"id":null,"trim":null}},"loadBalance":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","failover","random","customLoadBalancer","roundRobin","sticky","topic","weighted","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"loadBalancerConfiguration":{"attrs":{"id":null},"children":["properties"]},"log":{"attrs":{"message":null,"loggingLevel":null,"logName":null,"marker":null,"loggerRef":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"loop":{"attrs":{"copy":null,"doWhile":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"lzf":{"attrs":{"usingParallelCompression":null,"contentTypeHeader":null,"id":null}},"marshal":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","any23","asn1","avro","barcode","base64","beanio","bindy","cbor","crypto","csv","custom","fhirJson","fhirXml","flatpack","grok","gzip","hl7","ical","jacksonxml","jaxb","json","jsonApi","lzf","mimeMultipart","protobuf","rss","secureXML","soapjaxb","syslog","tarfile","thrift","tidyMarkup","univocity-csv","univocity-fixed","univocity-tsv","xmlrpc","xstream","pgp","yaml","zip","zipfile"]},"custom":{"attrs":{"ref":null,"contentTypeHeader":null,"id":null}},"gzip":{"attrs":{"contentTypeHeader":null,"id":null}},"mimeMultipart":{"attrs":{"multipartSubType":null,"multipartWithoutAttachment":null,"headersInline":null,"includeHeaders":null,"binaryContent":null,"contentTypeHeader":null,"id":null}},"zip":{"attrs":{"compressionLevel":null,"contentTypeHeader":null,"id":null}},"method":{"attrs":{"ref":null,"method":null,"beanType":null,"id":null,"trim":null}},"mime-multipart":{"attrs":{"multipartSubType":null,"multipartWithoutAttachment":null,"headersInline":null,"includeHeaders":null,"binaryContent":null,"contentTypeHeader":null,"id":null}},"multicast":{"attrs":{"parallelProcessing":null,"strategyRef":null,"strategyMethodName":null,"strategyMethodAllowNull":null,"executorServiceRef":null,"streaming":null,"stopOnException":null,"timeout":null,"onPrepareRef":null,"shareUnitOfWork":null,"parallelAggregate":null,"stopOnAggregateException":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"mvel":{"attrs":{"id":null,"trim":null}},"oauth2":{"attrs":{"authorizationUrl":null,"tokenUrl":null,"flow":null,"key":null,"description":null},"children":["scopes"]},"scopes":{"attrs":{"key":null,"value":null}},"ognl":{"attrs":{"id":null,"trim":null}},"onCompletion":{"attrs":{"mode":null,"onCompleteOnly":null,"onFailureOnly":null,"parallelProcessing":null,"executorServiceRef":null,"useOriginalMessage":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onWhen","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"onWhen":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"onException":{"attrs":{"redeliveryPolicyRef":null,"onRedeliveryRef":null,"onExceptionOccurredRef":null,"useOriginalMessage":null,"useOriginalBody":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","exception","onWhen","retryWhile","redeliveryPolicy","handled","continued","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"exception":{},"onWhen":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"retryWhile":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"handled":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"continued":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"onFallback":{"attrs":{"fallbackViaNetwork":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"optimisticLockRetryPolicy":{"attrs":{"maximumRetries":null,"retryDelay":null,"maximumRetryDelay":null,"exponentialBackOff":null,"randomBackOff":null}},"otherwise":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"outputType":{"attrs":{"urn":null,"validate":null,"customId":null,"id":null},"children":["description"]},"packageScan":{"children":["package","excludes","includes"]},"package":{},"excludes":{},"includes":{},"param":{"attrs":{"name":null,"type":["body","formData","header","path","query"],"description":null,"defaultValue":null,"required":null,"collectionFormat":["csv","ssv","tsv","pipes","multi"],"arrayType":null,"dataType":null,"dataFormat":null},"children":["allowableValues","examples"]},"allowableValues":{"children":["value"]},"value":{},"examples":{"attrs":{"key":null,"value":null}},"passThroughServiceFilter":{"attrs":{"id":null},"children":["properties"]},"patch":{"attrs":{"method":null,"uri":null,"consumes":null,"produces":null,"bindingMode":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"type":null,"outType":null,"routeId":null,"apiDocs":null,"customId":null,"id":null},"children":["description","param","responseMessage","security","to","toD","route"]},"pgp":{"attrs":{"keyUserid":null,"signatureKeyUserid":null,"password":null,"signaturePassword":null,"keyFileName":null,"signatureKeyFileName":null,"signatureKeyRing":null,"armored":null,"integrity":null,"provider":null,"algorithm":null,"compressionAlgorithm":null,"hashAlgorithm":null,"signatureVerificationOption":null,"contentTypeHeader":null,"id":null}},"pipeline":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"policy":{"attrs":{"ref":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"pollEnrich":{"attrs":{"timeout":null,"strategyRef":null,"strategyMethodName":null,"strategyMethodAllowNull":null,"aggregateOnException":null,"cacheSize":null,"ignoreInvalidEndpoint":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"post":{"attrs":{"method":null,"uri":null,"consumes":null,"produces":null,"bindingMode":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"type":null,"outType":null,"routeId":null,"apiDocs":null,"customId":null,"id":null},"children":["description","param","responseMessage","security","to","toD","route"]},"process":{"attrs":{"ref":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"propertiesFunction":{"attrs":{"ref":null,"id":null}},"propertiesLocation":{"attrs":{"resolver":null,"path":null,"optional":null,"id":null}},"property":{"attrs":{"key":null,"value":null}},"propertyPlaceholder":{"attrs":{"location":null,"encoding":null,"ignoreMissingLocation":null,"propertiesParserRef":null,"defaultFallbackEnabled":null,"id":null},"children":["propertiesFunction","propertiesLocation"]},"protobuf":{"attrs":{"instanceClass":null,"contentTypeFormat":null,"contentTypeHeader":null,"id":null}},"proxy":{"attrs":{"serviceUrl":null,"serviceRef":null,"serviceInterface":null,"binding":null,"camelContextId":null,"id":null}},"put":{"attrs":{"method":null,"uri":null,"consumes":null,"produces":null,"bindingMode":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"type":null,"outType":null,"routeId":null,"apiDocs":null,"customId":null,"id":null},"children":["description","param","responseMessage","security","to","toD","route"]},"random":{"attrs":{"id":null}},"recipientList":{"attrs":{"delimiter":null,"parallelProcessing":null,"strategyRef":null,"strategyMethodName":null,"strategyMethodAllowNull":null,"executorServiceRef":null,"stopOnException":null,"ignoreInvalidEndpoints":null,"streaming":null,"timeout":null,"onPrepareRef":null,"shareUnitOfWork":null,"cacheSize":null,"parallelAggregate":null,"stopOnAggregateException":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"redeliveryPolicy":{"attrs":{"maximumRedeliveries":null,"redeliveryDelay":null,"asyncDelayedRedelivery":null,"backOffMultiplier":null,"useExponentialBackOff":null,"collisionAvoidanceFactor":null,"useCollisionAvoidance":null,"maximumRedeliveryDelay":null,"retriesExhaustedLogLevel":null,"retryAttemptedLogLevel":null,"retryAttemptedLogInterval":null,"logRetryAttempted":null,"logStackTrace":null,"logRetryStackTrace":null,"logHandled":null,"logNewException":null,"logContinued":null,"logExhausted":null,"logExhaustedMessageHistory":null,"logExhaustedMessageBody":null,"disableRedelivery":null,"delayPattern":null,"allowRedeliveryWhileStopping":null,"exchangeFormatterRef":null}},"redeliveryPolicyProfile":{"attrs":{"maximumRedeliveries":null,"redeliveryDelay":null,"asyncDelayedRedelivery":null,"backOffMultiplier":null,"useExponentialBackOff":null,"collisionAvoidanceFactor":null,"useCollisionAvoidance":null,"maximumRedeliveryDelay":null,"retriesExhaustedLogLevel":null,"retryAttemptedLogLevel":null,"retryAttemptedLogInterval":null,"logRetryAttempted":null,"logStackTrace":null,"logRetryStackTrace":null,"logHandled":null,"logNewException":null,"logContinued":null,"logExhausted":null,"logExhaustedMessageHistory":null,"logExhaustedMessageBody":null,"disableRedelivery":null,"delayPattern":null,"allowRedeliveryWhileStopping":null,"exchangeFormatterRef":null,"camelContextId":null,"id":null}},"ref":{"attrs":{"id":null,"trim":null}},"removeHeader":{"attrs":{"headerName":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"removeHeaders":{"attrs":{"pattern":null,"excludePattern":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"removeProperties":{"attrs":{"pattern":null,"excludePattern":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"removeProperty":{"attrs":{"propertyName":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"resequence":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","batch-config","stream-config","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"resilience4jConfiguration":{"attrs":{"circuitBreakerRef":null,"configRef":null,"failureRateThreshold":null,"permittedNumberOfCallsInHalfOpenState":null,"slidingWindowSize":null,"slidingWindowType":null,"minimumNumberOfCalls":null,"writableStackTraceEnabled":null,"waitDurationInOpenState":null,"automaticTransitionFromOpenToHalfOpenEnabled":null,"slowCallRateThreshold":null,"slowCallDurationThreshold":null,"id":null},"children":["bulkheadEnabled","bulkheadMaxConcurrentCalls","bulkheadMaxWaitDuration","timeoutEnabled","timeoutExecutorServiceRef","timeoutDuration","timeoutCancelRunningFuture"]},"responseHeader":{"attrs":{"name":null,"description":null,"collectionFormat":["csv","ssv","tsv","pipes","multi"],"arrayType":null,"dataType":null,"dataFormat":null,"example":null},"children":["allowableValues"]},"allowableValues":{"children":["value"]},"value":{},"responseMessage":{"attrs":{"code":null,"message":null,"responseModel":null},"children":["header","examples"]},"header":{"attrs":{"name":null,"description":null,"collectionFormat":["csv","ssv","tsv","pipes","multi"],"arrayType":null,"dataType":null,"dataFormat":null,"example":null},"children":["allowableValues"]},"examples":{"attrs":{"key":null,"value":null}},"rest":{"attrs":{"path":null,"tag":null,"consumes":null,"produces":null,"bindingMode":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"apiDocs":null,"customId":null,"id":null},"children":["description","securityDefinitions","verb","delete","get","head","patch","post","put"]},"restBinding":{"attrs":{"consumes":null,"produces":null,"bindingMode":null,"type":null,"outType":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"component":null,"customId":null,"id":null},"children":["description"]},"restConfiguration":{"attrs":{"component":null,"apiComponent":null,"producerComponent":null,"scheme":null,"host":null,"apiHost":null,"useXForwardHeaders":null,"port":null,"producerApiDoc":null,"contextPath":null,"apiContextPath":null,"apiContextRouteId":null,"apiContextIdPattern":null,"apiContextListing":null,"apiVendorExtension":null,"hostNameResolver":["allLocalIp","localIp","localHostName"],"bindingMode":["auto","off","json","xml","json_xml"],"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"jsonDataFormat":null,"xmlDataFormat":null},"children":["componentProperty","endpointProperty","consumerProperty","dataFormatProperty","apiProperty","corsHeaders"]},"componentProperty":{"attrs":{"key":null,"value":null}},"endpointProperty":{"attrs":{"key":null,"value":null}},"consumerProperty":{"attrs":{"key":null,"value":null}},"dataFormatProperty":{"attrs":{"key":null,"value":null}},"apiProperty":{"attrs":{"key":null,"value":null}},"corsHeaders":{"attrs":{"key":null,"value":null}},"restContext":{"attrs":{"id":null},"children":["rest"]},"restContextRef":{"attrs":{"ref":null}},"restProperty":{"attrs":{"key":null,"value":null}},"rests":{"attrs":{"customId":null,"id":null},"children":["description","rest"]},"ribbonLoadBalancer":{"attrs":{"namespace":null,"username":null,"password":null,"clientName":null,"id":null},"children":["properties"]},"rollback":{"attrs":{"markRollbackOnly":null,"markRollbackOnlyLast":null,"message":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"roundRobin":{"attrs":{"id":null}},"route":{"attrs":{"autoStartup":null,"delayer":null,"errorHandlerRef":null,"group":null,"logMask":null,"messageHistory":null,"rest":null,"routePolicyRef":null,"shutdownRoute":null,"shutdownRunningTask":null,"startupOrder":null,"streamCache":null,"trace":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","from","inputType","outputType","routeProperty","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"routeProperty":{"attrs":{"key":null,"value":null}},"routeBuilder":{"attrs":{"ref":null,"id":null}},"routeContext":{"attrs":{"id":null},"children":["route"]},"routeContextRef":{"attrs":{"ref":null}},"routeController":{"attrs":{"supervising":null,"includeRoutes":null,"excludeRoutes":null,"threadPoolSize":null,"initialDelay":null,"backOffDelay":null,"backOffMaxDelay":null,"backOffMaxElapsedTime":null,"backOffMaxAttempts":null,"backOffMultiplier":null,"unhealthyOnExhausted":null,"id":null}},"routes":{"attrs":{"customId":null,"id":null},"children":["description","route"]},"routingSlip":{"attrs":{"uriDelimiter":null,"ignoreInvalidEndpoints":null,"cacheSize":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"rss":{"attrs":{"contentTypeHeader":null,"id":null}},"saga":{"attrs":{"propagation":null,"completionMode":null,"timeoutInMilliseconds":null,"timeout":null,"sagaServiceRef":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","compensation","completion","option","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"compensation":{"attrs":{"uri":null}},"completion":{"attrs":{"uri":null}},"option":{"attrs":{"optionName":null},"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"sample":{"attrs":{"samplePeriod":null,"messageFrequency":null,"units":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"script":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"secureRandomParameters":{"attrs":{"algorithm":null,"provider":null,"camelContextId":null,"id":null}},"secureXML":{"attrs":{"xmlCipherAlgorithm":null,"passPhrase":null,"passPhraseByte":null,"secureTag":null,"secureTagContents":null,"keyCipherAlgorithm":null,"recipientKeyAlias":null,"keyOrTrustStoreParametersRef":null,"keyPassword":null,"digestAlgorithm":null,"mgfAlgorithm":null,"addKeyValueForEncryptedKey":null,"contentTypeHeader":null,"id":null}},"security":{"attrs":{"key":null,"scopes":null}},"securityDefinitions":{"children":["apiKey","basicAuth","oauth2"]},"serviceCall":{"attrs":{"name":null,"uri":null,"component":null,"pattern":null,"configurationRef":null,"serviceDiscoveryRef":null,"serviceFilterRef":null,"serviceChooserRef":null,"loadBalancerRef":null,"expressionRef":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionConfiguration","cachingServiceDiscovery","combinedServiceDiscovery","consulServiceDiscovery","dnsServiceDiscovery","etcdServiceDiscovery","kubernetesServiceDiscovery","staticServiceDiscovery","zookeeperServiceDiscovery","blacklistServiceFilter","combinedServiceFilter","customServiceFilter","healthyServiceFilter","passThroughServiceFilter","ribbonLoadBalancer","defaultLoadBalancer"]},"expressionConfiguration":{"attrs":{"hostHeader":null,"portHeader":null,"id":null},"children":["properties","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"serviceCallConfiguration":{"attrs":{"uri":null,"component":null,"pattern":null,"serviceDiscoveryRef":null,"serviceFilterRef":null,"serviceChooserRef":null,"loadBalancerRef":null,"expressionRef":null,"id":null},"children":["expression","cachingServiceDiscovery","combinedServiceDiscovery","consulServiceDiscovery","dnsServiceDiscovery","etcdServiceDiscovery","kubernetesServiceDiscovery","staticServiceDiscovery","zookeeperServiceDiscovery","blacklistServiceFilter","combinedServiceFilter","customServiceFilter","healthyServiceFilter","passThroughServiceFilter","ribbonLoadBalancer","defaultLoadBalancer"]},"serviceChooserConfiguration":{"attrs":{"id":null},"children":["properties"]},"serviceDiscoveryConfiguration":{"attrs":{"id":null},"children":["properties"]},"serviceExpression":{"attrs":{"hostHeader":null,"portHeader":null,"id":null},"children":["properties","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"serviceFilterConfiguration":{"attrs":{"id":null},"children":["properties"]},"setBody":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"setExchangePattern":{"attrs":{"pattern":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"setHeader":{"attrs":{"name":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"setProperty":{"attrs":{"name":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"simple":{"attrs":{"resultType":null,"id":null,"trim":null}},"soapjaxb":{"attrs":{"contextPath":null,"encoding":null,"elementNameStrategyRef":null,"version":null,"namespacePrefixRef":null,"schema":null,"contentTypeHeader":null,"id":null}},"sort":{"attrs":{"comparatorRef":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"spel":{"attrs":{"id":null,"trim":null}},"split":{"attrs":{"parallelProcessing":null,"strategyRef":null,"strategyMethodName":null,"strategyMethodAllowNull":null,"executorServiceRef":null,"streaming":null,"stopOnException":null,"timeout":null,"onPrepareRef":null,"shareUnitOfWork":null,"parallelAggregate":null,"stopOnAggregateException":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"sslContextParameters":{"attrs":{"sessionTimeout":null,"provider":null,"secureSocketProtocol":null,"certAlias":null,"camelContextId":null,"id":null},"children":["cipherSuites","cipherSuitesFilter","secureSocketProtocols","secureSocketProtocolsFilter","keyManagers","trustManagers","secureRandom","clientParameters","serverParameters"]},"cipherSuites":{"children":["cipherSuite"]},"cipherSuite":{},"cipherSuitesFilter":{"children":["include","exclude"]},"include":{},"exclude":{},"secureSocketProtocols":{"children":["secureSocketProtocol"]},"secureSocketProtocol":{},"secureSocketProtocolsFilter":{"children":["include","exclude"]},"keyManagers":{"attrs":{"keyPassword":null,"provider":null,"algorithm":null,"camelContextId":null,"id":null},"children":["keyStore"]},"keyStore":{"attrs":{"type":null,"password":null,"provider":null,"resource":null,"camelContextId":null,"id":null}},"trustManagers":{"attrs":{"provider":null,"algorithm":null,"trustManager":null,"camelContextId":null,"id":null},"children":["keyStore"]},"keyStore":{"attrs":{"type":null,"password":null,"provider":null,"resource":null,"camelContextId":null,"id":null}},"secureRandom":{"attrs":{"algorithm":null,"provider":null,"camelContextId":null,"id":null}},"clientParameters":{"attrs":{"sessionTimeout":null,"camelContextId":null,"id":null},"children":["cipherSuites","cipherSuitesFilter","secureSocketProtocols","secureSocketProtocolsFilter","sniHostNames"]},"cipherSuites":{"children":["cipherSuite"]},"cipherSuitesFilter":{"children":["include","exclude"]},"secureSocketProtocols":{"children":["secureSocketProtocol"]},"secureSocketProtocolsFilter":{"children":["include","exclude"]},"sniHostNames":{"children":["sniHostName"]},"sniHostName":{},"serverParameters":{"attrs":{"sessionTimeout":null,"clientAuthentication":null,"camelContextId":null,"id":null},"children":["cipherSuites","cipherSuitesFilter","secureSocketProtocols","secureSocketProtocolsFilter"]},"cipherSuites":{"children":["cipherSuite"]},"cipherSuitesFilter":{"children":["include","exclude"]},"secureSocketProtocols":{"children":["secureSocketProtocol"]},"secureSocketProtocolsFilter":{"children":["include","exclude"]},"staticServiceDiscovery":{"attrs":{"id":null},"children":["properties","servers"]},"servers":{},"step":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"sticky":{"attrs":{"id":null},"children":["correlationExpression"]},"correlationExpression":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"stop":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"stream-config":{"attrs":{"capacity":null,"timeout":null,"deliveryAttemptInterval":null,"ignoreInvalidExchanges":null,"comparatorRef":null,"rejectOld":null}},"streamCaching":{"attrs":{"enabled":null,"spoolDirectory":null,"spoolCipher":null,"spoolThreshold":null,"spoolUsedHeapMemoryThreshold":null,"spoolUsedHeapMemoryLimit":null,"spoolRules":null,"bufferSize":null,"removeSpoolDirectoryWhenStopping":null,"statisticsEnabled":null,"anySpoolRules":null,"id":null}},"syslog":{"attrs":{"contentTypeHeader":null,"id":null}},"tarfile":{"attrs":{"usingIterator":null,"allowEmptyDirectory":null,"preservePathElements":null,"maxDecompressedSize":null,"contentTypeHeader":null,"id":null}},"template":{"attrs":{"defaultEndpoint":null,"maximumCacheSize":null,"camelContextId":null,"id":null}},"threadPool":{"attrs":{"poolSize":null,"maxPoolSize":null,"keepAliveTime":null,"timeUnit":null,"maxQueueSize":null,"allowCoreThreadTimeOut":null,"rejectedPolicy":null,"threadName":null,"scheduled":null,"camelContextId":null,"id":null}},"threadPoolProfile":{"attrs":{"defaultProfile":null,"poolSize":null,"maxPoolSize":null,"keepAliveTime":null,"timeUnit":null,"maxQueueSize":null,"allowCoreThreadTimeOut":null,"rejectedPolicy":null,"customId":null,"id":null},"children":["description"]},"threads":{"attrs":{"executorServiceRef":null,"poolSize":null,"maxPoolSize":null,"keepAliveTime":null,"timeUnit":null,"maxQueueSize":null,"allowCoreThreadTimeOut":null,"threadName":null,"rejectedPolicy":null,"callerRunsWhenRejected":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"thrift":{"attrs":{"instanceClass":null,"contentTypeFormat":null,"contentTypeHeader":null,"id":null}},"throttle":{"attrs":{"executorServiceRef":null,"timePeriodMillis":null,"asyncDelayed":null,"callerRunsWhenRejected":null,"rejectExecution":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","correlationExpression","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"correlationExpression":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"throwException":{"attrs":{"ref":null,"message":null,"exceptionType":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"tidyMarkup":{"attrs":{"dataObjectType":null,"omitXmlDeclaration":null,"contentTypeHeader":null,"id":null}},"to":{"attrs":{"pattern":null,"uri":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"toD":{"attrs":{"uri":null,"pattern":null,"cacheSize":null,"ignoreInvalidEndpoint":null,"allowOptimisedComponents":null,"autoStartComponents":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description"]},"tokenize":{"attrs":{"token":null,"endToken":null,"inheritNamespaceTagName":null,"headerName":null,"regex":null,"xml":null,"includeTokens":null,"group":null,"groupDelimiter":null,"skipFirst":null,"id":null,"trim":null}},"topic":{"attrs":{"id":null}},"transacted":{"attrs":{"ref":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"transform":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"transformers":{"children":["dataFormatTransformer","endpointTransformer","customTransformer"]},"dataFormatTransformer":{"attrs":{"ref":null,"scheme":null,"fromType":null,"toType":null},"children":["any23","asn1","avro","barcode","base64","beanio","bindy","cbor","crypto","csv","custom","fhirJson","fhirXml","flatpack","grok","gzip","hl7","ical","jacksonxml","jaxb","json","jsonApi","lzf","mimeMultipart","protobuf","rss","secureXML","soapjaxb","syslog","tarfile","thrift","tidyMarkup","univocity-csv","univocity-fixed","univocity-tsv","xmlrpc","xstream","pgp","yaml","zip","zipfile"]},"custom":{"attrs":{"ref":null,"contentTypeHeader":null,"id":null}},"gzip":{"attrs":{"contentTypeHeader":null,"id":null}},"mimeMultipart":{"attrs":{"multipartSubType":null,"multipartWithoutAttachment":null,"headersInline":null,"includeHeaders":null,"binaryContent":null,"contentTypeHeader":null,"id":null}},"zip":{"attrs":{"compressionLevel":null,"contentTypeHeader":null,"id":null}},"endpointTransformer":{"attrs":{"ref":null,"uri":null,"scheme":null,"fromType":null,"toType":null}},"customTransformer":{"attrs":{"ref":null,"className":null,"scheme":null,"fromType":null,"toType":null}},"typeFilter":{"attrs":{"value":null,"type":null}},"univocity-csv":{"attrs":{"quoteAllFields":null,"quote":null,"quoteEscape":null,"delimiter":null,"nullValue":null,"skipEmptyLines":null,"ignoreTrailingWhitespaces":null,"ignoreLeadingWhitespaces":null,"headersDisabled":null,"headerExtractionEnabled":null,"numberOfRecordsToRead":null,"emptyValue":null,"lineSeparator":null,"normalizedLineSeparator":null,"comment":null,"lazyLoad":null,"asMap":null,"contentTypeHeader":null,"id":null},"children":["univocity-header"]},"univocity-fixed":{"attrs":{"skipTrailingCharsUntilNewline":null,"recordEndsOnNewline":null,"padding":null,"nullValue":null,"skipEmptyLines":null,"ignoreTrailingWhitespaces":null,"ignoreLeadingWhitespaces":null,"headersDisabled":null,"headerExtractionEnabled":null,"numberOfRecordsToRead":null,"emptyValue":null,"lineSeparator":null,"normalizedLineSeparator":null,"comment":null,"lazyLoad":null,"asMap":null,"contentTypeHeader":null,"id":null},"children":["univocity-header"]},"univocity-header":{"attrs":{"length":null}},"univocity-tsv":{"attrs":{"escapeChar":null,"nullValue":null,"skipEmptyLines":null,"ignoreTrailingWhitespaces":null,"ignoreLeadingWhitespaces":null,"headersDisabled":null,"headerExtractionEnabled":null,"numberOfRecordsToRead":null,"emptyValue":null,"lineSeparator":null,"normalizedLineSeparator":null,"comment":null,"lazyLoad":null,"asMap":null,"contentTypeHeader":null,"id":null},"children":["univocity-header"]},"unmarshal":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","any23","asn1","avro","barcode","base64","beanio","bindy","cbor","crypto","csv","custom","fhirJson","fhirXml","flatpack","grok","gzip","hl7","ical","jacksonxml","jaxb","json","jsonApi","lzf","mimeMultipart","protobuf","rss","secureXML","soapjaxb","syslog","tarfile","thrift","tidyMarkup","univocity-csv","univocity-fixed","univocity-tsv","xmlrpc","xstream","pgp","yaml","zip","zipfile"]},"custom":{"attrs":{"ref":null,"contentTypeHeader":null,"id":null}},"gzip":{"attrs":{"contentTypeHeader":null,"id":null}},"mimeMultipart":{"attrs":{"multipartSubType":null,"multipartWithoutAttachment":null,"headersInline":null,"includeHeaders":null,"binaryContent":null,"contentTypeHeader":null,"id":null}},"zip":{"attrs":{"compressionLevel":null,"contentTypeHeader":null,"id":null}},"validate":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"validators":{"children":["endpointValidator","predicateValidator","customValidator"]},"endpointValidator":{"attrs":{"ref":null,"uri":null,"type":null}},"predicateValidator":{"attrs":{"type":null},"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"customValidator":{"attrs":{"ref":null,"className":null,"type":null}},"verb":{"attrs":{"method":null,"uri":null,"consumes":null,"produces":null,"bindingMode":null,"skipBindingOnErrorCode":null,"clientRequestValidation":null,"enableCORS":null,"type":null,"outType":null,"routeId":null,"apiDocs":null,"customId":null,"id":null},"children":["description","param","responseMessage","security","to","toD","route"]},"weighted":{"attrs":{"roundRobin":null,"distributionRatio":null,"distributionRatioDelimiter":null,"id":null}},"when":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"whenSkipSendToEndpoint":{"attrs":{"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery","onException","when","onCompletion","intercept","interceptFrom","interceptSendToEndpoint","to","toD","route","aggregate","bean","doCatch","choice","otherwise","circuitBreaker","claimCheck","convertBodyTo","delay","dynamicRouter","enrich","filter","doFinally","idempotentConsumer","inOnly","inOut","loadBalance","log","loop","marshal","multicast","onFallback","pipeline","policy","pollEnrich","process","recipientList","removeHeader","removeHeaders","removeProperties","removeProperty","resequence","rollback","routingSlip","saga","sample","script","setBody","setExchangePattern","setHeader","setProperty","sort","split","step","stop","threads","throttle","throwException","transacted","transform","doTry","unmarshal","validate","whenSkipSendToEndpoint","wireTap","serviceCall"]},"wireTap":{"attrs":{"processorRef":null,"executorServiceRef":null,"copy":null,"dynamicUri":null,"onPrepareRef":null,"uri":null,"pattern":null,"cacheSize":null,"ignoreInvalidEndpoint":null,"allowOptimisedComponents":null,"autoStartComponents":null,"inheritErrorHandler":null,"customId":null,"id":null},"children":["description","body","setHeader"]},"body":{"children":["expressionDefinition","constant","exchangeProperty","groovy","header","hl7terser","jsonpath","language","method","mvel","ognl","ref","simple","spel","tokenize","xtokenize","xpath","xquery"]},"xmlrpc":{"attrs":{"request":null,"contentTypeHeader":null,"id":null}},"xpath":{"attrs":{"documentType":null,"resultType":null,"saxon":null,"factoryRef":null,"objectModel":null,"logNamespaces":null,"headerName":null,"threadSafety":null,"id":null,"trim":null}},"xquery":{"attrs":{"type":null,"headerName":null,"id":null,"trim":null}},"xstream":{"attrs":{"permissions":null,"encoding":null,"driver":null,"driverRef":null,"mode":null,"contentTypeHeader":null,"id":null},"children":["converters","aliases","omitFields","implicitCollections"]},"converters":{"attrs":{"key":null,"value":null}},"aliases":{"attrs":{"key":null,"value":null}},"omitFields":{"attrs":{"key":null,"value":null}},"implicitCollections":{"attrs":{"key":null,"value":null}},"xtokenize":{"attrs":{"headerName":null,"mode":null,"group":null,"id":null,"trim":null}},"yaml":{"attrs":{"library":["SnakeYAML"],"unmarshalTypeName":null,"constructor":null,"representer":null,"dumperOptions":null,"resolver":null,"useApplicationContextClassLoader":null,"prettyFlow":null,"allowAnyType":null,"maxAliasesForCollections":null,"allowRecursiveKeys":null,"contentTypeHeader":null,"id":null},"children":["typeFilter"]},"zipdeflater":{"attrs":{"compressionLevel":null,"contentTypeHeader":null,"id":null}},"zipfile":{"attrs":{"usingIterator":null,"allowEmptyDirectory":null,"preservePathElements":null,"maxDecompressedSize":null,"contentTypeHeader":null,"id":null}},"zookeeperServiceDiscovery":{"attrs":{"nodes":null,"namespace":null,"reconnectBaseSleepTime":null,"reconnectMaxSleepTime":null,"reconnectMaxRetries":null,"sessionTimeout":null,"connectionTimeout":null,"basePath":null,"id":null},"children":["properties"]}}'; + +})(Entaxy || (Entaxy = {})); diff --git a/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/draggableModalDirective.js b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/draggableModalDirective.js new file mode 100644 index 00000000..632cf753 --- /dev/null +++ b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/draggableModalDirective.js @@ -0,0 +1,48 @@ +/*- + * ~~~~~~licensing~~~~~~ + * entaxy-management-plugin + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +var Entaxy; +(function (Entaxy) { + Entaxy._module + .directive('modalDialog', function(){ + return { + restrict: 'AC', + link: function($scope, element) { + var draggableStr = "draggableModal"; + var header = $(".modal-header", element); + + header.on('mousedown', (mouseDownEvent) => { + var modalDialog = element; + var offset = header.offset(); + + modalDialog.addClass(draggableStr).parents().on('mousemove', (mouseMoveEvent) => { + $("." + draggableStr, modalDialog.parents()).offset({ + top: mouseMoveEvent.pageY - (mouseDownEvent.pageY - offset.top), + left: mouseMoveEvent.pageX - (mouseDownEvent.pageX - offset.left) + }); + }).on('mouseup', () => { + modalDialog.removeClass(draggableStr); + }); + }); + } + } + }) + .name; + +})(Entaxy || (Entaxy = {})); diff --git a/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/modalListWithDescription.js b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/modalListWithDescription.js new file mode 100644 index 00000000..f8b033ff --- /dev/null +++ b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/modalListWithDescription.js @@ -0,0 +1,77 @@ +/*- + * ~~~~~~licensing~~~~~~ + * entaxy-management-plugin + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +var Entaxy; +(function (Entaxy) { + Entaxy._module + .component('entaxyModalListWithDescription', { + bindings: { + items: '<', + selectedItem: '<', + changeSelection: '<' + }, + template: + ` + + `, + controller: entaxyModalListWithDescriptionController + }) + .name; + + function entaxyModalListWithDescriptionController() { + + var ctrl = this; + + ctrl.$onInit = function() { + ctrl.title = 'Factory Description:'; + } + + ctrl.matchesFilter = function(factory, filter) { + var match = false; + + if (factory.displayName.toLowerCase().match(filter.value.toLowerCase()) !== null || + factory.name.toLowerCase().match(filter.value.toLowerCase()) !== null || + (factory.label && factory.label.toLowerCase().match(filter.value.toLowerCase()) !== null)) { + match = true; + return match; + } + + return match; + }; + } + +})(Entaxy || (Entaxy = {})); diff --git a/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/properties.js b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/properties.js new file mode 100644 index 00000000..569d8a60 --- /dev/null +++ b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/properties.js @@ -0,0 +1,148 @@ +/*- + * ~~~~~~licensing~~~~~~ + * entaxy-management-plugin + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +var Entaxy; +(function (Entaxy) { + Entaxy._module + .component('entaxyProperties', { + template: + ` +

+ {{$ctrl.title}} +

+
+ +
+ + `, + controller: entaxyPropertiesController + }) + .name; + + function entaxyPropertiesController(workspace, operationsService, entaxyService) { + 'ngInject'; + + var ctrl = this; + + ctrl.$onInit = function() { + + ctrl.itemName = 'Profile'; + ctrl.mode = Entaxy.MODAL_MODES.EDIT; + + let selectedMbean = workspace.getSelectedMBean(); + ctrl.title = 'Properties of ' + selectedMbean.title; + ctrl.submitBtnTitle = Entaxy.getButtonTitleByMode(ctrl.mode); + + let profilesMbean = workspace.tree.findDescendant(child => child.objectName ? child.objectName.endsWith('category=profiles') : false); + let mbeanName = profilesMbean.objectName; + + operationsService + .executeOperation(mbeanName, { name: 'get' + ctrl.itemName + 'Config' }, [ selectedMbean.title ]) + .then(result => { + ctrl.itemInfo = JSON.parse(result); + let properties = Object.entries(ctrl.itemInfo.properties); + ctrl.properties = properties.map(property => { return { name: property[0], value: property[1] }; }); + + let factory = workspace.tree.findDescendant(child => child.title === ctrl.itemInfo.factoryId); + ctrl.factories = [{ name: factory.title, mbeanName: factory.objectName }]; + + makeFormFieldsAndGroups(); + }).catch(error => { + Core.notification('danger', error, 5000); + Entaxy.log.error(error); + }); + } + + function makeFormFieldsAndGroups() { + + ctrl.formFields = []; + + ctrl.formFields.push({ + label: 'Factory Id', + name: 'factoryId', + type: 'java.lang.String', + helpText: null, + value: ctrl.factories[0].name, + readOnly: true, + required: true, + group: 'general' + }); + + let mbeanName = ctrl.factories[0].mbeanName; + + operationsService.executeOperation(mbeanName, { name: 'getFields' }, [ 'init' ]) + .then((response) => { + + let groups = new Set(); + groups.add('general'); + + _.forEach(JSON.parse(response), (field) => { + + let formField = entaxyService.makeFormField(field, ctrl.itemInfo['objectId'], ctrl.properties, ctrl.mode); + + ctrl.formFields.push(formField); + groups.add(formField.group); + }); + + ctrl.formFields.forEach(formField => formField.type = Entaxy.convertToHtmlInputType(formField.type)); + + ctrl.groups = Array.from(groups).map((group) => { return { name: group, displayName: group }; }); + }); + } + + ctrl.save = function(fieldsOrigin) { + + let fields = JSON.parse(JSON.stringify(fieldsOrigin)); + + entaxyService.validateFields(fields, ctrl.factories[0], ctrl.itemName) + .then(errors => { + ctrl.errors = errors; + + if (Object.keys(ctrl.errors).length === 0) { + let args = entaxyService.getArguments(fields, ctrl.factories); + update(args); + } + }); + } + + function update(args) { + + let objectId = args.fields.find((field) => field.name === 'objectId').value; + + let fields = objectId ? args.fields.filter((field) => field.name !== 'objectId') : args.fields; + + let mbeanName = args.factoryId.mbeanName; + let properties = fields.reduce((obj, cur) => ({ ...obj, [cur.name] : cur.value }), {}); + let instructions = {"@LIFECYCLE":["general"]}; + + operationsService.executeOperation(mbeanName, { name: 'createObjectByInstructions' }, [ objectId, 'public', instructions, properties ] ) + .then(result => { + let tableHtml = Entaxy.createTableFromResponse(result); + Entaxy.notification('success', tableHtml, 10000); + }).catch(error => { + Core.notification('danger', error, 5000); + Entaxy.log.error(error); + }); + } + + } + entaxyPropertiesController.$inject = ['workspace', 'operationsService', 'entaxyService']; + +})(Entaxy || (Entaxy = {})); diff --git a/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/select.js b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/select.js new file mode 100644 index 00000000..ea3bd0ae --- /dev/null +++ b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/select.js @@ -0,0 +1,193 @@ +/*- + * ~~~~~~licensing~~~~~~ + * entaxy-management-plugin + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +var Entaxy; +(function (Entaxy) { + // fixme this component works only for connections now + Entaxy._module + .component('entaxySelect', { + bindings: { + type: '<', + filter: '<', + model: '=', + updateParentFn: '<', + options: '=' + }, + template: + ` +
+ + +
+ `, + controller: entaxySelectController + }) + .name; + + function entaxySelectController(workspace, jolokiaService, $q, $uibModal) { + 'ngInject'; + + var ctrl = this; + + ctrl.$onInit = function() { + + if (ctrl.type === 'entaxy.runtime.connection') { + + if (!ctrl.options) { + + let promises = []; + let filteredConnections = []; + + let connectionsFolder = workspace.tree.findDescendant(child => (child.objectName && child.objectName.endsWith('category=connections'))); + + if (connectionsFolder) { + if (ctrl.filter) { + connectionsFolder.children.forEach((child) => { + promises.push( + jolokiaService.getAttribute(child.objectName, 'Label') + .then((label) => { + if (label.indexOf(ctrl.filter) > -1) { + filteredConnections.push({ name: child.title, mbeanName: connectionsFolder.objectName }); + } + }) + ); + }); + } else { + filteredConnections = connectionsFolder.children ? connectionsFolder.children.map(child => { name: child.title }) : []; + } + } + + $q.all(promises).then(() => { + if (filteredConnections && filteredConnections.length > 0) { + ctrl.options = filteredConnections.sort(Entaxy.compareBy('name')); + ctrl.changeSelection(filteredConnections[0]); + } else { + Core.notification('danger', 'There are no suitable connections', 5000); + // todo close the modal + } + }); + } else { + ctrl.selectedOption = ctrl.options.find((option) => option.name === ctrl.model || option.value === ctrl.model); + } + } + } + + ctrl.changeSelection = function (option) { + let previousOption = ctrl.selectedOption; + ctrl.selectedOption = option; + ctrl.model = option.value ? option.value : option.name; + + if (ctrl.type === 'entaxy.runtime.connection') { + if (previousOption) { + Core.notification('warning', 'Changing connection field value may lead to changes in other fields of the current connector. ' + + 'Please, make sure to revise all fields before accepting.', 10000); + } + ctrl.updateParentFn(previousOption, option, 'Connection'); + } + } + + ctrl.addConnection = function () { + ctrl.showModal(); + } + + ctrl.showModal = function() { + + let factories = []; + let promises = []; + + let factoryFolder = workspace.tree.findDescendant(child => child.title === ctrl.type); + + if (factoryFolder && factoryFolder.children) { + factoryFolder.children.forEach((child) => { + promises.push(jolokiaService.getAttributes(child.objectName, ['Abstract', 'DisplayName', 'Label', 'Description', 'Deprecated']) + .then((result) => { + let label = result['Label']; + + if (!result['Abstract']) { + if (!ctrl.filter || (ctrl.filter && label && label.indexOf(ctrl.filter) > -1)) { + factories.push({ + name: child.title, + displayName: result['DisplayName'] ? result['DisplayName'] : child.title, + label: result['Label'], + mbeanName: child.objectName, + description: result['Description'] ? result['Description'] : 'There is no description for this factory.', + additionalInfo: result['Deprecated'] ? ['[DEPRECATED]'] : undefined + }); + } + } + })); + }); + + $uibModal.open({ + component: 'entaxyModal', + resolve: { + mode: () => Entaxy.MODAL_MODES.ADD, + itemType: () => 'Connection', + factories: $q.all(promises).then(() => factories) + }, + size: 'xl', + backdrop: 'static', + windowTopClass: 'modal-top-margin-override' + }) + .result.then(args => { + addItem(args); + }, + reason => { + if (reason) { + Core.notification('danger', reason, 5000); + } + }); + } + } + + function addItem(args) { + + let factoryId = args.factoryId.name; + + let objectId = args.fields.find((field) => field.name === 'objectId').value; + + let fields = objectId ? args.fields.filter((field) => field.name !== 'objectId') : args.fields; + + let properties = fields.reduce((obj, cur) => ({ ...obj, [cur.name] : cur.value }), {}); + + let newObjectProperties = { + factoryId: factoryId, + objectId: objectId, + scope: 'private', + properties: properties + }; + + let newObjectOption = { + name: objectId ? objectId : 'private-connection', + value: newObjectProperties + }; + + ctrl.options.push(newObjectOption); + ctrl.changeSelection(newObjectOption); + } + } + entaxySelectController.$inject = ['workspace', 'jolokiaService', '$q', '$uibModal']; + +})(Entaxy || (Entaxy = {})); diff --git a/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/selectFromEnum.js b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/selectFromEnum.js new file mode 100644 index 00000000..5aa87656 --- /dev/null +++ b/ui/entaxy-hawtio/entaxy-management-plugin/src/main/webapp/plugin/js/components/selectFromEnum.js @@ -0,0 +1,58 @@ +/*- + * ~~~~~~licensing~~~~~~ + * entaxy-management-plugin + * ========== + * Copyright (C) 2020 - 2023 EmDev LLC + * ========== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ~~~~~~/licensing~~~~~~ + */ +var Entaxy; +(function (Entaxy) { + Entaxy._module + .component('entaxySelectFromEnum', { + bindings: { + values: '<', + isEmptyIncluded: '<', + model: '=' + }, + template: + ` +