release version 1.11.0
This commit is contained in:
@ -0,0 +1,49 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>config-implementation</artifactId>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.config-implementation</groupId>
|
||||
<artifactId>config-runtime</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONFIG :: RUNTIME</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONFIG :: RUNTIME</description>
|
||||
|
||||
<properties>
|
||||
|
||||
<bundle.osgi.export.pkg>ru.entaxy.platform.config.runtime</bundle.osgi.export.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.karaf.config</groupId>
|
||||
<artifactId>org.apache.karaf.config.core</artifactId>
|
||||
<version>${karaf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>org.apache.felix.configadmin</artifactId>
|
||||
<version>${felix.configadmin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.core.object-producing
|
||||
</groupId>
|
||||
<artifactId>object-producer-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>object-runtime-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons-io.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,163 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* config-runtime
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.config.runtime;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.framework.Constants;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.service.cm.Configuration;
|
||||
import org.osgi.service.cm.ConfigurationAdmin;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.support.JSONUtils;
|
||||
|
||||
public class ConfigEntaxyObject implements EntaxyObject, ConfigEntaxyObjectWrapped {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ConfigEntaxyObject.class);
|
||||
|
||||
protected EntaxyObject origin;
|
||||
|
||||
protected Map<String, Object> configurationMap = new HashMap<>();
|
||||
|
||||
public ConfigEntaxyObject(EntaxyObject entaxyObject) {
|
||||
super();
|
||||
this.origin = entaxyObject;
|
||||
configurationMap.put(EntaxyObject.FIELDS.OBJECT_ID, origin.getId());
|
||||
configurationMap.put(EntaxyObject.FIELDS.OBJECT_TYPE, origin.getType());
|
||||
configurationMap.put(EntaxyObject.FIELDS.FACTORY_ID, origin.getFactoryId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyObject getOrigin() {
|
||||
return this.origin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return origin.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return origin.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return origin.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScope() {
|
||||
return origin.getScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwner() {
|
||||
return origin.getOwner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFactoryId() {
|
||||
return origin.getFactoryId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BundleInfo getBundleInfo() {
|
||||
return origin.getBundleInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfiguration() {
|
||||
ServiceReference<ConfigurationAdmin> ref =
|
||||
ObjectConfigHelper.getInstance().getReference(ConfigurationAdmin.class);
|
||||
if (ref != null) {
|
||||
ConfigurationAdmin configurationAdmin = ObjectConfigHelper.getInstance().getService(ref);
|
||||
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
|
||||
try {
|
||||
Configuration config = configurationAdmin.getConfiguration(getId(), "?");
|
||||
|
||||
Enumeration<String> keys = config.getProperties().keys();
|
||||
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = keys.nextElement();
|
||||
properties.put(key, config.getProperties().get(key));
|
||||
}
|
||||
|
||||
properties.remove("felix.fileinstall.filename");
|
||||
properties.remove(Constants.SERVICE_PID);
|
||||
properties.remove(ConfigurationAdmin.SERVICE_FACTORYPID);
|
||||
|
||||
configurationMap.put(EntaxyObject.FIELDS.PROPERTIES, properties);
|
||||
|
||||
|
||||
return JSONUtils.GSON.toJsonTree(configurationMap).toString();
|
||||
|
||||
} catch (IOException e) {
|
||||
LOG.error("Error reading configuration [" + getId() + "]", e);
|
||||
} finally {
|
||||
ObjectConfigHelper.getInstance().ungetService(ref);
|
||||
}
|
||||
|
||||
}
|
||||
return origin.getConfiguration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProvided() {
|
||||
return origin.isProvided();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComplete() {
|
||||
return origin.isComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGhost() {
|
||||
return origin.isGhost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Relation> getRelations() {
|
||||
return origin.getRelations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Relation> getIncomingRelations() {
|
||||
return origin.getIncomingRelations();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* config-runtime
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.config.runtime;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
|
||||
public interface ConfigEntaxyObjectWrapped {
|
||||
EntaxyObject getOrigin();
|
||||
}
|
@ -0,0 +1,588 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-producing-config-support
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.config.runtime;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.felix.utils.properties.TypedProperties;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.service.cm.Configuration;
|
||||
import org.osgi.service.cm.ConfigurationAdmin;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory.FieldInfo;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory.OutputInfo;
|
||||
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.EntaxyProducerUtils;
|
||||
|
||||
public class ObjectConfig {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ObjectConfig.class);
|
||||
|
||||
public static final String CONFIG_OBJECT_TYPE = "entaxy.runtime.config";
|
||||
|
||||
public static final String TARGET_FACTORY_FIELD_NAME = "targetObjectFactoryId";
|
||||
public static final String TARGET_TYPE_FIELD_NAME = "targetObjectType";
|
||||
public static final String TARGET_ID_FIELD_NAME = "targetObjectId";
|
||||
public static final String TARGET_OUTPUT_FIELD_NAME = "targetObjectOutput";
|
||||
|
||||
public static final String CONFIG_PROPERTIES_FIELD_NAME = "configuredProperties";
|
||||
public static final String CONFIG_FACTORY_FIELD_NAME = "__entaxy_configuredFactoryId";
|
||||
public static final String CONFIG_TYPE_FIELD_NAME = "__entaxy_configuredType";
|
||||
public static final String CONFIG_ID_FIELD_NAME = "__entaxy_configuredId";
|
||||
public static final String CONFIG_OUTPUT_FIELD_NAME = "__entaxy_configuredOutput";
|
||||
public static final String CONFIG_HINT_FIELD_NAME = "__entaxy_config_hint";
|
||||
|
||||
public static final List<String> CONFIG_INTERNAL_FIELDS = Arrays.asList(new String[] {CONFIG_FACTORY_FIELD_NAME,
|
||||
CONFIG_TYPE_FIELD_NAME, CONFIG_ID_FIELD_NAME, CONFIG_OUTPUT_FIELD_NAME, CONFIG_HINT_FIELD_NAME});
|
||||
|
||||
public static final String CONFIG_PID_FIELD_NAME = "configurationPid";
|
||||
public static final String CONFIG_PLACEHOLDER_PREFIX_FIELD_NAME = "placeholderPrefix";
|
||||
|
||||
@Deprecated
|
||||
public static final String CONFIG_FIELD_NAME = "##config";
|
||||
public static final String CONFIG_DEFAULTS_FIELD_NAME = "##config";
|
||||
public static final String CONFIG_LINK_FIELD_NAME = "##config-link";
|
||||
public static final String CONFIGURABLE_ATTRIBUTE_NAME = "configurable";
|
||||
public static final String DEFAULT_FIELDS_CONFIGURABLE_ATTRIBUTE_NAME = "fieldsConfigurableByDefault";
|
||||
public static final String CONFIGURABLE_FIELDS_ATTRIBUTE_NAME = "configurableFields";
|
||||
public static final String PROPERTIES_BACKUP_FIELD = EntaxyObject.FIELDS.PROPERTIES + "_backup";
|
||||
|
||||
public static final String DIRECT_VALUE_ONLY_ATTR_NAME = "directValueOnly";
|
||||
|
||||
public static final String CONFIGURABLES_FIELD_NAME = "configurables";
|
||||
public static final String IMMUTABLES_FIELD_NAME = "immutables";
|
||||
|
||||
public static final String HEADER_OBJECT_CONFIG_PID = "Entaxy-Generated-Object-Config-Pid";
|
||||
|
||||
protected static Gson GSON = new GsonBuilder().create();
|
||||
|
||||
public static String getConfigurationPid(String objectId, String type) {
|
||||
return reduceType(type) + "." + objectId.replace("-", "_");
|
||||
}
|
||||
|
||||
public static String reduceType(String type) {
|
||||
return type
|
||||
// .replace(EntaxyObject.OBJECT_TYPES.ENTAXY_RUNTIME_TYPE_PREFIX, "e_r_")
|
||||
.replace("-", "_");
|
||||
}
|
||||
|
||||
public static String getConfigurationPrefix(String objectId, String type) {
|
||||
return "$" + getConfigurationPid(objectId, type) + "{";
|
||||
}
|
||||
|
||||
public static boolean isConfigurable(EntaxyFactory factory, String outputType, String fieldName,
|
||||
boolean defaultFieldsConfigurable, List<ConfigurableFieldsConfiguration> configurations) {
|
||||
Optional<FieldInfo> fi = factory.getOutputByType(outputType).getFields().stream()
|
||||
.filter(f -> f.getName().equals(fieldName)).findFirst();
|
||||
if (!fi.isPresent())
|
||||
return false;
|
||||
|
||||
boolean fieldIsConfigurable = defaultFieldsConfigurable;
|
||||
|
||||
try {
|
||||
fieldIsConfigurable = fi.get().getJsonOrigin().get(CONFIGURABLE_ATTRIBUTE_NAME).getAsBoolean();
|
||||
} catch (Exception e) {
|
||||
// usinf default value
|
||||
}
|
||||
|
||||
if (!fieldIsConfigurable)
|
||||
return false;
|
||||
|
||||
for (ConfigurableFieldsConfiguration cfc : configurations)
|
||||
if (cfc.isConfigurable(factory, outputType, fieldName))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void backupProperties(Map<String, Object> parameters) {
|
||||
backupProperties(parameters, EntaxyObject.FIELDS.PROPERTIES);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void backupProperties(Map<String, Object> parameters, String fieldName) {
|
||||
if (!parameters.containsKey(fieldName))
|
||||
return;
|
||||
Map<String, Object> backup = new HashMap<>();
|
||||
backup.putAll((Map<String, Object>) parameters.get(fieldName));
|
||||
parameters.put(ObjectConfig.PROPERTIES_BACKUP_FIELD, backup);
|
||||
}
|
||||
|
||||
public static void restoreBackupProperties(Map<String, Object> parameters) {
|
||||
restoreBackupProperties(parameters, EntaxyObject.FIELDS.PROPERTIES);
|
||||
}
|
||||
|
||||
public static void restoreBackupProperties(Map<String, Object> parameters, String fieldName) {
|
||||
if (!parameters.containsKey(ObjectConfig.PROPERTIES_BACKUP_FIELD))
|
||||
return;
|
||||
parameters.put(fieldName, parameters.get(ObjectConfig.PROPERTIES_BACKUP_FIELD));
|
||||
}
|
||||
|
||||
public static void removeConfigData(Map<String, Object> parameters) {
|
||||
removeConfigData(parameters, EntaxyObject.FIELDS.PROPERTIES);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void removeConfigData(Map<String, Object> parameters, String fieldName) {
|
||||
if (!parameters.containsKey(fieldName))
|
||||
return;
|
||||
((Map<String, Object>) parameters.get(fieldName)).remove(CONFIG_FIELD_NAME);
|
||||
}
|
||||
|
||||
public static Map<String, Object> getTargetConfigMap(EntaxyFactory factory, String outputType, String fieldName,
|
||||
Map<String, Object> configurables, Map<String, Object> immutables) {
|
||||
/*
|
||||
Optional<FieldInfo> fi = factory.getOutputByType(outputType).getFields().stream().filter(f -> f.getName().equals(fieldName)).findFirst();
|
||||
|
||||
if (!fi.isPresent()) {
|
||||
log.debug("FIELD NOT FOUND: " + fieldName);
|
||||
return null;
|
||||
}
|
||||
FieldInfo field = fi.get();
|
||||
boolean isConfigurable = true;
|
||||
log.debug("\n FIELDNAME:: " + fieldName + " -> " + field.getJsonOrigin());
|
||||
if (field.getJsonOrigin().has(CONFIGURABLE_ATTRIBUTE_NAME))
|
||||
try {
|
||||
isConfigurable = field.getJsonOrigin().get(CONFIGURABLE_ATTRIBUTE_NAME).getAsBoolean();
|
||||
} catch (Exception e) {
|
||||
isConfigurable = true;
|
||||
}
|
||||
if (!isConfigurable) {
|
||||
log.debug("FIELD NOT CONFIGURABLE: " + fieldName);
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
Optional<FieldInfo> fi = factory.getOutputByType(outputType).getFields().stream()
|
||||
.filter(f -> f.getName().equals(fieldName)).findFirst();
|
||||
|
||||
if (!fi.isPresent()) {
|
||||
log.debug("FIELD NOT FOUND: " + fieldName);
|
||||
return null;
|
||||
}
|
||||
|
||||
FactoryOutputConfiguration conf = FactoryOutputConfiguration.read(factory, outputType);
|
||||
|
||||
if (!isConfigurable(factory, outputType, fieldName, conf.defaultFieldsConfigurable, conf.configurations))
|
||||
return null;
|
||||
|
||||
FieldInfo field = fi.get();
|
||||
|
||||
if (field.isImmutable())
|
||||
return immutables;
|
||||
return configurables;
|
||||
}
|
||||
|
||||
public static String getConfiguredObjectId(String pid) {
|
||||
ServiceReference<ConfigurationAdmin> ref = null;
|
||||
try {
|
||||
ref =
|
||||
ObjectConfigHelper.getInstance().getReference(ConfigurationAdmin.class);
|
||||
ConfigurationAdmin configurationAdmin = ObjectConfigHelper.getInstance().getService(ref);
|
||||
|
||||
Configuration configuration = configurationAdmin.getConfiguration(pid, "?");
|
||||
if (configuration == null)
|
||||
return null;
|
||||
|
||||
String configuredId = configuration.getProperties().get(CONFIG_ID_FIELD_NAME).toString();
|
||||
String configuredType = configuration.getProperties().get(CONFIG_TYPE_FIELD_NAME).toString();
|
||||
|
||||
if (!CommonUtils.isValid(configuredId) || !CommonUtils.isValid(configuredType))
|
||||
return null;
|
||||
|
||||
return configuredId + ":" + configuredType;
|
||||
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
} finally {
|
||||
ObjectConfigHelper.getInstance().ungetService(ref);
|
||||
}
|
||||
}
|
||||
|
||||
public static class FactoryOutputConfiguration {
|
||||
|
||||
public static FactoryOutputConfiguration read(EntaxyFactory factory, String outputType) {
|
||||
|
||||
FactoryOutputConfiguration result = new FactoryOutputConfiguration();
|
||||
|
||||
OutputInfo oi = factory.getOutputByType(outputType);
|
||||
if (oi == null)
|
||||
oi = factory.getDefaultOutput();
|
||||
|
||||
Map<String, Object> outputConfig = oi.getConfig();
|
||||
|
||||
result.isConfigurable = false;
|
||||
try {
|
||||
result.isConfigurable = (Boolean) outputConfig.get(ObjectConfig.CONFIGURABLE_ATTRIBUTE_NAME);
|
||||
} catch (Exception e) {
|
||||
log.trace("Parameter [{}] not found in [{}]:[{}]", ObjectConfig.CONFIGURABLE_ATTRIBUTE_NAME,
|
||||
factory.getId(), outputType);
|
||||
}
|
||||
if (!result.isConfigurable)
|
||||
return result;
|
||||
|
||||
result.defaultFieldsConfigurable = false;
|
||||
try {
|
||||
result.defaultFieldsConfigurable =
|
||||
(Boolean) outputConfig.get(ObjectConfig.DEFAULT_FIELDS_CONFIGURABLE_ATTRIBUTE_NAME);
|
||||
} catch (Exception e) {
|
||||
log.trace("Parameter [{}] not found in [{}]:[{}]",
|
||||
ObjectConfig.DEFAULT_FIELDS_CONFIGURABLE_ATTRIBUTE_NAME, factory.getId(), outputType);
|
||||
}
|
||||
|
||||
result.configurations = new ArrayList<>();
|
||||
|
||||
Object configuration = outputConfig.get(ObjectConfig.CONFIGURABLE_FIELDS_ATTRIBUTE_NAME);
|
||||
if (configuration != null) {
|
||||
if (configuration instanceof List) {
|
||||
List configList = (List) configuration;
|
||||
for (Object configItem : configList) {
|
||||
if (configItem instanceof Map) {
|
||||
ObjectConfig.ConfigurableFieldsConfiguration cnf =
|
||||
ObjectConfig.ConfigurableFieldsConfiguration.read((Map) configItem);
|
||||
result.configurations.add(cnf);
|
||||
}
|
||||
}
|
||||
} else if (configuration instanceof Map) {
|
||||
ObjectConfig.ConfigurableFieldsConfiguration cnf =
|
||||
ObjectConfig.ConfigurableFieldsConfiguration.read((Map) configuration);
|
||||
result.configurations.add(cnf);
|
||||
}
|
||||
} else {
|
||||
result.configurations.add(new ObjectConfig.ConfigurableFieldsConfiguration());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean isConfigurable;
|
||||
public boolean defaultFieldsConfigurable;
|
||||
public List<ConfigurableFieldsConfiguration> configurations;
|
||||
|
||||
}
|
||||
|
||||
public static class ConfigurableFieldsConfiguration {
|
||||
|
||||
public static ConfigurableFieldsConfiguration read(Map parameters) {
|
||||
JsonElement obj = GSON.toJsonTree(parameters);
|
||||
if (obj.isJsonObject()) {
|
||||
ConfigurableFieldsConfiguration result = GSON.fromJson(obj, ConfigurableFieldsConfiguration.class);
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
List<String> includeNames = new ArrayList<>();
|
||||
List<String> includePatterns = new ArrayList<>();
|
||||
List<String> excludeNames = new ArrayList<>();
|
||||
List<String> excludePatterns = new ArrayList<>();
|
||||
|
||||
List<String> includeTypes = new ArrayList<>();
|
||||
List<String> excludeTypes = new ArrayList<>();
|
||||
|
||||
public ConfigurableFieldsConfiguration() {
|
||||
includeTypes.add("string");
|
||||
includeTypes.add("boolean");
|
||||
includeTypes.add("number");
|
||||
includePatterns.add("*");
|
||||
}
|
||||
|
||||
|
||||
public boolean isConfigurable(EntaxyFactory factory, String outputType, String fieldName) {
|
||||
Optional<FieldInfo> fi = factory.getOutputByType(outputType).getFields().stream()
|
||||
.filter(f -> f.getName().equals(fieldName)).findFirst();
|
||||
if (!fi.isPresent())
|
||||
return false;
|
||||
|
||||
String fieldType = fi.get().getType().toLowerCase();
|
||||
|
||||
|
||||
boolean fieldIsExcluded = false;
|
||||
for (String name : excludeNames)
|
||||
if (fieldName.equals(name)) {
|
||||
fieldIsExcluded = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!fieldIsExcluded) {
|
||||
for (String pattern : excludePatterns) {
|
||||
if (Pattern.matches(EntaxyProducerUtils.toRegexPattern(pattern), fieldName)) {
|
||||
fieldIsExcluded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!fieldIsExcluded) {
|
||||
for (String type : excludeTypes)
|
||||
if (type.equals(fieldType)) {
|
||||
fieldIsExcluded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fieldIsExcluded)
|
||||
return false;
|
||||
|
||||
boolean fieldIsIncluded = false;
|
||||
|
||||
// first we check types
|
||||
if (!fieldIsIncluded) {
|
||||
for (String type : includeTypes)
|
||||
if (type.equals(fieldType)) {
|
||||
fieldIsIncluded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!fieldIsIncluded)
|
||||
return false;
|
||||
|
||||
if (!includeNames.isEmpty() || !includePatterns.isEmpty())
|
||||
fieldIsIncluded = false;
|
||||
|
||||
for (String name : includeNames)
|
||||
if (fieldName.equals(name)) {
|
||||
fieldIsIncluded = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!fieldIsIncluded) {
|
||||
for (String pattern : includePatterns) {
|
||||
if (Pattern.matches(EntaxyProducerUtils.toRegexPattern(pattern), fieldName)) {
|
||||
fieldIsIncluded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fieldIsIncluded;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ConfigHint {
|
||||
|
||||
public static final String CONFIG_HINT_SECTION_FIELDS = "fields";
|
||||
|
||||
protected Map<String, Object> configHint = new HashMap<>();
|
||||
|
||||
public Map<String, Object> getAsMap() {
|
||||
return configHint;
|
||||
}
|
||||
|
||||
public JsonElement getAsJson() {
|
||||
return JSONUtils.GSON.toJsonTree(configHint);
|
||||
}
|
||||
|
||||
public String getAsJsonString() {
|
||||
return getAsJson().toString();
|
||||
}
|
||||
|
||||
public void generate(Map<String, Object> configProperties, String factoryId, String outputType) {
|
||||
|
||||
Map<String, Object> fieldsHint = generateFieldsHint(configProperties, factoryId, outputType);
|
||||
if (fieldsHint != null)
|
||||
configHint.put(CONFIG_HINT_SECTION_FIELDS, fieldsHint);
|
||||
|
||||
}
|
||||
|
||||
public void readFrom(TypedProperties typedProperties) {
|
||||
if (typedProperties.containsKey(CONFIG_HINT_FIELD_NAME)) {
|
||||
String encoded = typedProperties.get(CONFIG_HINT_FIELD_NAME).toString();
|
||||
String hintString = new String(Base64.getDecoder().decode(encoded));
|
||||
read(hintString);
|
||||
}
|
||||
}
|
||||
|
||||
public void read(String hintString) {
|
||||
this.configHint = JSONUtils.element2map(JSONUtils.getJsonRootObject(hintString));
|
||||
}
|
||||
|
||||
protected Map<String, Object> generateFieldsHint(Map<String, Object> configProperties, String factoryId,
|
||||
String outputType) {
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
try {
|
||||
|
||||
ServiceReference<EntaxyProducerService> ref =
|
||||
ObjectConfigHelper.getInstance().getReference(EntaxyProducerService.class);
|
||||
if (ref != null) {
|
||||
EntaxyProducerService entaxyProducerService = ObjectConfigHelper.getInstance().getService(ref);
|
||||
|
||||
EntaxyFactory factory = entaxyProducerService.findFactoryById(factoryId);
|
||||
if (factory == null) {
|
||||
log.error("Factory not found: [{}]", factoryId);
|
||||
return null;
|
||||
}
|
||||
|
||||
OutputInfo outputInfo = null;
|
||||
|
||||
if (CommonUtils.isValid(outputType)) {
|
||||
outputInfo = factory.getOutputByType(outputType);
|
||||
} else {
|
||||
outputInfo = factory.getDefaultOutput();
|
||||
}
|
||||
if (outputInfo == null) {
|
||||
log.error("Output [{}] not found in factory [{}]", outputType, factoryId);
|
||||
return null;
|
||||
}
|
||||
|
||||
for (FieldInfo fi : outputInfo.getFields()) {
|
||||
if (configProperties.containsKey(fi.getName())) {
|
||||
ConfigFieldHint fieldHint = ConfigFieldHint.create(fi);
|
||||
result.put(fieldHint.getName(), (Map<String, Object>) fieldHint);
|
||||
}
|
||||
}
|
||||
|
||||
ObjectConfigHelper.getInstance().ungetService(ref);
|
||||
|
||||
for (String name : ObjectConfig.CONFIG_INTERNAL_FIELDS) {
|
||||
ConfigFieldHint fieldHint = new ConfigFieldHint(name);
|
||||
fieldHint.setInternal(true);
|
||||
result.put(name, (Map<String, Object>) fieldHint);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, ConfigFieldHint> getFieldsHint() {
|
||||
if (configHint.containsKey(CONFIG_HINT_SECTION_FIELDS)) {
|
||||
Object obj = configHint.get(CONFIG_HINT_SECTION_FIELDS);
|
||||
if (obj instanceof Map) {
|
||||
Map<String, Object> fieldHints = (Map<String, Object>) obj;
|
||||
Map<String, ConfigFieldHint> result = new HashMap<>();
|
||||
|
||||
for (String name : fieldHints.keySet()) {
|
||||
ConfigFieldHint fieldHint = new ConfigFieldHint(name);
|
||||
fieldHint.load((Map<String, Object>) fieldHints.get(name));
|
||||
result.put(name, fieldHint);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class ConfigFieldHint extends HashMap<String, Object> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String CONFIG_FIELD_IS_INTERNAL = "isInternal";
|
||||
|
||||
public static ConfigFieldHint create(FieldInfo fieldInfo) {
|
||||
ConfigFieldHint result = new ConfigFieldHint(fieldInfo.getName());
|
||||
|
||||
result.setType(fieldInfo.getType());
|
||||
result.setDisplayName(fieldInfo.getDisplayName());
|
||||
result.setDescription(fieldInfo.getDescription());
|
||||
result.setInternal(false);
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public ConfigFieldHint(String name) {
|
||||
super();
|
||||
setName(name);
|
||||
}
|
||||
|
||||
String name;
|
||||
|
||||
public void load(Map<String, Object> data) {
|
||||
this.putAll(data);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
Object displayName = getOrDefault(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.FIELD_DISPLAY_NAME, "");
|
||||
return displayName != null ? displayName.toString() : "";
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
put(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.FIELD_DISPLAY_NAME, displayName);
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return getOrDefault(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.FIELD_TYPE, "String").toString();
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
put(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.FIELD_TYPE, type);
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return getOrDefault(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.FIELD_DESCRIPTION, "").toString();
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
put(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.FIELD_DESCRIPTION, description);
|
||||
}
|
||||
|
||||
public boolean isInternal() {
|
||||
return (Boolean) getOrDefault(CONFIG_FIELD_IS_INTERNAL, false);
|
||||
}
|
||||
|
||||
public void setInternal(boolean isInternal) {
|
||||
put(CONFIG_FIELD_IS_INTERNAL, isInternal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* config-runtime
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.config.runtime;
|
||||
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyObjectCustomizer;
|
||||
|
||||
@Component(service = EntaxyObjectCustomizer.class, immediate = true)
|
||||
public class ObjectConfigCustomizer implements EntaxyObjectCustomizer {
|
||||
|
||||
@Override
|
||||
public boolean isAccepted(EntaxyObject entaxyObject) {
|
||||
return entaxyObject.getType().equals(ObjectConfig.CONFIG_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyObject applyCustomization(EntaxyObject entaxyObject) {
|
||||
if (entaxyObject instanceof ConfigEntaxyObjectWrapped)
|
||||
return entaxyObject;
|
||||
return new ConfigEntaxyObject(entaxyObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyObject unapplyCustomization(EntaxyObject entaxyObject) {
|
||||
if (entaxyObject instanceof ConfigEntaxyObjectWrapped)
|
||||
return ((ConfigEntaxyObjectWrapped) entaxyObject).getOrigin();
|
||||
return entaxyObject;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,209 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* config-runtime
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.config.runtime;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.felix.utils.properties.TypedProperties;
|
||||
import org.osgi.framework.Constants;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.service.cm.Configuration;
|
||||
import org.osgi.service.cm.ConfigurationAdmin;
|
||||
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.config.runtime.ObjectConfig.ConfigFieldHint;
|
||||
|
||||
public class ObjectConfigEditor {
|
||||
|
||||
public static ObjectConfigEditor create(File configFile) throws IOException {
|
||||
return new ObjectConfigEditor(configFile);
|
||||
}
|
||||
|
||||
protected String pid;
|
||||
|
||||
protected File configFile;
|
||||
|
||||
protected TypedProperties loadedProperties;
|
||||
|
||||
protected ObjectConfig.ConfigHint configHint = new ObjectConfig.ConfigHint();
|
||||
|
||||
protected TypedProperties modifiedProperties = new TypedProperties();
|
||||
|
||||
protected Map<String, Object> currentProperties = new HashMap<>();
|
||||
|
||||
protected Map<String, ObjectConfig.ConfigFieldHint> fieldHints = new HashMap<>();
|
||||
|
||||
protected ObjectConfigEditor(File configFile) throws IOException {
|
||||
super();
|
||||
this.configFile = configFile;
|
||||
loadedProperties = new TypedProperties();
|
||||
loadedProperties.load(configFile);
|
||||
configHint.readFrom(loadedProperties);
|
||||
fieldHints = configHint.getFieldsHint();
|
||||
}
|
||||
|
||||
public void loadCurrent(String pid) throws Exception {
|
||||
ServiceReference<ConfigurationAdmin> ref = null;
|
||||
try {
|
||||
ref = ObjectConfigHelper.getInstance().getReference(ConfigurationAdmin.class);
|
||||
ConfigurationAdmin configurationAdmin = ObjectConfigHelper.getInstance().getService(ref);
|
||||
|
||||
int pos = pid.indexOf('~');
|
||||
if (pos >= 0) {
|
||||
pid = pid.substring(0, pos);
|
||||
}
|
||||
Configuration configuration = configurationAdmin.getConfiguration(pid, "?");
|
||||
|
||||
currentProperties.clear();
|
||||
if (configuration.getProperties() == null) {
|
||||
return;
|
||||
}
|
||||
Enumeration<String> keys = configuration.getProperties().keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = keys.nextElement();
|
||||
currentProperties.put(key, configuration.getProperties().get(key));
|
||||
}
|
||||
|
||||
} finally {
|
||||
if (ref != null)
|
||||
ObjectConfigHelper.getInstance().ungetService(ref);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean isDirty() {
|
||||
return !modifiedProperties.isEmpty();
|
||||
}
|
||||
|
||||
public Set<String> getPropertiesNames() {
|
||||
Set<String> result = new HashSet<>();
|
||||
result.addAll(loadedProperties.keySet());
|
||||
result.addAll(currentProperties.keySet());
|
||||
|
||||
// remove hint field itself
|
||||
result.remove(ObjectConfig.CONFIG_HINT_FIELD_NAME);
|
||||
// remove felix property
|
||||
result.remove("felix.fileinstall.filename");
|
||||
// remove osgi properties
|
||||
result.remove(Constants.SERVICE_PID);
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public ConfigProperty getAsConfigProperty(String name) {
|
||||
if (!getPropertiesNames().contains(name))
|
||||
return null;
|
||||
ConfigProperty result = new ConfigProperty(name);
|
||||
if (loadedProperties.containsKey(name))
|
||||
result.configValue = loadedProperties.get(name);
|
||||
if (currentProperties.containsKey(name))
|
||||
result.currentValue = currentProperties.get(name);
|
||||
if (modifiedProperties.containsKey(name))
|
||||
result.modifiedValue = modifiedProperties.get(name);
|
||||
if (fieldHints.containsKey(name))
|
||||
result.hint = fieldHints.get(name);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setValue(String propertyName, String propertyValue) throws Exception {
|
||||
if (!loadedProperties.containsKey(propertyName) && !currentProperties.containsKey(propertyName))
|
||||
throw new IllegalArgumentException("Unknown property: [" + propertyName + "]");
|
||||
ConfigProperty property = getAsConfigProperty(propertyName);
|
||||
String dataType = CommonUtils.getValid(property.hint.getType(), "string").toLowerCase();
|
||||
|
||||
Object valueToSet = propertyValue;
|
||||
|
||||
if ("boolean".equals(dataType)) {
|
||||
try {
|
||||
valueToSet = Boolean.parseBoolean(propertyValue);
|
||||
} catch (Exception e) {
|
||||
valueToSet = Boolean.FALSE;
|
||||
}
|
||||
} else if ("number".equals(valueToSet)) {
|
||||
try {
|
||||
valueToSet = NumberUtils.createNumber(propertyValue);
|
||||
} catch (Exception e) {
|
||||
valueToSet = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
modifiedProperties.put(propertyName, valueToSet);
|
||||
|
||||
}
|
||||
|
||||
public File getConfigFile() {
|
||||
return configFile;
|
||||
}
|
||||
|
||||
public void save() throws IOException {
|
||||
if (!isDirty())
|
||||
return;
|
||||
loadedProperties.putAll(modifiedProperties);
|
||||
loadedProperties.save(configFile);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
FileUtils.deleteQuietly(configFile);
|
||||
}
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public static class ConfigProperty {
|
||||
public ConfigFieldHint hint;
|
||||
public Object configValue = null;
|
||||
public Object currentValue = null;
|
||||
public Object modifiedValue = null;
|
||||
|
||||
public String name;
|
||||
|
||||
public ConfigProperty(String name) {
|
||||
this.name = name;
|
||||
this.hint = new ConfigFieldHint(name);
|
||||
}
|
||||
|
||||
public boolean isDirty() {
|
||||
return modifiedValue != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-producing-config-support
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.config.runtime;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
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.Deactivate;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObjectService;
|
||||
import ru.entaxy.platform.core.producer.executor.objectmodel.FactoredObjectRef;
|
||||
|
||||
@Component(service = ObjectConfigHelper.class, immediate = true)
|
||||
public class ObjectConfigHelper {
|
||||
|
||||
private static ObjectConfigHelper _INSTANCE = null;
|
||||
|
||||
public static ObjectConfigHelper getInstance() {
|
||||
return _INSTANCE;
|
||||
}
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY)
|
||||
EntaxyObjectService entaxyObjectService;
|
||||
|
||||
public BundleContext bundleContext;
|
||||
|
||||
public ObjectConfigHelper() {
|
||||
super();
|
||||
_INSTANCE = this;
|
||||
}
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
this.bundleContext = componentContext.getBundleContext();
|
||||
}
|
||||
|
||||
@Deactivate
|
||||
public void deactivate() {
|
||||
|
||||
}
|
||||
|
||||
public EntaxyObject findObject(String objectId, String objectType) {
|
||||
return entaxyObjectService.findObject(objectId, objectType);
|
||||
}
|
||||
|
||||
public boolean isDirectValueOnly(FactoredObjectRef ref) {
|
||||
if (!ref.origin.has(ObjectConfig.DIRECT_VALUE_ONLY_ATTR_NAME))
|
||||
return false;
|
||||
try {
|
||||
return ref.origin.get(ObjectConfig.DIRECT_VALUE_ONLY_ATTR_NAME).getAsBoolean();
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public <S> ServiceReference<S> getReference(Class<S> clazz) {
|
||||
if (bundleContext == null)
|
||||
return null;
|
||||
return bundleContext.getServiceReference(clazz);
|
||||
}
|
||||
|
||||
public <T> T getService(ServiceReference<T> ref) {
|
||||
return (T) bundleContext.getService(ref);
|
||||
}
|
||||
|
||||
public void ungetService(ServiceReference<?> ref) {
|
||||
if (bundleContext == null)
|
||||
return;
|
||||
bundleContext.ungetService(ref);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>config-implementation</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONFIG</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONFIG</description>
|
||||
<modules>
|
||||
<module>config-runtime</module>
|
||||
</modules>
|
||||
</project>
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connection-implementation</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.connection-implementation</groupId>
|
||||
<artifactId>connection-producing</artifactId>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connection-implementation</artifactId>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connection-implementation</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.connection-implementation</groupId>
|
||||
<artifactId>standard-connections-pack</artifactId>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* file-adapter
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* file-adapter
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -0,0 +1,130 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* file-adapter
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.runtime.connections.ftps;
|
||||
|
||||
import org.apache.camel.ExtendedCamelContext;
|
||||
import org.apache.camel.component.file.GenericFileEndpoint;
|
||||
import org.apache.camel.component.file.remote.FtpsComponent;
|
||||
import org.apache.camel.spi.PropertyConfigurer;
|
||||
import org.apache.commons.net.ftp.FTPFile;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class FtpsConnectionComponent extends FtpsComponent {
|
||||
|
||||
private static final String COMPONENT_CONFIGURER = "ftps-component-configurer";
|
||||
private static final String ENDPOINT_CONFIGURER = "ftps-endpoint-configurer";
|
||||
private static final String PATH_PLACEHOLDER = "PATH_PLACEHOLDER";
|
||||
|
||||
protected String username = "";
|
||||
protected String password = "";
|
||||
protected String host = "";
|
||||
protected String port = "";
|
||||
protected String directoryName = "";
|
||||
|
||||
private volatile PropertyConfigurer componentPropertyConfigurerLocal;
|
||||
private volatile PropertyConfigurer endpointPropertyConfigurerLocal;
|
||||
|
||||
@Override
|
||||
protected void doBuild() {
|
||||
|
||||
componentPropertyConfigurerLocal = getCamelContext().adapt(ExtendedCamelContext.class).getConfigurerResolver()
|
||||
.resolvePropertyConfigurer(COMPONENT_CONFIGURER, getCamelContext());
|
||||
log.debug("componentPropertyConfigurerLocal: {}", componentPropertyConfigurerLocal);
|
||||
|
||||
endpointPropertyConfigurerLocal = getCamelContext().adapt(ExtendedCamelContext.class).getConfigurerResolver()
|
||||
.resolvePropertyConfigurer(ENDPOINT_CONFIGURER, getCamelContext());
|
||||
log.debug("endpointPropertyConfigurerLocal: {}", endpointPropertyConfigurerLocal);
|
||||
}
|
||||
|
||||
protected GenericFileEndpoint<FTPFile> createEndpoint(String uri, String remaining, Map<String, Object> parameters)
|
||||
throws Exception {
|
||||
|
||||
// doBuild method called to force configurer initialization (doBuild not invoked in some scenario)
|
||||
doBuild();
|
||||
uri = uri.replace(PATH_PLACEHOLDER, buildPath());
|
||||
log.debug("CREATING ENDPOINT FOR [{}]", uri);
|
||||
if (CommonUtils.isValid(username)) {
|
||||
parameters.put("username", username);
|
||||
}
|
||||
if (CommonUtils.isValid(password)) {
|
||||
parameters.put("password", password);
|
||||
}
|
||||
|
||||
return super.createEndpoint(uri, remaining, parameters);
|
||||
}
|
||||
|
||||
private String buildPath() {
|
||||
|
||||
StringBuilder path = new StringBuilder();
|
||||
|
||||
if (CommonUtils.isValid(host)) {
|
||||
path.append(host.trim());
|
||||
}
|
||||
if (CommonUtils.isValid(port)) {
|
||||
path.append(":");
|
||||
path.append(port.trim());
|
||||
}
|
||||
if (CommonUtils.isValid(directoryName)) {
|
||||
if (!directoryName.startsWith("/")) {
|
||||
path.append("/");
|
||||
}
|
||||
path.append(directoryName.trim());
|
||||
}
|
||||
return path.toString();
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public void setDirectoryName(String directoryName) {
|
||||
this.directoryName = directoryName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyConfigurer getComponentPropertyConfigurer() {
|
||||
return componentPropertyConfigurerLocal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyConfigurer getEndpointPropertyConfigurer() {
|
||||
return endpointPropertyConfigurerLocal;
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* file-adapter
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -217,7 +217,10 @@
|
||||
"kind": "parameter",
|
||||
"required": false,
|
||||
"hidden": false,
|
||||
"defaultValue": false,
|
||||
"defaultValue": true,
|
||||
"@UI": {
|
||||
"transmitAlways": true
|
||||
},
|
||||
"group": "common",
|
||||
"##origin": "camel",
|
||||
"##camelDiff": {
|
||||
|
@ -0,0 +1,9 @@
|
||||
[#ftl]
|
||||
<bean id="[=objectId]" class="ru.entaxy.platform.runtime.connections.ftps.FtpsConnectionComponent">
|
||||
[=utils.createBeanProperties(properties, "camel_", true)]
|
||||
[#if properties.username??]<property name="username" value="[=properties.username]"/>[/#if]
|
||||
[#if properties.password??]<property name="password" value="[=properties.password]"/>[/#if]
|
||||
<property name="host" value="[=properties.host]"/>
|
||||
[#if properties.port??]<property name="port" value="[=properties.port]"/>[/#if]
|
||||
[#if properties.directoryName??]<property name="directoryName" value="[=properties.directoryName]"/>[/#if]
|
||||
</bean>
|
@ -0,0 +1,19 @@
|
||||
[#ftl attributes={"generated.type":"blueprint"}]
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
|
||||
xsi:schemaLocation="
|
||||
http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"
|
||||
>
|
||||
|
||||
[#import "templates:object-commons/common-utils.ftl" as utils]
|
||||
[#include "templates:ftps-connection/init.body.ftl"]
|
||||
|
||||
<service interface="org.apache.camel.Component" ref="[=objectId]">
|
||||
<service-properties>
|
||||
<entry key="connection.name" value="[=objectId]"/>
|
||||
</service-properties>
|
||||
</service>
|
||||
|
||||
</blueprint>
|
@ -0,0 +1,3 @@
|
||||
[#ftl attributes={"generated.type":"blueprint.fragment"}]
|
||||
[#import "templates:object-commons/common-utils.ftl" as utils]
|
||||
[#include "templates:ftps-connection/init.body.ftl"]
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connector-implementation</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.connector-implementation</groupId>
|
||||
<artifactId>connector-producing</artifactId>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connector-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -48,12 +48,12 @@
|
||||
"immutable": true,
|
||||
"defaultValue": "main",
|
||||
"description": "Classifier of the connector. Must be unique for each connector of the same direction in the owning system",
|
||||
"@UNIQUE": {
|
||||
"filterProperties": ["direction"]
|
||||
},
|
||||
"@TYPEINFO": {
|
||||
"validation": {
|
||||
"rules": {
|
||||
"checkUniqueness": {
|
||||
"extraProperties": ["direction"]
|
||||
},
|
||||
"content": {
|
||||
"regex": "^[a-zA-Z][a-zA-Z0-9-]*$",
|
||||
"errorMessage": "Value can contain only latin letters, numbers and hyphen and should start with a letter"
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<from uri="direct:pre-route" />
|
||||
<setProperty name="NTX_connector_preRouted">
|
||||
<constant>true</constant>
|
||||
</setProperty>
|
||||
</route>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<pre-output-start />
|
||||
<setProperty name="NTX_connector_preOutput">
|
||||
<constant>true</constant>
|
||||
</setProperty>
|
||||
</route>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<response-route-start />
|
||||
<log message="Response processed" loggingLevel="INFO" />
|
||||
</route>
|
@ -2,7 +2,7 @@
|
||||
<reference id="lockService" interface="ru.entaxy.platform.core.support.runtime.service.ServiceHolder"
|
||||
filter="(internalType=org.jgroups.blocks.locking.LockService)" availability="mandatory"/>
|
||||
|
||||
<bean id="[=properties.connectorId].clusterService" class="ru.entaxy.platform.core.support.runtime.cluster.JGroupsLockClusterService">
|
||||
<bean id="master.clusterService" class="ru.entaxy.platform.core.support.runtime.cluster.JGroupsLockClusterService">
|
||||
<argument index="0" ref="lockService" />
|
||||
<property name="id" value="Connector"/>
|
||||
</bean>
|
@ -0,0 +1,31 @@
|
||||
[#ftl attributes={"generated.type":"blueprint.fragment"}]
|
||||
<errorHandlerRef>[=properties.errorHandlerType]</errorHandlerRef>
|
||||
<errorHandler id="NoErrorHandler" type="NoErrorHandler"/>
|
||||
<errorHandler id="DefaultErrorHandler" type="DefaultErrorHandler" redeliveryPolicyRef="redeliveryPolicyProfileBean"/>
|
||||
<errorHandler id="DeadLetterChannel" type="DeadLetterChannel" deadLetterUri="[=properties.deadLetterUri]" redeliveryPolicyRef="redeliveryPolicyProfileBean"/>
|
||||
<redeliveryPolicyProfile id="redeliveryPolicyProfileBean"
|
||||
[#if properties.maximumRedeliveries??]maximumRedeliveries="[=properties.maximumRedeliveries]"[/#if]
|
||||
[#if properties.redeliveryDelay??]redeliveryDelay="[=properties.redeliveryDelay]"[/#if]
|
||||
[#if properties.asyncDelayedRedelivery??]asyncDelayedRedelivery="[=properties.asyncDelayedRedelivery]"[/#if]
|
||||
[#if properties.backOffMultiplier??]backOffMultiplier="[=properties.backOffMultiplier]"[/#if]
|
||||
[#if properties.useExponentialBackOff??]useExponentialBackOff="[=properties.useExponentialBackOff]"[/#if]
|
||||
[#if properties.collisionAvoidanceFactor??]collisionAvoidanceFactor="[=properties.collisionAvoidanceFactor]"[/#if]
|
||||
[#if properties.useCollisionAvoidance??]useCollisionAvoidance="[=properties.useCollisionAvoidance]"[/#if]
|
||||
[#if properties.maximumRedeliveryDelay??]maximumRedeliveryDelay="[=properties.maximumRedeliveryDelay]"[/#if]
|
||||
[#if properties.retriesExhaustedLogLevel??]retriesExhaustedLogLevel="[=properties.retriesExhaustedLogLevel]"[/#if]
|
||||
[#if properties.retryAttemptedLogLevel??]retryAttemptedLogLevel="[=properties.retryAttemptedLogLevel]"[/#if]
|
||||
[#if properties.retryAttemptedLogInterval??]retryAttemptedLogInterval="[=properties.retryAttemptedLogInterval]"[/#if]
|
||||
[#if properties.logRetryAttempted??]logRetryAttempted="[=properties.logRetryAttempted]"[/#if]
|
||||
[#if properties.logStackTrace??]logStackTrace="[=properties.logStackTrace]"[/#if]
|
||||
[#if properties.logRetryStackTrace??]logRetryStackTrace="[=properties.logRetryStackTrace]"[/#if]
|
||||
[#if properties.logHandled??]logHandled="[=properties.logHandled]"[/#if]
|
||||
[#if properties.logNewException??]logNewException="[=properties.logNewException]"[/#if]
|
||||
[#if properties.logContinued??]logContinued="[=properties.logContinued]"[/#if]
|
||||
[#if properties.logExhausted??]logExhausted="[=properties.logExhausted]"[/#if]
|
||||
[#if properties.logExhaustedMessageHistory??]logExhaustedMessageHistory="[=properties.logExhaustedMessageHistory]"[/#if]
|
||||
[#if properties.logExhaustedMessageBody??]logExhaustedMessageBody="[=properties.logExhaustedMessageBody]"[/#if]
|
||||
[#if properties.disableRedelivery??]disableRedelivery="[=properties.disableRedelivery]"[/#if]
|
||||
[#if properties.delayPattern??]delayPattern="[=properties.delayPattern]"[/#if]
|
||||
[#if properties.allowRedeliveryWhileStopping??]allowRedeliveryWhileStopping="[=properties.allowRedeliveryWhileStopping]"[/#if]
|
||||
[#if properties.exchangeFormatterRef??]exchangeFormatterRef="[=properties.exchangeFormatterRef]"[/#if]
|
||||
/>
|
@ -0,0 +1,2 @@
|
||||
[#ftl attributes={"generated.type":"blueprint.fragment"}]
|
||||
<globalOption key="CamelLogEipName" value="entaxy.runtime.connector.[=properties.systemName].[=properties.__direction].[=properties.type].[=properties.classifier]"/>
|
@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>connector-implementation</artifactId>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.connector-implementation</groupId>
|
||||
<artifactId>connector-storage</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR :: STORAGE</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTOR :: STORAGE</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>ru.entaxy.platform.base.objects.connector.storage</bundle.osgi.export.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.registry.connector</groupId>
|
||||
<artifactId>connector-impl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -1,113 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connector-storage
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connector.storage;
|
||||
|
||||
import java.util.Date;
|
||||
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.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
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;
|
||||
|
||||
@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<String, String> fieldMap = new HashMap<>() {
|
||||
{
|
||||
put("name", "objectId");
|
||||
put("version", "artifact.version");
|
||||
}
|
||||
};
|
||||
|
||||
protected Map<String, String> 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<String, Object> data) {
|
||||
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
Gson gson = new Gson();
|
||||
|
||||
for (Map.Entry<String, String> 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<String, String> 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;
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connector-implementation</artifactId>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connector-implementation</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.connector-implementation</groupId>
|
||||
<artifactId>standard-connectors-pack</artifactId>
|
||||
|
@ -51,15 +51,24 @@
|
||||
"queueOrTopicType": {},
|
||||
"queueOrTopicName": {},
|
||||
"entaxyOriginConnection": {},
|
||||
"camel_headerFilterStrategy": {
|
||||
"description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message. For more details see <a target=\"_blank\" href=\"https://camel-docs.entaxy.ru/components/${camel-docs.version}/jms-component.html\">Camel docs</a>"
|
||||
},
|
||||
"__headerFilterStrategyTemplate": {
|
||||
"type": "entaxy.runtime.connector",
|
||||
"defaultValue": {
|
||||
"type": "entaxy.runtime.connector"
|
||||
}
|
||||
},
|
||||
"@IMPORT": [{
|
||||
"sourceFactoryId": "artemis-connection",
|
||||
"location": "outputs.producer.fields",
|
||||
"prefix": "",
|
||||
"filter": {
|
||||
"contained": [{
|
||||
"attribute": "##origin",
|
||||
"values": ["camel"]
|
||||
},
|
||||
"attribute": "##origin",
|
||||
"values": ["camel"]
|
||||
},
|
||||
{
|
||||
"attribute": "group",
|
||||
"inverse": true,
|
||||
@ -69,6 +78,11 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"sourceFactoryId": "header-filter-strategy",
|
||||
"location": "fields",
|
||||
"prefix": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -80,6 +94,18 @@
|
||||
"includePatterns":[]
|
||||
}
|
||||
}
|
||||
},
|
||||
"header-filter-strategy": {
|
||||
"fields": {
|
||||
"__headerFilterStrategyTemplate": {}
|
||||
},
|
||||
"scopes": [
|
||||
"private"
|
||||
],
|
||||
"config": {
|
||||
"@SKIP_PUBLISH": {},
|
||||
"configurable": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
/* */
|
||||
{
|
||||
"factory": {
|
||||
"id": "ftps-connector-in",
|
||||
"type": "entaxy.runtime.connector",
|
||||
"displayName": "FTPS :: IN",
|
||||
"parent": "connection-based-connector-in",
|
||||
"description": "This component provides access to remote file systems over the FTP and SFTP protocols. For more details see <a target=\"_blank\" href=\"https://camel-docs.entaxy.ru/components/${camel-docs.version}/ftps-component.html\">Camel docs</a>",
|
||||
"isAbstract": false,
|
||||
"requires": [
|
||||
"ftps-connection"
|
||||
]
|
||||
},
|
||||
"entaxy.runtime.connector": {
|
||||
"type": "ftps",
|
||||
"protocol": "ftps"
|
||||
},
|
||||
"fields": {
|
||||
"entaxyOriginConnection": {
|
||||
"type": "entaxy.runtime.connection",
|
||||
"filter": "(&(type=entaxy.runtime.connection)(label=*ftps*))"
|
||||
},
|
||||
"connectorSubdirectory": {
|
||||
"displayName": "Subdirectory",
|
||||
"description": "Connector specific part of endpoint directory path. For example you can set value 'documents' in connection's field `Directory Name` and set value '2023september' in connectors's field `Subdirectory`, as a result endpoint will be configured to `/documents2023september` directory. Or you can add slash symbol (/) to one of these fields and make subdirectory for connector - `/documents/2023september`. For more details see <a target=\"_blank\" href=\"https://camel-docs.entaxy.ru/components/${camel-docs.version}/ftps-component.html\">Camel docs</a>",
|
||||
"type": "String",
|
||||
"group": "general"
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"init": {
|
||||
"isDefault": true,
|
||||
"fields": {
|
||||
"entaxyOriginConnection": {},
|
||||
"connectorSubdirectory": {},
|
||||
"runExclusive": {
|
||||
"type": "Boolean",
|
||||
"defaultValue": true
|
||||
},
|
||||
"@IMPORT": [
|
||||
{
|
||||
"sourceFactoryId": "ftps-connection",
|
||||
"location": "outputs.consumer.fields",
|
||||
"prefix": "",
|
||||
"filter": {
|
||||
"contained": [
|
||||
{
|
||||
"attribute": "##origin",
|
||||
"values": [
|
||||
"camel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attribute": "$key",
|
||||
"inverse": true,
|
||||
"values": [
|
||||
"camel_username",
|
||||
"camel_password"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"sourceFactoryId": "ftp-client-config",
|
||||
"location": "fields",
|
||||
"prefix": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"configurable": true,
|
||||
"fieldsConfigurableByDefault": true,
|
||||
"configurableFields": {
|
||||
"includeNames": [
|
||||
"connectorSubdirectory"
|
||||
],
|
||||
"includePatterns": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
/* */
|
||||
{
|
||||
"factory": {
|
||||
"id": "ftps-connector-out",
|
||||
"type": "entaxy.runtime.connector",
|
||||
"displayName": "FTPS :: OUT",
|
||||
"parent": "connection-based-connector-out",
|
||||
"description": "This component provides access to remote file systems over the FTP and SFTP protocols. For more details see <a target=\"_blank\" href=\"https://camel-docs.entaxy.ru/components/${camel-docs.version}/ftps-component.html\">Camel docs</a>",
|
||||
"isAbstract": false,
|
||||
"requires": ["ftps-connection"]
|
||||
},
|
||||
"entaxy.runtime.connector": {
|
||||
"type": "ftps",
|
||||
"protocol": "ftps"
|
||||
},
|
||||
"fields": {
|
||||
"entaxyOriginConnection": {
|
||||
"type": "entaxy.runtime.connection",
|
||||
"filter": "(&(type=entaxy.runtime.connection)(label=*ftps*))"
|
||||
},
|
||||
"connectorSubdirectory": {
|
||||
"displayName": "Subdirectory",
|
||||
"description": "Connector specific part of endpoint directory path. For example you can set value 'documents' in connection's field `Directory Name` and set value '2023september' in connectors's field `Subdirectory`, as a result endpoint will be configured to `/documents2023september` directory. Or you can add slash symbol (/) to one of these fields and make subdirectory for connector - `/documents/2023september`. For more details see <a target=\"_blank\" href=\"https://camel-docs.entaxy.ru/components/${camel-docs.version}/ftps-component.html\">Camel docs</a>",
|
||||
"type": "String",
|
||||
"group": "general"
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"init": {
|
||||
"isDefault": true,
|
||||
"fields": {
|
||||
"entaxyOriginConnection": {},
|
||||
"connectorSubdirectory": {},
|
||||
"@IMPORT": [{
|
||||
"sourceFactoryId": "ftps-connection",
|
||||
"location": "outputs.producer.fields",
|
||||
"prefix": "",
|
||||
"filter": {
|
||||
"contained": [{
|
||||
"attribute": "##origin",
|
||||
"values": ["camel"]
|
||||
},
|
||||
{
|
||||
"attribute": "$key",
|
||||
"inverse": true,
|
||||
"values": [
|
||||
"camel_username",
|
||||
"camel_password"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"sourceFactoryId": "ftp-client-config",
|
||||
"location": "fields",
|
||||
"prefix": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"configurable": true,
|
||||
"fieldsConfigurableByDefault": true,
|
||||
"configurableFields": {
|
||||
"includeNames":["connectorSubdirectory"],
|
||||
"includePatterns":[]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<custom-input-route>
|
||||
<!-- PLACE YOUR CAMEL/ENTAXY CODE HERE -->
|
||||
<log message="Custom input route start"/>
|
||||
</custom-input-route>
|
@ -0,0 +1,8 @@
|
||||
[#if properties.camel_headerFilterStrategy??]
|
||||
[#if properties.camel_headerFilterStrategy == "custom"]
|
||||
[#assign headerFilterStrategyReference = properties.headerFilterStrategyReference]
|
||||
[#else]
|
||||
[#assign headerFilterStrategyReference = "headerFilterStrategy"]
|
||||
[/#if]
|
||||
[#global properties = properties + {"camel_headerFilterStrategy": "#[=headerFilterStrategyReference]"} ]
|
||||
[/#if]
|
@ -4,12 +4,26 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
|
||||
|
||||
[#import "templates:object-commons/common-utils.ftl" as utils]
|
||||
|
||||
[#import "templates:object-commons/common-utils.ftl" as utils]
|
||||
[#include "customObjectReferences.ftl" ]
|
||||
|
||||
[#assign queueOrTopicName = properties.queueOrTopicName]
|
||||
[#if properties.rawValues.queueOrTopicName?? && properties.rawValues.queueOrTopicName?is_string]
|
||||
[#if properties.rawValues.queueOrTopicName?contains("${") && properties.rawValues.queueOrTopicName?contains("}")]
|
||||
[#assign dynamic = true]
|
||||
[#assign queueOrTopicName = "default"]
|
||||
[/#if]
|
||||
[/#if]
|
||||
|
||||
<camelContext id="[=objectId]" xmlns="http://camel.apache.org/schema/blueprint">
|
||||
<route id="[=objectId].output-route">
|
||||
<from uri="direct:entry-cascade-finish" />
|
||||
<to uri="[=properties.entaxyOriginConnection]:[=utils.convertConfigValue(properties.queueOrTopicType)]:[=utils.convertConfigValue(properties.queueOrTopicName)][=utils.createQueryString(properties, "camel_", true)]" />
|
||||
[#if dynamic?? && dynamic]
|
||||
<setHeader name="CamelJmsDestinationName">
|
||||
<simple>[=utils.convertConfigValue(properties.queueOrTopicName)]</simple>
|
||||
</setHeader>
|
||||
[/#if]
|
||||
<to uri="[=properties.entaxyOriginConnection]:[=utils.convertConfigValue(properties.queueOrTopicType)]:[=utils.convertConfigValue(queueOrTopicName)][=utils.createQueryString(properties, "camel_", true)]" />
|
||||
</route>
|
||||
</camelContext>
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
[#ftl attributes={"generated.type":"blueprint"}]
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
|
||||
|
||||
[#import "templates:object-commons/common-utils.ftl" as utils]
|
||||
|
||||
<camelContext id="[=objectId]" xmlns="http://camel.apache.org/schema/blueprint">
|
||||
<route id="[=objectId].input-route">
|
||||
<from uri="[=properties.exclusivePrefix!][=properties.entaxyOriginConnection]:PATH_PLACEHOLDER[=utils.convertConfigValue(properties.connectorSubdirectory!)][=utils.createQueryString(properties, "camel_", true, ["camel_username","camel_password"])]" />
|
||||
[#include "templates:abstract-connector/generate-logging-key.ftl"]
|
||||
<to uri="direct:exit-cascade-start" />
|
||||
</route>
|
||||
</camelContext>
|
||||
|
||||
</blueprint>
|
@ -0,0 +1,16 @@
|
||||
[#ftl attributes={"generated.type":"blueprint"}]
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
|
||||
|
||||
[#import "templates:object-commons/common-utils.ftl" as utils]
|
||||
|
||||
<camelContext id="[=objectId]" xmlns="http://camel.apache.org/schema/blueprint">
|
||||
<route id="[=objectId].output-route">
|
||||
<from uri="direct:entry-cascade-finish" />
|
||||
<to uri="[=properties.entaxyOriginConnection]:PATH_PLACEHOLDER[=utils.convertConfigValue(properties.connectorSubdirectory!)][=utils.createQueryString(properties, "camel_", true, ["camel_username","camel_password"])]" />
|
||||
</route>
|
||||
</camelContext>
|
||||
|
||||
</blueprint>
|
@ -0,0 +1,53 @@
|
||||
[#if properties.camel_headerFilterStrategy??]
|
||||
[#if properties.camel_headerFilterStrategy == "custom"]
|
||||
[#assign headerFilterStrategyReference = properties.headerFilterStrategyReference]
|
||||
[#else]
|
||||
[#assign headerFilterStrategyReference = "headerFilterStrategy"]
|
||||
[/#if]
|
||||
[#global properties = properties + {"camel_headerFilterStrategy": "#[=headerFilterStrategyReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_cookieStore??]
|
||||
[#if properties.camel_cookieStore == "custom"]
|
||||
[#assign cookieStoreReference = properties.cookieStoreReference]
|
||||
[#else]
|
||||
[#assign cookieStoreReference = "cookieStore"]
|
||||
[/#if]
|
||||
[#global properties = properties + {"camel_cookieStore": "#[=cookieStoreReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_clientConnectionManager?? && properties.camel_clientConnectionManager == "custom"]
|
||||
[#global properties = properties + {"camel_clientConnectionManager": "#[=properties.clientConnectionManagerReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_x509HostnameVerifier??]
|
||||
[#if properties.camel_x509HostnameVerifier == "custom"]
|
||||
[#assign x509HostnameVerifierReference = properties.x509HostnameVerifierReference]
|
||||
[#else]
|
||||
[#assign x509HostnameVerifierReference = "x509HostnameVerifier"]
|
||||
[/#if]
|
||||
[#global properties = properties + {"camel_x509HostnameVerifier": "#[=x509HostnameVerifierReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_sslContextParameters??]
|
||||
[#if properties.camel_sslContextParameters == "custom"]
|
||||
[#assign sslContextParametersReference = properties.sslContextParametersReference]
|
||||
[#else]
|
||||
[#assign sslContextParametersReference = "sslContextParameters"]
|
||||
[/#if]
|
||||
[#global properties = properties + {"camel_sslContextParameters": "#[=sslContextParametersReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_cookieStore?? && properties.camel_cookieStore == "custom"]
|
||||
[#global properties = properties + {"camel_cookieStore": "#[=properties.cookieStoreReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_clientConnectionManager?? && properties.camel_clientConnectionManager == "custom"]
|
||||
[#global properties = properties + {"camel_clientConnectionManager": "#[=properties.clientConnectionManagerReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_httpBinding?? && properties.camel_httpBinding == "custom"]
|
||||
[#global properties = properties + {"camel_httpBinding": "#[=properties.httpBindingReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_httpClientConfigurer?? && properties.camel_httpClientConfigurer == "custom"]
|
||||
[#global properties = properties + {"camel_httpClientConfigurer": "#[=properties.httpClientConfigurerReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_httpConfiguration?? && properties.camel_httpConfiguration == "custom"]
|
||||
[#global properties = properties + {"camel_httpConfiguration": "#[=properties.httpConfigurationReference]"} ]
|
||||
[/#if]
|
||||
[#if properties.camel_httpContext?? && properties.camel_httpContext == "custom"]
|
||||
[#global properties = properties + {"camel_httpContext": "#[=properties.httpContextReference]"} ]
|
||||
[/#if]
|
@ -0,0 +1,7 @@
|
||||
[#ftl attributes={"generated.type":"blueprint.fragment"}]
|
||||
[#if properties.x509HostnameVerifier?? && properties.x509HostnameVerifier != "custom"]
|
||||
<bean id="x509HostnameVerifier" class="[=properties.x509HostnameVerifier]" />
|
||||
[/#if]
|
||||
[#if properties.cookieStore?? && properties.cookieStore != "custom"]
|
||||
<bean id="cookieStore" class="[=properties.cookieStore]" />
|
||||
[/#if]
|
@ -0,0 +1,21 @@
|
||||
[#ftl attributes={"generated.type":"blueprint"}]
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
|
||||
|
||||
[#import "templates:object-commons/common-utils.ftl" as utils]
|
||||
[#include "customObjectReferences.ftl" ]
|
||||
|
||||
<camelContext id="[=objectId]" xmlns="http://camel.apache.org/schema/blueprint">
|
||||
<route id="[=objectId].output-route">
|
||||
<from uri="direct:entry-cascade-finish" />
|
||||
[#if properties.removeServiceHeadersBeforeSending]
|
||||
<removeHeaders pattern="Camel.+|operationName"/>
|
||||
[/#if]
|
||||
<to uri="[=utils.convertConfigValue(properties.httpUri)][=utils.createQueryString(properties, "camel_", true, ["fieldToExclude1","fieldToExclude2"])]" />
|
||||
</route>
|
||||
</camelContext>
|
||||
|
||||
</blueprint>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>profile-implementation</artifactId>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>profile-implementation</artifactId>
|
||||
<version>1.10.0</version>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
|
||||
<artifactId>profile-producing</artifactId>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* test-producers
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
|
@ -46,7 +46,7 @@
|
||||
"type": "xml:route",
|
||||
"required": true,
|
||||
"group": "in-flow",
|
||||
"description": "Customize the message processing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B8_in_flow\">Entaxy docs</a>",
|
||||
"description": "Customize the message processing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Response-postprocess-flow.html#_%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B8_in_flow\">Entaxy docs</a>",
|
||||
"@RESOURCE": {
|
||||
"_provider": "entaxy-file-internal",
|
||||
"endType": "String",
|
||||
@ -98,7 +98,7 @@
|
||||
"inFlowProcessResponse": {
|
||||
"displayName": "Process response",
|
||||
"type": "Boolean",
|
||||
"description": "Enables response processing before further routing to an input connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B8_in_flow\">Entaxy docs</a>",
|
||||
"description": "Enables response processing before further routing to an input connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Response-postprocess-flow.html#_%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B8_in_flow\">Entaxy docs</a>",
|
||||
"required": true,
|
||||
"group": "in-flow",
|
||||
"defaultValue": false
|
||||
@ -107,7 +107,7 @@
|
||||
"displayName": "In-flow response",
|
||||
"type": "xml:route",
|
||||
"required": true,
|
||||
"description": "Customize the response processing before further routing to an input connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_настройки_in_flow\">Entaxy docs</a>",
|
||||
"description": "Customize the response processing before further routing to an input connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Response-postprocess-flow.html#_настройки_in_flow\">Entaxy docs</a>",
|
||||
"group": "in-flow",
|
||||
"@RESOURCE": {
|
||||
"_provider": "entaxy-file-internal",
|
||||
@ -165,7 +165,7 @@
|
||||
"type": "xml:route",
|
||||
"required": true,
|
||||
"group": "out-flow",
|
||||
"description": "Customize the message processing before further routing to an output connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
|
||||
"description": "Customize the message processing before further routing to an output connector. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
|
||||
"@RESOURCE": {
|
||||
"_provider": "entaxy-file-internal",
|
||||
"endType": "String",
|
||||
@ -217,7 +217,7 @@
|
||||
"outFlowProcessResponse": {
|
||||
"displayName": "Postprocess response",
|
||||
"type": "Boolean",
|
||||
"description": "Enables response postprocessing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
|
||||
"description": "Enables response postprocessing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
|
||||
"required": true,
|
||||
"group": "out-flow",
|
||||
"defaultValue": false
|
||||
@ -227,7 +227,7 @@
|
||||
"type": "xml:route",
|
||||
"required": true,
|
||||
"group": "out-flow",
|
||||
"description": "Customize the response postprocessing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
|
||||
"description": "Customize the response postprocessing before further routing within the esb. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Response-postprocess-flow.html#_настройки_out_flow\">Entaxy docs</a>",
|
||||
"@RESOURCE": {
|
||||
"_provider": "entaxy-file-internal",
|
||||
"endType": "String",
|
||||
@ -283,7 +283,7 @@
|
||||
"displayName": "Output connector selector",
|
||||
"type": "xml:route",
|
||||
"required": true,
|
||||
"description": "Defines connector selecting logic based on specified properties and templates. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Custom-tags-system-management.html#_connector_selector\">Entaxy docs</a>",
|
||||
"description": "Defines connector selecting logic based on specified properties and templates. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Custom-tags-system-management.html#_connector_selector\">Entaxy docs</a>",
|
||||
"group": "out-flow",
|
||||
"@RESOURCE": {
|
||||
"_provider": "entaxy-file-internal",
|
||||
@ -364,7 +364,7 @@
|
||||
"displayName": "Default profile route",
|
||||
"type": "xml:route",
|
||||
"required": true,
|
||||
"description": "The router that connects the system to other entities in the Entaxy architecture. By default, the message is routed to an entity of the system type. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Entity.html#_маршрут_по_умолчанию_default_route\">Entaxy docs</a>",
|
||||
"description": "The router that connects the system to other entities in the Entaxy architecture. By default, the message is routed to an entity of the system type. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Entity.html#_маршрут_по_умолчанию_default_route\">Entaxy docs</a>",
|
||||
"group": "in-flow",
|
||||
"condition": "${useDefaultRoute}",
|
||||
"@INTERNAL": true,
|
||||
|
@ -4,7 +4,7 @@
|
||||
"type": "entaxy.runtime.default-route",
|
||||
"label": "route,default",
|
||||
"displayName": "DEFAULT ROUTE",
|
||||
"description": "The router that connects the system to other entities in the Entaxy architecture. By default, the message is routed to an entity of the system type. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Entity.html#_маршрут_по_умолчанию_default_route\">Entaxy docs</a>",
|
||||
"description": "The router that connects the system to other entities in the Entaxy architecture. By default, the message is routed to an entity of the system type. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Entity.html#_маршрут_по_умолчанию_default_route\">Entaxy docs</a>",
|
||||
"parent": "abstract-route-container-object",
|
||||
"isAbstract": false
|
||||
},
|
||||
@ -42,7 +42,7 @@
|
||||
"displayName": "Route",
|
||||
"type": "xml:route",
|
||||
"required": true,
|
||||
"description": "The router that connects the system to other entities in the Entaxy architecture. By default, the message is routed to an entity of the system type. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-managment/Entity.html#_маршрут_по_умолчанию_default_route\">Entaxy docs</a> and <a target=\"_blank\" href=\"https://camel-docs.entaxy.ru/manual/${camel-docs.version}/routes.html\">Camel docs</a>",
|
||||
"description": "The router that connects the system to other entities in the Entaxy architecture. By default, the message is routed to an entity of the system type. For more details see <a target=\"_blank\" href=\"https://docs.entaxy.ru/entaxy-core/${project.version}/core/system-management/Entity.html#_маршрут_по_умолчанию_default_route\">Entaxy docs</a> and <a target=\"_blank\" href=\"https://camel-docs.entaxy.ru/manual/${camel-docs.version}/routes.html\">Camel docs</a>",
|
||||
"@RESOURCE": {
|
||||
"_provider": "entaxy-file-internal",
|
||||
"endType": "String",
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<in-flow-pre-route-start />
|
||||
<setProperty name="NTX_profile_in_preRouted">
|
||||
<constant>true</constant>
|
||||
</setProperty>
|
||||
</route>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<in-flow-response-start />
|
||||
<setProperty name="NTX_profile_in_response">
|
||||
<constant>true</constant>
|
||||
</setProperty>
|
||||
</route>
|
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<!-- you can use camel -->
|
||||
<connector-selector>
|
||||
<properties-to-use>
|
||||
<property>connector.type</property>
|
||||
<property>connector.protocol</property>
|
||||
<property>connector.classifier</property>
|
||||
</properties-to-use>
|
||||
<patterns>
|
||||
<pattern>*:*:=</pattern>
|
||||
</patterns>
|
||||
<options>
|
||||
<fail-back-to-legacy-router/>
|
||||
<use-the-only-connector>false</use-the-only-connector>
|
||||
<use-default-connector/>
|
||||
<connector-preferred-as-mandatory>false</connector-preferred-as-mandatory>
|
||||
<allow-all-stars-pattern>false</allow-all-stars-pattern>
|
||||
<treat-no-property-as-any>false</treat-no-property-as-any>
|
||||
</options>
|
||||
</connector-selector>
|
||||
</route>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<out-flow-pre-route-start />
|
||||
<setProperty name="NTX_profile_out_preRouted">
|
||||
<constant>true</constant>
|
||||
</setProperty>
|
||||
</route>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<out-flow-response-start />
|
||||
<setProperty name="NTX_profile_out_response">
|
||||
<constant>true</constant>
|
||||
</setProperty>
|
||||
</route>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<route>
|
||||
<default-route-start />
|
||||
<standard-router />
|
||||
</route>
|
@ -0,0 +1,175 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения ENTAXY, принадлежащего
|
||||
Правообладателю – Обществу с ограниченной ответственностью "ЕМДЕВ" (ОГРН 1057810026658, ИНН
|
||||
7813313860, юридический адрес: 197022, Россия, г. Санкт-Петербург, ул. Профессора Попова,
|
||||
д. 23, литера В, помещение 3Н), расположенной в сети Интернет по адресу
|
||||
https://www.emdev.ru/about (далее - Компания).
|
||||
|
||||
Используя или получая доступ к Программному обеспечению, или нажав «Я согласен с Условиями»
|
||||
(или аналогичную кнопку или флажок) после загрузки или установки Программного обеспечения,
|
||||
Пользователь выражает свое согласие на обязательность условий и ограничений, изложенных в
|
||||
настоящем документе, в противном случае, он должен не использовать или не получать доступ
|
||||
к Программному обеспечению.
|
||||
|
||||
1. ТЕРМИНЫ И ОПРЕДЕЛЕНИЯ
|
||||
|
||||
a) ПО – Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) в любой ее версии
|
||||
или редакции, исключительные права на которую принадлежат Правообладателю.
|
||||
b) Правообладатель (Компания) – ООО «ЕМДЕВ», ОГРН 1057810026658, ИНН 7813313860, исключительные
|
||||
права которого подтверждаются Свидетельством о государственной регистрации в Реестре программ
|
||||
для ЭВМ № 2021610848 от 19.01.2021 года.
|
||||
c) Пользователь – юридическое или физическое лицо, получившее через скачивание с сайта
|
||||
https://entaxy.ru или иным образом, дистрибутив ПО, пользующееся ПО.
|
||||
d) ИС – интеллектуальная собственность – закреплённое законом исключительное право, а также
|
||||
личные неимущественные права авторов произведений на результат интеллектуальной деятельности.
|
||||
e) Подписка – это коммерческое предложение Правообладателя, состоящее из Лицензии на использование
|
||||
ПО и доступа к технической поддержке программного обеспечения на срок Подписки. Подписка
|
||||
включает предоставление Пользователю неисключительного права использования ПО, в том числе
|
||||
получение обновлений функционала ПО и безопасности ПО, исправление ошибок ПО и получение
|
||||
патчей с обновлениями и исправлениями программного обеспечения. Подписка приобретается
|
||||
Пользователем на период времени, указанный в Сертификате. Количество подписок устанавливается
|
||||
для каждого Пользователя индивидуально в Сертификате.
|
||||
f) Сертификат – документ, выдаваемый Дистрибъютором или Авторизованным партнёром (Партнёром),
|
||||
подтверждающий факт приобретения физическим или юридическим лицом Подписки на программное
|
||||
обеспечение в ограниченном объёме и на определённый период времени.
|
||||
g) Лицензия (простая (неисключительная) – совокупность ограниченных прав использования ПО,
|
||||
предоставленных Пользователю согласно условиям Подписки.
|
||||
h) Библиотека – совокупность подпрограмм и объектов, используемых для разработки программного
|
||||
обеспечения.
|
||||
i) Исходный код – текст компьютерной программы на каком-либо языке программирования, состоящий
|
||||
из одного или нескольких файлов, который может быть прочтён человеком.
|
||||
j) Объектный код – файл (часть машинного кода) с промежуточным представлением отдельного модуля
|
||||
программы, полученный в результате обработки исходного кода, еще не связанный в полную программу.
|
||||
Это машинный код для одной конкретной библиотеки или модуля, который будет составлять готовый
|
||||
продукт.
|
||||
k) Некоммерческое использование – индивидуальное личное использование Пользователем программного
|
||||
обеспечения с целью обучения работе с Программным обеспечением, для оценки или демонстрации
|
||||
возможностей Программного обеспечения, при котором, Пользователем не извлекается коммерческая
|
||||
выгода и/или не идёт в доход денежное вознаграждение при использовании Программного обеспечения.
|
||||
|
||||
2. ДОПУСТИМЫЕ СПОСОБЫ ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ
|
||||
|
||||
2.1. Правообладатель предоставляет Пользователю ограниченное право использования Программного
|
||||
обеспечения на условиях простой (неисключительной) лицензии в объёме, ограниченном правом
|
||||
воспроизведения полной рабочей версии программного обеспечения, новых версий программного обеспечения
|
||||
в памяти оборудования и его запуска на оборудовании в соответствии со ст. 1280 ГК РФ.
|
||||
2.2. Право на использование Программного обеспечения, предоставляемое Пользователю, носит
|
||||
неисключительный характер.
|
||||
2.3. Пользователю предоставляется всемирная, неисключительная, не подлежащая сублицензированию,
|
||||
лицензия на ограниченное использование Программного обеспечения.
|
||||
2.4. Пользователь, имеющий Базовую (некоммерческую) версию лицензии для пробного использования
|
||||
имеет право приобрести Подписку на программное обеспечение. В этом случае Пользователь обязан
|
||||
обратиться в службу поддержки Правообладателя по адресу: https://entaxy.ru/ для изменения
|
||||
вида лицензии с Базовой бесплатной версии на Подписки.
|
||||
2.5. Срок использования скачанной Пользователем базовой (некоммерческой) версии лицензии для
|
||||
пробного использования программного обеспечения – не ограничен.
|
||||
2.6. Использование Пользователем настоящего программного обеспечения в целях разработки,
|
||||
модификации, обновления другого ПО, принадлежащего третьим лицам, а не Правообладателю,
|
||||
без разрешения Правообладателя не допускается.
|
||||
|
||||
3. АВТОРСКОЕ ПРАВО.
|
||||
|
||||
3.1. Все авторские права, все права интеллектуальной собственности на Программное обеспечение
|
||||
и любые его копии принадлежат Правообладателю.
|
||||
3.2. Все авторские права, все права интеллектуальной собственности в отношении любого контента,
|
||||
к которому можно получить доступ с помощью Программного обеспечения, является собственностью
|
||||
соответствующего владельца контента и защищается применимым законодательством об авторском
|
||||
праве или другими законами и договорами об интеллектуальной собственности.
|
||||
3.3. Условия использования Программного обеспечения.
|
||||
Лицензия, предоставленная Пользователю, действительна только в том случае, если Пользователь
|
||||
придерживается следующих условий:
|
||||
3.3.1. Принятие уведомлений об авторских правах. Пользователю запрещается удалять или изменять
|
||||
какие-либо уведомления об авторских правах или лицензиях, которые появляются при использовании
|
||||
Программного обеспечения или на нем.
|
||||
3.3.2. Модификация. Пользователю запрещается модифицировать, изменять, декомпилировать,
|
||||
расшифровывать, дизассемблировать, переводить или реверсировать, перепроектировать
|
||||
Программное обеспечение.
|
||||
3.3.3. Распространение. Пользователю запрещается сублицензировать, передавать право использования
|
||||
ПО или иным образом распространять или предоставлять Программное обеспечение любой третьей стороне.
|
||||
3.3.4. SaaS. За исключением случаев, когда это разрешено Правообладателем, Пользователю запрещено
|
||||
использовать Программное обеспечение в коммерческих целях для оказания услуг третьим лицам.
|
||||
|
||||
4. ОТВЕТСТВЕННОСТЬ ПРАВООБЛАДАТЕЛЯ ПРИ НАРУШЕНИИ ПОЛЬЗОВАТЕЛЕМ ПРАВ «ИС»
|
||||
|
||||
4.1. Правообладатель не несет никаких обязательств в отношении каких-либо претензий к Пользователю
|
||||
на предмет нарушения последним прав Интеллектуальной собственности, возникших в связи с
|
||||
использованием Пользователем:
|
||||
4.1.1. Любых компонентов программного обеспечения с открытым исходным кодом, включенных в
|
||||
Программное обеспечение;
|
||||
4.1.2. Любого нарушения правил использования Программного обеспечения, установленного условиями
|
||||
настоящего соглашения;
|
||||
4.1.3. Любого использования Программного обеспечения в сочетании с другими ПО, оборудованием,
|
||||
или данными, не предоставленными Пользователю Правообладателем;
|
||||
4.1.4. Любого изменения Программного обеспечения любым третьим лицом, а не Правообладателем.
|
||||
|
||||
|
||||
5. НАСТОЯЩИМ ПРАВООБЛАДАТЕЛЬ ЗАЯВЛЯЕТ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ ПОЛЬЗОВАТЕЛЮ
|
||||
ПО ПРИНЦИПУ «AS IS» - «КАК ЕСТЬ». НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ НЕ ГАРАНТИРУЕТ
|
||||
И НЕ ОБЕЩАЕТ, ЧТО ПРЕДОСТАВЛЕННОЕ ИМ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ПОДХОДИТЬ ИЛИ НЕ ПОДХОДИТЬ
|
||||
ДЛЯ КОНКРЕТНЫХ ЦЕЛЕЙ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ОТВЕЧАТЬ ВСЕМ КОММЕРЧЕСКИМ
|
||||
И ЛИЧНЫМ СУБЪЕКТИВНЫМ ОЖИДАНИЯМ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ РАБОТАТЬ
|
||||
ИСПРАВНО, БЕЗ ТЕХНИЧЕСКИХ ОШИБОК, БЫСТРО И БЕСПЕРЕБОЙНО.
|
||||
|
||||
6. ОГРАНИЧЕНИЕ ОТВЕТСТВЕННОСТИ.
|
||||
НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ ИЛИ ЕГО АФФИЛЛИРОВАННЫЕ ЛИЦА НЕ НЕСУТ ПЕРЕД ПОЛЬЗОВАТЕЛЕМ
|
||||
ОТВЕТСТВЕННОСТИ ЗА ЛЮБЫЕ ПРЯМЫЕ ИЛИ КОСВЕННЫЕ УБЫТКИ ПОЛЬЗОВАТЕЛЯ, ЕГО РАСХОДЫ ИЛИ РЕАЛЬНЫЙ УЩЕРБ,
|
||||
ВКЛЮЧАЯ, ПОМИМО ПРОЧЕГО, ПРОСТОИ; УТРАТУ БИЗНЕСА; УПУЩЕННУЮ ВЫГОДУ; НЕДОПОЛУЧЕННУЮ ПРИБЫЛЬ;
|
||||
ПОТЕРЮ ИЛИ ПОВРЕЖДЕНИЕ ДАННЫХ, ИМУЩЕСТВА И ИНОЕ.
|
||||
ОГРАНИЧЕНИЯ ПРИМЕНЯЮТСЯ НЕЗАВИСИМО ОТ ОСНОВАНИЯ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ; В ТОМ ЧИСЛЕ ВСЛЕДСТВИЕ
|
||||
ДЕЙСТВИЯ ИЛИ БЕЗДЕЙСТВИЯ, НЕБРЕЖНОСТИ, УМЫСЛА, ПРЯМОГО ИЛИ КОСВЕННОГО; НЕОСТОРОЖНОСТИ; ЗАБЛУЖДЕНИЯ;
|
||||
КЛЕВЕТЫ; НАРУШЕНИЯ КОНФИДЕНЦИАЛЬНОСТИ ИЛИ ПРАВА ИНТЕЛЛЕКТУАЛЬНОЙ СОБСТВЕННОСТИ; ИЛИ ЛЮБОЕ ДРУГОЕ
|
||||
ОСНОВАНИЕ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ.
|
||||
|
||||
7. ОБЯЗАННОСТЬ ПОЛЬЗОВАТЕЛЯ:
|
||||
Не осуществлять самостоятельно и (или) с привлечением третьих лиц нижеследующие действия
|
||||
(включая, но не ограничиваясь) по:
|
||||
-дизассемблированию и (или) декомпилированию (преобразованию объектного кода в исходный код)
|
||||
Программного обеспечения;
|
||||
-модификации Программного обеспечения, в том числе вносить изменения в объектный код, исходный
|
||||
код Программного обеспечения, за исключением тех изменений, которые вносятся средствами,
|
||||
включёнными в Программное обеспечение и описанными непосредственно в документации к нему;
|
||||
-созданию условий для использования Программного обеспечения лицами, не имеющими прав на
|
||||
использование данного Программного обеспечения, включая (но не ограничиваясь) вмешательство
|
||||
третьих лиц в функционирование Программного обеспечения, предоставление третьим лицам доступа
|
||||
к исследованию и (или) замене настроек Программного обеспечения, включая его первичную установку;
|
||||
-распространению Программного обеспечения в целом или в части (включая приложенную к нему документацию).
|
||||
|
||||
8. БИБЛИОТЕКА ПО. ИСПОЛЬЗУЕМЫЕ ПРОГРАММНЫЕ СРЕДСТВА.
|
||||
|
||||
8.1. Настоящим, Правообладатель заверяет, что Библиотека программного обеспечения состоит из
|
||||
лицензионных продуктов, используемых на законных основаниях, а
|
||||
именно https://entaxy.ru/libs/licenses/root-aggregated.deps.
|
||||
8.2. Любые программные средства, применяемые Пользователем при работе с ПО, должны быть
|
||||
совместимы с библиотекой ПО, указанной в п.8.1. настоящего соглашения.
|
||||
8.3. Перечень внешних модулей ПО, указанный в п.8.1 настоящего соглашения, может изменяться
|
||||
Правообладателем в одностороннем порядке, в зависимости от выпуска релизов программного обеспечения,
|
||||
содержащих все изменения и дополнения программного обеспечения.
|
||||
|
||||
9. ВНЕСЕНИЕ ИЗМЕНЕНИЙ В ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ.
|
||||
|
||||
9.1. Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) является свободно распространяемым
|
||||
программным обеспечением.
|
||||
9.2. Пользователь имеет право вносить изменения в исходный код программного обеспечения исключительно
|
||||
с согласия Правообладателя в порядке предложения изменений/правок/дополнений через механизм
|
||||
«Pull Requests» в открытом репозитории Правообладателя по адресу: https://git.entaxy.ru/entaxy/entaxy-public.
|
||||
9.3. Любые изменения программного обеспечения, осуществляемые Пользователем без соблюдения условий
|
||||
пункта 9.2. настоящего документа, являются нарушением авторских и смежных прав Правообладателя,
|
||||
прав интеллектуальной собственности Правообладателя и влекут применение к Пользователю мер
|
||||
ответственности в соответствии с условиями настоящей Лицензии, а также применимого законодательства
|
||||
Российской Федерации.
|
||||
|
||||
10. ЗАКЛЮЧИТЕЛЬНЫЕ ПОЛОЖЕНИЯ.
|
||||
|
||||
10.1. В случае нарушения Пользователем любого из условий настоящей Лицензии, Правообладатель имеет
|
||||
право взыскать с Пользователя любые причинённые таким нарушением убытки, реальный ущерб,
|
||||
недополученную прибыль, упущенную выгоду, а также в случае нарушения Пользователем условий
|
||||
пункта 9.2 настоящего соглашения, в том числе, взыскать с Пользователя штраф в размере
|
||||
2 000 000 (Два миллиона) рублей за каждый установленный случай несанкционированного изменения
|
||||
исходного или объектного кода Программного обеспечения «Энтакси» (Entaxy).
|
||||
10.2. В рамках исполнения Пользователем обязательств по настоящей Лицензии, применимое
|
||||
законодательство – Российской Федерации.
|
||||
10.3. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -0,0 +1,41 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>profile-implementation</artifactId>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
|
||||
<artifactId>profile-runtime-camel-components</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME CAMEL</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME CAMEL</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.esb.system.component,
|
||||
ru.entaxy.esb.system.component.util,
|
||||
ru.entaxy.esb.system.groups.component,
|
||||
ru.entaxy.esb.system.groups.component.util
|
||||
</bundle.osgi.export.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>core-support-runtime-legacy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
|
||||
<artifactId>profile-runtime-legacy-support</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,44 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.component;
|
||||
|
||||
import org.apache.camel.Endpoint;
|
||||
import org.apache.camel.support.DefaultComponent;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SystemComponent extends DefaultComponent {
|
||||
|
||||
@Override
|
||||
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
|
||||
SystemEndpoint endpoint = new SystemEndpoint(uri, this);
|
||||
|
||||
endpoint.setSystemName(remaining);
|
||||
setProperties(endpoint, parameters);
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.component;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Processor;
|
||||
import org.apache.camel.support.ScheduledPollConsumer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SystemConsumer extends ScheduledPollConsumer {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SystemConsumer.class);
|
||||
|
||||
private final SystemEndpoint endpoint;
|
||||
|
||||
public SystemConsumer(SystemEndpoint endpoint, Processor processor) {
|
||||
super(endpoint, processor);
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int poll() throws Exception {
|
||||
Exchange exchange = endpoint.createExchange();
|
||||
|
||||
// create a message body
|
||||
exchange.getIn().setBody(readOptions());
|
||||
LOG.info("In SystemConsumer " + exchange.getIn().getBody());
|
||||
|
||||
try {
|
||||
// send message to next processor in the route
|
||||
getProcessor().process(exchange);
|
||||
return 1; // number of messages polled
|
||||
} finally {
|
||||
// log exception if an exception occurred and was not handled
|
||||
if (exchange.getException() != null) {
|
||||
getExceptionHandler().handleException(
|
||||
"Error processing exchange", exchange,
|
||||
exchange.getException());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String readOptions() {
|
||||
return "Operation name " + endpoint.getSystemName();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.component;
|
||||
|
||||
import org.apache.camel.Consumer;
|
||||
import org.apache.camel.Processor;
|
||||
import org.apache.camel.Producer;
|
||||
import org.apache.camel.spi.Metadata;
|
||||
import org.apache.camel.spi.UriEndpoint;
|
||||
import org.apache.camel.spi.UriParam;
|
||||
import org.apache.camel.spi.UriPath;
|
||||
import org.apache.camel.support.DefaultEndpoint;
|
||||
|
||||
@UriEndpoint(
|
||||
scheme = "system",
|
||||
title = "System",
|
||||
syntax = "system:systemName",
|
||||
label = "custom",
|
||||
producerOnly = true)
|
||||
public class SystemEndpoint extends DefaultEndpoint {
|
||||
|
||||
@UriPath
|
||||
@Metadata(required = true)
|
||||
private String systemName;
|
||||
@UriParam(label = "producer")
|
||||
private String connectorProtocol = null;
|
||||
@UriParam(label = "producer")
|
||||
private String connectorClassifier = null;
|
||||
@UriParam(label = "producer")
|
||||
private String connectorType = null;
|
||||
@UriParam(label = "producer")
|
||||
private Boolean connectorMandatory = null;
|
||||
|
||||
public SystemEndpoint() {
|
||||
}
|
||||
|
||||
public SystemEndpoint(String uri, SystemComponent component) {
|
||||
super(uri, component);
|
||||
}
|
||||
|
||||
public Producer createProducer() throws Exception {
|
||||
return new SystemProducer(this);
|
||||
}
|
||||
|
||||
public Consumer createConsumer(Processor processor) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getSystemName() {
|
||||
return systemName;
|
||||
}
|
||||
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
public String getConnectorProtocol() {
|
||||
return connectorProtocol;
|
||||
}
|
||||
|
||||
public void setConnectorProtocol(String connectorProtocol) {
|
||||
this.connectorProtocol = connectorProtocol;
|
||||
}
|
||||
|
||||
public String getConnectorClassifier() {
|
||||
return connectorClassifier;
|
||||
}
|
||||
|
||||
public void setConnectorClassifier(String connectorClassifier) {
|
||||
this.connectorClassifier = connectorClassifier;
|
||||
}
|
||||
|
||||
public String getConnectorType() {
|
||||
return connectorType;
|
||||
}
|
||||
|
||||
public void setConnectorType(String connectorType) {
|
||||
this.connectorType = connectorType;
|
||||
}
|
||||
|
||||
public Boolean isConnectorMandatory() {
|
||||
return connectorMandatory;
|
||||
}
|
||||
|
||||
public void setConnectorMandatory(Boolean connectorMandatory) {
|
||||
this.connectorMandatory = connectorMandatory;
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.support.DefaultProducer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.system.common.exception.ProfileNotFound;
|
||||
import ru.entaxy.esb.system.registry.systems.profile.SystemCollectorListener;
|
||||
import ru.entaxy.esb.system.registry.systems.profile.SystemProfile;
|
||||
import ru.entaxy.platform.base.support.osgi.OSGIUtils;
|
||||
|
||||
|
||||
public class SystemProducer extends DefaultProducer {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SystemProducer.class);
|
||||
private final SystemEndpoint endpoint;
|
||||
|
||||
private SystemCollectorListener systemCollectorListener;
|
||||
|
||||
public SystemProducer(SystemEndpoint endpoint) {
|
||||
super(endpoint);
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public void process(Exchange exchange) throws Exception {
|
||||
LOG.debug("In SystemProducer " + exchange.getIn().getBody());
|
||||
|
||||
// get System Profile from systemRegistry endpoint.getSystemName()
|
||||
SystemProfile systemProfile = null;
|
||||
|
||||
systemProfile = getSystemProfile(endpoint.getSystemName());
|
||||
|
||||
setPreferredConnector(exchange);
|
||||
setConnectorMandatory(exchange);
|
||||
|
||||
LOG.debug("Called system profile " + (systemProfile != null ? systemProfile.getSystemName() : "NULL"));
|
||||
|
||||
systemProfile.send(exchange);
|
||||
|
||||
}
|
||||
|
||||
public SystemProfile getSystemProfile(String nameSystem) throws ProfileNotFound {
|
||||
systemCollectorListener = getSystemProfileNamedListener();
|
||||
LOG.debug("Registry SystemProfile {}; systems count {}", nameSystem,
|
||||
systemCollectorListener.getReferenceNames().size());
|
||||
SystemProfile systemProfile = null;
|
||||
if (systemCollectorListener.isRegistered(nameSystem)) {
|
||||
systemProfile = (SystemProfile) systemCollectorListener.getReference(nameSystem);
|
||||
} else {
|
||||
throw new ProfileNotFound("Profile for system " + nameSystem + " not found");
|
||||
}
|
||||
return systemProfile;
|
||||
}
|
||||
|
||||
public SystemCollectorListener getSystemProfileNamedListener() {
|
||||
if (systemCollectorListener == null) {
|
||||
systemCollectorListener = (SystemCollectorListener) OSGIUtils.getService(
|
||||
FrameworkUtil.getBundle(SystemProducer.class).getBundleContext(),
|
||||
SystemCollectorListener.class);
|
||||
}
|
||||
return systemCollectorListener;
|
||||
}
|
||||
|
||||
public void setPreferredConnector(Exchange exchange) {
|
||||
if (!StringUtils.isEmpty(endpoint.getConnectorProtocol())
|
||||
|| !StringUtils.isEmpty(endpoint.getConnectorClassifier()) ||
|
||||
!StringUtils.isEmpty(endpoint.getConnectorType())) {
|
||||
List<String> preferredConnectorList = new ArrayList<>();
|
||||
if (!StringUtils.isEmpty(endpoint.getConnectorProtocol())) {
|
||||
preferredConnectorList.add("\"protocol\":\"" + endpoint.getConnectorProtocol() + "\"");
|
||||
}
|
||||
if (!StringUtils.isEmpty(endpoint.getConnectorClassifier())) {
|
||||
preferredConnectorList.add("\"classifier\":\"" + endpoint.getConnectorClassifier() + "\"");
|
||||
}
|
||||
if (!StringUtils.isEmpty(endpoint.getConnectorType())) {
|
||||
preferredConnectorList.add("\"type\":\"" + endpoint.getConnectorType() + "\"");
|
||||
}
|
||||
String jsonPreferredConnector = "{" + joinByComma(preferredConnectorList) + "}";
|
||||
exchange.getMessage().getHeaders().put("NTX_preferred_connector", jsonPreferredConnector);
|
||||
}
|
||||
}
|
||||
|
||||
public void setConnectorMandatory(Exchange exchange) {
|
||||
if (endpoint.isConnectorMandatory() != null)
|
||||
exchange.getMessage().getHeaders().put("NTX_connector_preferred_as_mandatory",
|
||||
endpoint.isConnectorMandatory());
|
||||
}
|
||||
|
||||
private String joinByComma(List<String> preferredConnectorList) {
|
||||
StringBuilder summary = new StringBuilder();
|
||||
for (int i = 0; i < preferredConnectorList.size(); i++) {
|
||||
summary.append(preferredConnectorList.get(i));
|
||||
if (i < preferredConnectorList.size() - 1) {
|
||||
summary.append(",");
|
||||
}
|
||||
}
|
||||
return summary.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.component.util;
|
||||
|
||||
public class SystemConstants {
|
||||
|
||||
public static final String PARAMETER_PREFERRED_CONNECTOR = "preferredConnector";
|
||||
|
||||
private SystemConstants() {
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.component;
|
||||
|
||||
import org.apache.camel.Endpoint;
|
||||
import org.apache.camel.support.DefaultComponent;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class SystemGroupComponent extends DefaultComponent {
|
||||
|
||||
@Override
|
||||
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
|
||||
SystemGroupEndpoint endpoint = new SystemGroupEndpoint(uri, this);
|
||||
|
||||
endpoint.setSystemName(remaining);
|
||||
setProperties(endpoint, parameters);
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.component;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Processor;
|
||||
import org.apache.camel.support.ScheduledPollConsumer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SystemGroupConsumer extends ScheduledPollConsumer {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SystemGroupConsumer.class);
|
||||
|
||||
private final SystemGroupEndpoint endpoint;
|
||||
|
||||
public SystemGroupConsumer(SystemGroupEndpoint endpoint, Processor processor) {
|
||||
super(endpoint, processor);
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int poll() throws Exception {
|
||||
Exchange exchange = endpoint.createExchange();
|
||||
|
||||
// create a message body
|
||||
exchange.getIn().setBody(readOptions());
|
||||
LOG.info("In SystemGroupConsumer ++++ " + exchange.getIn().getBody());
|
||||
|
||||
try {
|
||||
// send message to next processor in the route
|
||||
getProcessor().process(exchange);
|
||||
return 1; // number of messages polled
|
||||
} finally {
|
||||
// log exception if an exception occurred and was not handled
|
||||
if (exchange.getException() != null) {
|
||||
getExceptionHandler().handleException(
|
||||
"Error processing exchange", exchange,
|
||||
exchange.getException());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String readOptions() {
|
||||
return "Operation name " + endpoint.getSystemName();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.component;
|
||||
|
||||
import org.apache.camel.Consumer;
|
||||
import org.apache.camel.Processor;
|
||||
import org.apache.camel.Producer;
|
||||
import org.apache.camel.spi.Metadata;
|
||||
import org.apache.camel.spi.UriEndpoint;
|
||||
import org.apache.camel.spi.UriParam;
|
||||
import org.apache.camel.spi.UriPath;
|
||||
import org.apache.camel.support.DefaultEndpoint;
|
||||
|
||||
@UriEndpoint(
|
||||
scheme = "system-group",
|
||||
title = "System",
|
||||
syntax = "system-group:systemName",
|
||||
label = "custom",
|
||||
producerOnly = true)
|
||||
public class SystemGroupEndpoint extends DefaultEndpoint {
|
||||
|
||||
@UriPath
|
||||
@Metadata(required = true)
|
||||
private String systemName;
|
||||
@UriParam
|
||||
private String preferredConnector = null;
|
||||
|
||||
public SystemGroupEndpoint() {
|
||||
}
|
||||
|
||||
public SystemGroupEndpoint(String uri, SystemGroupComponent component) {
|
||||
super(uri, component);
|
||||
}
|
||||
|
||||
public Producer createProducer() throws Exception {
|
||||
return new SystemGroupProducer(this);
|
||||
}
|
||||
|
||||
public Consumer createConsumer(Processor processor) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getSystemName() {
|
||||
return systemName;
|
||||
}
|
||||
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
public String getPreferredConnector() {
|
||||
return preferredConnector;
|
||||
}
|
||||
|
||||
public void setPreferredConnector(String preferredConnector) {
|
||||
this.preferredConnector = preferredConnector;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.component;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.support.DefaultProducer;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ru.entaxy.esb.system.common.exception.ProfileNotFound;
|
||||
import ru.entaxy.esb.system.groups.registry.system.groups.profile.SystemGroupCollectorListener;
|
||||
import ru.entaxy.esb.system.groups.registry.system.groups.profile.SystemGroupProfile;
|
||||
|
||||
|
||||
public class SystemGroupProducer extends DefaultProducer {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SystemGroupProducer.class);
|
||||
private final SystemGroupEndpoint endpoint;
|
||||
|
||||
private SystemGroupCollectorListener systemGroupCollectorListener;
|
||||
|
||||
public SystemGroupProducer(SystemGroupEndpoint endpoint) {
|
||||
super(endpoint);
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public void process(Exchange exchange) throws Exception {
|
||||
LOG.debug("In SystemGroupProducer " + exchange.getIn().getBody());
|
||||
|
||||
//get System Group Profile from systemRegistry endpoint.getSystemName()
|
||||
SystemGroupProfile systemGroupProfile = null;
|
||||
|
||||
systemGroupProfile = getSystemGroupProfile(endpoint.getSystemName());
|
||||
|
||||
LOG.debug("Called system group profile " + (systemGroupProfile != null ? systemGroupProfile.getProfileName() : "NULL"));
|
||||
|
||||
systemGroupProfile.send(exchange);
|
||||
}
|
||||
|
||||
public SystemGroupProfile getSystemGroupProfile(String nameSystem) throws ProfileNotFound {
|
||||
systemGroupCollectorListener = getSystemGroupCollectorListener();
|
||||
LOG.info("Registry SystemGroupProfile {}; services count {}", nameSystem, systemGroupCollectorListener.getReferenceNames().size());
|
||||
SystemGroupProfile systemGroupProfile = null;
|
||||
if (systemGroupCollectorListener.isRegistered(nameSystem)) {
|
||||
systemGroupProfile = (SystemGroupProfile) systemGroupCollectorListener.getReference(nameSystem);
|
||||
} else {
|
||||
throw new ProfileNotFound("Profile for group system " + nameSystem + " not found");
|
||||
}
|
||||
return systemGroupProfile;
|
||||
}
|
||||
|
||||
|
||||
public SystemGroupCollectorListener getSystemGroupCollectorListener() {
|
||||
if (systemGroupCollectorListener == null) {
|
||||
BundleContext bundleContext = FrameworkUtil.getBundle(SystemGroupProducer.class).getBundleContext();
|
||||
ServiceReference<SystemGroupCollectorListener> systemGroupCollectorListenerServiceReference =
|
||||
bundleContext.getServiceReference(SystemGroupCollectorListener.class);
|
||||
systemGroupCollectorListener = bundleContext.getService(systemGroupCollectorListenerServiceReference);
|
||||
}
|
||||
return systemGroupCollectorListener;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.component.util;
|
||||
|
||||
public class SystemGroupConstants {
|
||||
|
||||
public static final String PARAMETER_PREFERRED_CONNECTOR = "preferredConnector";
|
||||
|
||||
private SystemGroupConstants() {
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
class=ru.entaxy.esb.system.component.SystemComponent
|
@ -0,0 +1 @@
|
||||
class=ru.entaxy.esb.system.groups.component.SystemGroupComponent
|
@ -0,0 +1,175 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения ENTAXY, принадлежащего
|
||||
Правообладателю – Обществу с ограниченной ответственностью "ЕМДЕВ" (ОГРН 1057810026658, ИНН
|
||||
7813313860, юридический адрес: 197022, Россия, г. Санкт-Петербург, ул. Профессора Попова,
|
||||
д. 23, литера В, помещение 3Н), расположенной в сети Интернет по адресу
|
||||
https://www.emdev.ru/about (далее - Компания).
|
||||
|
||||
Используя или получая доступ к Программному обеспечению, или нажав «Я согласен с Условиями»
|
||||
(или аналогичную кнопку или флажок) после загрузки или установки Программного обеспечения,
|
||||
Пользователь выражает свое согласие на обязательность условий и ограничений, изложенных в
|
||||
настоящем документе, в противном случае, он должен не использовать или не получать доступ
|
||||
к Программному обеспечению.
|
||||
|
||||
1. ТЕРМИНЫ И ОПРЕДЕЛЕНИЯ
|
||||
|
||||
a) ПО – Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) в любой ее версии
|
||||
или редакции, исключительные права на которую принадлежат Правообладателю.
|
||||
b) Правообладатель (Компания) – ООО «ЕМДЕВ», ОГРН 1057810026658, ИНН 7813313860, исключительные
|
||||
права которого подтверждаются Свидетельством о государственной регистрации в Реестре программ
|
||||
для ЭВМ № 2021610848 от 19.01.2021 года.
|
||||
c) Пользователь – юридическое или физическое лицо, получившее через скачивание с сайта
|
||||
https://entaxy.ru или иным образом, дистрибутив ПО, пользующееся ПО.
|
||||
d) ИС – интеллектуальная собственность – закреплённое законом исключительное право, а также
|
||||
личные неимущественные права авторов произведений на результат интеллектуальной деятельности.
|
||||
e) Подписка – это коммерческое предложение Правообладателя, состоящее из Лицензии на использование
|
||||
ПО и доступа к технической поддержке программного обеспечения на срок Подписки. Подписка
|
||||
включает предоставление Пользователю неисключительного права использования ПО, в том числе
|
||||
получение обновлений функционала ПО и безопасности ПО, исправление ошибок ПО и получение
|
||||
патчей с обновлениями и исправлениями программного обеспечения. Подписка приобретается
|
||||
Пользователем на период времени, указанный в Сертификате. Количество подписок устанавливается
|
||||
для каждого Пользователя индивидуально в Сертификате.
|
||||
f) Сертификат – документ, выдаваемый Дистрибъютором или Авторизованным партнёром (Партнёром),
|
||||
подтверждающий факт приобретения физическим или юридическим лицом Подписки на программное
|
||||
обеспечение в ограниченном объёме и на определённый период времени.
|
||||
g) Лицензия (простая (неисключительная) – совокупность ограниченных прав использования ПО,
|
||||
предоставленных Пользователю согласно условиям Подписки.
|
||||
h) Библиотека – совокупность подпрограмм и объектов, используемых для разработки программного
|
||||
обеспечения.
|
||||
i) Исходный код – текст компьютерной программы на каком-либо языке программирования, состоящий
|
||||
из одного или нескольких файлов, который может быть прочтён человеком.
|
||||
j) Объектный код – файл (часть машинного кода) с промежуточным представлением отдельного модуля
|
||||
программы, полученный в результате обработки исходного кода, еще не связанный в полную программу.
|
||||
Это машинный код для одной конкретной библиотеки или модуля, который будет составлять готовый
|
||||
продукт.
|
||||
k) Некоммерческое использование – индивидуальное личное использование Пользователем программного
|
||||
обеспечения с целью обучения работе с Программным обеспечением, для оценки или демонстрации
|
||||
возможностей Программного обеспечения, при котором, Пользователем не извлекается коммерческая
|
||||
выгода и/или не идёт в доход денежное вознаграждение при использовании Программного обеспечения.
|
||||
|
||||
2. ДОПУСТИМЫЕ СПОСОБЫ ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ
|
||||
|
||||
2.1. Правообладатель предоставляет Пользователю ограниченное право использования Программного
|
||||
обеспечения на условиях простой (неисключительной) лицензии в объёме, ограниченном правом
|
||||
воспроизведения полной рабочей версии программного обеспечения, новых версий программного обеспечения
|
||||
в памяти оборудования и его запуска на оборудовании в соответствии со ст. 1280 ГК РФ.
|
||||
2.2. Право на использование Программного обеспечения, предоставляемое Пользователю, носит
|
||||
неисключительный характер.
|
||||
2.3. Пользователю предоставляется всемирная, неисключительная, не подлежащая сублицензированию,
|
||||
лицензия на ограниченное использование Программного обеспечения.
|
||||
2.4. Пользователь, имеющий Базовую (некоммерческую) версию лицензии для пробного использования
|
||||
имеет право приобрести Подписку на программное обеспечение. В этом случае Пользователь обязан
|
||||
обратиться в службу поддержки Правообладателя по адресу: https://entaxy.ru/ для изменения
|
||||
вида лицензии с Базовой бесплатной версии на Подписки.
|
||||
2.5. Срок использования скачанной Пользователем базовой (некоммерческой) версии лицензии для
|
||||
пробного использования программного обеспечения – не ограничен.
|
||||
2.6. Использование Пользователем настоящего программного обеспечения в целях разработки,
|
||||
модификации, обновления другого ПО, принадлежащего третьим лицам, а не Правообладателю,
|
||||
без разрешения Правообладателя не допускается.
|
||||
|
||||
3. АВТОРСКОЕ ПРАВО.
|
||||
|
||||
3.1. Все авторские права, все права интеллектуальной собственности на Программное обеспечение
|
||||
и любые его копии принадлежат Правообладателю.
|
||||
3.2. Все авторские права, все права интеллектуальной собственности в отношении любого контента,
|
||||
к которому можно получить доступ с помощью Программного обеспечения, является собственностью
|
||||
соответствующего владельца контента и защищается применимым законодательством об авторском
|
||||
праве или другими законами и договорами об интеллектуальной собственности.
|
||||
3.3. Условия использования Программного обеспечения.
|
||||
Лицензия, предоставленная Пользователю, действительна только в том случае, если Пользователь
|
||||
придерживается следующих условий:
|
||||
3.3.1. Принятие уведомлений об авторских правах. Пользователю запрещается удалять или изменять
|
||||
какие-либо уведомления об авторских правах или лицензиях, которые появляются при использовании
|
||||
Программного обеспечения или на нем.
|
||||
3.3.2. Модификация. Пользователю запрещается модифицировать, изменять, декомпилировать,
|
||||
расшифровывать, дизассемблировать, переводить или реверсировать, перепроектировать
|
||||
Программное обеспечение.
|
||||
3.3.3. Распространение. Пользователю запрещается сублицензировать, передавать право использования
|
||||
ПО или иным образом распространять или предоставлять Программное обеспечение любой третьей стороне.
|
||||
3.3.4. SaaS. За исключением случаев, когда это разрешено Правообладателем, Пользователю запрещено
|
||||
использовать Программное обеспечение в коммерческих целях для оказания услуг третьим лицам.
|
||||
|
||||
4. ОТВЕТСТВЕННОСТЬ ПРАВООБЛАДАТЕЛЯ ПРИ НАРУШЕНИИ ПОЛЬЗОВАТЕЛЕМ ПРАВ «ИС»
|
||||
|
||||
4.1. Правообладатель не несет никаких обязательств в отношении каких-либо претензий к Пользователю
|
||||
на предмет нарушения последним прав Интеллектуальной собственности, возникших в связи с
|
||||
использованием Пользователем:
|
||||
4.1.1. Любых компонентов программного обеспечения с открытым исходным кодом, включенных в
|
||||
Программное обеспечение;
|
||||
4.1.2. Любого нарушения правил использования Программного обеспечения, установленного условиями
|
||||
настоящего соглашения;
|
||||
4.1.3. Любого использования Программного обеспечения в сочетании с другими ПО, оборудованием,
|
||||
или данными, не предоставленными Пользователю Правообладателем;
|
||||
4.1.4. Любого изменения Программного обеспечения любым третьим лицом, а не Правообладателем.
|
||||
|
||||
|
||||
5. НАСТОЯЩИМ ПРАВООБЛАДАТЕЛЬ ЗАЯВЛЯЕТ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ ПОЛЬЗОВАТЕЛЮ
|
||||
ПО ПРИНЦИПУ «AS IS» - «КАК ЕСТЬ». НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ НЕ ГАРАНТИРУЕТ
|
||||
И НЕ ОБЕЩАЕТ, ЧТО ПРЕДОСТАВЛЕННОЕ ИМ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ПОДХОДИТЬ ИЛИ НЕ ПОДХОДИТЬ
|
||||
ДЛЯ КОНКРЕТНЫХ ЦЕЛЕЙ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ОТВЕЧАТЬ ВСЕМ КОММЕРЧЕСКИМ
|
||||
И ЛИЧНЫМ СУБЪЕКТИВНЫМ ОЖИДАНИЯМ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ РАБОТАТЬ
|
||||
ИСПРАВНО, БЕЗ ТЕХНИЧЕСКИХ ОШИБОК, БЫСТРО И БЕСПЕРЕБОЙНО.
|
||||
|
||||
6. ОГРАНИЧЕНИЕ ОТВЕТСТВЕННОСТИ.
|
||||
НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ ИЛИ ЕГО АФФИЛЛИРОВАННЫЕ ЛИЦА НЕ НЕСУТ ПЕРЕД ПОЛЬЗОВАТЕЛЕМ
|
||||
ОТВЕТСТВЕННОСТИ ЗА ЛЮБЫЕ ПРЯМЫЕ ИЛИ КОСВЕННЫЕ УБЫТКИ ПОЛЬЗОВАТЕЛЯ, ЕГО РАСХОДЫ ИЛИ РЕАЛЬНЫЙ УЩЕРБ,
|
||||
ВКЛЮЧАЯ, ПОМИМО ПРОЧЕГО, ПРОСТОИ; УТРАТУ БИЗНЕСА; УПУЩЕННУЮ ВЫГОДУ; НЕДОПОЛУЧЕННУЮ ПРИБЫЛЬ;
|
||||
ПОТЕРЮ ИЛИ ПОВРЕЖДЕНИЕ ДАННЫХ, ИМУЩЕСТВА И ИНОЕ.
|
||||
ОГРАНИЧЕНИЯ ПРИМЕНЯЮТСЯ НЕЗАВИСИМО ОТ ОСНОВАНИЯ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ; В ТОМ ЧИСЛЕ ВСЛЕДСТВИЕ
|
||||
ДЕЙСТВИЯ ИЛИ БЕЗДЕЙСТВИЯ, НЕБРЕЖНОСТИ, УМЫСЛА, ПРЯМОГО ИЛИ КОСВЕННОГО; НЕОСТОРОЖНОСТИ; ЗАБЛУЖДЕНИЯ;
|
||||
КЛЕВЕТЫ; НАРУШЕНИЯ КОНФИДЕНЦИАЛЬНОСТИ ИЛИ ПРАВА ИНТЕЛЛЕКТУАЛЬНОЙ СОБСТВЕННОСТИ; ИЛИ ЛЮБОЕ ДРУГОЕ
|
||||
ОСНОВАНИЕ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ.
|
||||
|
||||
7. ОБЯЗАННОСТЬ ПОЛЬЗОВАТЕЛЯ:
|
||||
Не осуществлять самостоятельно и (или) с привлечением третьих лиц нижеследующие действия
|
||||
(включая, но не ограничиваясь) по:
|
||||
-дизассемблированию и (или) декомпилированию (преобразованию объектного кода в исходный код)
|
||||
Программного обеспечения;
|
||||
-модификации Программного обеспечения, в том числе вносить изменения в объектный код, исходный
|
||||
код Программного обеспечения, за исключением тех изменений, которые вносятся средствами,
|
||||
включёнными в Программное обеспечение и описанными непосредственно в документации к нему;
|
||||
-созданию условий для использования Программного обеспечения лицами, не имеющими прав на
|
||||
использование данного Программного обеспечения, включая (но не ограничиваясь) вмешательство
|
||||
третьих лиц в функционирование Программного обеспечения, предоставление третьим лицам доступа
|
||||
к исследованию и (или) замене настроек Программного обеспечения, включая его первичную установку;
|
||||
-распространению Программного обеспечения в целом или в части (включая приложенную к нему документацию).
|
||||
|
||||
8. БИБЛИОТЕКА ПО. ИСПОЛЬЗУЕМЫЕ ПРОГРАММНЫЕ СРЕДСТВА.
|
||||
|
||||
8.1. Настоящим, Правообладатель заверяет, что Библиотека программного обеспечения состоит из
|
||||
лицензионных продуктов, используемых на законных основаниях, а
|
||||
именно https://entaxy.ru/libs/licenses/root-aggregated.deps.
|
||||
8.2. Любые программные средства, применяемые Пользователем при работе с ПО, должны быть
|
||||
совместимы с библиотекой ПО, указанной в п.8.1. настоящего соглашения.
|
||||
8.3. Перечень внешних модулей ПО, указанный в п.8.1 настоящего соглашения, может изменяться
|
||||
Правообладателем в одностороннем порядке, в зависимости от выпуска релизов программного обеспечения,
|
||||
содержащих все изменения и дополнения программного обеспечения.
|
||||
|
||||
9. ВНЕСЕНИЕ ИЗМЕНЕНИЙ В ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ.
|
||||
|
||||
9.1. Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) является свободно распространяемым
|
||||
программным обеспечением.
|
||||
9.2. Пользователь имеет право вносить изменения в исходный код программного обеспечения исключительно
|
||||
с согласия Правообладателя в порядке предложения изменений/правок/дополнений через механизм
|
||||
«Pull Requests» в открытом репозитории Правообладателя по адресу: https://git.entaxy.ru/entaxy/entaxy-public.
|
||||
9.3. Любые изменения программного обеспечения, осуществляемые Пользователем без соблюдения условий
|
||||
пункта 9.2. настоящего документа, являются нарушением авторских и смежных прав Правообладателя,
|
||||
прав интеллектуальной собственности Правообладателя и влекут применение к Пользователю мер
|
||||
ответственности в соответствии с условиями настоящей Лицензии, а также применимого законодательства
|
||||
Российской Федерации.
|
||||
|
||||
10. ЗАКЛЮЧИТЕЛЬНЫЕ ПОЛОЖЕНИЯ.
|
||||
|
||||
10.1. В случае нарушения Пользователем любого из условий настоящей Лицензии, Правообладатель имеет
|
||||
право взыскать с Пользователя любые причинённые таким нарушением убытки, реальный ущерб,
|
||||
недополученную прибыль, упущенную выгоду, а также в случае нарушения Пользователем условий
|
||||
пункта 9.2 настоящего соглашения, в том числе, взыскать с Пользователя штраф в размере
|
||||
2 000 000 (Два миллиона) рублей за каждый установленный случай несанкционированного изменения
|
||||
исходного или объектного кода Программного обеспечения «Энтакси» (Entaxy).
|
||||
10.2. В рамках исполнения Пользователем обязательств по настоящей Лицензии, применимое
|
||||
законодательство – Российской Федерации.
|
||||
10.3. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -0,0 +1,43 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>profile-implementation</artifactId>
|
||||
<version>1.11.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
|
||||
<artifactId>profile-runtime-legacy-support</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME LEGACY</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME LEGACY</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.esb.system.profile.commons,
|
||||
ru.entaxy.esb.system.profile.commons.connectors,
|
||||
ru.entaxy.esb.system.profile.commons.connectors.in,
|
||||
ru.entaxy.esb.system.profile.commons.connectors.out,
|
||||
ru.entaxy.esb.system.profile.commons.profile_output,
|
||||
ru.entaxy.esb.system.registry.systems.profile,
|
||||
ru.entaxy.esb.system.registry.systems.profile.collector,
|
||||
ru.entaxy.esb.system.registry.systems.profile.impl.defaults,
|
||||
ru.entaxy.esb.system.groups.registry.system.groups.profile,
|
||||
ru.entaxy.esb.system.groups.registry.system.groups.profile.collector,
|
||||
ru.entaxy.esb.system.groups.registry.system.groups.profile.impl.defaults
|
||||
</bundle.osgi.export.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>core-support-runtime-legacy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,31 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-profile-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.registry.system.groups.profile;
|
||||
|
||||
import ru.entaxy.platform.base.support.osgi.service.NamedReferenceListener;
|
||||
|
||||
public interface SystemGroupCollectorListener<T> extends NamedReferenceListener<T> {
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-profile-api
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.registry.system.groups.profile;
|
||||
|
||||
import ru.entaxy.esb.system.profile.commons.Profile;
|
||||
|
||||
public interface SystemGroupProfile extends Profile {
|
||||
|
||||
String getProfileName();
|
||||
|
||||
void send(Object request);
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-profile-collector
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.registry.system.groups.profile.collector;
|
||||
|
||||
import ru.entaxy.esb.system.groups.registry.system.groups.profile.SystemGroupCollectorListener;
|
||||
import ru.entaxy.esb.system.groups.registry.system.groups.profile.SystemGroupProfile;
|
||||
import ru.entaxy.platform.base.support.osgi.service.CommonNamedReferenceListener;
|
||||
|
||||
public class SystemGroupProfileNamedListener extends CommonNamedReferenceListener<SystemGroupProfile>
|
||||
implements SystemGroupCollectorListener<SystemGroupProfile> {
|
||||
|
||||
@Override
|
||||
protected String getObjectName(SystemGroupProfile systemGroupProfile) {
|
||||
return systemGroupProfile.getProfileName();
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* system-group-profile-impl-default
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.groups.registry.system.groups.profile.impl.defaults;
|
||||
|
||||
import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Message;
|
||||
import org.apache.camel.ProducerTemplate;
|
||||
import org.apache.camel.component.jms.JmsComponent;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import ru.entaxy.esb.system.groups.registry.system.groups.profile.SystemGroupProfile;
|
||||
import ru.entaxy.esb.system.profile.commons.CommonProfile;
|
||||
import ru.entaxy.esb.system.registry.systems.profile.SystemCollectorListener;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
|
||||
public class DefaultSystemGroupProfile extends CommonProfile implements SystemGroupProfile {
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(DefaultSystemGroupProfile.class);
|
||||
private static final String NAME_JMS_COMPONENT = "jms";
|
||||
|
||||
private String systemGroupName = "system";
|
||||
private String profileName = "default";
|
||||
private String destination = "default";
|
||||
private final String dlq = "DLQ";
|
||||
private ConnectionFactory jmsConnectionFactory;
|
||||
|
||||
private SystemCollectorListener systemCollectorListener;
|
||||
|
||||
public DefaultSystemGroupProfile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProfileName() {
|
||||
return profileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSend(Object request) {
|
||||
LOG.info("Send request " + request + "in " + destination);
|
||||
Exchange exchange = (Exchange) request;
|
||||
|
||||
ProducerTemplate template = exchange.getContext().createProducerTemplate();
|
||||
addJmsComponent(exchange.getContext());
|
||||
|
||||
Message message = exchange.getMessage();
|
||||
message.setHeader("NTX_SystemId", systemGroupName);
|
||||
message.setHeader("ExchangePattern", "InOnly");
|
||||
|
||||
template.send(destination, exchange);
|
||||
}
|
||||
|
||||
private void addJmsComponent(CamelContext context) {
|
||||
if (!context.getComponentNames().contains(NAME_JMS_COMPONENT))
|
||||
addJmsComponent(context, NAME_JMS_COMPONENT);
|
||||
}
|
||||
|
||||
private void addJmsComponent(CamelContext context, String componentName) {
|
||||
JmsComponent component = new JmsComponent(context);
|
||||
component.setConnectionFactory(jmsConnectionFactory);
|
||||
|
||||
context.addComponent(componentName, component);
|
||||
}
|
||||
|
||||
public void setSystemGroupName(String systemGroupName) {
|
||||
this.systemGroupName = systemGroupName;
|
||||
}
|
||||
|
||||
public void setProfileName(String profileName) {
|
||||
this.profileName = profileName;
|
||||
}
|
||||
|
||||
public void setDestination(String destination) {
|
||||
this.destination = destination;
|
||||
}
|
||||
|
||||
public void setJmsConnectionFactory(ConnectionFactory jmsConnectionFactory) {
|
||||
this.jmsConnectionFactory = jmsConnectionFactory;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons;
|
||||
|
||||
import ru.entaxy.esb.system.profile.commons.profile_output.ProfileOutput;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class CommonProfile implements Profile {
|
||||
|
||||
protected String systemName = "system";
|
||||
protected ProfileOutput profileOutput;
|
||||
protected InConnectorCollector inConnectorCollector;
|
||||
|
||||
@Override
|
||||
public void send(Object request) {
|
||||
doSend(request);
|
||||
}
|
||||
|
||||
protected abstract void doSend(Object request);
|
||||
|
||||
@Override
|
||||
public String getSystemName() {
|
||||
return systemName;
|
||||
}
|
||||
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfileOutput getProfileOutput() {
|
||||
return profileOutput;
|
||||
}
|
||||
|
||||
public void setProfileOutput(ProfileOutput profileOutput) {
|
||||
this.profileOutput = profileOutput;
|
||||
}
|
||||
|
||||
public InConnectorCollector getInConnectorCollector() {
|
||||
return inConnectorCollector;
|
||||
}
|
||||
|
||||
public void setInConnectorCollector(InConnectorCollector inConnectorCollector) {
|
||||
this.inConnectorCollector = inConnectorCollector;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CommonProfile that = (CommonProfile) o;
|
||||
return Objects.equals(systemName, that.systemName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(systemName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CommonProfile{" +
|
||||
"systemName='" + systemName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Header;
|
||||
|
||||
import ru.entaxy.esb.system.common.exception.ConnectorNotFound;
|
||||
import ru.entaxy.esb.system.profile.commons.connectors.Connector;
|
||||
import ru.entaxy.platform.base.support.osgi.service.CommonNamedReferenceListener;
|
||||
|
||||
public class ConnectorRegistry extends CommonNamedReferenceListener<Connector> {
|
||||
|
||||
public String getParam(String systemName, String paramName) {
|
||||
Connector connector = getReference(systemName);
|
||||
if (connector != null) {
|
||||
return connector.getParam(paramName);
|
||||
} else {
|
||||
throw new ConnectorNotFound("Connector for " + systemName + " not found");
|
||||
}
|
||||
}
|
||||
|
||||
public void send(@Header("X-SystemName") String systemName, Exchange exchange) {
|
||||
Connector connector = getReference(systemName);
|
||||
if (connector != null) {
|
||||
connector.send(exchange);
|
||||
} else {
|
||||
throw new ConnectorNotFound("Connector for " + systemName + " not found");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getObjectName(Connector Connector) {
|
||||
return Connector.getSystemName();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons;
|
||||
|
||||
import ru.entaxy.esb.system.profile.commons.connectors.in.InConnector;
|
||||
import ru.entaxy.platform.base.support.osgi.service.CommonNamedReferenceListener;
|
||||
|
||||
public class InConnectorCollector extends CommonNamedReferenceListener<InConnector> {
|
||||
|
||||
@Override
|
||||
protected String getObjectName(InConnector inConnector) {
|
||||
return inConnector == null ? null : inConnector.getEndpointName();
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons;
|
||||
|
||||
import ru.entaxy.esb.system.profile.commons.profile_output.ProfileOutput;
|
||||
|
||||
public interface Profile {
|
||||
|
||||
ProfileOutput getProfileOutput();
|
||||
|
||||
String getSystemName();
|
||||
|
||||
InConnectorCollector getInConnectorCollector();
|
||||
|
||||
void send(Object request);
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons.connectors;
|
||||
|
||||
import ru.entaxy.esb.system.profile.commons.Profile;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class CommonConnector implements Connector {
|
||||
protected String endpointName;
|
||||
protected Profile profile;
|
||||
protected String systemName;
|
||||
protected Map<String, String> params;
|
||||
|
||||
public void setEndpointName(String endpointName) {
|
||||
this.endpointName = endpointName;
|
||||
}
|
||||
|
||||
public void setProfile(Profile profile) {
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEndpointName() {
|
||||
return endpointName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Profile getProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemName() {
|
||||
return systemName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParam(String paramName) {
|
||||
return params.get(paramName);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons.connectors;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.profile.commons.Profile;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface Connector {
|
||||
|
||||
public static final String HEADERS_START = "NTX_Connector_";
|
||||
public static final String ROLE = "role";
|
||||
public static final String TYPE = "type";
|
||||
public static final String SUBTYPE = "subtype";
|
||||
|
||||
String getEndpointName();
|
||||
|
||||
String getEndpointType();
|
||||
|
||||
Profile getProfile();
|
||||
|
||||
String getSystemName();
|
||||
|
||||
Map<String, String> getParams();
|
||||
|
||||
String getParam(String paramName);
|
||||
|
||||
void send(Exchange exchange);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons.connectors.in;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.ProducerTemplate;
|
||||
import ru.entaxy.esb.system.profile.commons.connectors.CommonConnector;
|
||||
|
||||
public class DirectVMInConnectorImpl extends CommonConnector implements InConnector {
|
||||
|
||||
@Override
|
||||
public String getEndpointType() {
|
||||
return endpointType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void send(Exchange exchange) {
|
||||
ProducerTemplate template = exchange.getContext().createProducerTemplate();
|
||||
exchange.getIn().setHeader(HEADERS_START + ROLE, getParam(ROLE));
|
||||
exchange.getIn().setHeader(HEADERS_START + TYPE, getParam(TYPE));
|
||||
exchange.getIn().setHeader(HEADERS_START + SUBTYPE, getParam(SUBTYPE));
|
||||
template.send("direct-vm:" + endpointName + "-" + endpointType + "-connector-" + systemName +
|
||||
"?block=true&timeout=60000", exchange);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons.connectors.in;
|
||||
|
||||
import ru.entaxy.esb.system.profile.commons.connectors.Connector;
|
||||
|
||||
public interface InConnector extends Connector {
|
||||
|
||||
String endpointType = "in";
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons.connectors.out;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.ProducerTemplate;
|
||||
import ru.entaxy.esb.system.profile.commons.connectors.CommonConnector;
|
||||
|
||||
public class DirectVMOutConnectorImpl extends CommonConnector implements OutConnector {
|
||||
|
||||
@Override
|
||||
public String getEndpointType() {
|
||||
return endpointType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void send(Exchange exchange) {
|
||||
ProducerTemplate template = exchange.getContext().createProducerTemplate();
|
||||
template.send("direct-vm:" + endpointName + "-" +
|
||||
endpointType + "-connector-" + systemName + "?block=true&timeout=60000", exchange);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons.connectors.out;
|
||||
|
||||
import ru.entaxy.esb.system.profile.commons.connectors.Connector;
|
||||
|
||||
public interface OutConnector extends Connector {
|
||||
|
||||
String endpointType = "out";
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons.profile_output;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Header;
|
||||
import ru.entaxy.esb.system.profile.commons.connectors.out.OutConnector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static ru.entaxy.esb.system.profile.commons.connectors.Connector.*;
|
||||
|
||||
public interface ProfileOutput {
|
||||
OutConnector getOutConnector(String endpointName, String role, String type, String subtype);
|
||||
|
||||
void send(Exchange exchange);
|
||||
|
||||
void sendTo(@Header("EndpointName") String endpointName,
|
||||
@Header(HEADERS_START + ROLE) String role,
|
||||
@Header(HEADERS_START + TYPE) String type,
|
||||
@Header(HEADERS_START + SUBTYPE) String subtype,
|
||||
Exchange exchange);
|
||||
|
||||
public List<String> getReferenceNames();
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-commons
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.profile.commons.profile_output;
|
||||
|
||||
import static ru.entaxy.esb.system.profile.commons.connectors.Connector.HEADERS_START;
|
||||
import static ru.entaxy.esb.system.profile.commons.connectors.Connector.ROLE;
|
||||
import static ru.entaxy.esb.system.profile.commons.connectors.Connector.SUBTYPE;
|
||||
import static ru.entaxy.esb.system.profile.commons.connectors.Connector.TYPE;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Header;
|
||||
import org.apache.camel.ProducerTemplate;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.system.common.exception.ConnectorNotFound;
|
||||
import ru.entaxy.esb.system.profile.commons.connectors.out.OutConnector;
|
||||
import ru.entaxy.platform.base.support.osgi.service.CommonNamedReferenceListener;
|
||||
|
||||
public class ProfileOutputImpl extends CommonNamedReferenceListener<OutConnector> implements ProfileOutput {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProfileOutputImpl.class);
|
||||
|
||||
protected String systemName;
|
||||
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutConnector getOutConnector(String endpointName, String role, String type, String subtype) {
|
||||
for (OutConnector outConnector : registeredReferences.values()) {
|
||||
if ((role == null || role.equals(outConnector.getParam(ROLE))) &&
|
||||
type != null && type.equals(outConnector.getParam(TYPE)) &&
|
||||
subtype != null && subtype.equals(outConnector.getParam(SUBTYPE))) {
|
||||
return outConnector;
|
||||
} else if ((role == null || role.equals(outConnector.getParam(ROLE))) &&
|
||||
type != null && type.equals(outConnector.getParam(TYPE))) {
|
||||
return outConnector;
|
||||
} else if (role != null && role.equals(outConnector.getParam(ROLE))) {
|
||||
return outConnector;
|
||||
}
|
||||
}
|
||||
if (endpointName == null || registeredReferences.get(endpointName) == null) {
|
||||
for (OutConnector outConnector : registeredReferences.values()) {
|
||||
return outConnector;
|
||||
}
|
||||
}
|
||||
return registeredReferences.get(endpointName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void send(Exchange exchange) {
|
||||
/*
|
||||
* !!! WE ARE NOT SURE THE SENDING FROM PROCESSOR (COMPONENT) IS ALLOWED IN CAMEL !!!
|
||||
* but we managed to do this
|
||||
*
|
||||
* we need another Thread to execute because when sending
|
||||
* from system to itself the execution stops in waiting forever
|
||||
* due to existing running ReactiveExecutor will be found for this thread
|
||||
* and the task will be placed in it's queue while being in
|
||||
* execution of the previous task from another Workers's queue
|
||||
* of the same ReactiveExecutor
|
||||
*
|
||||
* Example (without separate thread):
|
||||
*
|
||||
* profile_s1 (ExtendedCamelContext_1 -> ReactiveExecutor_1)
|
||||
* -> task (we're in it now!) -> [switch to ExtendedCamelContext_2] producer (vmdirect)
|
||||
* -> ExtendedCamelContext_2 (with ReactiveExecutor_2) (route_s1)
|
||||
* -> consumer (profile_s1)
|
||||
* -> task {
|
||||
* Who will execute? Let's check if there's already a ReactiveExecutor !!for current Thread!!
|
||||
* in target context. If no, our executor will be used.
|
||||
* Oh! We've found ReactiveExecutor_1, it will execute.
|
||||
* } -> enqueue (ReactiveExecutor_1)
|
||||
* -> (execution is still in ExtendedCamelContext_2 - route_s1)
|
||||
* -> wait for task to be executed.
|
||||
*
|
||||
* Result: being in previous (current) task we're waiting for the next task
|
||||
* in the same ReactiveExecutor's queue to be executed.
|
||||
* This will never happen.
|
||||
*
|
||||
*/
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
Thread exec = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ProducerTemplate template = exchange.getContext().createProducerTemplate();
|
||||
template.send("direct-vm:profile-" + systemName + "-enter-point?block=true&timeout=60000", exchange);
|
||||
latch.countDown();
|
||||
}
|
||||
});
|
||||
exec.setContextClassLoader(Thread.currentThread().getContextClassLoader());
|
||||
exec.start();
|
||||
try {
|
||||
// we have to wait the thread to be executed
|
||||
// because we're calling synchronously
|
||||
latch.await();
|
||||
} catch (InterruptedException e) {
|
||||
// e.printStackTrace();
|
||||
log.error("Error awaiting latch", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendTo(@Header("ENTAXY_EndpointName") String endpointName,
|
||||
@Header(HEADERS_START + ROLE) String role,
|
||||
@Header(HEADERS_START + TYPE) String type,
|
||||
@Header(HEADERS_START + SUBTYPE) String subtype,
|
||||
Exchange exchange) {
|
||||
try {
|
||||
getOutConnector(endpointName, role, type, subtype).send(exchange);
|
||||
} catch (NullPointerException ex) {
|
||||
throw new ConnectorNotFound("Out connector for " + systemName + " not found");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getObjectName(OutConnector outConnector) {
|
||||
return outConnector == null ? null : outConnector.getEndpointName();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user