release version 1.10.0
This commit is contained in:
@ -1,175 +0,0 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения 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. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -1,76 +0,0 @@
|
||||
<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>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>blueprint-generator-service</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: MANAGEMENT :: BLUEPRINT GENERATOR SERVICE</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: MANAGEMENT :: BLUEPRINT GENERATOR SERVICE</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>ru.entaxy.platform.core.blueprint.generator</bundle.osgi.export.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.karaf</groupId>
|
||||
<artifactId>org.apache.karaf.util</artifactId>
|
||||
</dependency>
|
||||
<!-- dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base</groupId>
|
||||
<artifactId>base-support</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency-->
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.service.component.annotations</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- dependency>
|
||||
<groupId>ru.entaxy.esb.system.core</groupId>
|
||||
<artifactId>template</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency-->
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.base.connecting.generator
|
||||
</groupId>
|
||||
<artifactId>generator-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.base.connecting.generator
|
||||
</groupId>
|
||||
<artifactId>generator-factory</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>${maven-bundle-plugin.version}</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Entaxy-Template-Provider>true</Entaxy-Template-Provider>
|
||||
<_dsannotations>*</_dsannotations>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -1,69 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* blueprint-generator
|
||||
* ==========
|
||||
* 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.core.blueprint.generator;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Blueprint {
|
||||
|
||||
private String name;
|
||||
private byte[] body;
|
||||
|
||||
private Map<String, Object> properties = new HashMap<>();
|
||||
|
||||
public Blueprint(String name, byte[] body) {
|
||||
this.name = name;
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public byte[] getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(byte[] body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public Map<String, Object> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Blueprint{" +
|
||||
"name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* blueprint-generator
|
||||
* ==========
|
||||
* 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.core.blueprint.generator;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
|
||||
public interface BlueprintGenerator {
|
||||
|
||||
Blueprint createBlueprint(URL templateUrl, String templateName, String systemName, Map<String, String> params)
|
||||
throws Exception;
|
||||
|
||||
Blueprint createBlueprint(String templateName, String systemName, Map<String, String> params)
|
||||
throws Exception;
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* blueprint-generator
|
||||
* ==========
|
||||
* 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.core.blueprint.generator;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.base.generator.template.Template;
|
||||
import ru.entaxy.base.generator.template.TemplateAwareGenerator;
|
||||
import ru.entaxy.base.generator.template.TemplateImpl;
|
||||
import ru.entaxy.base.generator.template.TemplateService;
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated;
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generator;
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.generator.factory.GeneratorFactory;
|
||||
|
||||
@Component(service = {BlueprintGenerator.class}, immediate = true)
|
||||
public class BlueprintGeneratorImpl implements BlueprintGenerator {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BlueprintGeneratorImpl.class);
|
||||
private static final String SYSTEM_NAME = "systemName";
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY)
|
||||
protected TemplateService templateService;
|
||||
|
||||
@Override
|
||||
public Blueprint createBlueprint(URL templateUrl, String templateName, String systemName, Map<String, String> params)
|
||||
throws Exception {
|
||||
TemplateImpl template = new TemplateImpl();
|
||||
template.setTemplateName(templateName);
|
||||
template.setTemplateLocation(templateUrl.toString());
|
||||
template.setType("ftl");
|
||||
return createBlueprintWithTemplate(template, systemName, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Blueprint createBlueprint(String templateName, String systemName, Map<String, String> params) throws Exception {
|
||||
Template template = templateService.getTemplateById(templateName);
|
||||
if (template == null) {
|
||||
LOG.error("Template not found: [{}]", templateName);
|
||||
// TODO throw exception
|
||||
return null;
|
||||
}
|
||||
return createBlueprintWithTemplate(template, systemName, params);
|
||||
}
|
||||
|
||||
protected Blueprint createBlueprintWithTemplate(ru.entaxy.base.generator.template.Template template,
|
||||
String systemName, Map<String, String> params) throws Exception {
|
||||
TemplateAwareGenerator generator = GeneratorFactory.createGenerator(template);
|
||||
if (generator == null) {
|
||||
LOG.error("Generator not found for template: [{}]", template.getId());
|
||||
// TODO throw exception
|
||||
return null;
|
||||
}
|
||||
addSystemParam(params, systemName);
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.putAll(params);
|
||||
Generated result = generator.generate(template,parameters);
|
||||
if ((result == null) || (result.getObject() == null)) {
|
||||
LOG.error("Generator returned null for template: [{}]", template.getId());
|
||||
// TODO throw exception
|
||||
return null;
|
||||
}
|
||||
if (!Generated.GENERATED_TYPE_BLUEPRINT.equals(result.getType())) {
|
||||
LOG.error("Generator returned type [{}], while [{}] is expected for template: [{}]"
|
||||
, result.getType()
|
||||
, Generated.GENERATED_TYPE_BLUEPRINT
|
||||
, template.getId());
|
||||
// TODO throw exception
|
||||
return null;
|
||||
}
|
||||
Blueprint blueprint = new Blueprint(template.getTemplateName(), result.getObject().toString().getBytes());
|
||||
blueprint.getProperties().putAll(result.getProperties());
|
||||
blueprint.getProperties().put("template.name", template.getTemplateName());
|
||||
blueprint.getProperties().put("template.id", template.getId());
|
||||
blueprint.getProperties().put("template.type", template.getType());
|
||||
return blueprint;
|
||||
}
|
||||
|
||||
private void addSystemParam(Map<String, String> params, String systemName) {
|
||||
params.put(SYSTEM_NAME, systemName);
|
||||
}
|
||||
|
||||
}
|
@ -1,39 +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">
|
||||
|
||||
<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"/>
|
||||
</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]-enter-point"/>
|
||||
<log message="Message ${headers} send to bridge" loggingLevel="TRACE"/>
|
||||
<toD uri="permission:checkSystemAccessException?objectId=${headers.X-SystemId}&subjectId=[=systemName]"/>
|
||||
<setHeader name="NTX_DestinationPointAfterBridge">
|
||||
<simple>system:[=systemName]</simple>
|
||||
</setHeader>
|
||||
<to uri="jms:queue:entaxy.local.out.[=origin]"/>
|
||||
</route>
|
||||
</camelContext>
|
||||
</blueprint>
|
@ -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'
|
||||
&& ${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>
|
@ -1,23 +0,0 @@
|
||||
{
|
||||
"templates":[
|
||||
{
|
||||
"id":"bridge-profile",
|
||||
/* by default:
|
||||
"name":"{id}",
|
||||
"type":"ftl",
|
||||
"path":"DEFAULT_PATH"
|
||||
"filename":"{id}"
|
||||
"fullname":"{id}.{type}",
|
||||
*/
|
||||
"description":"Ftl template for bridge profile"
|
||||
},
|
||||
{
|
||||
"id":"default-route",
|
||||
"description":"Ftl template for default route from profile"
|
||||
},
|
||||
{
|
||||
"id":"profile",
|
||||
"description":"Ftl template for system profile"
|
||||
}
|
||||
]
|
||||
}
|
@ -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}&subjectId=[=systemName]"/>
|
||||
</when>
|
||||
</choice>
|
||||
<to uri="bean:profileOutput?method=sendTo"/>
|
||||
</route>
|
||||
</camelContext>
|
||||
</blueprint>
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>cluster-node-management</artifactId>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* cluster-node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* cluster-node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* cluster-node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* cluster-node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* cluster-node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* cluster-node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* cluster-node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* cluster-node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
@ -17,15 +17,23 @@
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.esb.platform.core.management.connection
|
||||
ru.entaxy.platform.core.management.connection
|
||||
</bundle.osgi.export.pkg>
|
||||
<bundle.osgi.private.pkg>
|
||||
ru.entaxy.esb.platform.core.management.connection.impl,
|
||||
ru.entaxy.esb.platform.core.management.connection.tracker
|
||||
ru.entaxy.platform.core.management.connection.impl,
|
||||
ru.entaxy.platform.core.management.connection.support.legacy,
|
||||
ru.entaxy.esb.platform.core.management.connection.to_remove,
|
||||
ru.entaxy.esb.platform.core.management.connection.to_remove.impl,
|
||||
ru.entaxy.esb.platform.core.management.connection.to_remove.tracker
|
||||
</bundle.osgi.private.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>object-management</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.service.component.annotations</artifactId>
|
||||
|
@ -1,76 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.api.RuntimeTypedMBean;
|
||||
|
||||
public interface ConnectionMBean extends RuntimeTypedMBean {
|
||||
|
||||
public static final String CONNECTION_KEY = "connection";
|
||||
|
||||
/*
|
||||
* connection name
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/*
|
||||
* if connection is platform one or user defined
|
||||
*/
|
||||
public boolean isPlatform();
|
||||
|
||||
/*
|
||||
* status of the bundle if connection is deplyed
|
||||
*/
|
||||
public String getStatus();
|
||||
|
||||
/*
|
||||
* if the connection local or shared (cluster)
|
||||
*/
|
||||
public boolean isLocal();
|
||||
|
||||
/*
|
||||
* if the connection is shared (single malt)
|
||||
* or prototype-like (blended)
|
||||
*/
|
||||
public boolean isShared();
|
||||
|
||||
/*
|
||||
* if the connection is deployed or only defined
|
||||
*/
|
||||
public boolean isDeployed();
|
||||
|
||||
/*
|
||||
* bundle id for single malt connection
|
||||
* null for blended
|
||||
*/
|
||||
public String getBundleId();
|
||||
|
||||
/*
|
||||
* connection label
|
||||
*/
|
||||
public String getLabel();
|
||||
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Operation;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Parameter;
|
||||
|
||||
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
|
||||
public interface ConnectionsMBean {
|
||||
|
||||
public static final String CAPABILITY_NAMESPACE = "entaxy.runtime.connection";
|
||||
|
||||
public static final String CONNECTIONS_KEY = "category";
|
||||
|
||||
public static final String CONNECTIONS_KEY_VALUE = "connections";
|
||||
|
||||
@Operation(desc = "Gets connection's configuration")
|
||||
public String getConnectionConfig(
|
||||
@Parameter(name = "connectionName", desc = "Connection name") String connectionName) throws Exception;
|
||||
|
||||
}
|
@ -1,105 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection.impl;
|
||||
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
import javax.management.StandardMBean;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
|
||||
import ru.entaxy.esb.platform.core.management.connection.ConnectionMBean;
|
||||
|
||||
//@TODO move string to constant
|
||||
@EntaxyRuntimeTyped(name = "entaxy.runtime.connection")
|
||||
public class ConnectionMBeanImpl extends StandardMBean implements ConnectionMBean {
|
||||
|
||||
protected ManagedConnection connection;
|
||||
|
||||
protected BundleContext bundleContext;
|
||||
|
||||
public ConnectionMBeanImpl(BundleContext bundleContext, ManagedConnection connection) throws NotCompliantMBeanException {
|
||||
super(ConnectionMBean.class);
|
||||
this.bundleContext = bundleContext;
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return connection.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlatform() {
|
||||
return connection.isPlatform();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatus() {
|
||||
int state = this.bundleContext.getBundle(connection.getBundleId()).getState();
|
||||
switch (state) {
|
||||
case Bundle.ACTIVE:
|
||||
return "Active";
|
||||
case Bundle.INSTALLED:
|
||||
return "Installed";
|
||||
case Bundle.RESOLVED:
|
||||
return "Resolved";
|
||||
case Bundle.STARTING:
|
||||
return "Starting";
|
||||
case Bundle.STOPPING:
|
||||
return "Stopping";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocal() {
|
||||
return connection.isLocal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShared() {
|
||||
return connection.isShared();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeployed() {
|
||||
return connection.isDeployed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBundleId() {
|
||||
return connection.getBundleId() + "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return connection.getLabel();
|
||||
}
|
||||
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.management.DynamicMBean;
|
||||
import javax.management.MBeanRegistration;
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceRegistration;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.ManagementCore;
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.AnnotatedMBean;
|
||||
import ru.entaxy.esb.platform.core.management.connection.ConnectionMBean;
|
||||
import ru.entaxy.esb.platform.core.management.connection.ConnectionsMBean;
|
||||
import ru.entaxy.esb.platform.core.management.connection.tracker.DeployedConnectionTracker;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObjectService;
|
||||
|
||||
@Component(
|
||||
service = {ConnectionsMBean.class, DynamicMBean.class, MBeanRegistration.class},
|
||||
property = {ManagementCore.JMX_OBJECTNAME
|
||||
+ "=" + ManagementCore.Q_RUNTIME_S
|
||||
+ "," + ConnectionsMBean.CONNECTIONS_KEY
|
||||
+ "=" + ConnectionsMBean.CONNECTIONS_KEY_VALUE},
|
||||
scope = ServiceScope.SINGLETON,
|
||||
immediate = true
|
||||
)
|
||||
public class ConnectionsMBeanImpl extends AnnotatedMBean<ConnectionsMBean>
|
||||
implements ConnectionsMBean, ManagedConnectionsListener {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ConnectionsMBeanImpl.class);
|
||||
|
||||
public static final Qualifier Q_CONNECTIONS = ManagementCore.Q_RUNTIME
|
||||
.qualifier(ConnectionsMBean.CONNECTIONS_KEY, ConnectionsMBean.CONNECTIONS_KEY_VALUE);
|
||||
|
||||
protected BundleContext bundleContext;
|
||||
|
||||
protected DeployedConnectionTracker tracker;
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY)
|
||||
EntaxyObjectService entaxyObjectService;
|
||||
|
||||
protected static class ManagedConnectionDescriptor {
|
||||
|
||||
ManagedConnection connection;
|
||||
ServiceRegistration<ConnectionMBean> registration;
|
||||
|
||||
}
|
||||
|
||||
protected Map<String, ManagedConnectionDescriptor> managed = new HashMap<>();
|
||||
|
||||
public ConnectionsMBeanImpl() throws NotCompliantMBeanException {
|
||||
super(ConnectionsMBean.class);
|
||||
}
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
this.bundleContext = componentContext.getBundleContext();
|
||||
tracker = new DeployedConnectionTracker(bundleContext, this);
|
||||
tracker.open();
|
||||
}
|
||||
|
||||
@Deactivate
|
||||
public void deactivate() {
|
||||
tracker.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void added(ManagedConnections connections) {
|
||||
Hashtable props = new Hashtable<>();
|
||||
// String jmxObjectName = "jmx.objectname";
|
||||
// String objectName = "ru.entaxy.esb:group=platform,category=connections,connection=";
|
||||
for (ManagedConnection connection: connections.managedConnections) {
|
||||
if (managed.containsKey(connection.getName()))
|
||||
this.managed.get(connection.getName()).registration.unregister();
|
||||
try {
|
||||
ConnectionMBeanImpl service = new ConnectionMBeanImpl(bundleContext, connection);
|
||||
ManagedConnectionDescriptor descriptor = new ManagedConnectionDescriptor();
|
||||
descriptor.connection = connection;
|
||||
props.put(ManagementCore.JMX_OBJECTNAME
|
||||
, Q_CONNECTIONS.qualifier(ConnectionMBean.CONNECTION_KEY
|
||||
, connection.getName()).getValue());
|
||||
descriptor.registration = bundleContext.registerService(ConnectionMBean.class
|
||||
, service
|
||||
, props);
|
||||
managed.put(connection.getName(), descriptor);
|
||||
} catch (Exception e) {
|
||||
log.error("Error adding connection [" + connection.getName() + "]", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed(ManagedConnections connections) {
|
||||
for (ManagedConnection connection: connections.managedConnections) {
|
||||
if (managed.containsKey(connection.getName())) {
|
||||
this.managed.get(connection.getName()).registration.unregister();
|
||||
this.managed.remove(connection.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConnectionConfig(String connectionName) throws Exception {
|
||||
return entaxyObjectService.findObject(connectionName, "entaxy.runtime.connection").getConfiguration();
|
||||
}
|
||||
}
|
@ -1,116 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection.impl;
|
||||
|
||||
public class ManagedConnection {
|
||||
|
||||
protected String name;
|
||||
protected boolean isPlatform;
|
||||
protected boolean isLocal;
|
||||
protected boolean isShared;
|
||||
protected long bundleId;
|
||||
protected boolean isDeployed;
|
||||
protected String label;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public boolean isPlatform() {
|
||||
return isPlatform;
|
||||
}
|
||||
public boolean isLocal() {
|
||||
return isLocal;
|
||||
}
|
||||
public boolean isShared() {
|
||||
return isShared;
|
||||
}
|
||||
public long getBundleId() {
|
||||
return bundleId;
|
||||
}
|
||||
public boolean isDeployed() {
|
||||
return isDeployed;
|
||||
}
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public void setPlatform(boolean isPlatform) {
|
||||
this.isPlatform = isPlatform;
|
||||
}
|
||||
public void setLocal(boolean isLocal) {
|
||||
this.isLocal = isLocal;
|
||||
}
|
||||
public void setShared(boolean isShared) {
|
||||
this.isShared = isShared;
|
||||
}
|
||||
public void setBundleId(long bundleId) {
|
||||
this.bundleId = bundleId;
|
||||
}
|
||||
public void setDeployed(boolean isDeployed) {
|
||||
this.isDeployed = isDeployed;
|
||||
}
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public ManagedConnection name(String name) {
|
||||
setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ManagedConnection platform(boolean isPlatform) {
|
||||
setPlatform(isPlatform);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ManagedConnection local(boolean isLocal) {
|
||||
setLocal(isLocal);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ManagedConnection shared(boolean isShared) {
|
||||
setShared(isShared);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ManagedConnection bundleId(long bundleId) {
|
||||
setBundleId(bundleId);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ManagedConnection deployed(boolean deployed) {
|
||||
setDeployed(deployed);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ManagedConnection label(String label) {
|
||||
setLabel(label);
|
||||
return this;
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ManagedConnections {
|
||||
|
||||
public List<ManagedConnection> managedConnections = new ArrayList<>();
|
||||
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection.impl;
|
||||
|
||||
public interface ManagedConnectionsListener {
|
||||
|
||||
public void added(ManagedConnections connections);
|
||||
public void removed(ManagedConnections connections);
|
||||
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection.tracker;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleEvent;
|
||||
import org.osgi.framework.wiring.BundleCapability;
|
||||
import org.osgi.framework.wiring.BundleRevision;
|
||||
import org.osgi.util.tracker.BundleTrackerCustomizer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.connection.ConnectionsMBean;
|
||||
import ru.entaxy.esb.platform.core.management.connection.impl.ManagedConnection;
|
||||
import ru.entaxy.esb.platform.core.management.connection.impl.ManagedConnections;
|
||||
import ru.entaxy.esb.platform.core.management.connection.impl.ManagedConnectionsListener;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
|
||||
public class DeployedConnectionCustomizer implements BundleTrackerCustomizer<ManagedConnections> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(DeployedConnectionCustomizer.class);
|
||||
|
||||
protected ManagedConnectionsListener listener;
|
||||
|
||||
public DeployedConnectionCustomizer(ManagedConnectionsListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManagedConnections addingBundle(Bundle bundle, BundleEvent event) {
|
||||
log.debug("INSPECTING: " + bundle.getBundleId());
|
||||
BundleRevision revision = bundle.adapt(BundleRevision.class);
|
||||
if (revision == null)
|
||||
return null;
|
||||
log.debug("REVISION FOUND: " + bundle.getBundleId());
|
||||
List<BundleCapability> capabilities = revision.getDeclaredCapabilities(ConnectionsMBean.CAPABILITY_NAMESPACE);
|
||||
if ((capabilities==null) || (capabilities.size()==0))
|
||||
return null;
|
||||
log.debug("CAPABILITIES FOUND: " + bundle.getBundleId());
|
||||
ManagedConnections result = new ManagedConnections();
|
||||
for (BundleCapability capability: capabilities) {
|
||||
Object val = capability.getAttributes().get("name");
|
||||
String name = val==null?"":val.toString();
|
||||
log.debug("CAPABILITIES/NAME [" + name + "] : " + bundle.getBundleId());
|
||||
if (!CommonUtils.isValid(name))
|
||||
continue;
|
||||
val = capability.getAttributes().get("platform");
|
||||
boolean isPlatform = val==null?false:"true".equals(val.toString());
|
||||
val = capability.getAttributes().get("label");
|
||||
String label = val == null ? "" : val.toString();
|
||||
ManagedConnection mc = (new ManagedConnection())
|
||||
.name(name)
|
||||
.platform(isPlatform)
|
||||
.deployed(true)
|
||||
.local(isPlatform)
|
||||
.shared(true)
|
||||
.bundleId(bundle.getBundleId())
|
||||
.label(label);
|
||||
result.managedConnections.add(mc);
|
||||
}
|
||||
listener.added(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifiedBundle(Bundle bundle, BundleEvent event, ManagedConnections object) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removedBundle(Bundle bundle, BundleEvent event, ManagedConnections object) {
|
||||
log.debug("BUNDLE [{}] REMOVING", bundle.getBundleId());
|
||||
listener.removed(object);
|
||||
}
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.connection.tracker;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.util.tracker.BundleTracker;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.connection.impl.ManagedConnections;
|
||||
import ru.entaxy.esb.platform.core.management.connection.impl.ManagedConnectionsListener;
|
||||
|
||||
public class DeployedConnectionTracker extends BundleTracker<ManagedConnections> {
|
||||
|
||||
public DeployedConnectionTracker(BundleContext bundleContext, ManagedConnectionsListener listener) {
|
||||
super(bundleContext
|
||||
, Bundle.ACTIVE | Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.STOPPING
|
||||
, new DeployedConnectionCustomizer(listener));
|
||||
}
|
||||
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения 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. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -1,53 +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>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>connection-manager</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
|
||||
<name>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: MANAGEMENT :: CONNECTION MANAGER</name>
|
||||
<description>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: MANAGEMENT :: CONNECTION MANAGER</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.esb.platform.runtime.core.management.connection.api,
|
||||
ru.entaxy.esb.platform.runtime.core.management.connection.util
|
||||
</bundle.osgi.export.pkg>
|
||||
<!-- bundle.osgi.private.pkg>
|
||||
ru.entaxy.esb.platform.runtime.core.management.connection.impl
|
||||
</bundle.osgi.private.pkg -->
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base.connecting.producer</groupId>
|
||||
<artifactId>connection-producer</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>artifact-management</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base</groupId>
|
||||
<artifactId>base-support</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.base.connecting
|
||||
</groupId>
|
||||
<artifactId>connection</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -1,40 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-manager
|
||||
* ==========
|
||||
* 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.esb.platform.runtime.core.management.connection.api;
|
||||
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.connection.Connection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Deprecated
|
||||
public interface ConnectionManager {
|
||||
/*
|
||||
@Deprecated
|
||||
public List<Connection> createAndInstallConnections(String json) throws Exception;
|
||||
*/
|
||||
public List<Connection> installUpdateConnections(String json, String newTimestamp) throws Exception;
|
||||
public List<Connection> checkInstallConnections(String json, String timestamp) throws Exception;
|
||||
}
|
@ -1,349 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-manager
|
||||
* ==========
|
||||
* 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.esb.platform.runtime.core.management.connection.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.framework.Constants;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.connection.Connection;
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.connection.util.ConnectionUtil;
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated;
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.producer.connection.util.ConnectionProducerUtil;
|
||||
import ru.entaxy.esb.platform.runtime.core.management.connection.api.ConnectionManager;
|
||||
import ru.entaxy.platform.core.artifact.Artifact;
|
||||
import ru.entaxy.platform.core.artifact.ArtifactManifest;
|
||||
import ru.entaxy.platform.core.artifact.Artifacts;
|
||||
import ru.entaxy.platform.core.artifact.DeployedArtifact;
|
||||
import ru.entaxy.platform.core.artifact.Manifested;
|
||||
import ru.entaxy.platform.core.artifact.capabilities.ManifestCapabilityHelper;
|
||||
import ru.entaxy.platform.core.artifact.installer.builder.Installer;
|
||||
import ru.entaxy.platform.core.artifact.installer.builder.typed.BlueprintInstaller;
|
||||
import ru.entaxy.platform.core.artifact.service.ArtifactService;
|
||||
|
||||
public class ConnectionManagerImpl implements ConnectionManager {
|
||||
|
||||
private static final String CONNECTION = "connection";
|
||||
/*
|
||||
private static final String GROUP_ID = "ru.entaxy.esb.";
|
||||
private static final String XML_EXTENSION = "xml";
|
||||
private static final String LOCAL_FILE_REPOSITORY = "data" + File.separator + "local-repository";
|
||||
*/
|
||||
protected ArtifactService artifactService;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ConnectionManagerImpl.class);
|
||||
|
||||
@Override
|
||||
public List<Connection> checkInstallConnections(String json, String timestamp) throws Exception {
|
||||
List<Connection> connections = parseConnections(json);
|
||||
for (Connection connection: connections) {
|
||||
|
||||
Artifact artifact = createArtifactForConnection(connection);
|
||||
artifact.getCoordinates().timestamped(timestamp);
|
||||
|
||||
DeployedArtifact deployed;
|
||||
if (connection.isPlatform()) {
|
||||
deployed = artifactService.deployLocal(artifact);
|
||||
} else {
|
||||
deployed = artifactService.deployShared(artifact);
|
||||
}
|
||||
log.info("Artifact [{}] deployed to location [{}]", artifact.getCoordinates(), deployed.getLocation());
|
||||
|
||||
Installer<?> installer = connection.isPlatform()
|
||||
?artifactService.installers().local()
|
||||
:artifactService.installers().cluster();
|
||||
|
||||
// TODO add support for other types
|
||||
// assume artifact is blueprint
|
||||
installer
|
||||
.artifact(deployed)
|
||||
.typed(BlueprintInstaller.class)
|
||||
.installOnlyIfMissing()
|
||||
.start()
|
||||
.install();
|
||||
|
||||
}
|
||||
return connections;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Connection> installUpdateConnections(String json, String newTimestamp) throws Exception {
|
||||
List<Connection> connections = parseConnections(json);
|
||||
for (Connection connection: connections) {
|
||||
|
||||
Artifact artifact = createArtifactForConnection(connection);
|
||||
artifact.getCoordinates().timestamped(newTimestamp);
|
||||
|
||||
DeployedArtifact deployed;
|
||||
if (connection.isPlatform()) {
|
||||
deployed = artifactService.deployLocal(artifact);
|
||||
} else {
|
||||
deployed = artifactService.deployShared(artifact);
|
||||
}
|
||||
log.info("Artifact [{}] deployed to location [{}]", artifact.getCoordinates(), deployed.getLocation());
|
||||
|
||||
Installer<?> installer = connection.isPlatform()
|
||||
?artifactService.installers().local()
|
||||
:artifactService.installers().cluster();
|
||||
|
||||
// TODO add support for other types
|
||||
// assume artifact is blueprint
|
||||
installer
|
||||
.artifact(deployed)
|
||||
.typed(BlueprintInstaller.class)
|
||||
.update(deployed
|
||||
.getArtifact().getProperties()
|
||||
.getOrDefault(Constants.BUNDLE_SYMBOLICNAME, "")
|
||||
.toString())
|
||||
.start()
|
||||
.install();
|
||||
|
||||
}
|
||||
return connections;
|
||||
}
|
||||
|
||||
protected List<Connection> parseConnections(String json){
|
||||
List<Connection> connectionList = new ArrayList<>();
|
||||
JsonElement jsonElement = getJsonElement(json);
|
||||
List<JsonObject> jsonConnectionList = getJsonConnectionList(jsonElement);
|
||||
for (JsonObject jsonConnection : jsonConnectionList) {
|
||||
connectionList.add(ConnectionProducerUtil.createConnection(jsonConnection));
|
||||
}
|
||||
return connectionList;
|
||||
}
|
||||
|
||||
protected List<Artifact> createArtifactsForConnections(List<Connection> connections) throws Exception{
|
||||
List<Artifact> artifacts = new ArrayList<>();
|
||||
for (Connection connection: connections)
|
||||
artifacts.add(createArtifactForConnection(connection));
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
protected Artifact createArtifactForConnection(Connection connection) throws Exception{
|
||||
Generated result = ConnectionUtil.getInit(connection);
|
||||
String type = CONNECTION;
|
||||
String name = connection.getName();
|
||||
String version = "1.0.0";
|
||||
|
||||
// TODO add support for other artifact types
|
||||
if (Generated.GENERATED_TYPE_BLUEPRINT.equals(result.getType())) {
|
||||
|
||||
Artifact artifact = Artifacts.fromGenerated(result);
|
||||
artifact.getCoordinates()
|
||||
.timestampedVersion(version)
|
||||
.groupId(Artifact.DEFAULT_RUNTIME_GROUP_ID + "." + type)
|
||||
.artifactId(type + "-" + name);
|
||||
|
||||
if (artifact.isManifested()) {
|
||||
ArtifactManifest manifest = ((Manifested)artifact).getManifest();
|
||||
ManifestCapabilityHelper capabilityHelper = new ManifestCapabilityHelper(manifest);
|
||||
capabilityHelper.provideCapability(artifact.getCoordinates().getGroupId())
|
||||
.attribute("name",connection.getName())
|
||||
.attribute("platform", connection.isPlatform()?"true":"false");
|
||||
capabilityHelper.save();
|
||||
}
|
||||
|
||||
log.info("Artifact of category [{}] is prepared: [{}]", artifact.getCategory(), artifact.getCoordinates());
|
||||
return artifact;
|
||||
} else {
|
||||
log.error("Generated result for connection [{}] is of type '{}' while expected '{}'"
|
||||
, connection.getName()
|
||||
, result.getType()
|
||||
, Generated.GENERATED_TYPE_BLUEPRINT);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public List<Connection> createAndInstallConnections(String json) throws Exception {
|
||||
return createConnections(json, false, true);
|
||||
}
|
||||
|
||||
private List<Connection> createConnections(String json) throws Exception {
|
||||
return createConnections(json, false, false);
|
||||
}
|
||||
|
||||
private List<Connection> createConnections(String json, boolean register, boolean install) throws Exception {
|
||||
List<Connection> connectionList = new ArrayList<>();
|
||||
JsonElement jsonElement = getJsonElement(json);
|
||||
List<JsonObject> jsonConnectionList = getJsonConnectionList(jsonElement);
|
||||
for (JsonObject jsonConnection : jsonConnectionList) {
|
||||
connectionList.add(createConnection(jsonConnection, register, install));
|
||||
}
|
||||
return connectionList;
|
||||
}
|
||||
*/
|
||||
private JsonElement getJsonElement(String json) {
|
||||
return new Gson().fromJson(json, JsonElement.class);
|
||||
}
|
||||
|
||||
private List<JsonObject> getJsonConnectionList(JsonElement element) {
|
||||
List<JsonObject> jsonConnectionList = new ArrayList<>();
|
||||
|
||||
if (element.isJsonObject()) {
|
||||
JsonObject object = element.getAsJsonObject();
|
||||
if (object.has("nodeType") &&
|
||||
"connection".equals(object.get("nodeType").getAsString())) {
|
||||
jsonConnectionList.add(object);
|
||||
} else {
|
||||
for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
|
||||
jsonConnectionList.addAll(getJsonConnectionList(entry.getValue()));
|
||||
}
|
||||
}
|
||||
} else if (element.isJsonArray()) {
|
||||
for (JsonElement jsonElement : element.getAsJsonArray()) {
|
||||
jsonConnectionList.addAll(getJsonConnectionList(jsonElement));
|
||||
}
|
||||
}
|
||||
|
||||
return jsonConnectionList;
|
||||
}
|
||||
/*
|
||||
private Connection createConnection(JsonObject jsonConnection, boolean register, boolean install) {
|
||||
Connection connection = ConnectionProducerUtil.createConnection(jsonConnection);
|
||||
if (register) {
|
||||
// TODO: 09.07.2021 registration method
|
||||
}
|
||||
if (install) {
|
||||
try {
|
||||
installConnection(connection);
|
||||
} catch (Exception e) {
|
||||
log.error("Can't install connection: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
return connection;
|
||||
}
|
||||
|
||||
public Bundle installConnection(Connection connection) throws Exception {
|
||||
String name = connection.getName();
|
||||
String type = CONNECTION;
|
||||
String version = String.valueOf(1.0);
|
||||
Generated result = ConnectionUtil.getInit(connection);
|
||||
|
||||
// TODO: pass the Generated to artifact management
|
||||
|
||||
if (Generated.GENERATED_TYPE_BLUEPRINT.equals(result.getType())) {
|
||||
|
||||
Artifact artifact = Artifacts.fromGenerated(result);
|
||||
artifact.getCoordinates()
|
||||
.timestampedVersion(version)
|
||||
.groupId(Artifact.DEFAULT_RUNTIME_GROUP_ID + "." + type)
|
||||
.artifactId(type + "-" + name);
|
||||
log.info("Artifact of category [{}] is prepared: [{}]", artifact.getCategory(), artifact.getCoordinates());
|
||||
|
||||
DeployedArtifact deployedArtifact = artifactService.deployLocal(artifact);
|
||||
log.info("Artifact [{}] deployed to location [{}]", artifact.getCoordinates(), deployedArtifact.getLocation());
|
||||
|
||||
InstallationResult installationResult = this.artifactService
|
||||
.installers()
|
||||
.cluster()
|
||||
.artifact(deployedArtifact)
|
||||
.typed(BlueprintInstaller.class)
|
||||
.start()
|
||||
.update(deployedArtifact.getArtifact().getProperties().getOrDefault(Constants.BUNDLE_SYMBOLICNAME, "").toString())
|
||||
.install();
|
||||
*/
|
||||
/*
|
||||
log.debug(new String(result.getObject().toString().getBytes(), Charset.defaultCharset()));
|
||||
log.info("Blueprint is generated for connection [{}]", connection.getName());
|
||||
|
||||
// Local bundle install needed instead of cellar install to cluster
|
||||
String bundleUrl = deployBlueprint(GROUP_ID + type, type + "-" + name,
|
||||
version, XML_EXTENSION, result.getObject().toString().getBytes());
|
||||
Bundle bundle = installAndStartBundle(bundleUrl);
|
||||
*/
|
||||
/* if (installationResult.isSuccessful()) {
|
||||
if (installationResult.getObject() != null)
|
||||
if (installationResult.getObject() instanceof Bundle) {
|
||||
Bundle bundle = (Bundle)installationResult.getObject();
|
||||
log.info("Bundle [{}] successfully {}'d from artifact [{}]"
|
||||
, bundle.getBundleId()
|
||||
, installationResult.getResult().name()
|
||||
, deployedArtifact.getArtifact().getCoordinates());
|
||||
return bundle;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
// TODO: 09.07.2021 callback for webeditor needed
|
||||
} else {
|
||||
log.error("Generated result for connection [{}] is of type '{}' while expected '{}'"
|
||||
, connection.getName()
|
||||
, result.getType()
|
||||
, Generated.GENERATED_TYPE_BLUEPRINT);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// ru.entaxy.esb.system.deployer.file.FileSystemRepositoryImpl.deployBlueprint method copy
|
||||
@Deprecated
|
||||
public String deployBlueprint(String groupId, String name, String version,
|
||||
String extension, byte[] data) throws Exception {
|
||||
Path path = preparePath(groupId, name, version, extension);
|
||||
if (!Files.exists(path.getParent())) {
|
||||
Files.createDirectories(path.getParent());
|
||||
}
|
||||
Files.write(path, data);
|
||||
return "blueprint:file:" + path.normalize();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private Path preparePath(String groupId, String name, String version, String extension) {
|
||||
String gpoupIdPath = groupId.replaceAll("\\.", Matcher.quoteReplacement(File.separator));
|
||||
String fileName = name + "-" + version + "." + extension;
|
||||
Path path = Paths.get(LOCAL_FILE_REPOSITORY, gpoupIdPath, fileName);
|
||||
return path;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private Bundle installAndStartBundle(String bundleUrl) {
|
||||
BundleContext bundleContext = FrameworkUtil.getBundle(ConnectionManagerImpl.class).getBundleContext();
|
||||
Bundle bundle = null;
|
||||
try {
|
||||
bundle = bundleContext.installBundle(bundleUrl, null);
|
||||
try {
|
||||
bundle.start();
|
||||
} catch (BundleException e) {
|
||||
log.error("Unable to start bundle " + bundle.getLocation() + ": " + e, e);
|
||||
}
|
||||
} catch (BundleException e) {
|
||||
log.error("Unable to install bundle " + bundle.getLocation() + ": " + e, e);
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
*/
|
||||
public void setArtifactService(ArtifactService artifactService) {
|
||||
this.artifactService = artifactService;
|
||||
}
|
||||
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-manager
|
||||
* ==========
|
||||
* 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.esb.platform.runtime.core.management.connection.util;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.util.tracker.ServiceTracker;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ru.entaxy.esb.platform.runtime.core.management.connection.api.ConnectionManager;
|
||||
import ru.entaxy.platform.base.support.osgi.OSGIUtils;
|
||||
|
||||
public class ConnectionManagerUtil {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ConnectionManagerUtil.class);
|
||||
|
||||
private static ServiceTracker tracker = null;
|
||||
|
||||
public static ConnectionManager getService() {
|
||||
|
||||
// get our own bundleContext
|
||||
BundleContext bundleContext = FrameworkUtil.getBundle(ConnectionManagerUtil.class).getBundleContext();
|
||||
|
||||
try {
|
||||
return OSGIUtils.services().bundleContext(bundleContext)
|
||||
.waitService(2000)
|
||||
.ofClass(ConnectionManager.class)
|
||||
.<ConnectionManager>get();
|
||||
} catch (Exception e1) {
|
||||
// TODO Auto-generated catch block
|
||||
LOG.warn(e1.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
// found an issue: service is not returned 'cause the initializers start earlier than
|
||||
// Karaf publishes service
|
||||
// So we should use tracker here to be sure the service is active
|
||||
/*
|
||||
if (tracker == null) {
|
||||
tracker = new ServiceTracker(bundleContext, ConnectionManager.class, null);
|
||||
tracker.open();
|
||||
}
|
||||
try {
|
||||
tracker.waitForService(2000);
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
*/
|
||||
/*
|
||||
ServiceReference<ConnectionManager> connectionManagerServiceReference =
|
||||
tracker.getServiceReference();
|
||||
// bundleContext.getServiceReference(ConnectionManager.class);
|
||||
return bundleContext.getService(connectionManagerServiceReference);
|
||||
*/
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~~~~~~licensing~~~~~~
|
||||
connection-manager
|
||||
==========
|
||||
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~~~~~~
|
||||
-->
|
||||
|
||||
<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="artifactService" interface="ru.entaxy.platform.core.artifact.service.ArtifactService" availability="mandatory"></reference>
|
||||
|
||||
<bean id="connectionManager" class="ru.entaxy.esb.platform.runtime.core.management.connection.impl.ConnectionManagerImpl">
|
||||
<property name="artifactService" ref="artifactService"></property>
|
||||
</bean>
|
||||
|
||||
<service ref="connectionManager" interface="ru.entaxy.esb.platform.runtime.core.management.connection.api.ConnectionManager"/>
|
||||
|
||||
</blueprint>
|
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connector-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connector-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>node-management</artifactId>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* node-management
|
||||
* ==========
|
||||
* 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
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
@ -14,16 +14,53 @@
|
||||
<name>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: MANAGEMENT</name>
|
||||
<description>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: MANAGEMENT</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.service.component.annotations</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>org.apache.felix.scr</artifactId>
|
||||
<version>2.1.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.base
|
||||
</groupId>
|
||||
<artifactId>base-support</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base</groupId>
|
||||
<artifactId>management-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<modules>
|
||||
<module>connection-manager</module>
|
||||
<module>connection-management</module>
|
||||
|
||||
<!-- @MOVED root/platform-backward-compat-->
|
||||
<!--
|
||||
<module>blueprint-generator-service</module>
|
||||
-->
|
||||
|
||||
<module>profile-management</module>
|
||||
<module>connector-management</module>
|
||||
<module>node-management</module>
|
||||
<module>cluster-node-management</module>
|
||||
<!-- @MOVED root/platform-backward-compat-->
|
||||
<!--
|
||||
<module>profile-management-service-adapters</module>
|
||||
-->
|
||||
<module>service-management</module>
|
||||
<module>object-management</module>
|
||||
<module>repository-management</module>
|
||||
<module>config-management</module>
|
||||
<module>route-management</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
@ -1,175 +0,0 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения 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. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -1,126 +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>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>profile-management-service-adapters</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
|
||||
<name>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: MANAGEMENT :: PROFILE MANAGEMENT SERVICE ADAPTERS</name>
|
||||
<description>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: MANAGEMENT :: PROFILE MANAGEMENT SERVICE ADAPTERS</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
<!-- ru.entaxy.esb.platform.core.management.profile,
|
||||
ru.entaxy.esb.platform.core.management.profile.api -->
|
||||
</bundle.osgi.export.pkg>
|
||||
<bundle.osgi.private.pkg>
|
||||
ru.entaxy.esb.platform.core.management.profile.adapters
|
||||
<!-- ru.entaxy.esb.platform.base.management.core.utils,
|
||||
ru.entaxy.platform.base.support.osgi.tracker,
|
||||
ru.entaxy.platform.base.support.osgi.tracker.filter,
|
||||
ru.entaxy.esb.platform.core.management.profile.impl* -->
|
||||
</bundle.osgi.private.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.service.component.annotations</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>org.apache.felix.scr</artifactId>
|
||||
<version>2.1.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.base
|
||||
</groupId>
|
||||
<artifactId>base-support</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base</groupId>
|
||||
<artifactId>management-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency-->
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>profile-management</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.management.profile.manager</groupId>
|
||||
<artifactId>profile-manager</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.registry.systems</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.management</groupId>
|
||||
<artifactId>system-management-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.system.management.connector.manager
|
||||
</groupId>
|
||||
<artifactId>connector-manager</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.management.bundle.jpa</groupId>
|
||||
<artifactId>bundle-service</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.registry.connector</groupId>
|
||||
<artifactId>connector-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.registry.connector</groupId>
|
||||
<artifactId>connector-impl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.core.permission</groupId>
|
||||
<artifactId>permission-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.system.management.permission.manager
|
||||
</groupId>
|
||||
<artifactId>permission-manager</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<_dsannotations>*</_dsannotations>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -1,139 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management-service-adapters
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.adapters;
|
||||
|
||||
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 ru.entaxy.esb.system.connector.entity.Connector;
|
||||
import ru.entaxy.esb.system.connector.impl.ConnectorService;
|
||||
import ru.entaxy.esb.system.jpa.SystemService;
|
||||
import ru.entaxy.esb.system.jpa.entity.System;
|
||||
import ru.entaxy.esb.system.management.bundle.jpa.dto.BundleDto;
|
||||
import ru.entaxy.esb.system.management.bundle.jpa.dto.BundleStatus;
|
||||
import ru.entaxy.esb.system.management.connector.manager.ConnectorManager;
|
||||
import ru.entaxy.esb.system.management.connector.manager.dto.ConnectorDto;
|
||||
|
||||
@Component (service = ru.entaxy.esb.platform.core.management.profile.api.ConnectorManager.class
|
||||
, immediate = true)
|
||||
public class ConnectorManagerAdapter implements ru.entaxy.esb.platform.core.management.profile.api.ConnectorManager {
|
||||
|
||||
@Reference(service = ConnectorManager.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
ConnectorManager connectorManager;
|
||||
|
||||
@Reference (service = SystemService.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
SystemService systemService;
|
||||
|
||||
@Reference (service = ConnectorService.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
ConnectorService connectorService;
|
||||
|
||||
@Override
|
||||
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> parameters)
|
||||
throws Exception {
|
||||
|
||||
System system = getSystemByIdOrName(idOrName);
|
||||
if (system == null)
|
||||
throw new IllegalArgumentException("System not found by Id or Name [" + idOrName + "]");
|
||||
ConnectorDto connectorDto = new ConnectorDto();
|
||||
connectorDto.setConnectorParams(parameters);
|
||||
connectorDto.setSystemUuid(system.getUuid());
|
||||
connectorDto.setTemplateName(connectorFactoryId);
|
||||
|
||||
// FIXME remove hardcoded
|
||||
connectorDto.setCreatedBy("admin");
|
||||
|
||||
checkBundleResult(connectorManager.installConnector(connectorDto)
|
||||
, BundleStatus.ACTIVE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeConnector(String idOrName, String connectorName) throws Exception {
|
||||
|
||||
System system = getSystemByIdOrName(idOrName);
|
||||
if (system == null)
|
||||
throw new IllegalArgumentException("System not found by Id or Name [" + idOrName + "]");
|
||||
|
||||
Connector connector = connectorService.getConnectorByName(connectorName);
|
||||
if (connector == null)
|
||||
throw new IllegalArgumentException("Connector not found by Name [" + connectorName + "]");
|
||||
|
||||
checkBundleResult(connectorManager.uninstallConnector(connector)
|
||||
, BundleStatus.UNINSTALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startConnector(String idOrName, String connectorName) throws Exception {
|
||||
|
||||
System system = getSystemByIdOrName(idOrName);
|
||||
if (system == null)
|
||||
throw new IllegalArgumentException("System not found by Id or Name [" + idOrName + "]");
|
||||
|
||||
Connector connector = connectorService.getConnectorByName(connectorName);
|
||||
if (connector == null)
|
||||
throw new IllegalArgumentException("Connector not found by Name [" + connectorName + "]");
|
||||
|
||||
checkBundleResult(connectorManager.startConnector(connector)
|
||||
, BundleStatus.ACTIVE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopConnector(String idOrName, String connectorName) throws Exception {
|
||||
|
||||
System system = getSystemByIdOrName(idOrName);
|
||||
if (system == null)
|
||||
throw new IllegalArgumentException("System not found by Id or Name [" + idOrName + "]");
|
||||
|
||||
Connector connector = connectorService.getConnectorByName(connectorName);
|
||||
if (connector == null)
|
||||
throw new IllegalArgumentException("Connector not found by Name [" + connectorName + "]");
|
||||
|
||||
checkBundleResult(connectorManager.stopConnector(connector)
|
||||
, BundleStatus.RESOLVED);
|
||||
|
||||
}
|
||||
|
||||
protected System getSystemByIdOrName(String idOrName) {
|
||||
System result = systemService.getByName(idOrName);
|
||||
if (result == null)
|
||||
result = systemService.getByUuid(idOrName);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void checkBundleResult(BundleDto bundleDto, BundleStatus expectedStatus) throws Exception {
|
||||
if ((bundleDto == null) || !expectedStatus.equals(bundleDto.getStatus()))
|
||||
throw new Exception("Result bundle is null or in a wrong state");
|
||||
|
||||
}
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management-service-adapters
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.adapters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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 ru.entaxy.esb.system.core.permission.jpa.PermissionService;
|
||||
import ru.entaxy.esb.system.core.permission.jpa.entity.Permission;
|
||||
import ru.entaxy.esb.system.jpa.SystemService;
|
||||
import ru.entaxy.esb.system.jpa.entity.System;
|
||||
import ru.entaxy.esb.system.management.permission.manager.PermissionManager;
|
||||
import ru.entaxy.esb.system.management.permission.manager.dto.PermissionDto;
|
||||
|
||||
@Component (service = ru.entaxy.esb.platform.core.management.profile.api.PermissionManager.class
|
||||
, immediate = true)
|
||||
public class PermissionManagerAdapter implements ru.entaxy.esb.platform.core.management.profile.api.PermissionManager {
|
||||
|
||||
@Reference(service = PermissionManager.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
PermissionManager permissionManager;
|
||||
|
||||
@Reference(service = PermissionService.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
PermissionService permissionService;
|
||||
|
||||
@Reference (service = SystemService.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
SystemService systemService;
|
||||
|
||||
@Override
|
||||
public List<String> getObjectPermissions(String objectId) throws Exception {
|
||||
System system = getRequiredSystemByIdOrName(objectId);
|
||||
List<Permission> permissions = permissionService.getAllById(system.getId(), "system");
|
||||
long systemId = system.getId();
|
||||
List<String> result = new ArrayList<>();
|
||||
for (Permission perm: permissions) {
|
||||
if (perm.getObjectId() == systemId) {
|
||||
if ("system".equals(perm.getSubjectType())) {
|
||||
System s = systemService.get(Long.parseLong(perm.getSubjectId()));
|
||||
if (s != null)
|
||||
result.add(s.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSubjectPermissions(String subjectId) throws Exception {
|
||||
System system = getRequiredSystemByIdOrName(subjectId);
|
||||
List<Permission> permissions = permissionService.getAllById(system.getId(), "system");
|
||||
String systemId = system.getId() + "";
|
||||
List<String> result = new ArrayList<>();
|
||||
for (Permission perm: permissions) {
|
||||
if (perm.getSubjectId().equals(systemId)) {
|
||||
System s = systemService.get(perm.getObjectId());
|
||||
if (s != null)
|
||||
result.add(s.getName());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPermission(String objectId, String subjectId) throws Exception {
|
||||
PermissionDto dto = new PermissionDto(objectId, subjectId);
|
||||
permissionManager.createPermission(dto);
|
||||
}
|
||||
|
||||
protected System getSystemByIdOrName(String idOrName) {
|
||||
System result = systemService.getByName(idOrName);
|
||||
if (result == null)
|
||||
result = systemService.getByUuid(idOrName);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected System getRequiredSystemByIdOrName(String idOrName) throws Exception {
|
||||
System result = systemService.getByName(idOrName);
|
||||
if (result == null)
|
||||
result = systemService.getByUuid(idOrName);
|
||||
if (result == null)
|
||||
throw new IllegalArgumentException("System not found by Id or Name: [" + idOrName + "]");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management-service-adapters
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.adapters;
|
||||
|
||||
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 ru.entaxy.esb.system.jpa.SystemService;
|
||||
import ru.entaxy.esb.system.jpa.entity.System;
|
||||
import ru.entaxy.esb.system.management.profile.manager.ProfileManager;
|
||||
import ru.entaxy.esb.system.management.profile.manager.dto.ProfileDto;
|
||||
import ru.entaxy.esb.system.management.profile.manager.mapper.ProfileMapper;
|
||||
|
||||
import javax.naming.OperationNotSupportedException;
|
||||
|
||||
@Component (
|
||||
service = {ru.entaxy.esb.platform.core.management.profile.api.ProfileManager.class}
|
||||
, immediate = true
|
||||
)
|
||||
public class ProfileManagerAdapter implements ru.entaxy.esb.platform.core.management.profile.api.ProfileManager{
|
||||
|
||||
@Reference (service = ProfileManager.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
ProfileManager profileManager;
|
||||
|
||||
@Reference (service = ProfileMapper.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
ProfileMapper profileMapper;
|
||||
|
||||
@Reference (service = SystemService.class, cardinality = ReferenceCardinality.MANDATORY
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
SystemService systemService;
|
||||
|
||||
@Override
|
||||
public void createProfile(String id, String name, String description) throws Exception {
|
||||
ProfileDto dto = new ProfileDto();
|
||||
dto.setUuid(id);
|
||||
dto.setName(name);
|
||||
dto.setDescription(description);
|
||||
|
||||
// TODO get the user name from JMX,
|
||||
// need to investigate, how
|
||||
dto.setCreatedBy("admin");
|
||||
|
||||
profileManager.installProfile(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startProfile(String idOrName) throws Exception {
|
||||
ProfileDto dto = getProfileForSystem(getSystemByIdOrName(idOrName));
|
||||
if (dto == null)
|
||||
throw new IllegalArgumentException("System/profile not found for [" + idOrName + "]");
|
||||
profileManager.startProfile(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopProfile(String idOrName) throws Exception {
|
||||
ProfileDto dto = getProfileForSystem(getSystemByIdOrName(idOrName));
|
||||
if (dto == null)
|
||||
throw new IllegalArgumentException("System/profile not found for [" + idOrName + "]");
|
||||
profileManager.stopProfile(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallProfile(String idOrName) throws Exception {
|
||||
ProfileDto dto = getProfileForSystem(getSystemByIdOrName(idOrName));
|
||||
if (dto == null)
|
||||
throw new IllegalArgumentException("System/profile not found for [" + idOrName + "]");
|
||||
profileManager.uninstallProfile(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProfileConfig(String idOrName) throws Exception {
|
||||
throw new OperationNotSupportedException();
|
||||
}
|
||||
|
||||
protected System getSystemByIdOrName(String idOrName) {
|
||||
System result = systemService.getByName(idOrName);
|
||||
if (result == null)
|
||||
result = systemService.getByUuid(idOrName);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected ProfileDto getProfileForSystem(System system) {
|
||||
if (system == null)
|
||||
return null;
|
||||
return profileMapper.toProfileDto(system);
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
@ -17,18 +17,22 @@
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.esb.platform.core.management.profile,
|
||||
ru.entaxy.esb.platform.core.management.profile.api
|
||||
ru.entaxy.platform.core.management.profile,
|
||||
ru.entaxy.platform.core.management.profile.support.legacy
|
||||
</bundle.osgi.export.pkg>
|
||||
<bundle.osgi.private.pkg>
|
||||
ru.entaxy.esb.platform.base.management.core.utils,
|
||||
ru.entaxy.platform.base.support.osgi.tracker,
|
||||
ru.entaxy.platform.base.support.osgi.tracker.filter,
|
||||
ru.entaxy.esb.platform.core.management.profile.impl*
|
||||
ru.entaxy.platform.core.management.profile.impl*,
|
||||
ru.entaxy.platform.core.management.profile.support*,
|
||||
ru.entaxy.esb.platform.core.management.profile.helper.*
|
||||
</bundle.osgi.private.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>object-management</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.service.component.annotations</artifactId>
|
||||
@ -52,16 +56,13 @@
|
||||
<artifactId>management-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.auth.basic.api</groupId>
|
||||
<artifactId>basic-auth-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.registry.systems</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base.objects-base</groupId>
|
||||
<artifactId>objects-core</artifactId>
|
||||
|
@ -1,83 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Attribute;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Operation;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.RuntimeTypedMBean;
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBean;
|
||||
|
||||
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
|
||||
public interface ConnectorMBean extends BundleAwareMBean, RuntimeTypedMBean {
|
||||
|
||||
public static interface Helper {
|
||||
|
||||
public static Qualifier getQualifier(String profileName, String connectorName) {
|
||||
return ConnectorsMBean.Helper.getQualifier(profileName).qualifier(CONNECTOR_KEY, connectorName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final String CAPABILITY_NAMESPACE = "entaxy.runtime.connector";
|
||||
|
||||
public static final String CONNECTOR_KEY = "connector";
|
||||
|
||||
public static final String CONNECTOR_KEY_VALUE_DEFAULT = "default";
|
||||
|
||||
// TODO implement if needed
|
||||
// public boolean isDefault();
|
||||
|
||||
@Attribute(desc = "Factory ID used to create the connector")
|
||||
public String getFactoryId();
|
||||
|
||||
@Attribute(desc = "Connector name")
|
||||
public String getName();
|
||||
|
||||
@Attribute(desc = "Connector registered name used in registry")
|
||||
public String getRegisteredName();
|
||||
|
||||
@Attribute(desc = "Connector system")
|
||||
public String getSystem();
|
||||
|
||||
@Attribute(desc = "Connector classifier")
|
||||
public String getClassifier();
|
||||
|
||||
@Attribute(desc = "Connector display name")
|
||||
public String getDisplayName();
|
||||
|
||||
@Attribute(desc = "Connector direction")
|
||||
public String getDirection();
|
||||
|
||||
@Operation(desc = "Starts the connector")
|
||||
public void start() throws Exception;
|
||||
|
||||
@Operation(desc = "Stops the connector")
|
||||
public void stop() throws Exception;
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
|
||||
public interface ConnectorsMBean {
|
||||
public static interface Helper {
|
||||
public static Qualifier getQualifier(String profileName) {
|
||||
return ProfileMBean.Helper
|
||||
.getQualifier(profileName)
|
||||
.qualifier(CONNECTORS_KEY, CONNECTORS_KEY_VALUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final String CONNECTORS_KEY = "section";
|
||||
public static final String CONNECTORS_KEY_VALUE = "connectors";
|
||||
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.*;
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBean;
|
||||
|
||||
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
|
||||
public interface DefaultRouteMBean extends BundleAwareMBean, RuntimeTypedMBean {
|
||||
|
||||
public static interface Helper {
|
||||
|
||||
public static Qualifier getQualifier(String profileName) {
|
||||
return RoutesMBean.Helper.getQualifier(profileName).qualifier(ROUTE_KEY, ROUTE_KEY_VALUE_DEFAULT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static final String CAPABILITY_NAMESPACE = "entaxy.runtime.default-route";
|
||||
|
||||
public static final String ROUTE_KEY = "route";
|
||||
|
||||
public static final String ROUTE_KEY_VALUE_DEFAULT = "default";
|
||||
|
||||
public boolean isDefault();
|
||||
|
||||
@Operation(desc = "Gets route's configuration")
|
||||
public String doGetRouteConfig() throws Exception;
|
||||
|
||||
}
|
@ -1,109 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.management.MBeanOperationInfo;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Attribute;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Operation;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Parameter;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.RuntimeTypedMBean;
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBean;
|
||||
|
||||
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
|
||||
public interface ProfileMBean extends BundleAwareMBean, RuntimeTypedMBean {
|
||||
|
||||
public static interface Helper {
|
||||
|
||||
public static Qualifier getQualifier(String name) {
|
||||
return ProfilesMBean.Q_PROFILES.qualifier(PROFILE_KEY, name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final String CAPABILITY_NAMESPACE = "entaxy.runtime.profile";
|
||||
|
||||
public static final String PROFILE_KEY = "profile";
|
||||
|
||||
@Attribute
|
||||
public String getName();
|
||||
|
||||
@Attribute
|
||||
public String getDescription();
|
||||
|
||||
@Attribute
|
||||
public String getBasicAuthAccount();
|
||||
|
||||
@Attribute
|
||||
public String getUuid();
|
||||
|
||||
@Attribute(desc = "Systems the current can send messages to")
|
||||
public List<String> getAllowedTargets();
|
||||
|
||||
@Attribute(desc = "Systems the current can receive messages from")
|
||||
public List<String> getAllowedSources();
|
||||
|
||||
|
||||
@Operation(desc = "Adds connector to profile")
|
||||
public void addConnector(
|
||||
@Parameter(name = "factoryId", desc = "Connector factory ID") String connectorFactoryId
|
||||
, @Parameter(name = "parameters", desc = "Connector parameters") Map<String, String> parameters) throws Exception;
|
||||
|
||||
@Operation(desc = "Removes connector from profile")
|
||||
public void removeConnector(
|
||||
@Parameter(name = "connectorName", desc = "Connector name") String connectorName) throws Exception;
|
||||
|
||||
@Operation(desc = "Starts connector in profile")
|
||||
public void startConnector(
|
||||
@Parameter(name = "connectorName", desc = "Connector name") String connectorName) throws Exception;
|
||||
|
||||
@Operation(desc = "Stops connector in profile")
|
||||
public void stopConnector(
|
||||
@Parameter(name = "connectorName", desc = "Connector name") String connectorName) throws Exception;
|
||||
|
||||
@Operation(desc = "Gets connector's configuration")
|
||||
public String getConnectorConfig(
|
||||
@Parameter(name = "connectorName", desc = "Connector name") String connectorName) throws Exception;
|
||||
|
||||
@Operation(desc = "Creates account for this system", impact = MBeanOperationInfo.ACTION)
|
||||
public void createAccount(
|
||||
@Parameter(name = "login", desc = "Login") String login
|
||||
, @Parameter(name = "password", desc = "Password") String password) throws Exception;
|
||||
|
||||
@Operation(desc = "Allow this system to send messages to other system")
|
||||
public void allowTarget(
|
||||
@Parameter(name="targetIdOrName", desc = "Target system Id or Name")String idOrName) throws Exception;
|
||||
|
||||
@Operation(desc = "Allow this system to receive messages from other system")
|
||||
public void allowSource(
|
||||
@Parameter(name="sourceIdOrName", desc = "Source system Id or Name")String idOrName) throws Exception;
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.ManagementCore;
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy;
|
||||
import ru.entaxy.esb.platform.core.management.profile.api.ProfileManager;
|
||||
|
||||
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
|
||||
public interface ProfilesMBean extends ProfileManager {
|
||||
|
||||
public static final String CAPABILITY_NAMESPACE_DEFAULT_ROUTE = "entaxy.runtime.default-route";
|
||||
|
||||
public static final String PROFILES_KEY = "category";
|
||||
|
||||
public static final String PROFILES_KEY_VALUE = "profiles";
|
||||
|
||||
public static final Qualifier Q_PROFILES = ManagementCore.Q_RUNTIME
|
||||
.qualifier(ProfilesMBean.PROFILES_KEY, ProfilesMBean.PROFILES_KEY_VALUE);
|
||||
|
||||
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
|
||||
public interface RoutesMBean {
|
||||
|
||||
public static interface Helper {
|
||||
public static Qualifier getQualifier(String profileName) {
|
||||
return ProfileMBean.Helper
|
||||
.getQualifier(profileName)
|
||||
.qualifier(ROUTES_KEY, ROUTES_KEY_VALUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final String ROUTES_KEY = "section";
|
||||
public static final String ROUTES_KEY_VALUE = "routes";
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.api;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ConnectorManager {
|
||||
|
||||
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> parameters) throws Exception;
|
||||
|
||||
public void removeConnector(String idOrName, String connectorName) throws Exception;
|
||||
|
||||
public void startConnector(String idOrName, String connectorName) throws Exception;
|
||||
|
||||
public void stopConnector(String idOrName, String connectorName) throws Exception;
|
||||
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PermissionManager {
|
||||
|
||||
public List<String> getObjectPermissions(String objectId) throws Exception;
|
||||
|
||||
public List<String> getSubjectPermissions(String subjectId) throws Exception;
|
||||
|
||||
public void createPermission(String objectId, String subjectId) throws Exception;
|
||||
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.api;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Operation;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Parameter;
|
||||
|
||||
public interface ProfileManager {
|
||||
|
||||
@Operation(desc = "Create and deploy new profile")
|
||||
public void createProfile(
|
||||
@Parameter(desc = "Profile ID", name = "id") String id,
|
||||
@Parameter(desc = "System name", name = "name") String name,
|
||||
@Parameter(desc = "Description", name = "description") String description) throws Exception;
|
||||
|
||||
@Operation(desc = "Get profile configuration")
|
||||
public String getProfileConfig(@Parameter(desc = "Profile ID or system name", name = "idOrName") String idOrName) throws Exception;
|
||||
|
||||
@Operation(desc = "Start profile")
|
||||
public void startProfile(@Parameter(desc = "Profile ID or system name", name = "idOrName") String idOrName) throws Exception;
|
||||
|
||||
@Operation(desc = "Stop profile")
|
||||
public void stopProfile(@Parameter(desc = "Profile ID or system name", name = "idOrName") String idOrName) throws Exception;
|
||||
|
||||
@Operation(desc = "Uninstall profile")
|
||||
public void uninstallProfile(@Parameter(desc = "Profile ID or system name", name = "idOrName") String idOrName) throws Exception;
|
||||
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleEvent;
|
||||
import org.osgi.framework.wiring.BundleCapability;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.ExtendedBundleTrackerCustomizer;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleCapabilityFilter;
|
||||
|
||||
public class DeployedProfileCustomizer extends ExtendedBundleTrackerCustomizer<List<ManagedProfile>> {
|
||||
|
||||
@Override
|
||||
protected List<ManagedProfile> createManagedObject(Bundle bundle, BundleEvent event,
|
||||
Map<String, List<?>> filterResults) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<BundleCapability> capabilities = (List<BundleCapability>)filterResults.get(BundleCapabilityFilter.DEFAULT_FILTER_ID);
|
||||
if (capabilities==null)
|
||||
capabilities = new ArrayList<>();
|
||||
List<ManagedProfile> result = new ArrayList<>();
|
||||
for (BundleCapability capability: capabilities) {
|
||||
Object val = capability.getAttributes().get("name");
|
||||
String name = val==null?"":val.toString();
|
||||
if (!CommonUtils.isValid(name))
|
||||
continue;
|
||||
|
||||
val = capability.getAttributes().get("desc");
|
||||
String desc;
|
||||
try {
|
||||
desc = val==null?"":new String(val.toString().getBytes(StandardCharsets.ISO_8859_1), "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
desc = val==null?"":val.toString();
|
||||
}
|
||||
|
||||
|
||||
ManagedProfile mp = (new ManagedProfile())
|
||||
.name(name)
|
||||
.description(desc);
|
||||
enrich(bundle, event, filterResults, mp);
|
||||
result.add(mp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareManagedObjectImpl;
|
||||
|
||||
public class ManagedProfile extends BundleAwareManagedObjectImpl {
|
||||
|
||||
protected String name;
|
||||
|
||||
protected String description;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public ManagedProfile name(String name) {
|
||||
setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ManagedProfile description(String desc) {
|
||||
setDescription(desc);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.ManagedObjectsListener;
|
||||
import ru.entaxy.esb.platform.core.management.profile.ProfileMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.bundle.BundleCapabilityHelper;
|
||||
import ru.entaxy.platform.base.support.osgi.bundle.CapabilityDescriptor;
|
||||
|
||||
public class ManagedProfilesListener extends ManagedObjectsListener<List<ManagedProfile>
|
||||
, ManagedProfile, ProfileMBean, ProfileMBeanImpl> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ManagedProfilesListener.class);
|
||||
|
||||
protected Helpers helpers;
|
||||
|
||||
public ManagedProfilesListener(BundleContext bundleContext, Helpers helpers) {
|
||||
super(bundleContext, ProfileMBean.class);
|
||||
this.helpers = helpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterator<ManagedProfile> getIterator(List<ManagedProfile> managedObject) {
|
||||
return managedObject.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getKeyValue(ManagedProfile object) {
|
||||
return object.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ProfileMBeanImpl createService(ManagedProfile managedObject) {
|
||||
try {
|
||||
return new ProfileMBeanImpl(bundleContext, managedObject, helpers);
|
||||
} catch (Exception e) {
|
||||
log.error("Error creating service", e);
|
||||
return null;
|
||||
} }
|
||||
|
||||
@Override
|
||||
protected String getJmxObjectName(ManagedProfile managedObject) {
|
||||
return ProfileMBean.Helper.getQualifier(managedObject.getName()).getValue();
|
||||
}
|
||||
|
||||
// TODO add method to refresh objects to parent class
|
||||
@Override
|
||||
public void modified(List<ManagedProfile> managedObject) {
|
||||
super.modified(managedObject);
|
||||
for (ManagedProfile mp: managedObject) {
|
||||
updateManagedProfile(mp);
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateManagedProfile(ManagedProfile managedObject) {
|
||||
BundleCapabilityHelper helper = new BundleCapabilityHelper(bundleContext.getBundle(managedObject.getBundleId()));
|
||||
List<CapabilityDescriptor> capabilities = helper.getProvidedCapabilities(ProfileMBean.CAPABILITY_NAMESPACE);
|
||||
if (capabilities.isEmpty())
|
||||
return;
|
||||
|
||||
CapabilityDescriptor capability = capabilities.get(0);
|
||||
|
||||
Object val = capability.getAttributes().get("name");
|
||||
String name = val==null?"":val.toString();
|
||||
if (!CommonUtils.isValid(name))
|
||||
return;
|
||||
|
||||
val = capability.getAttributes().get("desc");
|
||||
String desc;
|
||||
try {
|
||||
desc = val==null?"":new String(val.toString().getBytes(StandardCharsets.ISO_8859_1), "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
desc = val==null?"":val.toString();
|
||||
}
|
||||
|
||||
managedObject.name(name).description(desc);
|
||||
}
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.profile.api.ProfileManager;
|
||||
|
||||
public interface ProfileHelper extends ProfileManager {
|
||||
|
||||
}
|
@ -1,135 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl;
|
||||
|
||||
import javax.naming.OperationNotSupportedException;
|
||||
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.CollectionType;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ReferencePolicyOption;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.profile.api.ProfileManager;
|
||||
|
||||
@Component(service = {ProfileHelper.class},
|
||||
immediate = true)
|
||||
public class ProfileHelperImpl implements ProfileHelper {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProfileHelperImpl.class);
|
||||
|
||||
protected static final String EXPLANATION = "ProfileManager not bound";
|
||||
|
||||
protected ProfileManager profileManager = null;
|
||||
|
||||
protected ProfileManager nullProfileManager = null;
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
|
||||
this.nullProfileManager = new ProfileManager() {
|
||||
|
||||
@Override
|
||||
public void uninstallProfile(String idOrName) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopProfile(String idOrName) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startProfile(String idOrName) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createProfile(String id, String name, String description) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProfileConfig(String idOrName) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ProfileManager getEffectiveProfileManager() {
|
||||
return profileManager!=null?profileManager:nullProfileManager;
|
||||
}
|
||||
|
||||
@Reference (collectionType = CollectionType.SERVICE
|
||||
, cardinality = ReferenceCardinality.OPTIONAL
|
||||
, policyOption = ReferencePolicyOption.GREEDY
|
||||
, service = ProfileManager.class
|
||||
, unbind = "unsetProfileManager")
|
||||
public void setProfileManager(ProfileManager profileManager) {
|
||||
this.profileManager = profileManager;
|
||||
log.debug(">> ProfileManager is bound");
|
||||
}
|
||||
|
||||
public void unsetProfileManager(ProfileManager profileManager) {
|
||||
this.profileManager = null;
|
||||
log.debug(">> ProfileManager is unbound");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void createProfile(String id, String name, String description) throws Exception {
|
||||
getEffectiveProfileManager().createProfile(id, name, description);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProfileConfig(String idOrName) throws Exception {
|
||||
return getEffectiveProfileManager().getProfileConfig(idOrName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startProfile(String idOrName) throws Exception {
|
||||
getEffectiveProfileManager().startProfile(idOrName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopProfile(String idOrName) throws Exception {
|
||||
getEffectiveProfileManager().stopProfile(idOrName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallProfile(String idOrName) throws Exception {
|
||||
getEffectiveProfileManager().uninstallProfile(idOrName);
|
||||
}
|
||||
|
||||
}
|
@ -1,160 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBeanImpl;
|
||||
import ru.entaxy.esb.platform.core.management.profile.ProfileMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
|
||||
import ru.entaxy.esb.system.auth.basic.jpa.api.entity.BasicAuthAccount;
|
||||
import ru.entaxy.esb.system.jpa.entity.System;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
|
||||
// @TODO move string to constant
|
||||
@EntaxyRuntimeTyped(name = "entaxy.runtime.profile")
|
||||
public class ProfileMBeanImpl extends BundleAwareMBeanImpl<ManagedProfile, ProfileMBean> implements ProfileMBean {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProfileMBeanImpl.class);
|
||||
|
||||
Helpers helpers;
|
||||
|
||||
public ProfileMBeanImpl(BundleContext bundleContext, ManagedProfile managedProfile
|
||||
, Helpers helpers)
|
||||
throws NotCompliantMBeanException {
|
||||
super(ProfileMBean.class, managedProfile);
|
||||
this.bundleContext = bundleContext;
|
||||
this.helpers = helpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return managedObject.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return managedObject.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
System system = helpers.systemService.getByName(getName());
|
||||
if (system == null)
|
||||
return "N/A";
|
||||
return system.getUuid();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getBasicAuthAccount() {
|
||||
Optional<BasicAuthAccount> bas = this.helpers.basicAuthService.getBySystem(getUuid());
|
||||
if (bas.isPresent())
|
||||
return bas.get().getLogin();
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createAccount(String login, String password) throws Exception {
|
||||
if (CommonUtils.isValid(getBasicAuthAccount()))
|
||||
throw new IllegalArgumentException("Account already exists");
|
||||
// FIXME remove hardcoded
|
||||
this.helpers.basicAuthService.saveCommon(login
|
||||
, password
|
||||
, getUuid()
|
||||
, "admin"
|
||||
, "admin");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConnector(String connectorFactoryId, Map<String, String> parameters) throws Exception {
|
||||
this.helpers.connectorHelper.addConnector(getName(), connectorFactoryId, parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeConnector(String connectorName) throws Exception {
|
||||
this.helpers.connectorHelper.removeConnector(getName(), connectorName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startConnector(String connectorName) throws Exception {
|
||||
this.helpers.connectorHelper.startConnector(getName(), connectorName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopConnector(String connectorName) throws Exception {
|
||||
this.helpers.connectorHelper.stopConnector(getName(), connectorName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConnectorConfig(String connectorName) throws Exception {
|
||||
return helpers.entaxyObjectService.findObject(connectorName, "entaxy.runtime.connector").getConfiguration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAllowedTargets() {
|
||||
try {
|
||||
return helpers.permissionHelper.getObjectPermissions(getUuid());
|
||||
} catch (Exception e) {
|
||||
log.warn("getAllowedTargets not succeded", e);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAllowedSources() {
|
||||
try {
|
||||
return helpers.permissionHelper.getSubjectPermissions(getUuid());
|
||||
} catch (Exception e) {
|
||||
log.warn("getAllowedSources not succeded", e);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void allowSource(String idOrName) throws Exception {
|
||||
helpers.permissionHelper.createPermission(idOrName, getUuid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void allowTarget(String idOrName) throws Exception {
|
||||
helpers.permissionHelper.createPermission(getUuid(), idOrName);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,182 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.management.DynamicMBean;
|
||||
import javax.management.MBeanRegistration;
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceRegistration;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.CollectionType;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Deactivate;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ServiceScope;
|
||||
import org.osgi.util.tracker.BundleTracker;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.ManagementCore;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.AnnotatedMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.ConnectorMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.DefaultRouteMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.ProfileMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.ProfilesMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.connector.DeployedConnectorCustomizer;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.connector.ManagedConnector;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.connector.ManagedConnectorsListener;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.route.DeployedDefaultRouteCustomizer;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.route.ManagedRoute;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.route.ManagedRoutesListener;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleCapabilityFilter;
|
||||
|
||||
@Component(service = { ProfilesMBean.class, DynamicMBean.class, MBeanRegistration.class }, property = {
|
||||
ManagementCore.JMX_OBJECTNAME + "=" + ManagementCore.Q_RUNTIME_S + "," + ProfilesMBean.PROFILES_KEY + "="
|
||||
+ ProfilesMBean.PROFILES_KEY_VALUE }, scope = ServiceScope.SINGLETON, immediate = true)
|
||||
public class ProfilesMBeanImpl extends AnnotatedMBean<ProfilesMBean>
|
||||
implements ProfilesMBean {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProfilesMBeanImpl.class);
|
||||
|
||||
protected BundleContext bundleContext;
|
||||
|
||||
protected BundleTracker<List<ManagedProfile>> tracker;
|
||||
|
||||
protected BundleTracker<List<ManagedRoute>> routeTracker;
|
||||
|
||||
protected BundleTracker<List<ManagedConnector>> connectorTracker;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY
|
||||
, service = Helpers.class
|
||||
, collectionType = CollectionType.SERVICE)
|
||||
Helpers helpers;
|
||||
|
||||
public ProfilesMBeanImpl() throws NotCompliantMBeanException {
|
||||
super(ProfilesMBean.class);
|
||||
}
|
||||
|
||||
protected static class ManagedProfileDescriptor {
|
||||
|
||||
ManagedProfile profile;
|
||||
ServiceRegistration<ProfileMBean> registration;
|
||||
|
||||
}
|
||||
|
||||
protected Map<String, ManagedProfileDescriptor> managed = new HashMap<>();
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
this.bundleContext = componentContext.getBundleContext();
|
||||
|
||||
//tracker = new DeployedProfileTrackerOld(bundleContext, this);
|
||||
tracker = BundleTrackerUtils.<List<ManagedProfile>>createBuilder()
|
||||
.customizer(
|
||||
(new DeployedProfileCustomizer())
|
||||
.listener(new ManagedProfilesListener(bundleContext, this.helpers))
|
||||
)
|
||||
.addFilter(
|
||||
(new BundleCapabilityFilter()).namespace(ProfileMBean.CAPABILITY_NAMESPACE)
|
||||
)
|
||||
.bundleContext(bundleContext)
|
||||
.bundleState(Bundle.ACTIVE | Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.STOPPING)
|
||||
.get();
|
||||
tracker.open();
|
||||
|
||||
routeTracker = BundleTrackerUtils.<List<ManagedRoute>>createBuilder()
|
||||
.customizer(
|
||||
(new DeployedDefaultRouteCustomizer())
|
||||
.listener(new ManagedRoutesListener(bundleContext, helpers))
|
||||
)
|
||||
.addFilter(
|
||||
(new BundleCapabilityFilter()).namespace(DefaultRouteMBean.CAPABILITY_NAMESPACE)
|
||||
)
|
||||
.bundleContext(bundleContext)
|
||||
.bundleState(Bundle.ACTIVE | Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.STOPPING)
|
||||
.get();
|
||||
routeTracker.open();
|
||||
|
||||
connectorTracker = BundleTrackerUtils.<List<ManagedConnector>>createBuilder()
|
||||
.customizer(
|
||||
(new DeployedConnectorCustomizer())
|
||||
.listener(new ManagedConnectorsListener(bundleContext, this.helpers))
|
||||
)
|
||||
.addFilter(
|
||||
(new BundleCapabilityFilter()).namespace(ConnectorMBean.CAPABILITY_NAMESPACE)
|
||||
)
|
||||
.bundleContext(bundleContext)
|
||||
.bundleState(Bundle.ACTIVE | Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.STOPPING)
|
||||
.get();
|
||||
connectorTracker.open();
|
||||
}
|
||||
|
||||
@Deactivate
|
||||
public void deactivate() {
|
||||
tracker.close();
|
||||
routeTracker.close();
|
||||
connectorTracker.close();
|
||||
}
|
||||
|
||||
/*
|
||||
* ProfileManager implementation
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void createProfile(String id, String name, String description) throws Exception {
|
||||
this.helpers.profileHelper.createProfile(id, name, description);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProfileConfig(String idOrName) throws Exception {
|
||||
return this.helpers.entaxyObjectService.findObject(idOrName, "entaxy.runtime.profile").getConfiguration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startProfile(String idOrName) throws Exception {
|
||||
this.helpers.profileHelper.startProfile(idOrName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopProfile(String idOrName) throws Exception {
|
||||
this.helpers.profileHelper.stopProfile(idOrName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallProfile(String idOrName) throws Exception {
|
||||
this.helpers.profileHelper.uninstallProfile(idOrName);
|
||||
}
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.connector;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.profile.api.ConnectorManager;
|
||||
|
||||
public interface ConnectorHelper extends ConnectorManager {
|
||||
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.connector;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.naming.OperationNotSupportedException;
|
||||
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.CollectionType;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ReferencePolicyOption;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.profile.api.ConnectorManager;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.ProfileHelperImpl;
|
||||
|
||||
@Component(service = ConnectorHelper.class, immediate = true)
|
||||
public class ConnectorHelperImpl implements ConnectorHelper {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProfileHelperImpl.class);
|
||||
|
||||
protected static final String EXPLANATION = "ConnectorManager not bound";
|
||||
|
||||
protected ConnectorManager connectorManager = null;
|
||||
|
||||
protected ConnectorManager nullConnectorManager = null;
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
this.nullConnectorManager = new ConnectorManager() {
|
||||
|
||||
@Override
|
||||
public void stopConnector(String idOrName, String connectorName) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startConnector(String idOrName, String connectorName) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeConnector(String idOrName, String connectorName) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> parameters)
|
||||
throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public ConnectorManager getEffectiveConnectorManager() {
|
||||
return connectorManager!=null?connectorManager:nullConnectorManager;
|
||||
}
|
||||
|
||||
@Reference (collectionType = CollectionType.SERVICE
|
||||
, cardinality = ReferenceCardinality.OPTIONAL
|
||||
, policyOption = ReferencePolicyOption.GREEDY
|
||||
, service = ConnectorManager.class
|
||||
, unbind = "unsetConnectorManager")
|
||||
public void setConnectorManager(ConnectorManager connectorManager) {
|
||||
this.connectorManager = connectorManager;
|
||||
log.debug(">> ConnectorManager is bound");
|
||||
}
|
||||
|
||||
public void unsetConnectorManager(ConnectorManager connectorManager) {
|
||||
this.connectorManager = null;
|
||||
log.debug(">> ConnectorManager is unbound");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> parameters)
|
||||
throws Exception {
|
||||
getEffectiveConnectorManager().addConnector(idOrName, connectorFactoryId, parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeConnector(String idOrName, String connectorName) throws Exception {
|
||||
getEffectiveConnectorManager().removeConnector(idOrName, connectorName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startConnector(String idOrName, String connectorName) throws Exception {
|
||||
getEffectiveConnectorManager().startConnector(idOrName, connectorName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopConnector(String idOrName, String connectorName) throws Exception {
|
||||
getEffectiveConnectorManager().stopConnector(idOrName, connectorName);
|
||||
}
|
||||
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.connector;
|
||||
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBeanImpl;
|
||||
import ru.entaxy.esb.platform.core.management.profile.ConnectorMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
|
||||
|
||||
//@TODO move string to constant
|
||||
@EntaxyRuntimeTyped(name = "entaxy.runtime.connector")
|
||||
public class ConnectorMBeanImpl extends BundleAwareMBeanImpl<ManagedConnector, ConnectorMBean> implements ConnectorMBean {
|
||||
|
||||
protected Helpers helpers;
|
||||
|
||||
public ConnectorMBeanImpl(BundleContext bundleContext, ManagedConnector managedObject, Helpers helpers)
|
||||
throws NotCompliantMBeanException {
|
||||
super(ConnectorMBean.class, managedObject);
|
||||
this.bundleContext = bundleContext;
|
||||
this.helpers = helpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFactoryId() {
|
||||
return this.managedObject.getFactoryId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.managedObject.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRegisteredName() {
|
||||
return this.managedObject.getRegisteredName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystem() {
|
||||
return this.managedObject.getSystem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClassifier() {
|
||||
return this.managedObject.getClassifier();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return this.managedObject.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDirection() {
|
||||
return this.managedObject.getDirection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() throws Exception {
|
||||
this.helpers.connectorHelper.startConnector(this.managedObject.getSystem(), this.getRegisteredName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() throws Exception {
|
||||
this.helpers.connectorHelper.stopConnector(this.managedObject.getSystem(), this.getRegisteredName());
|
||||
}
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.connector;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleEvent;
|
||||
import org.osgi.framework.wiring.BundleCapability;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.ExtendedBundleTrackerCustomizer;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleCapabilityFilter;
|
||||
|
||||
public class DeployedConnectorCustomizer extends ExtendedBundleTrackerCustomizer<List<ManagedConnector>> {
|
||||
|
||||
@Override
|
||||
protected List<ManagedConnector> createManagedObject(Bundle bundle, BundleEvent event,
|
||||
Map<String, List<?>> filterResults) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<BundleCapability> capabilities = (List<BundleCapability>)filterResults.get(BundleCapabilityFilter.DEFAULT_FILTER_ID);
|
||||
if (capabilities==null)
|
||||
capabilities = new ArrayList<>();
|
||||
List<ManagedConnector> result = new ArrayList<>();
|
||||
for (BundleCapability capability: capabilities) {
|
||||
Object val = capability.getAttributes().get("name");
|
||||
String name = val==null?"":val.toString();
|
||||
if (!CommonUtils.isValid(name))
|
||||
continue;
|
||||
val = capability.getAttributes().get("system");
|
||||
String system = val==null?"":val.toString();
|
||||
if (!CommonUtils.isValid(system))
|
||||
continue;
|
||||
|
||||
val = capability.getAttributes().get("templateId");
|
||||
String factoryId = val==null?"":val.toString();
|
||||
|
||||
val = capability.getAttributes().get("factory");
|
||||
factoryId = val==null?factoryId:val.toString();
|
||||
|
||||
val = capability.getAttributes().get("bundleName");
|
||||
String registeredName = val==null?"":val.toString();
|
||||
|
||||
val = capability.getAttributes().get("classifier");
|
||||
String classifier = val==null?"":val.toString();
|
||||
|
||||
val = capability.getAttributes().get("displayName");
|
||||
String displayName;
|
||||
try {
|
||||
displayName = val==null?"":new String(val.toString().getBytes(StandardCharsets.ISO_8859_1), "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
displayName = val==null?"":val.toString();
|
||||
}
|
||||
|
||||
val = capability.getAttributes().get("direction");
|
||||
String direction = val==null?"":val.toString();
|
||||
|
||||
|
||||
ManagedConnector mc = (new ManagedConnector())
|
||||
.name(name)
|
||||
.system(system)
|
||||
.factoryId(factoryId)
|
||||
.registeredName(registeredName)
|
||||
.classifier(classifier)
|
||||
.displayName(displayName)
|
||||
.direction(direction);
|
||||
enrich(bundle, event, filterResults, mc);
|
||||
result.add(mc);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -1,136 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.connector;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareManagedObjectImpl;
|
||||
|
||||
public class ManagedConnector extends BundleAwareManagedObjectImpl {
|
||||
|
||||
protected String system;
|
||||
|
||||
protected String name;
|
||||
|
||||
protected String registeredName;
|
||||
|
||||
protected String factoryId;
|
||||
|
||||
protected String classifier;
|
||||
|
||||
protected String displayName;
|
||||
|
||||
protected String direction;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ManagedConnector name(String name) {
|
||||
setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSystem() {
|
||||
return system;
|
||||
}
|
||||
|
||||
public void setSystem(String system) {
|
||||
this.system = system;
|
||||
}
|
||||
|
||||
public ManagedConnector system(String system) {
|
||||
setSystem(system);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFactoryId() {
|
||||
return factoryId;
|
||||
}
|
||||
|
||||
public void setFactoryId(String factoryId) {
|
||||
this.factoryId = factoryId;
|
||||
}
|
||||
|
||||
public ManagedConnector factoryId(String factoryIdValue) {
|
||||
this.setFactoryId(factoryIdValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRegisteredName() {
|
||||
return registeredName;
|
||||
}
|
||||
|
||||
public void setRegisteredName(String registeredName) {
|
||||
this.registeredName = registeredName;
|
||||
};
|
||||
|
||||
public ManagedConnector registeredName(String registeredNameValue) {
|
||||
this.setRegisteredName(registeredNameValue);
|
||||
return this;
|
||||
};
|
||||
|
||||
public String getClassifier() {
|
||||
return classifier;
|
||||
}
|
||||
|
||||
public void setClassifier(String classifier) {
|
||||
this.classifier = classifier;
|
||||
}
|
||||
|
||||
public ManagedConnector classifier(String classifierValue) {
|
||||
this.setClassifier(classifierValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public ManagedConnector displayName(String displayNameValue) {
|
||||
this.setDisplayName(displayNameValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public ManagedConnector direction(String directionValue) {
|
||||
this.setDirection(directionValue);
|
||||
return this;
|
||||
}
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.connector;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.ManagedObjectsListener;
|
||||
import ru.entaxy.esb.platform.core.management.profile.ConnectorMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
|
||||
|
||||
public class ManagedConnectorsListener extends ManagedObjectsListener<List<ManagedConnector>, ManagedConnector, ConnectorMBean, ConnectorMBeanImpl> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ManagedConnectorsListener.class);
|
||||
|
||||
protected Helpers helpers;
|
||||
|
||||
public ManagedConnectorsListener(BundleContext bundleContext, Helpers helpers) {
|
||||
super(bundleContext, ConnectorMBean.class);
|
||||
this.helpers = helpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterator<ManagedConnector> getIterator(List<ManagedConnector> managedObject) {
|
||||
return managedObject.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getKeyValue(ManagedConnector object) {
|
||||
return object.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConnectorMBeanImpl createService(ManagedConnector managedObject) {
|
||||
try {
|
||||
return new ConnectorMBeanImpl(bundleContext, managedObject, helpers);
|
||||
} catch (Exception e) {
|
||||
log.error("Error creating service", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getJmxObjectName(ManagedConnector managedObject) {
|
||||
return ConnectorMBean.Helper.getQualifier(
|
||||
managedObject.getSystem(),
|
||||
managedObject.getName()
|
||||
).getValue();
|
||||
}
|
||||
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.helper;
|
||||
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.ProfileHelper;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.connector.ConnectorHelper;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.permission.PermissionHelper;
|
||||
import ru.entaxy.esb.system.auth.basic.jpa.api.BasicAuthService;
|
||||
import ru.entaxy.esb.system.jpa.SystemService;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObjectService;
|
||||
|
||||
@Component (service = Helpers.class, immediate = true)
|
||||
public class Helpers {
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY)
|
||||
public ProfileHelper profileHelper;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY)
|
||||
public ConnectorHelper connectorHelper;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY)
|
||||
public BasicAuthService basicAuthService;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY)
|
||||
public SystemService systemService;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY)
|
||||
public PermissionHelper permissionHelper;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY)
|
||||
public EntaxyObjectService entaxyObjectService;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.permission;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.profile.api.PermissionManager;
|
||||
|
||||
public interface PermissionHelper extends PermissionManager {
|
||||
|
||||
}
|
@ -1,109 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.permission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.naming.OperationNotSupportedException;
|
||||
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.CollectionType;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ReferencePolicyOption;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.core.management.profile.api.PermissionManager;
|
||||
|
||||
@Component(service = PermissionHelper.class, immediate = true)
|
||||
public class PermissionHelperImpl implements PermissionHelper {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PermissionHelperImpl.class);
|
||||
|
||||
protected static final String EXPLANATION = "PermissionManager not bound";
|
||||
|
||||
protected PermissionManager permissionManager = null;
|
||||
|
||||
protected PermissionManager nullPermissionManager = null;
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
this.nullPermissionManager = new PermissionManager() {
|
||||
|
||||
@Override
|
||||
public List<String> getSubjectPermissions(String subjectId) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION); }
|
||||
|
||||
@Override
|
||||
public List<String> getObjectPermissions(String objectId) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION); }
|
||||
|
||||
@Override
|
||||
public void createPermission(String objectId, String subjectId) throws Exception {
|
||||
throw new OperationNotSupportedException(EXPLANATION); }
|
||||
};
|
||||
}
|
||||
|
||||
public PermissionManager getEffectivePermissionManager() {
|
||||
return this.permissionManager!=null?this.permissionManager:this.nullPermissionManager;
|
||||
}
|
||||
|
||||
@Reference (collectionType = CollectionType.SERVICE
|
||||
, cardinality = ReferenceCardinality.OPTIONAL
|
||||
, policyOption = ReferencePolicyOption.GREEDY
|
||||
, service = PermissionManager.class
|
||||
, unbind = "unsetPermissionManager")
|
||||
public void setPermissionManager(PermissionManager permissionManager) {
|
||||
this.permissionManager = permissionManager;
|
||||
log.debug(">> PermissionManager is bound");
|
||||
}
|
||||
|
||||
public void unsetPermissionManager(PermissionManager permissionManager) {
|
||||
this.permissionManager = null;
|
||||
log.debug(">> PermissionManager is unbound");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> getObjectPermissions(String objectId) throws Exception {
|
||||
return getEffectivePermissionManager().getObjectPermissions(objectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSubjectPermissions(String subjectId) throws Exception {
|
||||
return getEffectivePermissionManager().getSubjectPermissions(subjectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPermission(String objectId, String subjectId) throws Exception {
|
||||
getEffectivePermissionManager().createPermission(objectId, subjectId);
|
||||
}
|
||||
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.route;
|
||||
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBeanImpl;
|
||||
import ru.entaxy.esb.platform.core.management.profile.DefaultRouteMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
|
||||
|
||||
//@TODO move string to constant
|
||||
@EntaxyRuntimeTyped(name = "entaxy.runtime.default-route")
|
||||
public class DefaultRouteMBeanImpl extends BundleAwareMBeanImpl<ManagedRoute, DefaultRouteMBean> implements DefaultRouteMBean {
|
||||
|
||||
Helpers helpers;
|
||||
|
||||
public DefaultRouteMBeanImpl(BundleContext bundleContext, ManagedRoute managedRoute, Helpers helpers) throws NotCompliantMBeanException {
|
||||
super(DefaultRouteMBean.class, managedRoute);
|
||||
this.bundleContext = bundleContext;
|
||||
this.managedObject = managedRoute;
|
||||
this.helpers = helpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefault() {
|
||||
return this.managedObject.isDefault();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String doGetRouteConfig() throws Exception {
|
||||
return this.helpers.entaxyObjectService.findObject(managedObject.getName(), "entaxy.runtime.default-route").getConfiguration();
|
||||
}
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.route;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleEvent;
|
||||
import org.osgi.framework.wiring.BundleCapability;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.ExtendedBundleTrackerCustomizer;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleCapabilityFilter;
|
||||
|
||||
public class DeployedDefaultRouteCustomizer extends ExtendedBundleTrackerCustomizer<List<ManagedRoute>> {
|
||||
|
||||
@Override
|
||||
protected List<ManagedRoute> createManagedObject(Bundle bundle, BundleEvent event, Map<String, List<?>> filterResults) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<BundleCapability> capabilities = (List<BundleCapability>)filterResults.get(BundleCapabilityFilter.DEFAULT_FILTER_ID);
|
||||
if (capabilities==null)
|
||||
capabilities = new ArrayList<>();
|
||||
List<ManagedRoute> result = new ArrayList<>();
|
||||
for (BundleCapability capability: capabilities) {
|
||||
Object val = capability.getAttributes().get("objectId"); // fixme this is temporary solution
|
||||
String name = val==null?"":val.toString();
|
||||
if (!CommonUtils.isValid(name))
|
||||
continue;
|
||||
val = capability.getAttributes().get("profile");
|
||||
String profile = val==null?"":val.toString();
|
||||
if (!CommonUtils.isValid(profile)) {
|
||||
// backward comp
|
||||
val = capability.getAttributes().get("system");
|
||||
profile = val==null?"":val.toString();
|
||||
}
|
||||
if (!CommonUtils.isValid(profile))
|
||||
continue;
|
||||
ManagedRoute mr = (new ManagedRoute())
|
||||
.name(name)
|
||||
.profile(profile)
|
||||
.defaultRoute(true);
|
||||
enrich(bundle, event, filterResults, mr);
|
||||
result.add(mr);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.route;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareManagedObjectImpl;
|
||||
|
||||
public class ManagedRoute extends BundleAwareManagedObjectImpl {
|
||||
|
||||
protected boolean isDefault;
|
||||
|
||||
protected String name;
|
||||
|
||||
protected String profile;
|
||||
|
||||
public boolean isDefault() {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setDefault(boolean isDefault) {
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
|
||||
public ManagedRoute defaultRoute(boolean isDefault) {
|
||||
setDefault(isDefault);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ManagedRoute name(String name) {
|
||||
setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
public void setProfile(String profile) {
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
public ManagedRoute profile(String profile) {
|
||||
setProfile(profile);
|
||||
return this;
|
||||
}
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.profile.impl.route;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.ManagedObjectsListener;
|
||||
import ru.entaxy.esb.platform.core.management.profile.DefaultRouteMBean;
|
||||
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
|
||||
|
||||
public class ManagedRoutesListener extends ManagedObjectsListener<List<ManagedRoute>, ManagedRoute, DefaultRouteMBean, DefaultRouteMBeanImpl> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ManagedRoutesListener.class);
|
||||
|
||||
protected Helpers helpers;
|
||||
|
||||
public ManagedRoutesListener(BundleContext bundleContext, Helpers helpers) {
|
||||
super(bundleContext, DefaultRouteMBean.class);
|
||||
this.helpers = helpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterator<ManagedRoute> getIterator(List<ManagedRoute> managedObject) {
|
||||
log.debug(">> getIterator");
|
||||
return managedObject.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getKeyValue(ManagedRoute object) {
|
||||
return object.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DefaultRouteMBeanImpl createService(ManagedRoute managedObject) {
|
||||
try {
|
||||
return new DefaultRouteMBeanImpl(bundleContext, managedObject, helpers);
|
||||
} catch (Exception e) {
|
||||
log.error("Error creating service", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getJmxObjectName(ManagedRoute managedObject) {
|
||||
return DefaultRouteMBean.Helper.getQualifier(managedObject.getProfile()).getValue();
|
||||
}
|
||||
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>service-management</artifactId>
|
||||
@ -14,11 +14,10 @@
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.esb.platform.core.management.service
|
||||
ru.entaxy.platform.core.management.service
|
||||
</bundle.osgi.export.pkg>
|
||||
<bundle.osgi.private.pkg>
|
||||
ru.entaxy.esb.platform.core.management.service.impl,
|
||||
ru.entaxy.esb.platform.core.management.service.impl.tracker
|
||||
ru.entaxy.platform.core.management.service.impl
|
||||
</bundle.osgi.private.pkg>
|
||||
</properties>
|
||||
|
||||
@ -51,11 +50,18 @@
|
||||
<artifactId>objects-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
|
||||
<artifactId>object-management</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.management.bundle.manager</groupId>
|
||||
<artifactId>bundle-manager</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
@ -1,52 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* service-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.service;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Attribute;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.RuntimeTypedMBean;
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBean;
|
||||
|
||||
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
|
||||
public interface ServiceMBean extends BundleAwareMBean, RuntimeTypedMBean {
|
||||
|
||||
public static interface Helper {
|
||||
|
||||
public static Qualifier getQualifier(String name) {
|
||||
return ServicesMBean.Q_SERVICES.qualifier(SERVICE_KEY, name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final String CAPABILITY_NAMESPACE = "entaxy.runtime.service";
|
||||
|
||||
public static final String SERVICE_KEY = "service";
|
||||
|
||||
@Attribute
|
||||
String getName();
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* service-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.service;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.ManagementCore;
|
||||
import ru.entaxy.esb.platform.base.management.core.Qualifier;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Operation;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.Parameter;
|
||||
|
||||
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
|
||||
public interface ServicesMBean {
|
||||
|
||||
public static final String CAPABILITY_NAMESPACE = "entaxy.runtime.service";
|
||||
|
||||
public static final String SERVICES_KEY = "category";
|
||||
|
||||
public static final String SERVICES_KEY_VALUE = "services";
|
||||
|
||||
public static final Qualifier Q_SERVICES = ManagementCore.Q_RUNTIME
|
||||
.qualifier(ServicesMBean.SERVICES_KEY, ServicesMBean.SERVICES_KEY_VALUE);
|
||||
|
||||
@Operation(desc = "Gets service's configuration")
|
||||
public String getServiceConfig(
|
||||
@Parameter(name = "idOrName", desc = "Service id or name") String idOrName) throws Exception;
|
||||
|
||||
@Operation(desc = "Start service")
|
||||
public void startService(
|
||||
@Parameter(name = "idOrName", desc = "Service id or name") String idOrName) throws Exception;
|
||||
|
||||
@Operation(desc = "Stop service")
|
||||
public void stopService(
|
||||
@Parameter(name = "idOrName", desc = "Service id or name") String idOrName) throws Exception;
|
||||
|
||||
@Operation(desc = "Uninstall service")
|
||||
public void uninstallService(
|
||||
@Parameter(name = "idOrName", desc = "Service id or name") String idOrName) throws Exception;
|
||||
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* service-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.service.impl;
|
||||
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBeanImpl;
|
||||
import ru.entaxy.esb.platform.core.management.service.ServiceMBean;
|
||||
import ru.entaxy.esb.platform.core.management.service.impl.tracker.ManagedService;
|
||||
|
||||
@EntaxyRuntimeTyped(name = "entaxy.runtime.service")
|
||||
public class ServiceMBeanImpl extends BundleAwareMBeanImpl<ManagedService, ServiceMBean> implements ServiceMBean {
|
||||
|
||||
public ServiceMBeanImpl(BundleContext bundleContext, ManagedService managedProfile)
|
||||
throws NotCompliantMBeanException {
|
||||
super(ServiceMBean.class, managedProfile);
|
||||
this.bundleContext = bundleContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.managedObject.getName();
|
||||
}
|
||||
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* service-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.management.DynamicMBean;
|
||||
import javax.management.MBeanRegistration;
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceRegistration;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.*;
|
||||
import org.osgi.util.tracker.BundleTracker;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.ManagementCore;
|
||||
import ru.entaxy.esb.platform.base.management.core.api.AnnotatedMBean;
|
||||
import ru.entaxy.esb.platform.core.management.service.ServiceMBean;
|
||||
import ru.entaxy.esb.platform.core.management.service.ServicesMBean;
|
||||
import ru.entaxy.esb.platform.core.management.service.impl.tracker.DeployedServiceCustomizer;
|
||||
import ru.entaxy.esb.platform.core.management.service.impl.tracker.ManagedService;
|
||||
import ru.entaxy.esb.platform.core.management.service.impl.tracker.ManagedServiceListener;
|
||||
import ru.entaxy.esb.system.management.bundle.manager.BundleManager;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObjectService;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleCapabilityFilter;
|
||||
|
||||
@Component(service = { ServicesMBean.class, DynamicMBean.class, MBeanRegistration.class }, property = {
|
||||
ManagementCore.JMX_OBJECTNAME + "=" + ManagementCore.Q_RUNTIME_S + "," + ServicesMBean.SERVICES_KEY + "="
|
||||
+ ServicesMBean.SERVICES_KEY_VALUE }, scope = ServiceScope.SINGLETON, immediate = true)
|
||||
public class ServicesMBeanImpl extends AnnotatedMBean<ServicesMBean> implements ServicesMBean {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ServicesMBeanImpl.class);
|
||||
|
||||
protected BundleContext bundleContext;
|
||||
|
||||
protected BundleTracker<List<ManagedService>> tracker;
|
||||
|
||||
private String SERVICE_RUNTIME_TYPE = "entaxy.runtime.service";
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY)
|
||||
public EntaxyObjectService entaxyObjectService;
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY)
|
||||
private BundleManager bundleManager;
|
||||
|
||||
protected static class ManagedServiceDescriptor {
|
||||
|
||||
ManagedService profile;
|
||||
ServiceRegistration<ServiceMBean> registration;
|
||||
|
||||
}
|
||||
|
||||
protected Map<String, ManagedServiceDescriptor> managed = new HashMap<>();
|
||||
|
||||
public ServicesMBeanImpl() throws NotCompliantMBeanException {
|
||||
super(ServicesMBean.class);
|
||||
}
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
this.bundleContext = componentContext.getBundleContext();
|
||||
|
||||
//tracker = new DeployedProfileTrackerOld(bundleContext, this);
|
||||
tracker = BundleTrackerUtils.<List<ManagedService>>createBuilder()
|
||||
.customizer(
|
||||
(new DeployedServiceCustomizer())
|
||||
.listener(new ManagedServiceListener(bundleContext))
|
||||
)
|
||||
.addFilter(
|
||||
(new BundleCapabilityFilter()).namespace(ServiceMBean.CAPABILITY_NAMESPACE)
|
||||
)
|
||||
.bundleContext(bundleContext)
|
||||
.bundleState(Bundle.ACTIVE | Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.STOPPING)
|
||||
.get();
|
||||
tracker.open();
|
||||
}
|
||||
|
||||
@Deactivate
|
||||
public void deactivate() {
|
||||
tracker.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServiceConfig(String idOrName) {
|
||||
return entaxyObjectService.findObject(idOrName, SERVICE_RUNTIME_TYPE).getConfiguration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startService(String idOrName) throws Exception {
|
||||
long bundleId = entaxyObjectService.findObject(idOrName, SERVICE_RUNTIME_TYPE).getBundleInfo().getBundleId();
|
||||
bundleManager.startBundle(bundleContext.getBundle(bundleId).getSymbolicName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopService(String idOrName) throws Exception {
|
||||
long bundleId = entaxyObjectService.findObject(idOrName, SERVICE_RUNTIME_TYPE).getBundleInfo().getBundleId();
|
||||
bundleManager.stopBundle(bundleContext.getBundle(bundleId).getSymbolicName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallService(String idOrName) throws Exception {
|
||||
long bundleId = entaxyObjectService.findObject(idOrName, SERVICE_RUNTIME_TYPE).getBundleInfo().getBundleId();
|
||||
Bundle bundle = bundleContext.getBundle(bundleId);
|
||||
bundleManager.uninstallBundleByName(bundle.getSymbolicName(), "service", bundle.getVersion().toString());
|
||||
// todo remove all connected resources
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.service.impl.tracker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleEvent;
|
||||
import org.osgi.framework.wiring.BundleCapability;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.ExtendedBundleTrackerCustomizer;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleCapabilityFilter;
|
||||
|
||||
public class DeployedServiceCustomizer extends ExtendedBundleTrackerCustomizer<List<ManagedService>> {
|
||||
|
||||
@Override
|
||||
protected List<ManagedService> createManagedObject(Bundle bundle, BundleEvent event,
|
||||
Map<String, List<?>> filterResults) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<BundleCapability> capabilities = (List<BundleCapability>)filterResults.get(BundleCapabilityFilter.DEFAULT_FILTER_ID);
|
||||
if (capabilities==null)
|
||||
capabilities = new ArrayList<>();
|
||||
List<ManagedService> result = new ArrayList<>();
|
||||
for (BundleCapability capability: capabilities) {
|
||||
Object val = capability.getAttributes().get("name");
|
||||
String name = val==null?"":val.toString();
|
||||
if (!CommonUtils.isValid(name))
|
||||
continue;
|
||||
|
||||
ManagedService mp = (new ManagedService())
|
||||
.name(name);
|
||||
enrich(bundle, event, filterResults, mp);
|
||||
result.add(mp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.service.impl.tracker;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareManagedObjectImpl;
|
||||
|
||||
public class ManagedService extends BundleAwareManagedObjectImpl {
|
||||
|
||||
protected String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ManagedService name(String name) {
|
||||
setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* profile-management
|
||||
* ==========
|
||||
* 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.esb.platform.core.management.service.impl.tracker;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.base.management.core.utils.ManagedObjectsListener;
|
||||
import ru.entaxy.esb.platform.core.management.service.ServiceMBean;
|
||||
import ru.entaxy.esb.platform.core.management.service.impl.ServiceMBeanImpl;
|
||||
|
||||
public class ManagedServiceListener extends ManagedObjectsListener<List<ManagedService>
|
||||
, ManagedService, ServiceMBean, ServiceMBeanImpl> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ManagedServiceListener.class);
|
||||
|
||||
// protected Helpers helpers;
|
||||
|
||||
public ManagedServiceListener(BundleContext bundleContext) {
|
||||
super(bundleContext, ServiceMBean.class);
|
||||
// this.helpers = helpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterator<ManagedService> getIterator(List<ManagedService> managedObject) {
|
||||
return managedObject.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getKeyValue(ManagedService object) {
|
||||
return object.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ServiceMBeanImpl createService(ManagedService managedObject) {
|
||||
try {
|
||||
return new ServiceMBeanImpl(bundleContext, managedObject);
|
||||
} catch (Exception e) {
|
||||
log.error("Error creating service", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getJmxObjectName(ManagedService managedObject) {
|
||||
return ServiceMBean.Helper.getQualifier(managedObject.getName()).getValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user