release version 1.10.0

This commit is contained in:
2024-10-07 18:42:55 +03:00
parent 2034182607
commit a5088587f7
1501 changed files with 28818 additions and 59966 deletions

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>objects-implementations</artifactId>
<version>1.9.0</version>
<version>1.10.0</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
<artifactId>profile-implementation</artifactId>
@ -13,6 +13,13 @@
<modules>
<module>profile-runtime</module>
<module>profile-producing</module>
<!-- @MOVED root/platform-backward-compat-->
<!--
<module>profile-storage</module>
-->
<module>profile-runtime-legacy-support</module>
<module>profile-runtime-camel-components</module>
</modules>
</project>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
<artifactId>profile-implementation</artifactId>
<version>1.9.0</version>
<version>1.10.0</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
<artifactId>profile-producing</artifactId>

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* test-producers
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -1,88 +0,0 @@
{
"factory": {
"id": "common-profile",
"type": "entaxy.runtime.profile",
"displayName": "System profile [LEGACY]",
"isDeprecated": true,
"isAbstract": false
},
"entaxy.runtime.profile": {
"profileType": "SYSTEM"
},
"fields": {
"systemName": {
"displayName": "System Name",
"type": "String",
"required": true,
"immutable": true,
"@TYPEINFO": {
"validation": {
"rules": [
{
"length": {
"min": 3
}
},
{
"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"
}
}
]
}
}
},
"description": {
"displayName": "Description",
"type": "String"
},
"useDefaultRoute": {
"displayName": "Use Default Route",
"type": "Boolean",
"required": true,
"defaultValue": true
},
"defaultRoute": {
"type": "entaxy.runtime.default-route",
"isRef": true,
/* actually there's no reference, but the object must be in a model */
/* so while producing we must check the defaultRoute is found */
"isBackRef": true,
/* but only if useDefaultRoute is set to true */
"condition": "${useDefaultRoute}",
"required": true,
"immutable": true,
"defaultValue": {
"type": "entaxy.runtime.default-route",
"factoryId": "default-route",
"properties": {
"description": "Default route for ${systemName}"
}
}
},
"##publish": {
"defaultValue": {
"profileType": {
"@CALCULATED": {
"expression": "${#FACTORY#.#TYPEINFO#.profileType}",
"lazy": false
}
}
}
}
},
"outputs": {
"init": {
"isDefault": true,
"fields": {
"systemName": {},
"description": {},
"useDefaultRoute": {},
"defaultRoute": {}
}
}
}
}

View File

@ -3,6 +3,9 @@
"id": "default-route-2",
"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>",
"parent": "abstract-route-container-object",
"isAbstract": false
},
"entaxy.runtime.default-route": {
@ -21,10 +24,12 @@
"lazy": false
}
}
},
},
"systemName": {
"type": "entaxy.runtime.profile",
"isRef": true,
"displayName": "System name",
"description": "Name of the system owning the route",
"required": true,
"immutable": true,
"refField": "systemName",
@ -37,16 +42,17 @@
"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>",
"@RESOURCE": {
"_provider": "entaxy-file-internal",
"endType": "String",
"format": "base64",
"preprocess":[
"postprocess_bak": [
{
"processor": "xslt",
"source":"entaxy-file-internal:factories/default-route-2/default-route.xslt",
"source": "entaxy-file-internal:factories/default-route-2/default-route.xslt",
"parameters": {
"profileName": {
"profileName": {
"@CALCULATED": {
"expression": "${#OWNER#.properties.systemName}",
"lazy": false
@ -56,11 +62,24 @@
},
{
"processor": "merge",
"source":"entaxy-file-internal:factories/default-route-2/standard-router.xml",
"source": "entaxy-file-internal:factories/default-route-2/standard-router.xml",
"sourceElement": "standard-router",
"targetElement": "standard-router",
"parameters": {
"profileName": {
"profileName": {
"@CALCULATED": {
"expression": "${#OWNER#.properties.systemName}",
"lazy": false
}
}
}
}
],
"postprocess": [
{
"processor": "component-library",
"parameters": {
"profileName": {
"@CALCULATED": {
"expression": "${#OWNER#.properties.systemName}",
"lazy": false
@ -69,11 +88,19 @@
}
}
]
},
"@UI": {
"isResource": true,
"resourceFormat": "base64"
}
},
"profileObjectType": {
"type": "String",
"required": true,
"isHidden": true
},
"##publish": {
"defaultValue":{
"defaultValue": {
"profile": {
"@CALCULATED": {
"expression": "${properties.systemName}",
@ -83,23 +110,28 @@
"relation": {
"@CALCULATED": {
"_expression": "${properties.systemName}:${#OWNER#.#FACTORY#.type}:default-route:routes",
"expression": "${properties.systemName}:${properties.profileObjectType}:default-route:routes",
"expression": "${properties.systemName}:${properties.profileObjectType}:default-route:-composition:routes/bound",
"lazy": false
}
}
}
}
}
}
},
"outputs": {
"init": {
"isDefault": true,
"fields": {
"systemName": {},
"description": {},
"routeContent": {},
"__objectId": {}
"systemName": {
},
"description": {
},
"routeContent": {
},
"__objectId": {
},
"profileObjectType": {
}
}
}
}
}
}

View File

@ -1,32 +0,0 @@
{
"factory": {
"id": "default-route",
"type": "entaxy.runtime.default-route"
},
"entaxy.runtime.default-route": {
"displayName": "Default route for system profile"
},
"fields": {
"systemName": {
"type": "entaxy.runtime.profile",
"isRef": true,
"required": true,
"immutable": true,
"refField": "systemName",
"isRefByValueOnly": true
},
"description": {
"type": "String"
}
},
"outputs": {
"init": {
"isDefault": true,
"fields": {
"systemName": {},
"description": {}
}
}
}
}

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<route>
<in-flow-pre-route-start />
<entaxy:object-route xmlns="http://camel.apache.org/schema/blueprint" xmlns:blueprint="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:entaxy="http://www.entaxy.ru/schemas/1.0" xmlns:m="http://www.entaxy.ru/schemas/entaxy-mediators/1.0">
<setProperty name="NTX_profile_in_preRouted">
<constant>true</constant>
</setProperty>
</route>
</entaxy:object-route>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<route>
<in-flow-response-start />
<entaxy:object-route xmlns="http://camel.apache.org/schema/blueprint" xmlns:blueprint="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:entaxy="http://www.entaxy.ru/schemas/1.0" xmlns:m="http://www.entaxy.ru/schemas/entaxy-mediators/1.0">
<setProperty name="NTX_profile_in_response">
<constant>true</constant>
</setProperty>
</route>
</entaxy:object-route>

View File

@ -1,53 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<route>
<choice>
<when>
<simple>${headers.in} == null</simple>
<connector-selector>
<properties-to-use>
<property>connector.type</property>
<property>connector.protocol</property>
<property>connector.classifier</property>
</properties-to-use>
<patterns>
<pattern>=:=:=</pattern>
<pattern>=:=:*</pattern>
<pattern>=:*:*</pattern>
<pattern>*:=:=</pattern>
<pattern>*:=:*</pattern>
</patterns>
<options>
<fail-back-to-legacy-router />
<use-the-only-connector />
<use-default-connector />
<allow-all-stars-pattern>false</allow-all-stars-pattern>
<treat-no-property-as-any>false</treat-no-property-as-any>
</options>
</connector-selector>
</when>
<otherwise>
<connector-selector>
<properties-to-use>
<property>connector.type</property>
<property>connector.protocol</property>
<property>connector.classifier</property>
</properties-to-use>
<patterns>
<pattern>=:=:=</pattern>
<pattern>=:=:*</pattern>
<pattern>=:*:*</pattern>
<pattern>*:=:=</pattern>
<pattern>*:=:*</pattern>
<pattern>*:*:*</pattern>
</patterns>
<options>
<fail-back-to-legacy-router />
<use-the-only-connector />
<use-default-connector>false</use-default-connector>
<allow-all-stars-pattern>false</allow-all-stars-pattern>
<treat-no-property-as-any>false</treat-no-property-as-any>
</options>
</connector-selector>
</otherwise>
</choice>
</route>
<entaxy:object-route xmlns="http://camel.apache.org/schema/blueprint" xmlns:blueprint="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:entaxy="http://www.entaxy.ru/schemas/1.0" xmlns:m="http://www.entaxy.ru/schemas/entaxy-mediators/1.0">
<!-- you can use camel -->
<m:connector-selector>
<m:properties-to-use>
<m:property>connector.type</m:property>
<m:property>connector.protocol</m:property>
<m:property>connector.classifier</m:property>
</m:properties-to-use>
<m:patterns>
<m:pattern>*:*:=</m:pattern>
</m:patterns>
<m:options>
<m:fail-back-to-legacy-router/>
<m:use-the-only-connector>true</m:use-the-only-connector>
<m:use-default-connector/>
<m:connector-preferred-as-mandatory>false</m:connector-preferred-as-mandatory>
<m:allow-all-stars-pattern>false</m:allow-all-stars-pattern>
<m:treat-no-property-as-any>false</m:treat-no-property-as-any>
</m:options>
</m:connector-selector>
</entaxy:object-route>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<route>
<out-flow-pre-route-start />
<entaxy:object-route xmlns="http://camel.apache.org/schema/blueprint" xmlns:blueprint="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:entaxy="http://www.entaxy.ru/schemas/1.0" xmlns:m="http://www.entaxy.ru/schemas/entaxy-mediators/1.0">
<setProperty name="NTX_profile_out_preRouted">
<constant>true</constant>
</setProperty>
</route>
</entaxy:object-route>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<route>
<out-flow-response-start />
<entaxy:object-route xmlns="http://camel.apache.org/schema/blueprint" xmlns:blueprint="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:entaxy="http://www.entaxy.ru/schemas/1.0" xmlns:m="http://www.entaxy.ru/schemas/entaxy-mediators/1.0">
<setProperty name="NTX_profile_out_response">
<constant>true</constant>
</setProperty>
</route>
</entaxy:object-route>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<route>
<default-route-start />
<standard-router />
</route>
<entaxy:object-route xmlns="http://camel.apache.org/schema/blueprint" xmlns:blueprint="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:entaxy="http://www.entaxy.ru/schemas/1.0" xmlns:m="http://www.entaxy.ru/schemas/entaxy-mediators/1.0">
<m:standard-router />
</entaxy:object-route>

View File

@ -1,75 +0,0 @@
[#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">
<reference-list id="outConnector"
interface="ru.entaxy.esb.system.profile.commons.connectors.out.OutConnector"
filter="(systemName=[=systemName])" availability="optional">
<reference-listener ref="profileOutput"
bind-method="register" unbind-method="unregister"/>
</reference-list>
<reference-list id="inConnector"
interface="ru.entaxy.esb.system.profile.commons.connectors.in.InConnector"
filter="(systemName=[=systemName])" availability="optional">
<reference-listener ref="inConnectorCollector"
bind-method="register" unbind-method="unregister"/>
</reference-list>
<bean id="inConnectorCollector" class="ru.entaxy.esb.system.profile.commons.InConnectorCollector"/>
<bean id="system-profile" class="ru.entaxy.esb.system.registry.systems.profile.impl.defaults.DefaultSystemProfile"
activation="eager">
<property name="systemName" value="[=systemName]"/>
<property name="profileOutput" ref="profileOutput"/>
<property name="inConnectorCollector" ref="inConnectorCollector"/>
</bean>
<bean id="profileOutput" class="ru.entaxy.esb.system.profile.commons.profile_output.ProfileOutputImpl"
activation="eager">
<property name="systemName" value="[=systemName]"/>
</bean>
<service activation="eager" auto-export="interfaces" ref="system-profile"/>
<reference id="pooledConnectionFactory" interface="javax.jms.ConnectionFactory"/>
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="pooledConnectionFactory"/>
</bean>
<camelContext id="profile-[=systemName]" xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="direct-vm:profile-[=systemName]-exit-dispatcher"/>
<log message="Message ${headers} send to profile dispatcher" loggingLevel="TRACE"/>
<choice>
<when>
<simple>${headers.NTX_NextPoint} != null</simple>
<setProperty name="NTX_Tmp">
<simple>${headers.NTX_NextPoint}</simple>
</setProperty>
<removeHeader headerName="NTX_NextPoint"/>
<toD uri="${exchangeProperty.NTX_Tmp}"/>
</when>
<otherwise>
<to uri="direct-vm:profile-[=systemName]-exit-point"/>
</otherwise>
</choice>
</route>
<route>
<from uri="direct-vm:profile-[=systemName]-enter-point"/>
<log message="Message ${headers} send to profile output" loggingLevel="TRACE"/>
<choice>
<when>
<simple>${headers.NTX_Origin} == null</simple>
<toD uri="permission:checkSystemAccessException?objectId=${headers.X-SystemId}&amp;subjectId=[=systemName]"/>
</when>
</choice>
<to uri="bean:profileOutput?method=sendTo"/>
</route>
</camelContext>
</blueprint>

View File

@ -141,12 +141,12 @@
<from uri="direct-vm:profile-[=properties.systemName]-enter-point"/>
<removeHeader headerName="ENTAXY_Destination"/>
<log message="Message ${headers} send to profile output" loggingLevel="TRACE"/>
<choice>
<when>
<simple>${headers.NTX_Origin} == null</simple>
<toD uri="permission:checkSystemAccessException?objectId=${headers.X-SystemId}&amp;subjectId=[=systemName]"/>
</when>
</choice>
[#-- <choice>--]
[#-- <when>--]
[#-- <simple>${headers.NTX_Origin} == null</simple>--]
[#-- <toD uri="permission:checkSystemAccessException?objectId=${headers.X-SystemId}&amp;subjectId=[=systemName]"/>--]
[#-- </when>--]
[#-- </choice>--]
<to uri="direct-vm:profile-[=properties.systemName]-out-flow" />
</route>
@ -170,8 +170,17 @@
</when>
<otherwise>
<!-- try to route via legacy scheme -->
<log message="Message ${headers} is routing via legacy scheme" loggingLevel="WARN"/>
<to uri="bean:profileOutput?method=sendTo"/>
<choice>
<when>
<simple>${headers.NTX_treat_preferred_as_not_mandatory} != null &amp;&amp; ${headers.NTX_treat_preferred_as_not_mandatory} == false</simple>
<throwException exceptionType="ru.entaxy.platform.services.runtime.exceptions.ConnectorNotFound"
message="Connector not found for [=properties.systemName] by ${headers.NTX_preferred_connector}"/>
</when>
<otherwise>
<log message="Message ${headers} is routing via legacy scheme" loggingLevel="WARN"/>
<to uri="bean:profileOutput?method=sendTo"/>
</otherwise>
</choice>
</otherwise>
</choice>
</route>

View File

@ -1,48 +0,0 @@
[#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">
<reference id="entaxy-broker" interface="org.apache.camel.Component"
filter="(connection.name=entaxy-broker)"/>
<camelContext id="route-[=systemName]" xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="direct-vm:profile-[=systemName]-exit-point"/>
<log message="Message ${headers} send to route" loggingLevel="TRACE"/>
<when>
<simple>${headers.ENTAXY_Destination} == 'nsi'
&amp;&amp; ${headers.ENTAXY_DestinationType} == null
</simple>
<setHeader name="NTX_NSI_Answer">
<simple>true</simple>
</setHeader>
<to uri="entaxy-broker:queue:entaxy.nsi.entry.point?exchangePattern=InOnly"/>
</when>
<choice>
<when>
<simple>${headers.ENTAXY_DestinationType} == 'system.name'</simple>
<toD uri="system:${headers.ENTAXY_Destination}"/>
</when>
<when>
<simple>${headers.ENTAXY_DestinationType} == 'system-group.name'</simple>
<toD uri="system-group:${headers.ENTAXY_Destination}"/>
</when>
<when>
<simple>${headers.ENTAXY_DestinationType} == 'queue.name'</simple>
<toD uri="entaxy-broker:queue:${headers.ENTAXY_Destination}"/>
</when>
<when>
<simple>${headers.ENTAXY_DestinationType} == 'topic.name'</simple>
<toD uri="entaxy-broker:topic:${headers.ENTAXY_Destination}"/>
</when>
<otherwise>
<toD uri="system:${headers.ENTAXY_Destination}"/>
</otherwise>
</choice>
</route>
</camelContext>
</blueprint>

View File

@ -1,25 +1,31 @@
<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.9.0</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
<artifactId>profile-runtime</artifactId>
<packaging>bundle</packaging>
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME</name>
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME</description>
<properties>
<bundle.osgi.export.pkg>ru.entaxy.platform.profiles.runtime*</bundle.osgi.export.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
</dependencies>
<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.10.0</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
<artifactId>profile-runtime</artifactId>
<packaging>bundle</packaging>
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME</name>
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: RUNTIME</description>
<properties>
<bundle.osgi.export.pkg>ru.entaxy.platform.profiles.runtime*</bundle.osgi.export.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.service-implementation</groupId>
<artifactId>service-runtime</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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

View File

@ -2,21 +2,21 @@
* ~~~~~~licensing~~~~~~
* profile-runtime
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* Copyright (C) 2020 - 2024 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
@ -45,8 +45,8 @@ import com.google.gson.reflect.TypeToken;
import ru.entaxy.platform.base.support.CommonUtils;
import ru.entaxy.platform.base.support.JSONUtils;
import ru.entaxy.platform.profiles.runtime.OutConnector;
import ru.entaxy.platform.profiles.runtime.Profile;
import ru.entaxy.platform.profiles.runtime.SystemProfile;
import ru.entaxy.platform.services.runtime.exceptions.ConnectorNotFound;
public class ConnectorSelector implements Processor {
@ -54,6 +54,7 @@ public class ConnectorSelector implements Processor {
public static final String PROP_TARGET_CONNECTOR = "NTX_target_connector";
public static final String PROP_PREFERRED_CONNECTOR = "NTX_preferred_connector";
public static final String PROP_CONNECTOR_PREFERRED_AS_MANDATORY = "NTX_connector_preferred_as_mandatory";
public static final String PROP_SOURCE_PREFIX = "NTX_SOURCE_";
@ -128,17 +129,37 @@ public class ConnectorSelector implements Processor {
} catch (Exception e) {
log.warn("Invalid preferred connector format", e);
}
Boolean connectorPreferredAsMandatory = getConnectorPreferredAsMandatory(exchange);
if (result == null && ((connectorPreferredAsMandatory != null && connectorPreferredAsMandatory)
|| (selectorConfig.connectorPreferredAsMandatory != null && selectorConfig.connectorPreferredAsMandatory))) {
setConnectorPreferredAsNotMandatory(exchange, selectorConfig);
throw new ConnectorNotFound(getHeaderLoggingKey(exchange) + " Connector by preferred connector [" + value + "] not found");
}
}
// FIND BY SOURCE
List<String> resolvedPatterns = resolvePatternsForExchange(selectorConfig, exchange);
result = findConnectorByPatterns(selectorConfig, resolvedPatterns);
if ((result == null) && selectorConfig.useDefaultConnector)
if (result == null && selectorConfig.useDefaultConnector)
result = profile.getDefaultOutConnector();
if (result == null) {
StringBuilder errorMessage = new StringBuilder();
errorMessage.append(getHeaderLoggingKey(exchange)).append(" Connector by source")
.append(selectorConfig.useDefaultConnector ? " " : " and default connector not found ").append(" not found");
throw new ConnectorNotFound(errorMessage.toString());
}
return result;
}
private String getHeaderLoggingKey(Exchange exchange) {
Object headerLoggingKey = exchange.getIn().getHeader("NTX_loggingKey");
return headerLoggingKey == null ? "" : headerLoggingKey.toString();
}
protected List<String> resolvePatternsForExchange(SelectorConfig config, Exchange exchange) {
List<String> result = new ArrayList<>();
List<String> values = new ArrayList<>();
@ -224,11 +245,22 @@ public class ConnectorSelector implements Processor {
result.failBackToLLegacyRouter = false;
result.useDefaultConnector = false;
result.useTheOnlyConnector = false;
result.connectorPreferredAsMandatory = true;
result.allowAllStarsPattern = false;
result.treatNoPropertyAsAny = false;
return result;
}
private Boolean getConnectorPreferredAsMandatory(Exchange exchange) {
Object connectorPreferredAsMandatory = exchange.getIn().getHeader(PROP_CONNECTOR_PREFERRED_AS_MANDATORY);
return (connectorPreferredAsMandatory == null ? null : (Boolean) connectorPreferredAsMandatory);
}
private void setConnectorPreferredAsNotMandatory(Exchange exchange, SelectorConfig selectorConfig) {
if (exchange.getIn().getHeader(PROP_CONNECTOR_PREFERRED_AS_MANDATORY) != null)
exchange.getIn().getHeaders().put(PROP_CONNECTOR_PREFERRED_AS_MANDATORY, selectorConfig.connectorPreferredAsMandatory);
}
}
@ -240,6 +272,7 @@ public class ConnectorSelector implements Processor {
String OPTIONS = "options";
String OPTION_FAIL_BACK_TO_LEGACY = "fail-back-to-legacy-router";
String OPTION_USE_THE_ONLY_CONNECTOR = "use-the-only-connector";
String CONNECTOR_PREFERRED_AS_MANDATORY = "connector-preferred-as-mandatory";
String OPTION_USE_DEFAULT_CONNECTOR = "use-default-connector";
String OPTION_ALLOW_ALL_STARS_PATTERN = "allow-all-stars-pattern";
String OPTION_TREAT_NO_PROPERTY_AS_ANY = "treat-no-property-as-any";
@ -251,6 +284,7 @@ public class ConnectorSelector implements Processor {
boolean failBackToLLegacyRouter = true;
boolean useTheOnlyConnector = true;
Boolean connectorPreferredAsMandatory = null;
boolean useDefaultConnector = true;
boolean allowAllStarsPattern = true;
boolean treatNoPropertyAsAny = true;
@ -304,6 +338,12 @@ public class ConnectorSelector implements Processor {
} catch (Exception e) {
// NOOP
}
if (options.has(FIELDS.CONNECTOR_PREFERRED_AS_MANDATORY))
try {
connectorPreferredAsMandatory = options.get(FIELDS.CONNECTOR_PREFERRED_AS_MANDATORY).getAsBoolean();
} catch (Exception e) {
// NOOP
}
if (options.has(FIELDS.OPTION_ALLOW_ALL_STARS_PATTERN))
try {
allowAllStarsPattern = options.get(FIELDS.OPTION_ALLOW_ALL_STARS_PATTERN).getAsBoolean();

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
<artifactId>profile-implementation</artifactId>
<version>1.9.0</version>
<version>1.10.0</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
<artifactId>profile-storage</artifactId>

View File

@ -25,24 +25,26 @@
*/
package ru.entaxy.platform.base.objects.profile.storage;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
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.jpa.SystemService;
import ru.entaxy.esb.system.management.bundle.jpa.entity.BundleEntity;
import ru.entaxy.platform.base.objects.EntaxyObject;
import ru.entaxy.platform.base.objects.EntaxyObjectStorage;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@Component(service = EntaxyObjectStorage.class, immediate = true)
public class SystemObjectStorage implements EntaxyObjectStorage {
@ -52,25 +54,29 @@ public class SystemObjectStorage implements EntaxyObjectStorage {
protected SystemService systemService;
@SuppressWarnings("serial")
protected Map<String, String> fieldMap = new HashMap<>() {{
put("uuid", "objectId");
put("name", "systemName");
put("description", "description");
put("version", "artifact.version");
put("isDefaultRoute", "useDefaultRoute");
}};
protected Map<String, String> fieldMap = new HashMap<>() {
{
put("uuid", "objectId");
put("name", "systemName");
put("description", "description");
put("version", "artifact.version");
put("isDefaultRoute", "useDefaultRoute");
}
};
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");
}};
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.PROFILE};
return new String[] {EntaxyObject.OBJECT_TYPES.PROFILE};
}
@Override
@ -90,7 +96,8 @@ public class SystemObjectStorage implements EntaxyObjectStorage {
}
log.debug("JSON :: " + jsonObject.toString());
ru.entaxy.esb.system.jpa.entity.System system = gson.fromJson(jsonObject, ru.entaxy.esb.system.jpa.entity.System.class);
ru.entaxy.esb.system.jpa.entity.System system =
gson.fromJson(jsonObject, ru.entaxy.esb.system.jpa.entity.System.class);
system.setCreateDate(new Date());
system.setCreatedBy("admin");