ENTAXY-634 release version 1.9.0
This commit is contained in:
175
platform/runtime/core/object-runtime/LICENSE.txt
Normal file
175
platform/runtime/core/object-runtime/LICENSE.txt
Normal file
@ -0,0 +1,175 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения ENTAXY, принадлежащего
|
||||
Правообладателю – Обществу с ограниченной ответственностью "ЕМДЕВ" (ОГРН 1057810026658, ИНН
|
||||
7813313860, юридический адрес: 197022, Россия, г. Санкт-Петербург, ул. Профессора Попова,
|
||||
д. 23, литера В, помещение 3Н), расположенной в сети Интернет по адресу
|
||||
https://www.emdev.ru/about (далее - Компания).
|
||||
|
||||
Используя или получая доступ к Программному обеспечению, или нажав «Я согласен с Условиями»
|
||||
(или аналогичную кнопку или флажок) после загрузки или установки Программного обеспечения,
|
||||
Пользователь выражает свое согласие на обязательность условий и ограничений, изложенных в
|
||||
настоящем документе, в противном случае, он должен не использовать или не получать доступ
|
||||
к Программному обеспечению.
|
||||
|
||||
1. ТЕРМИНЫ И ОПРЕДЕЛЕНИЯ
|
||||
|
||||
a) ПО – Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) в любой ее версии
|
||||
или редакции, исключительные права на которую принадлежат Правообладателю.
|
||||
b) Правообладатель (Компания) – ООО «ЕМДЕВ», ОГРН 1057810026658, ИНН 7813313860, исключительные
|
||||
права которого подтверждаются Свидетельством о государственной регистрации в Реестре программ
|
||||
для ЭВМ № 2021610848 от 19.01.2021 года.
|
||||
c) Пользователь – юридическое или физическое лицо, получившее через скачивание с сайта
|
||||
https://entaxy.ru или иным образом, дистрибутив ПО, пользующееся ПО.
|
||||
d) ИС – интеллектуальная собственность – закреплённое законом исключительное право, а также
|
||||
личные неимущественные права авторов произведений на результат интеллектуальной деятельности.
|
||||
e) Подписка – это коммерческое предложение Правообладателя, состоящее из Лицензии на использование
|
||||
ПО и доступа к технической поддержке программного обеспечения на срок Подписки. Подписка
|
||||
включает предоставление Пользователю неисключительного права использования ПО, в том числе
|
||||
получение обновлений функционала ПО и безопасности ПО, исправление ошибок ПО и получение
|
||||
патчей с обновлениями и исправлениями программного обеспечения. Подписка приобретается
|
||||
Пользователем на период времени, указанный в Сертификате. Количество подписок устанавливается
|
||||
для каждого Пользователя индивидуально в Сертификате.
|
||||
f) Сертификат – документ, выдаваемый Дистрибъютором или Авторизованным партнёром (Партнёром),
|
||||
подтверждающий факт приобретения физическим или юридическим лицом Подписки на программное
|
||||
обеспечение в ограниченном объёме и на определённый период времени.
|
||||
g) Лицензия (простая (неисключительная) – совокупность ограниченных прав использования ПО,
|
||||
предоставленных Пользователю согласно условиям Подписки.
|
||||
h) Библиотека – совокупность подпрограмм и объектов, используемых для разработки программного
|
||||
обеспечения.
|
||||
i) Исходный код – текст компьютерной программы на каком-либо языке программирования, состоящий
|
||||
из одного или нескольких файлов, который может быть прочтён человеком.
|
||||
j) Объектный код – файл (часть машинного кода) с промежуточным представлением отдельного модуля
|
||||
программы, полученный в результате обработки исходного кода, еще не связанный в полную программу.
|
||||
Это машинный код для одной конкретной библиотеки или модуля, который будет составлять готовый
|
||||
продукт.
|
||||
k) Некоммерческое использование – индивидуальное личное использование Пользователем программного
|
||||
обеспечения с целью обучения работе с Программным обеспечением, для оценки или демонстрации
|
||||
возможностей Программного обеспечения, при котором, Пользователем не извлекается коммерческая
|
||||
выгода и/или не идёт в доход денежное вознаграждение при использовании Программного обеспечения.
|
||||
|
||||
2. ДОПУСТИМЫЕ СПОСОБЫ ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ
|
||||
|
||||
2.1. Правообладатель предоставляет Пользователю ограниченное право использования Программного
|
||||
обеспечения на условиях простой (неисключительной) лицензии в объёме, ограниченном правом
|
||||
воспроизведения полной рабочей версии программного обеспечения, новых версий программного обеспечения
|
||||
в памяти оборудования и его запуска на оборудовании в соответствии со ст. 1280 ГК РФ.
|
||||
2.2. Право на использование Программного обеспечения, предоставляемое Пользователю, носит
|
||||
неисключительный характер.
|
||||
2.3. Пользователю предоставляется всемирная, неисключительная, не подлежащая сублицензированию,
|
||||
лицензия на ограниченное использование Программного обеспечения.
|
||||
2.4. Пользователь, имеющий Базовую (некоммерческую) версию лицензии для пробного использования
|
||||
имеет право приобрести Подписку на программное обеспечение. В этом случае Пользователь обязан
|
||||
обратиться в службу поддержки Правообладателя по адресу: https://entaxy.ru/ для изменения
|
||||
вида лицензии с Базовой бесплатной версии на Подписки.
|
||||
2.5. Срок использования скачанной Пользователем базовой (некоммерческой) версии лицензии для
|
||||
пробного использования программного обеспечения – не ограничен.
|
||||
2.6. Использование Пользователем настоящего программного обеспечения в целях разработки,
|
||||
модификации, обновления другого ПО, принадлежащего третьим лицам, а не Правообладателю,
|
||||
без разрешения Правообладателя не допускается.
|
||||
|
||||
3. АВТОРСКОЕ ПРАВО.
|
||||
|
||||
3.1. Все авторские права, все права интеллектуальной собственности на Программное обеспечение
|
||||
и любые его копии принадлежат Правообладателю.
|
||||
3.2. Все авторские права, все права интеллектуальной собственности в отношении любого контента,
|
||||
к которому можно получить доступ с помощью Программного обеспечения, является собственностью
|
||||
соответствующего владельца контента и защищается применимым законодательством об авторском
|
||||
праве или другими законами и договорами об интеллектуальной собственности.
|
||||
3.3. Условия использования Программного обеспечения.
|
||||
Лицензия, предоставленная Пользователю, действительна только в том случае, если Пользователь
|
||||
придерживается следующих условий:
|
||||
3.3.1. Принятие уведомлений об авторских правах. Пользователю запрещается удалять или изменять
|
||||
какие-либо уведомления об авторских правах или лицензиях, которые появляются при использовании
|
||||
Программного обеспечения или на нем.
|
||||
3.3.2. Модификация. Пользователю запрещается модифицировать, изменять, декомпилировать,
|
||||
расшифровывать, дизассемблировать, переводить или реверсировать, перепроектировать
|
||||
Программное обеспечение.
|
||||
3.3.3. Распространение. Пользователю запрещается сублицензировать, передавать право использования
|
||||
ПО или иным образом распространять или предоставлять Программное обеспечение любой третьей стороне.
|
||||
3.3.4. SaaS. За исключением случаев, когда это разрешено Правообладателем, Пользователю запрещено
|
||||
использовать Программное обеспечение в коммерческих целях для оказания услуг третьим лицам.
|
||||
|
||||
4. ОТВЕТСТВЕННОСТЬ ПРАВООБЛАДАТЕЛЯ ПРИ НАРУШЕНИИ ПОЛЬЗОВАТЕЛЕМ ПРАВ «ИС»
|
||||
|
||||
4.1. Правообладатель не несет никаких обязательств в отношении каких-либо претензий к Пользователю
|
||||
на предмет нарушения последним прав Интеллектуальной собственности, возникших в связи с
|
||||
использованием Пользователем:
|
||||
4.1.1. Любых компонентов программного обеспечения с открытым исходным кодом, включенных в
|
||||
Программное обеспечение;
|
||||
4.1.2. Любого нарушения правил использования Программного обеспечения, установленного условиями
|
||||
настоящего соглашения;
|
||||
4.1.3. Любого использования Программного обеспечения в сочетании с другими ПО, оборудованием,
|
||||
или данными, не предоставленными Пользователю Правообладателем;
|
||||
4.1.4. Любого изменения Программного обеспечения любым третьим лицом, а не Правообладателем.
|
||||
|
||||
|
||||
5. НАСТОЯЩИМ ПРАВООБЛАДАТЕЛЬ ЗАЯВЛЯЕТ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ ПОЛЬЗОВАТЕЛЮ
|
||||
ПО ПРИНЦИПУ «AS IS» - «КАК ЕСТЬ». НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ НЕ ГАРАНТИРУЕТ
|
||||
И НЕ ОБЕЩАЕТ, ЧТО ПРЕДОСТАВЛЕННОЕ ИМ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ПОДХОДИТЬ ИЛИ НЕ ПОДХОДИТЬ
|
||||
ДЛЯ КОНКРЕТНЫХ ЦЕЛЕЙ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ОТВЕЧАТЬ ВСЕМ КОММЕРЧЕСКИМ
|
||||
И ЛИЧНЫМ СУБЪЕКТИВНЫМ ОЖИДАНИЯМ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ РАБОТАТЬ
|
||||
ИСПРАВНО, БЕЗ ТЕХНИЧЕСКИХ ОШИБОК, БЫСТРО И БЕСПЕРЕБОЙНО.
|
||||
|
||||
6. ОГРАНИЧЕНИЕ ОТВЕТСТВЕННОСТИ.
|
||||
НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ ИЛИ ЕГО АФФИЛЛИРОВАННЫЕ ЛИЦА НЕ НЕСУТ ПЕРЕД ПОЛЬЗОВАТЕЛЕМ
|
||||
ОТВЕТСТВЕННОСТИ ЗА ЛЮБЫЕ ПРЯМЫЕ ИЛИ КОСВЕННЫЕ УБЫТКИ ПОЛЬЗОВАТЕЛЯ, ЕГО РАСХОДЫ ИЛИ РЕАЛЬНЫЙ УЩЕРБ,
|
||||
ВКЛЮЧАЯ, ПОМИМО ПРОЧЕГО, ПРОСТОИ; УТРАТУ БИЗНЕСА; УПУЩЕННУЮ ВЫГОДУ; НЕДОПОЛУЧЕННУЮ ПРИБЫЛЬ;
|
||||
ПОТЕРЮ ИЛИ ПОВРЕЖДЕНИЕ ДАННЫХ, ИМУЩЕСТВА И ИНОЕ.
|
||||
ОГРАНИЧЕНИЯ ПРИМЕНЯЮТСЯ НЕЗАВИСИМО ОТ ОСНОВАНИЯ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ; В ТОМ ЧИСЛЕ ВСЛЕДСТВИЕ
|
||||
ДЕЙСТВИЯ ИЛИ БЕЗДЕЙСТВИЯ, НЕБРЕЖНОСТИ, УМЫСЛА, ПРЯМОГО ИЛИ КОСВЕННОГО; НЕОСТОРОЖНОСТИ; ЗАБЛУЖДЕНИЯ;
|
||||
КЛЕВЕТЫ; НАРУШЕНИЯ КОНФИДЕНЦИАЛЬНОСТИ ИЛИ ПРАВА ИНТЕЛЛЕКТУАЛЬНОЙ СОБСТВЕННОСТИ; ИЛИ ЛЮБОЕ ДРУГОЕ
|
||||
ОСНОВАНИЕ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ.
|
||||
|
||||
7. ОБЯЗАННОСТЬ ПОЛЬЗОВАТЕЛЯ:
|
||||
Не осуществлять самостоятельно и (или) с привлечением третьих лиц нижеследующие действия
|
||||
(включая, но не ограничиваясь) по:
|
||||
-дизассемблированию и (или) декомпилированию (преобразованию объектного кода в исходный код)
|
||||
Программного обеспечения;
|
||||
-модификации Программного обеспечения, в том числе вносить изменения в объектный код, исходный
|
||||
код Программного обеспечения, за исключением тех изменений, которые вносятся средствами,
|
||||
включёнными в Программное обеспечение и описанными непосредственно в документации к нему;
|
||||
-созданию условий для использования Программного обеспечения лицами, не имеющими прав на
|
||||
использование данного Программного обеспечения, включая (но не ограничиваясь) вмешательство
|
||||
третьих лиц в функционирование Программного обеспечения, предоставление третьим лицам доступа
|
||||
к исследованию и (или) замене настроек Программного обеспечения, включая его первичную установку;
|
||||
-распространению Программного обеспечения в целом или в части (включая приложенную к нему документацию).
|
||||
|
||||
8. БИБЛИОТЕКА ПО. ИСПОЛЬЗУЕМЫЕ ПРОГРАММНЫЕ СРЕДСТВА.
|
||||
|
||||
8.1. Настоящим, Правообладатель заверяет, что Библиотека программного обеспечения состоит из
|
||||
лицензионных продуктов, используемых на законных основаниях, а
|
||||
именно https://entaxy.ru/libs/licenses/root-aggregated.deps.
|
||||
8.2. Любые программные средства, применяемые Пользователем при работе с ПО, должны быть
|
||||
совместимы с библиотекой ПО, указанной в п.8.1. настоящего соглашения.
|
||||
8.3. Перечень внешних модулей ПО, указанный в п.8.1 настоящего соглашения, может изменяться
|
||||
Правообладателем в одностороннем порядке, в зависимости от выпуска релизов программного обеспечения,
|
||||
содержащих все изменения и дополнения программного обеспечения.
|
||||
|
||||
9. ВНЕСЕНИЕ ИЗМЕНЕНИЙ В ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ.
|
||||
|
||||
9.1. Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) является свободно распространяемым
|
||||
программным обеспечением.
|
||||
9.2. Пользователь имеет право вносить изменения в исходный код программного обеспечения исключительно
|
||||
с согласия Правообладателя в порядке предложения изменений/правок/дополнений через механизм
|
||||
«Pull Requests» в открытом репозитории Правообладателя по адресу: https://git.entaxy.ru/entaxy/entaxy-public.
|
||||
9.3. Любые изменения программного обеспечения, осуществляемые Пользователем без соблюдения условий
|
||||
пункта 9.2. настоящего документа, являются нарушением авторских и смежных прав Правообладателя,
|
||||
прав интеллектуальной собственности Правообладателя и влекут применение к Пользователю мер
|
||||
ответственности в соответствии с условиями настоящей Лицензии, а также применимого законодательства
|
||||
Российской Федерации.
|
||||
|
||||
10. ЗАКЛЮЧИТЕЛЬНЫЕ ПОЛОЖЕНИЯ.
|
||||
|
||||
10.1. В случае нарушения Пользователем любого из условий настоящей Лицензии, Правообладатель имеет
|
||||
право взыскать с Пользователя любые причинённые таким нарушением убытки, реальный ущерб,
|
||||
недополученную прибыль, упущенную выгоду, а также в случае нарушения Пользователем условий
|
||||
пункта 9.2 настоящего соглашения, в том числе, взыскать с Пользователя штраф в размере
|
||||
2 000 000 (Два миллиона) рублей за каждый установленный случай несанкционированного изменения
|
||||
исходного или объектного кода Программного обеспечения «Энтакси» (Entaxy).
|
||||
10.2. В рамках исполнения Пользователем обязательств по настоящей Лицензии, применимое
|
||||
законодательство – Российской Федерации.
|
||||
10.3. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -0,0 +1,175 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения ENTAXY, принадлежащего
|
||||
Правообладателю – Обществу с ограниченной ответственностью "ЕМДЕВ" (ОГРН 1057810026658, ИНН
|
||||
7813313860, юридический адрес: 197022, Россия, г. Санкт-Петербург, ул. Профессора Попова,
|
||||
д. 23, литера В, помещение 3Н), расположенной в сети Интернет по адресу
|
||||
https://www.emdev.ru/about (далее - Компания).
|
||||
|
||||
Используя или получая доступ к Программному обеспечению, или нажав «Я согласен с Условиями»
|
||||
(или аналогичную кнопку или флажок) после загрузки или установки Программного обеспечения,
|
||||
Пользователь выражает свое согласие на обязательность условий и ограничений, изложенных в
|
||||
настоящем документе, в противном случае, он должен не использовать или не получать доступ
|
||||
к Программному обеспечению.
|
||||
|
||||
1. ТЕРМИНЫ И ОПРЕДЕЛЕНИЯ
|
||||
|
||||
a) ПО – Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) в любой ее версии
|
||||
или редакции, исключительные права на которую принадлежат Правообладателю.
|
||||
b) Правообладатель (Компания) – ООО «ЕМДЕВ», ОГРН 1057810026658, ИНН 7813313860, исключительные
|
||||
права которого подтверждаются Свидетельством о государственной регистрации в Реестре программ
|
||||
для ЭВМ № 2021610848 от 19.01.2021 года.
|
||||
c) Пользователь – юридическое или физическое лицо, получившее через скачивание с сайта
|
||||
https://entaxy.ru или иным образом, дистрибутив ПО, пользующееся ПО.
|
||||
d) ИС – интеллектуальная собственность – закреплённое законом исключительное право, а также
|
||||
личные неимущественные права авторов произведений на результат интеллектуальной деятельности.
|
||||
e) Подписка – это коммерческое предложение Правообладателя, состоящее из Лицензии на использование
|
||||
ПО и доступа к технической поддержке программного обеспечения на срок Подписки. Подписка
|
||||
включает предоставление Пользователю неисключительного права использования ПО, в том числе
|
||||
получение обновлений функционала ПО и безопасности ПО, исправление ошибок ПО и получение
|
||||
патчей с обновлениями и исправлениями программного обеспечения. Подписка приобретается
|
||||
Пользователем на период времени, указанный в Сертификате. Количество подписок устанавливается
|
||||
для каждого Пользователя индивидуально в Сертификате.
|
||||
f) Сертификат – документ, выдаваемый Дистрибъютором или Авторизованным партнёром (Партнёром),
|
||||
подтверждающий факт приобретения физическим или юридическим лицом Подписки на программное
|
||||
обеспечение в ограниченном объёме и на определённый период времени.
|
||||
g) Лицензия (простая (неисключительная) – совокупность ограниченных прав использования ПО,
|
||||
предоставленных Пользователю согласно условиям Подписки.
|
||||
h) Библиотека – совокупность подпрограмм и объектов, используемых для разработки программного
|
||||
обеспечения.
|
||||
i) Исходный код – текст компьютерной программы на каком-либо языке программирования, состоящий
|
||||
из одного или нескольких файлов, который может быть прочтён человеком.
|
||||
j) Объектный код – файл (часть машинного кода) с промежуточным представлением отдельного модуля
|
||||
программы, полученный в результате обработки исходного кода, еще не связанный в полную программу.
|
||||
Это машинный код для одной конкретной библиотеки или модуля, который будет составлять готовый
|
||||
продукт.
|
||||
k) Некоммерческое использование – индивидуальное личное использование Пользователем программного
|
||||
обеспечения с целью обучения работе с Программным обеспечением, для оценки или демонстрации
|
||||
возможностей Программного обеспечения, при котором, Пользователем не извлекается коммерческая
|
||||
выгода и/или не идёт в доход денежное вознаграждение при использовании Программного обеспечения.
|
||||
|
||||
2. ДОПУСТИМЫЕ СПОСОБЫ ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ
|
||||
|
||||
2.1. Правообладатель предоставляет Пользователю ограниченное право использования Программного
|
||||
обеспечения на условиях простой (неисключительной) лицензии в объёме, ограниченном правом
|
||||
воспроизведения полной рабочей версии программного обеспечения, новых версий программного обеспечения
|
||||
в памяти оборудования и его запуска на оборудовании в соответствии со ст. 1280 ГК РФ.
|
||||
2.2. Право на использование Программного обеспечения, предоставляемое Пользователю, носит
|
||||
неисключительный характер.
|
||||
2.3. Пользователю предоставляется всемирная, неисключительная, не подлежащая сублицензированию,
|
||||
лицензия на ограниченное использование Программного обеспечения.
|
||||
2.4. Пользователь, имеющий Базовую (некоммерческую) версию лицензии для пробного использования
|
||||
имеет право приобрести Подписку на программное обеспечение. В этом случае Пользователь обязан
|
||||
обратиться в службу поддержки Правообладателя по адресу: https://entaxy.ru/ для изменения
|
||||
вида лицензии с Базовой бесплатной версии на Подписки.
|
||||
2.5. Срок использования скачанной Пользователем базовой (некоммерческой) версии лицензии для
|
||||
пробного использования программного обеспечения – не ограничен.
|
||||
2.6. Использование Пользователем настоящего программного обеспечения в целях разработки,
|
||||
модификации, обновления другого ПО, принадлежащего третьим лицам, а не Правообладателю,
|
||||
без разрешения Правообладателя не допускается.
|
||||
|
||||
3. АВТОРСКОЕ ПРАВО.
|
||||
|
||||
3.1. Все авторские права, все права интеллектуальной собственности на Программное обеспечение
|
||||
и любые его копии принадлежат Правообладателю.
|
||||
3.2. Все авторские права, все права интеллектуальной собственности в отношении любого контента,
|
||||
к которому можно получить доступ с помощью Программного обеспечения, является собственностью
|
||||
соответствующего владельца контента и защищается применимым законодательством об авторском
|
||||
праве или другими законами и договорами об интеллектуальной собственности.
|
||||
3.3. Условия использования Программного обеспечения.
|
||||
Лицензия, предоставленная Пользователю, действительна только в том случае, если Пользователь
|
||||
придерживается следующих условий:
|
||||
3.3.1. Принятие уведомлений об авторских правах. Пользователю запрещается удалять или изменять
|
||||
какие-либо уведомления об авторских правах или лицензиях, которые появляются при использовании
|
||||
Программного обеспечения или на нем.
|
||||
3.3.2. Модификация. Пользователю запрещается модифицировать, изменять, декомпилировать,
|
||||
расшифровывать, дизассемблировать, переводить или реверсировать, перепроектировать
|
||||
Программное обеспечение.
|
||||
3.3.3. Распространение. Пользователю запрещается сублицензировать, передавать право использования
|
||||
ПО или иным образом распространять или предоставлять Программное обеспечение любой третьей стороне.
|
||||
3.3.4. SaaS. За исключением случаев, когда это разрешено Правообладателем, Пользователю запрещено
|
||||
использовать Программное обеспечение в коммерческих целях для оказания услуг третьим лицам.
|
||||
|
||||
4. ОТВЕТСТВЕННОСТЬ ПРАВООБЛАДАТЕЛЯ ПРИ НАРУШЕНИИ ПОЛЬЗОВАТЕЛЕМ ПРАВ «ИС»
|
||||
|
||||
4.1. Правообладатель не несет никаких обязательств в отношении каких-либо претензий к Пользователю
|
||||
на предмет нарушения последним прав Интеллектуальной собственности, возникших в связи с
|
||||
использованием Пользователем:
|
||||
4.1.1. Любых компонентов программного обеспечения с открытым исходным кодом, включенных в
|
||||
Программное обеспечение;
|
||||
4.1.2. Любого нарушения правил использования Программного обеспечения, установленного условиями
|
||||
настоящего соглашения;
|
||||
4.1.3. Любого использования Программного обеспечения в сочетании с другими ПО, оборудованием,
|
||||
или данными, не предоставленными Пользователю Правообладателем;
|
||||
4.1.4. Любого изменения Программного обеспечения любым третьим лицом, а не Правообладателем.
|
||||
|
||||
|
||||
5. НАСТОЯЩИМ ПРАВООБЛАДАТЕЛЬ ЗАЯВЛЯЕТ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ ПОЛЬЗОВАТЕЛЮ
|
||||
ПО ПРИНЦИПУ «AS IS» - «КАК ЕСТЬ». НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ НЕ ГАРАНТИРУЕТ
|
||||
И НЕ ОБЕЩАЕТ, ЧТО ПРЕДОСТАВЛЕННОЕ ИМ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ПОДХОДИТЬ ИЛИ НЕ ПОДХОДИТЬ
|
||||
ДЛЯ КОНКРЕТНЫХ ЦЕЛЕЙ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ОТВЕЧАТЬ ВСЕМ КОММЕРЧЕСКИМ
|
||||
И ЛИЧНЫМ СУБЪЕКТИВНЫМ ОЖИДАНИЯМ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ РАБОТАТЬ
|
||||
ИСПРАВНО, БЕЗ ТЕХНИЧЕСКИХ ОШИБОК, БЫСТРО И БЕСПЕРЕБОЙНО.
|
||||
|
||||
6. ОГРАНИЧЕНИЕ ОТВЕТСТВЕННОСТИ.
|
||||
НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ ИЛИ ЕГО АФФИЛЛИРОВАННЫЕ ЛИЦА НЕ НЕСУТ ПЕРЕД ПОЛЬЗОВАТЕЛЕМ
|
||||
ОТВЕТСТВЕННОСТИ ЗА ЛЮБЫЕ ПРЯМЫЕ ИЛИ КОСВЕННЫЕ УБЫТКИ ПОЛЬЗОВАТЕЛЯ, ЕГО РАСХОДЫ ИЛИ РЕАЛЬНЫЙ УЩЕРБ,
|
||||
ВКЛЮЧАЯ, ПОМИМО ПРОЧЕГО, ПРОСТОИ; УТРАТУ БИЗНЕСА; УПУЩЕННУЮ ВЫГОДУ; НЕДОПОЛУЧЕННУЮ ПРИБЫЛЬ;
|
||||
ПОТЕРЮ ИЛИ ПОВРЕЖДЕНИЕ ДАННЫХ, ИМУЩЕСТВА И ИНОЕ.
|
||||
ОГРАНИЧЕНИЯ ПРИМЕНЯЮТСЯ НЕЗАВИСИМО ОТ ОСНОВАНИЯ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ; В ТОМ ЧИСЛЕ ВСЛЕДСТВИЕ
|
||||
ДЕЙСТВИЯ ИЛИ БЕЗДЕЙСТВИЯ, НЕБРЕЖНОСТИ, УМЫСЛА, ПРЯМОГО ИЛИ КОСВЕННОГО; НЕОСТОРОЖНОСТИ; ЗАБЛУЖДЕНИЯ;
|
||||
КЛЕВЕТЫ; НАРУШЕНИЯ КОНФИДЕНЦИАЛЬНОСТИ ИЛИ ПРАВА ИНТЕЛЛЕКТУАЛЬНОЙ СОБСТВЕННОСТИ; ИЛИ ЛЮБОЕ ДРУГОЕ
|
||||
ОСНОВАНИЕ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ.
|
||||
|
||||
7. ОБЯЗАННОСТЬ ПОЛЬЗОВАТЕЛЯ:
|
||||
Не осуществлять самостоятельно и (или) с привлечением третьих лиц нижеследующие действия
|
||||
(включая, но не ограничиваясь) по:
|
||||
-дизассемблированию и (или) декомпилированию (преобразованию объектного кода в исходный код)
|
||||
Программного обеспечения;
|
||||
-модификации Программного обеспечения, в том числе вносить изменения в объектный код, исходный
|
||||
код Программного обеспечения, за исключением тех изменений, которые вносятся средствами,
|
||||
включёнными в Программное обеспечение и описанными непосредственно в документации к нему;
|
||||
-созданию условий для использования Программного обеспечения лицами, не имеющими прав на
|
||||
использование данного Программного обеспечения, включая (но не ограничиваясь) вмешательство
|
||||
третьих лиц в функционирование Программного обеспечения, предоставление третьим лицам доступа
|
||||
к исследованию и (или) замене настроек Программного обеспечения, включая его первичную установку;
|
||||
-распространению Программного обеспечения в целом или в части (включая приложенную к нему документацию).
|
||||
|
||||
8. БИБЛИОТЕКА ПО. ИСПОЛЬЗУЕМЫЕ ПРОГРАММНЫЕ СРЕДСТВА.
|
||||
|
||||
8.1. Настоящим, Правообладатель заверяет, что Библиотека программного обеспечения состоит из
|
||||
лицензионных продуктов, используемых на законных основаниях, а
|
||||
именно https://entaxy.ru/libs/licenses/root-aggregated.deps.
|
||||
8.2. Любые программные средства, применяемые Пользователем при работе с ПО, должны быть
|
||||
совместимы с библиотекой ПО, указанной в п.8.1. настоящего соглашения.
|
||||
8.3. Перечень внешних модулей ПО, указанный в п.8.1 настоящего соглашения, может изменяться
|
||||
Правообладателем в одностороннем порядке, в зависимости от выпуска релизов программного обеспечения,
|
||||
содержащих все изменения и дополнения программного обеспечения.
|
||||
|
||||
9. ВНЕСЕНИЕ ИЗМЕНЕНИЙ В ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ.
|
||||
|
||||
9.1. Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) является свободно распространяемым
|
||||
программным обеспечением.
|
||||
9.2. Пользователь имеет право вносить изменения в исходный код программного обеспечения исключительно
|
||||
с согласия Правообладателя в порядке предложения изменений/правок/дополнений через механизм
|
||||
«Pull Requests» в открытом репозитории Правообладателя по адресу: https://git.entaxy.ru/entaxy/entaxy-public.
|
||||
9.3. Любые изменения программного обеспечения, осуществляемые Пользователем без соблюдения условий
|
||||
пункта 9.2. настоящего документа, являются нарушением авторских и смежных прав Правообладателя,
|
||||
прав интеллектуальной собственности Правообладателя и влекут применение к Пользователю мер
|
||||
ответственности в соответствии с условиями настоящей Лицензии, а также применимого законодательства
|
||||
Российской Федерации.
|
||||
|
||||
10. ЗАКЛЮЧИТЕЛЬНЫЕ ПОЛОЖЕНИЯ.
|
||||
|
||||
10.1. В случае нарушения Пользователем любого из условий настоящей Лицензии, Правообладатель имеет
|
||||
право взыскать с Пользователя любые причинённые таким нарушением убытки, реальный ущерб,
|
||||
недополученную прибыль, упущенную выгоду, а также в случае нарушения Пользователем условий
|
||||
пункта 9.2 настоящего соглашения, в том числе, взыскать с Пользователя штраф в размере
|
||||
2 000 000 (Два миллиона) рублей за каждый установленный случай несанкционированного изменения
|
||||
исходного или объектного кода Программного обеспечения «Энтакси» (Entaxy).
|
||||
10.2. В рамках исполнения Пользователем обязательств по настоящей Лицензии, применимое
|
||||
законодательство – Российской Федерации.
|
||||
10.3. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -0,0 +1,45 @@
|
||||
<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>object-runtime</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</parent>
|
||||
<artifactId>object-runtime-core</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECT RUNTIME CORE</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECT RUNTIME CORE</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.platform.objects.runtime,
|
||||
ru.entaxy.platform.objects.runtime.healthcheck,
|
||||
ru.entaxy.platform.objects.runtime.impl,
|
||||
ru.entaxy.platform.objects.runtime.impl.manager
|
||||
</bundle.osgi.export.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.karaf.bundle</groupId>
|
||||
<artifactId>org.apache.karaf.bundle.core</artifactId>
|
||||
<version>${karaf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>artifact-management</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>org.apache.felix.healthcheck.api</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>org.apache.felix.healthcheck.annotation</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,60 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
|
||||
public interface EntaxyRuntimeObject extends EntaxyObject {
|
||||
|
||||
public enum ENTAXY_RUNTIME_OBJECT_STATE {
|
||||
ACTIVE,
|
||||
INACTIVE,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
public interface CAPABILITIES_RUNTIME extends CAPABILITIES {
|
||||
String ATTR_RESOURCES = "resources";
|
||||
}
|
||||
|
||||
boolean isColocatedWith(EntaxyRuntimeObject object);
|
||||
|
||||
List<EntaxyRuntimeRelation> getRelations(EntaxyObject.OBJECT_RELATION relationType);
|
||||
List<EntaxyRuntimeRelation> getSubordRelations();
|
||||
List<EntaxyRuntimeRelation> getIncomiingRelations(EntaxyObject.OBJECT_RELATION relationType);
|
||||
List<EntaxyRuntimeRelation> getIncomiingSubordRelations();
|
||||
|
||||
List<EntaxyRuntimeRelation> getDependsOn();
|
||||
List<EntaxyRuntimeRelation> getDependents();
|
||||
|
||||
EntaxyRuntimeObjectContainer getContainer();
|
||||
|
||||
List<EntaxyRuntimeObject> getColocatedObjects();
|
||||
|
||||
List<EntaxyRuntimeObjectResource> getResources();
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EntaxyRuntimeObjectContainer {
|
||||
|
||||
public enum ENTAXY_RUNTIME_OBJECT_CONTAINER_STATE {
|
||||
Installed,
|
||||
Resolved,
|
||||
Unknown,
|
||||
GracePeriod,
|
||||
Waiting,
|
||||
Starting,
|
||||
Active,
|
||||
Stopping,
|
||||
Failure,
|
||||
}
|
||||
|
||||
String getId();
|
||||
String getName();
|
||||
|
||||
default String getType() {
|
||||
return "bundle";
|
||||
}
|
||||
|
||||
ENTAXY_RUNTIME_OBJECT_CONTAINER_STATE getState();
|
||||
|
||||
List<EntaxyRuntimeObject> getObjects();
|
||||
|
||||
List<EntaxyRuntimeObjectContainer> getParentContainers();
|
||||
List<EntaxyRuntimeObjectContainer> getChildContainers();
|
||||
|
||||
List<EntaxyRuntimeObjectContainer> getDependencies();
|
||||
List<EntaxyRuntimeObjectContainer> getDependent();
|
||||
|
||||
List<EntaxyRuntimeObjectContainer> getRelatedContainers();
|
||||
List<EntaxyRuntimeObjectContainer> getIncomingRelatedContainers();
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface EntaxyRuntimeObjectManager {
|
||||
|
||||
public enum ENTAXY_RUNTIME_OBJECT_OPERATION {
|
||||
START,
|
||||
STOP,
|
||||
UNINSTALL
|
||||
}
|
||||
|
||||
public enum ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT {
|
||||
DONE,
|
||||
FAILED,
|
||||
BLOCKED,
|
||||
REQUEST
|
||||
}
|
||||
|
||||
public interface OperationConfig {
|
||||
String getObjectFullId();
|
||||
boolean isForced();
|
||||
boolean isSoft();
|
||||
Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> getAffected();
|
||||
}
|
||||
|
||||
public interface OperationResult {
|
||||
ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT getResult();
|
||||
Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> getAffected();
|
||||
String getMessage();
|
||||
}
|
||||
|
||||
OperationResult execute(ENTAXY_RUNTIME_OBJECT_OPERATION operation, OperationConfig config);
|
||||
|
||||
OperationResult start(String objectFullId);
|
||||
OperationResult startForced(String objectFullId);
|
||||
OperationResult startSoft(String objectFullId);
|
||||
|
||||
OperationResult start(OperationConfig config);
|
||||
|
||||
OperationResult stop(String objectFullId);
|
||||
OperationResult stopForced(String objectFullId);
|
||||
OperationResult stopSoft(String objectFullId);
|
||||
|
||||
OperationResult stop(OperationConfig config);
|
||||
|
||||
OperationResult uninstall(String objectFullId);
|
||||
OperationResult uninstallForced(String objectFullId);
|
||||
OperationResult uninstallSoft(String objectFullId);
|
||||
|
||||
OperationResult uninstall(OperationConfig config);
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime;
|
||||
|
||||
import ru.entaxy.esb.resources.EntaxyResource;
|
||||
import ru.entaxy.esb.resources.EntaxyResource.RESOURCE_SCOPE;
|
||||
|
||||
public interface EntaxyRuntimeObjectResource {
|
||||
|
||||
RESOURCE_SCOPE getScope();
|
||||
EntaxyResource getResource();
|
||||
|
||||
String getResourceUrl();
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject.ENTAXY_RUNTIME_OBJECT_STATE;
|
||||
|
||||
public interface EntaxyRuntimeObjectService {
|
||||
|
||||
EntaxyRuntimeObject getRuntimeObject(EntaxyObject origin);
|
||||
EntaxyRuntimeObject getRuntimeObject(String runtimeObjectId);
|
||||
|
||||
EntaxyRuntimeObjectContainer getContainer(String containerName);
|
||||
|
||||
List<EntaxyRuntimeObject> getObjects();
|
||||
List<EntaxyRuntimeObject> getObjectsForContainer(EntaxyRuntimeObjectContainer container);
|
||||
|
||||
List<EntaxyRuntimeObjectContainer> getContainers();
|
||||
|
||||
EntaxyRuntimeObjectContainer getContainerForObject(EntaxyRuntimeObject runtimeObject);
|
||||
EntaxyRuntimeObjectContainer getContainerForObject(String runtimeObjectId);
|
||||
|
||||
ENTAXY_RUNTIME_OBJECT_STATE getObjectState(String runtimeObjectId);
|
||||
ENTAXY_RUNTIME_OBJECT_STATE getObjectState(EntaxyRuntimeObject runtimeObject);
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.RelationDescriptor;
|
||||
|
||||
public interface EntaxyRuntimeRelation extends RelationDescriptor {
|
||||
|
||||
EntaxyRuntimeObject getSource();
|
||||
EntaxyRuntimeObject getTarget();
|
||||
|
||||
default EntaxyRuntimeObject getMain() {
|
||||
switch (getType()) {
|
||||
case AGGREGATION:
|
||||
case COMPOSITION:
|
||||
return getSource();
|
||||
case DEPENDENCY:
|
||||
case USE:
|
||||
return getTarget();
|
||||
default:
|
||||
return getSource();
|
||||
}
|
||||
};
|
||||
|
||||
default EntaxyRuntimeObject getDependent() {
|
||||
if (getMain().equals(getSource()))
|
||||
return getTarget();
|
||||
return getSource();
|
||||
};
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.healthcheck;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.felix.hc.annotation.HealthCheckMBean;
|
||||
import org.apache.felix.hc.annotation.HealthCheckService;
|
||||
import org.apache.felix.hc.api.HealthCheck;
|
||||
import org.apache.felix.hc.api.Result;
|
||||
import org.apache.felix.hc.api.Result.Status;
|
||||
import org.apache.felix.hc.api.ResultLog;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectService;
|
||||
|
||||
@Component
|
||||
@HealthCheckService(name = "Ghost Objects HealthCheck", tags = {"runtime", "objects"})
|
||||
@HealthCheckMBean(name = "Entaxy.Objects.Ghosts")
|
||||
public class GhostObjectsHealthCheck implements HealthCheck {
|
||||
|
||||
@Reference
|
||||
EntaxyRuntimeObjectService objectService;
|
||||
|
||||
@Override
|
||||
public Result execute() {
|
||||
List<EntaxyRuntimeObject> ghosts = objectService.getObjects().stream()
|
||||
.filter(obj -> obj.isGhost())
|
||||
.collect(Collectors.toList());
|
||||
if (ghosts.isEmpty()) {
|
||||
return new Result(Status.OK, "");
|
||||
}
|
||||
ResultLog resultLog = new ResultLog();
|
||||
for (EntaxyRuntimeObject obj: ghosts)
|
||||
resultLog.add(new ResultLog.Entry(Status.WARN, obj.getObjectFullId()));
|
||||
Result result = new Result(resultLog);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl;
|
||||
|
||||
import org.apache.karaf.bundle.core.BundleService;
|
||||
import org.apache.karaf.bundle.core.BundleState;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
|
||||
public class EntaxyRuntimeObjectContainerBundle extends EntaxyRuntimeObjectContainerImpl {
|
||||
|
||||
@Override
|
||||
public ENTAXY_RUNTIME_OBJECT_CONTAINER_STATE getState() {
|
||||
try {
|
||||
|
||||
long bundleId = Long.parseLong(getId());
|
||||
Bundle bundle = FrameworkUtil.getBundle(getClass()).getBundleContext().getBundle(bundleId);
|
||||
BundleService bundleService = EntaxyRuntimeObjectServiceImpl.getInstance().getBundleService();
|
||||
BundleState state = bundleService.getInfo(bundle).getState();
|
||||
return ENTAXY_RUNTIME_OBJECT_CONTAINER_STATE.valueOf(state.name());
|
||||
|
||||
} catch (Exception e) {
|
||||
return ENTAXY_RUNTIME_OBJECT_CONTAINER_STATE.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,189 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
|
||||
public abstract class EntaxyRuntimeObjectContainerImpl implements EntaxyRuntimeObjectContainer {
|
||||
|
||||
String id;
|
||||
String name;
|
||||
|
||||
Map<String, EntaxyRuntimeObjectImpl> objects = new HashMap<>();
|
||||
|
||||
List<EntaxyRuntimeObject> objectsCache = new ArrayList<>();
|
||||
|
||||
public void bundle(Bundle bundle) {
|
||||
setId(bundle.getBundleId() + "");
|
||||
setName(bundle.getSymbolicName());
|
||||
}
|
||||
|
||||
public void bundle(long bundleId) {
|
||||
if (bundleId > 0) {
|
||||
Bundle b = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle(bundleId);
|
||||
if (b != null)
|
||||
bundle(b);
|
||||
}
|
||||
}
|
||||
|
||||
public void add(EntaxyRuntimeObjectImpl object) {
|
||||
objects.put(object.getObjectFullId(), object);
|
||||
object.setContainerImpl(this);
|
||||
objectsCache.add((EntaxyRuntimeObject)object);
|
||||
}
|
||||
|
||||
public void remove(EntaxyRuntimeObjectImpl object) {
|
||||
objects.remove(object.getObjectFullId());
|
||||
object.setContainerImpl(null);
|
||||
objectsCache.remove((EntaxyRuntimeObject)object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObject> getObjects() {
|
||||
return objectsCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObjectContainer> getParentContainers() {
|
||||
final Set<EntaxyRuntimeObjectContainer> containers = new HashSet<>();
|
||||
for (EntaxyRuntimeObjectImpl roi: this.objects.values()) {
|
||||
roi.getIncomingRelations().stream()
|
||||
.filter(r -> r.isSubordinating())
|
||||
.map(r -> r.getSource())
|
||||
.map(obj -> EntaxyRuntimeObjectServiceImpl.getInstance().getContainerForObject(obj.getObjectFullId()))
|
||||
.filter(cont -> (cont != null))
|
||||
.filter(cnt -> !this.id.equals(cnt.getId()))
|
||||
.forEach(cont -> containers.add(cont));
|
||||
}
|
||||
return new ArrayList<>(containers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObjectContainer> getChildContainers() {
|
||||
final Set<EntaxyRuntimeObjectContainer> containers = new HashSet<>();
|
||||
for (EntaxyRuntimeObjectImpl roi: this.objects.values()) {
|
||||
roi.getRelations().stream()
|
||||
.filter(r -> r.isSubordinating())
|
||||
.map(r -> r.getTarget())
|
||||
.map(obj -> EntaxyRuntimeObjectServiceImpl.getInstance().getContainerForObject(obj.getObjectFullId()))
|
||||
.filter(cont -> (cont != null))
|
||||
.filter(cnt -> !this.id.equals(cnt.getId()))
|
||||
.forEach(cont -> containers.add(cont));
|
||||
}
|
||||
return new ArrayList<>(containers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObjectContainer> getDependencies() {
|
||||
final Set<EntaxyRuntimeObjectContainer> containers = new HashSet<>();
|
||||
for (EntaxyRuntimeObjectImpl roi: this.objects.values()) {
|
||||
roi.getRelations().stream()
|
||||
.filter(r -> EntaxyObject.OBJECT_RELATION.DEPENDENCY.equals(r.getType()))
|
||||
.map(r -> r.getTarget())
|
||||
.map(obj -> EntaxyRuntimeObjectServiceImpl.getInstance().getContainerForObject(obj.getObjectFullId()))
|
||||
.filter(cont -> (cont != null))
|
||||
.filter(cnt -> !this.id.equals(cnt.getId()))
|
||||
.forEach(cont -> containers.add(cont));
|
||||
}
|
||||
return new ArrayList<>(containers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObjectContainer> getDependent() {
|
||||
final Set<EntaxyRuntimeObjectContainer> containers = new HashSet<>();
|
||||
for (EntaxyRuntimeObjectImpl roi: this.objects.values()) {
|
||||
roi.getIncomingRelations().stream()
|
||||
.filter(r -> EntaxyObject.OBJECT_RELATION.DEPENDENCY.equals(r.getType()))
|
||||
.map(r -> r.getSource())
|
||||
.map(obj -> EntaxyRuntimeObjectServiceImpl.getInstance().getContainerForObject(obj.getObjectFullId()))
|
||||
.filter(cont -> (cont != null))
|
||||
.filter(cnt -> !this.id.equals(cnt.getId()))
|
||||
.forEach(cont -> containers.add(cont));
|
||||
}
|
||||
return new ArrayList<>(containers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObjectContainer> getRelatedContainers() {
|
||||
final Set<EntaxyRuntimeObjectContainer> containers = new HashSet<>();
|
||||
for (EntaxyRuntimeObjectImpl roi: this.objects.values()) {
|
||||
roi.getRelations().stream()
|
||||
.filter(r -> EntaxyObject.OBJECT_RELATION.DEPENDENCY.equals(r.getType()))
|
||||
.map(r -> r.getTarget())
|
||||
.map(obj -> EntaxyRuntimeObjectServiceImpl.getInstance().getContainerForObject(obj.getObjectFullId()))
|
||||
.filter(cont -> (cont != null))
|
||||
.filter(cnt -> !this.id.equals(cnt.getId()))
|
||||
.forEach(cont -> containers.add(cont));
|
||||
}
|
||||
return new ArrayList<>(containers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObjectContainer> getIncomingRelatedContainers() {
|
||||
final Set<EntaxyRuntimeObjectContainer> containers = new HashSet<>();
|
||||
for (EntaxyRuntimeObjectImpl roi: this.objects.values()) {
|
||||
roi.getIncomingRelations().stream()
|
||||
.filter(r -> EntaxyObject.OBJECT_RELATION.DEPENDENCY.equals(r.getType()))
|
||||
.map(r -> r.getSource())
|
||||
.map(obj -> EntaxyRuntimeObjectServiceImpl.getInstance().getContainerForObject(obj.getObjectFullId()))
|
||||
.filter(cont -> (cont != null))
|
||||
.filter(cnt -> !this.id.equals(cnt.getId()))
|
||||
.forEach(cont -> containers.add(cont));
|
||||
}
|
||||
return new ArrayList<>(containers);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,316 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.support.osgi.bundle.BundleCapabilityHelper;
|
||||
import ru.entaxy.platform.base.support.osgi.bundle.CapabilityDescriptor;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectResource;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeRelation;
|
||||
|
||||
public class EntaxyRuntimeObjectImpl implements EntaxyRuntimeObject {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(EntaxyRuntimeObjectImpl.class);
|
||||
|
||||
private static final BundleInfo nullBundleInfo = new BundleInfo() {
|
||||
public long getBundleId() {
|
||||
return -1;
|
||||
};
|
||||
};
|
||||
|
||||
protected static EntaxyObject nullWrappedObject = new EntaxyObject() {
|
||||
|
||||
@Override
|
||||
public BundleInfo getBundleInfo() {
|
||||
return nullBundleInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfiguration() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFactoryId() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "NULL-object";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Relation> getRelations() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Relation> getIncomingRelations() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScope() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComplete() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProvided() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGhost() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
EntaxyRuntimeObjectContainerImpl containerImpl;
|
||||
|
||||
protected EntaxyObject wrappedObject = nullWrappedObject;
|
||||
|
||||
List<EntaxyRuntimeObjectResourceImpl> resources = new ArrayList<>();
|
||||
|
||||
public EntaxyRuntimeObjectImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
public EntaxyRuntimeObjectImpl(EntaxyObject object) {
|
||||
super();
|
||||
setWrappedObject(object);
|
||||
}
|
||||
|
||||
protected void reload(EntaxyObject object) {
|
||||
this.resources.clear();
|
||||
try {
|
||||
|
||||
// we assume that the object can be a ghost with no bundle info yet
|
||||
if (object.getBundleInfo() == null)
|
||||
return;
|
||||
|
||||
Bundle bundle = FrameworkUtil.getBundle(getClass()).getBundleContext().getBundle(object.getBundleInfo().getBundleId());
|
||||
BundleCapabilityHelper helper = new BundleCapabilityHelper(bundle);
|
||||
CapabilityDescriptor capability = helper.findObjectDeclaration(object.getId(), object.getType());
|
||||
if (capability != null) {
|
||||
Object resources = capability.getAttributes().get(CAPABILITIES_RUNTIME.ATTR_RESOURCES);
|
||||
if (resources != null) {
|
||||
if (resources instanceof List) {
|
||||
List<?> resourceList = (List)resources;
|
||||
for (Object resourceDesc: resourceList)
|
||||
if (resourceDesc == null)
|
||||
continue;
|
||||
else
|
||||
try {
|
||||
this.resources.add(EntaxyRuntimeObjectResourceImpl.create(resourceDesc.toString()));
|
||||
} catch (IllegalArgumentException iae) {
|
||||
log.warn("Error wrapping reeource ", iae);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Reloading object [" + object.getObjectFullId() + "] failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BundleInfo getBundleInfo() {
|
||||
return wrappedObject.getBundleInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfiguration() {
|
||||
return wrappedObject.getConfiguration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFactoryId() {
|
||||
return wrappedObject.getFactoryId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return wrappedObject.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Relation> getRelations() {
|
||||
return wrappedObject.getRelations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Relation> getIncomingRelations() {
|
||||
return wrappedObject.getIncomingRelations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScope() {
|
||||
return wrappedObject.getScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return wrappedObject.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComplete() {
|
||||
return wrappedObject.isComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProvided() {
|
||||
return wrappedObject.isProvided();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGhost() {
|
||||
return wrappedObject.isGhost();
|
||||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
return (this.wrappedObject != null)
|
||||
&& (this.wrappedObject != nullWrappedObject);
|
||||
}
|
||||
|
||||
public EntaxyObject getWrappedObject() {
|
||||
return wrappedObject;
|
||||
}
|
||||
|
||||
public void setWrappedObject(EntaxyObject wrappedObject) {
|
||||
reload(wrappedObject);
|
||||
this.wrappedObject = wrappedObject;
|
||||
}
|
||||
|
||||
EntaxyRuntimeObjectContainerImpl getContainerImpl() {
|
||||
return containerImpl;
|
||||
}
|
||||
|
||||
void setContainerImpl(EntaxyRuntimeObjectContainerImpl containerImpl) {
|
||||
this.containerImpl = containerImpl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isColocatedWith(EntaxyRuntimeObject object) {
|
||||
EntaxyRuntimeObjectContainer objectContainer = object.getContainer();
|
||||
if ((containerImpl == null) || (objectContainer == null))
|
||||
return false;
|
||||
return containerImpl.getId().equals(objectContainer.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeRelation> getRelations(OBJECT_RELATION relationType) {
|
||||
return getRelations().stream()
|
||||
.filter(r -> relationType.equals(r.getType()))
|
||||
.map(r -> new EntaxyRuntimeRelationImpl(r))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeRelation> getSubordRelations() {
|
||||
return getRelations().stream()
|
||||
.filter(r -> r.isSubordinating())
|
||||
.map(r -> new EntaxyRuntimeRelationImpl(r))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeRelation> getIncomiingRelations(OBJECT_RELATION relationType) {
|
||||
return getIncomingRelations().stream()
|
||||
.filter(r -> relationType.equals(r.getType()))
|
||||
.map(r -> new EntaxyRuntimeRelationImpl(r))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeRelation> getIncomiingSubordRelations() {
|
||||
return getIncomingRelations().stream()
|
||||
.filter(r -> r.isSubordinating())
|
||||
.map(r -> new EntaxyRuntimeRelationImpl(r))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeRelation> getDependsOn() {
|
||||
List<EntaxyRuntimeRelation> result = getIncomiingSubordRelations();
|
||||
result.addAll(getRelations(OBJECT_RELATION.DEPENDENCY));
|
||||
result.addAll(getRelations(OBJECT_RELATION.USE));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeRelation> getDependents() {
|
||||
List<EntaxyRuntimeRelation> result = getSubordRelations();
|
||||
result.addAll(getIncomiingRelations(OBJECT_RELATION.DEPENDENCY));
|
||||
result.addAll(getIncomiingRelations(OBJECT_RELATION.USE));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyRuntimeObjectContainer getContainer() {
|
||||
return (EntaxyRuntimeObjectContainer)containerImpl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObject> getColocatedObjects() {
|
||||
if (containerImpl == null)
|
||||
return Collections.emptyList();
|
||||
return containerImpl.getObjects().stream()
|
||||
.filter(obj -> (obj!=this))
|
||||
.map(obj -> (EntaxyRuntimeObject)obj)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObjectResource> getResources() {
|
||||
return this.resources.stream().map(res -> (EntaxyRuntimeObjectResource)res).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl;
|
||||
|
||||
import ru.entaxy.esb.resources.EntaxyResource;
|
||||
import ru.entaxy.esb.resources.EntaxyResource.RESOURCE_SCOPE;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectResource;
|
||||
|
||||
public class EntaxyRuntimeObjectResourceImpl implements EntaxyRuntimeObjectResource {
|
||||
|
||||
public static EntaxyRuntimeObjectResourceImpl create(String resourceDescriptor) throws IllegalArgumentException {
|
||||
|
||||
if (!CommonUtils.isValid(resourceDescriptor))
|
||||
throw new IllegalArgumentException("Resource descriptor is empty");
|
||||
String[] data = resourceDescriptor.split(";");
|
||||
EntaxyRuntimeObjectResourceImpl resourceImpl = new EntaxyRuntimeObjectResourceImpl(data[0]);
|
||||
if (data.length > 1)
|
||||
try {
|
||||
RESOURCE_SCOPE scope = RESOURCE_SCOPE.valueOf(data[1].trim().toUpperCase());
|
||||
resourceImpl.setScope(scope);
|
||||
} catch (Exception e) {
|
||||
// use default scope
|
||||
}
|
||||
return resourceImpl;
|
||||
}
|
||||
|
||||
protected RESOURCE_SCOPE scope = RESOURCE_SCOPE.RUNTIME;
|
||||
protected String url;
|
||||
|
||||
public EntaxyRuntimeObjectResourceImpl(String url) {
|
||||
super();
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RESOURCE_SCOPE getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyResource getResource() {
|
||||
return EntaxyRuntimeObjectServiceImpl.getInstance()
|
||||
.getResourceService().getResource(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResourceUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public void setScope(RESOURCE_SCOPE scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,198 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.karaf.bundle.core.BundleService;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ReferencePolicyOption;
|
||||
|
||||
import ru.entaxy.esb.resources.EntaxyResourceService;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObjectService;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObjectServiceListener;
|
||||
import ru.entaxy.platform.core.artifact.service.ArtifactService;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer.ENTAXY_RUNTIME_OBJECT_CONTAINER_STATE;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectService;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject.ENTAXY_RUNTIME_OBJECT_STATE;
|
||||
|
||||
@Component (service = EntaxyRuntimeObjectService.class, immediate = true)
|
||||
public class EntaxyRuntimeObjectServiceImpl implements EntaxyRuntimeObjectService, EntaxyObjectServiceListener {
|
||||
|
||||
private static EntaxyRuntimeObjectServiceImpl INSTANCE = null;
|
||||
|
||||
public static EntaxyRuntimeObjectServiceImpl getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY, policyOption = ReferencePolicyOption.GREEDY)
|
||||
protected EntaxyObjectService objectService;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY, policyOption = ReferencePolicyOption.GREEDY)
|
||||
protected EntaxyResourceService resourceService;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY, policyOption = ReferencePolicyOption.GREEDY)
|
||||
protected BundleService bundleService;
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY, policyOption = ReferencePolicyOption.GREEDY)
|
||||
ArtifactService artifactService;
|
||||
|
||||
protected Object storageLock = new Object();
|
||||
|
||||
protected ObjectRuntimeStorage storage = new ObjectRuntimeStorage();
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
INSTANCE = this;
|
||||
objectService.addListener(this);
|
||||
synchronized (storageLock) {
|
||||
fillCurrentObjects();
|
||||
}
|
||||
}
|
||||
|
||||
protected void fillCurrentObjects() {
|
||||
// make a copy
|
||||
List<EntaxyObject> objectsList = new ArrayList<>(objectService.getObjects());
|
||||
for (EntaxyObject obj: objectsList)
|
||||
storage.add(obj);
|
||||
}
|
||||
|
||||
// EntaxyObjectServiceListener
|
||||
|
||||
@Override
|
||||
public void objectAdded(EntaxyObject entaxyObject) {
|
||||
synchronized (storageLock) {
|
||||
storage.add(entaxyObject);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void objectModified(EntaxyObject entaxyObject) {
|
||||
synchronized (storageLock) {
|
||||
storage.update(entaxyObject);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void objectRemoved(EntaxyObject entaxyObject) {
|
||||
synchronized (storageLock) {
|
||||
storage.remove(entaxyObject);
|
||||
}
|
||||
}
|
||||
|
||||
// EntaxyRuntimeObjectService
|
||||
|
||||
@Override
|
||||
public EntaxyRuntimeObject getRuntimeObject(EntaxyObject origin) {
|
||||
return this.storage.objects.get(origin.getObjectFullId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyRuntimeObject getRuntimeObject(String runtimeObjectId) {
|
||||
return this.storage.objects.get(runtimeObjectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyRuntimeObjectContainer getContainer(String containerName) {
|
||||
Optional<EntaxyRuntimeObjectContainer> container = storage.containers.values().stream()
|
||||
.filter(c -> containerName.equalsIgnoreCase(c.getName()))
|
||||
.map(c -> (EntaxyRuntimeObjectContainer)c)
|
||||
.findFirst();
|
||||
return container.isPresent()?container.get():null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObject> getObjects() {
|
||||
return this.storage.objectsCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObject> getObjectsForContainer(EntaxyRuntimeObjectContainer container) {
|
||||
return container.getObjects();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntaxyRuntimeObjectContainer> getContainers() {
|
||||
return storage.containers.values().stream().map(c -> (EntaxyRuntimeObjectContainer)c).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyRuntimeObjectContainer getContainerForObject(EntaxyRuntimeObject runtimeObject) {
|
||||
return runtimeObject.getContainer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyRuntimeObjectContainer getContainerForObject(String runtimeObjectId) {
|
||||
EntaxyRuntimeObjectImpl impl = storage.objects.get(runtimeObjectId);
|
||||
if (impl == null)
|
||||
return null;
|
||||
return impl.getContainer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ENTAXY_RUNTIME_OBJECT_STATE getObjectState(String runtimeObjectId) {
|
||||
return getObjectState(getRuntimeObject(runtimeObjectId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ENTAXY_RUNTIME_OBJECT_STATE getObjectState(EntaxyRuntimeObject runtimeObject) {
|
||||
if (runtimeObject == null)
|
||||
return ENTAXY_RUNTIME_OBJECT_STATE.UNKNOWN;
|
||||
EntaxyRuntimeObjectContainer container = runtimeObject.getContainer();
|
||||
try {
|
||||
ENTAXY_RUNTIME_OBJECT_CONTAINER_STATE containerState = container.getState();
|
||||
if (ENTAXY_RUNTIME_OBJECT_CONTAINER_STATE.Active.equals(containerState))
|
||||
return ENTAXY_RUNTIME_OBJECT_STATE.ACTIVE;
|
||||
return ENTAXY_RUNTIME_OBJECT_STATE.INACTIVE;
|
||||
} catch (Exception e) {
|
||||
return ENTAXY_RUNTIME_OBJECT_STATE.UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// others
|
||||
|
||||
public EntaxyResourceService getResourceService() {
|
||||
return resourceService;
|
||||
}
|
||||
|
||||
public BundleService getBundleService() {
|
||||
return bundleService;
|
||||
}
|
||||
|
||||
public ArtifactService getArtifactService() {
|
||||
return artifactService;
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_RELATION;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_RELATION_SCOPE;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.Relation;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectService;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeRelation;
|
||||
|
||||
public class EntaxyRuntimeRelationImpl implements EntaxyRuntimeRelation {
|
||||
|
||||
Relation wrappedRelation;
|
||||
|
||||
public EntaxyRuntimeRelationImpl(Relation wrappedRelation) {
|
||||
super();
|
||||
this.wrappedRelation = wrappedRelation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroup() {
|
||||
return this.wrappedRelation.getGroup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.wrappedRelation.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public OBJECT_RELATION_SCOPE getScope() {
|
||||
return this.wrappedRelation.getScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
public OBJECT_RELATION getType() {
|
||||
return this.wrappedRelation.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyRuntimeObject getSource() {
|
||||
return EntaxyRuntimeObjectServiceImpl.getInstance().getRuntimeObject(wrappedRelation.getSource());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntaxyRuntimeObject getTarget() {
|
||||
return EntaxyRuntimeObjectServiceImpl.getInstance().getRuntimeObject(wrappedRelation.getTarget());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.hazelcast.map.impl.mapstore.writethrough.WriteThroughStore;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
|
||||
public class ObjectRuntimeStorage {
|
||||
|
||||
EntaxyRuntimeObjectContainerImpl ghostsContainer;
|
||||
|
||||
Map<String, EntaxyRuntimeObjectContainerImpl> containers = new HashMap<>();
|
||||
|
||||
Map<String, EntaxyRuntimeObjectImpl> objects = new HashMap<>();
|
||||
|
||||
List<EntaxyRuntimeObject> objectsCache = new ArrayList<>();
|
||||
|
||||
protected Object containersLock = new Object();
|
||||
|
||||
public ObjectRuntimeStorage() {
|
||||
super();
|
||||
ghostsContainer = new EntaxyRuntimeObjectContainerBundle();
|
||||
}
|
||||
|
||||
public void add(EntaxyObject object) {
|
||||
|
||||
if (!object.isGhost()) {
|
||||
|
||||
long bundleId = object.getBundleInfo().getBundleId();
|
||||
EntaxyRuntimeObjectContainerImpl container = getCreateBundleContainer(bundleId);
|
||||
EntaxyRuntimeObjectImpl wrapped = wrap(object);
|
||||
container.add(wrapped);
|
||||
|
||||
} else {
|
||||
|
||||
EntaxyRuntimeObjectContainerImpl container = ghostsContainer;
|
||||
EntaxyRuntimeObjectImpl wrapped = wrap(object);
|
||||
container.add(wrapped);
|
||||
|
||||
}
|
||||
|
||||
rebuildCache();
|
||||
}
|
||||
|
||||
public void update(EntaxyObject object) {
|
||||
add(object);
|
||||
rebuildCache();
|
||||
}
|
||||
|
||||
public void remove(EntaxyObject object) {
|
||||
EntaxyRuntimeObjectImpl impl = objects.get(object.getObjectFullId());
|
||||
if (impl == null)
|
||||
return;
|
||||
|
||||
objects.remove(object.getObjectFullId());
|
||||
|
||||
rebuildCache();
|
||||
}
|
||||
|
||||
protected synchronized void rebuildCache() {
|
||||
this.objectsCache.clear();
|
||||
this.objects.values().stream().map(obj -> (EntaxyRuntimeObject)obj).forEach(obj -> this.objectsCache.add(obj));
|
||||
}
|
||||
|
||||
protected EntaxyRuntimeObjectImpl wrap(EntaxyObject object) {
|
||||
if (objects.containsKey(object.getObjectFullId()))
|
||||
objects.get(object.getObjectFullId()).setWrappedObject(object);
|
||||
else
|
||||
objects.put(object.getObjectFullId(), new EntaxyRuntimeObjectImpl(object));
|
||||
return objects.get(object.getObjectFullId());
|
||||
}
|
||||
|
||||
protected EntaxyRuntimeObjectContainerImpl getCreateBundleContainer(long bundleId) {
|
||||
String containerId = bundleId + "";
|
||||
synchronized (containersLock) {
|
||||
if (!containers.containsKey(containerId)) {
|
||||
EntaxyRuntimeObjectContainerImpl containerImpl = new EntaxyRuntimeObjectContainerBundle();
|
||||
containerImpl.bundle(bundleId);
|
||||
containers.put(containerImpl.getId(), containerImpl);
|
||||
}
|
||||
}
|
||||
return containers.get(containerId);
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl.manager;
|
||||
|
||||
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 ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject.ENTAXY_RUNTIME_OBJECT_STATE;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectService;
|
||||
|
||||
@Component(service = EntaxyRuntimeObjectManager.class, immediate = true)
|
||||
public class EntaxyRuntimeObjectManagerImpl implements EntaxyRuntimeObjectManager {
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY, policyOption = ReferencePolicyOption.GREEDY)
|
||||
EntaxyRuntimeObjectService objectService;
|
||||
|
||||
@Override
|
||||
public OperationResult execute(ENTAXY_RUNTIME_OBJECT_OPERATION operation, OperationConfig config) {
|
||||
return createExecutor(operation).execute(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult start(String objectFullId) {
|
||||
return start(new OperationConfigImpl(objectFullId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult startForced(String objectFullId) {
|
||||
return start((new OperationConfigImpl(objectFullId)).forced(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult startSoft(String objectFullId) {
|
||||
return start((new OperationConfigImpl(objectFullId)).soft(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult start(OperationConfig config) {
|
||||
EntaxyRuntimeObject object = objectService.getRuntimeObject(config.getObjectFullId());
|
||||
if (object == null)
|
||||
return OperationResultImpl.createFailed();
|
||||
if (ENTAXY_RUNTIME_OBJECT_STATE.ACTIVE.equals(objectService.getObjectState(object)))
|
||||
return OperationResultImpl.createDone();
|
||||
return createExecutor(ENTAXY_RUNTIME_OBJECT_OPERATION.START).execute(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult stop(String objectFullId) {
|
||||
return stop(new OperationConfigImpl(objectFullId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult stopForced(String objectFullId) {
|
||||
return stop((new OperationConfigImpl(objectFullId)).forced(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult stopSoft(String objectFullId) {
|
||||
return stop((new OperationConfigImpl(objectFullId)).soft(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult stop(OperationConfig config) {
|
||||
EntaxyRuntimeObject object = objectService.getRuntimeObject(config.getObjectFullId());
|
||||
if (object == null)
|
||||
return OperationResultImpl.createFailed();
|
||||
if (ENTAXY_RUNTIME_OBJECT_STATE.INACTIVE.equals(objectService.getObjectState(object)))
|
||||
return OperationResultImpl.createDone();
|
||||
return createExecutor(ENTAXY_RUNTIME_OBJECT_OPERATION.STOP).execute(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult uninstall(String objectFullId) {
|
||||
return uninstall(new OperationConfigImpl(objectFullId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult uninstallForced(String objectFullId) {
|
||||
return uninstall((new OperationConfigImpl(objectFullId)).forced(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult uninstallSoft(String objectFullId) {
|
||||
return uninstall((new OperationConfigImpl(objectFullId)).soft(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult uninstall(OperationConfig config) {
|
||||
return createExecutor(ENTAXY_RUNTIME_OBJECT_OPERATION.UNINSTALL).execute(config);
|
||||
}
|
||||
|
||||
public EntaxyRuntimeObjectService getObjectService() {
|
||||
return objectService;
|
||||
}
|
||||
|
||||
protected OperationExecutor<?> createExecutor(ENTAXY_RUNTIME_OBJECT_OPERATION operation) {
|
||||
switch (operation) {
|
||||
case START:
|
||||
return (new OperationExecutorStart()).objectManager(this);
|
||||
case STOP:
|
||||
return (new OperationExecutorStop()).objectManager(this);
|
||||
case UNINSTALL:
|
||||
return (new OperationExecutorUninstall()).objectManager(this);
|
||||
default:
|
||||
return (new OperationExecutorStart()).objectManager(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl.manager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationConfig;
|
||||
|
||||
public class OperationConfigImpl implements OperationConfig {
|
||||
|
||||
String objectFullId;
|
||||
|
||||
boolean isForced = false;
|
||||
boolean isSoft = false;
|
||||
|
||||
final Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> affected = new HashMap<>();
|
||||
|
||||
public OperationConfigImpl(String objectFullId) {
|
||||
super();
|
||||
setObjectFullId(objectFullId);
|
||||
}
|
||||
|
||||
// OperationConfig
|
||||
|
||||
@Override
|
||||
public String getObjectFullId() {
|
||||
return objectFullId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForced() {
|
||||
return isForced;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSoft() {
|
||||
return isSoft;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> getAffected() {
|
||||
return affected;
|
||||
}
|
||||
|
||||
// others
|
||||
|
||||
public OperationConfigImpl forced(boolean forcedValue) {
|
||||
this.setForced(forcedValue);
|
||||
return this;
|
||||
};
|
||||
|
||||
public OperationConfigImpl soft(boolean softValue) {
|
||||
this.setSoft(softValue);
|
||||
return this;
|
||||
};
|
||||
|
||||
public OperationConfigImpl objectFullId(String objectFullIdValue) {
|
||||
this.setObjectFullId(objectFullIdValue);
|
||||
return this;
|
||||
};
|
||||
|
||||
public void setObjectFullId(String objectFullId) {
|
||||
this.objectFullId = objectFullId;
|
||||
}
|
||||
|
||||
public void setForced(boolean isForced) {
|
||||
this.isForced = isForced;
|
||||
}
|
||||
|
||||
public void setSoft(boolean isSoft) {
|
||||
this.isSoft = isSoft;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl.manager;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import ru.entaxy.platform.core.artifact.legacy.BundleController;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject.ENTAXY_RUNTIME_OBJECT_STATE;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationConfig;
|
||||
import ru.entaxy.platform.objects.runtime.impl.EntaxyRuntimeObjectServiceImpl;
|
||||
|
||||
public abstract class OperationExecutor<T extends OperationExecutor<T>> {
|
||||
|
||||
EntaxyRuntimeObjectManagerImpl objectManager;
|
||||
|
||||
public T objectManager(EntaxyRuntimeObjectManagerImpl objectManager) {
|
||||
this.objectManager = objectManager;
|
||||
return (T)this;
|
||||
}
|
||||
|
||||
public OperationResultImpl execute(OperationConfig operationConfig) {
|
||||
EntaxyRuntimeObject runtimeObject = getObjectFromConfig(operationConfig);
|
||||
if (runtimeObject == null)
|
||||
return OperationResultImpl.createFailed().message("Object not found: " + operationConfig.getObjectFullId());
|
||||
Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> prerequisites = getPrerequisites(operationConfig, runtimeObject);
|
||||
if (!prerequisites.isEmpty()) {
|
||||
return OperationResultImpl.createBlocked().affected(prerequisites);
|
||||
}
|
||||
if (operationConfig.isForced()) {
|
||||
// execute all operations on affected objects
|
||||
operationConfig.getAffected().clear();
|
||||
operationConfig.getAffected().putAll(getAffected(operationConfig));
|
||||
return doExecute(operationConfig, runtimeObject);
|
||||
}
|
||||
if (operationConfig.isSoft()) {
|
||||
// NOT execute operations on affected objects
|
||||
operationConfig.getAffected().clear();
|
||||
return doExecute(operationConfig, runtimeObject);
|
||||
}
|
||||
if (checkAffected(operationConfig)) {
|
||||
return doExecute(operationConfig, runtimeObject);
|
||||
}
|
||||
return OperationResultImpl.createRequest(getAffected(operationConfig));
|
||||
}
|
||||
|
||||
protected Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> createMapForObjects(List<EntaxyRuntimeObject> objects, ENTAXY_RUNTIME_OBJECT_OPERATION operation) {
|
||||
Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> map = new HashMap<>();
|
||||
for (EntaxyRuntimeObject obj: objects)
|
||||
map.put(obj.getObjectFullId(), operation);
|
||||
return map;
|
||||
}
|
||||
|
||||
protected boolean colocated(EntaxyRuntimeObject...objects) {
|
||||
if (objects.length == 0)
|
||||
return true;
|
||||
String containerId = objects[0].getContainer().getId();
|
||||
for (int i=0; i<objects.length; i++)
|
||||
if (!objects[i].getContainer().getId().equals(containerId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected ENTAXY_RUNTIME_OBJECT_STATE getObjectState(EntaxyRuntimeObject object) {
|
||||
return EntaxyRuntimeObjectServiceImpl.getInstance().getObjectState(object);
|
||||
}
|
||||
|
||||
protected EntaxyRuntimeObject getObjectFromConfig(OperationConfig operationConfig) {
|
||||
try {
|
||||
return EntaxyRuntimeObjectServiceImpl.getInstance().getRuntimeObject(operationConfig.getObjectFullId());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> getAffected(OperationConfig operationConfig){
|
||||
EntaxyRuntimeObject object = getObjectFromConfig(operationConfig);
|
||||
if (object == null)
|
||||
return new HashMap<>();
|
||||
return doGetAffected(operationConfig, object);
|
||||
};
|
||||
|
||||
protected abstract Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> doGetAffected(
|
||||
OperationConfig operationConfig
|
||||
, EntaxyRuntimeObject runtimeObject);
|
||||
|
||||
protected Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> getPrerequisites(
|
||||
OperationConfig operationConfig
|
||||
, EntaxyRuntimeObject runtimeObject){
|
||||
return Collections.emptyMap();
|
||||
};
|
||||
|
||||
protected boolean checkAffected(OperationConfig operationConfig) {
|
||||
Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> affected = getAffected(operationConfig);
|
||||
for (Entry<String, ENTAXY_RUNTIME_OBJECT_OPERATION> entry: operationConfig.getAffected().entrySet()) {
|
||||
if (!affected.containsKey(entry.getKey()))
|
||||
// found not affected object
|
||||
return false;
|
||||
if (!affected.get(entry.getKey()).equals(entry.getValue()))
|
||||
// operation not equal
|
||||
return false;
|
||||
}
|
||||
return affected.size() == operationConfig.getAffected().size();
|
||||
}
|
||||
|
||||
protected abstract OperationResultImpl doExecute(OperationConfig operationConfig, EntaxyRuntimeObject runtimeObject);
|
||||
|
||||
// TOOD return local or cluster controller depending on object location
|
||||
protected BundleController getBundleController(EntaxyRuntimeObject runtimeObject) {
|
||||
return EntaxyRuntimeObjectServiceImpl.getInstance().getArtifactService()
|
||||
.installers().cluster().bundleController();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl.manager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_RELATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject.ENTAXY_RUNTIME_OBJECT_STATE;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationConfig;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
|
||||
public class OperationExecutorStart extends OperationExecutor<OperationExecutorStart> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OperationExecutorStart.class);
|
||||
|
||||
@Override
|
||||
protected Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> getPrerequisites(OperationConfig operationConfig,
|
||||
EntaxyRuntimeObject runtimeObject) {
|
||||
|
||||
List<EntaxyRuntimeObject> objects = runtimeObject.getDependsOn().stream()
|
||||
.map(rel -> rel.getMain())
|
||||
.filter(obj -> !runtimeObject.isColocatedWith(obj))
|
||||
.filter(obj -> !ENTAXY_RUNTIME_OBJECT_STATE.ACTIVE.equals(getObjectState(obj)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return createMapForObjects(objects, ENTAXY_RUNTIME_OBJECT_OPERATION.START);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> doGetAffected(OperationConfig operationConfig,
|
||||
EntaxyRuntimeObject runtimeObject) {
|
||||
final Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> result = new HashMap<>();
|
||||
|
||||
List<EntaxyRuntimeObject> dependents = runtimeObject.getDependents().stream()
|
||||
.filter(rel -> !OBJECT_RELATION.COMPOSITION.equals(rel.getType()))
|
||||
.map(rel -> rel.getDependent())
|
||||
.filter(obj -> !runtimeObject.isColocatedWith(obj))
|
||||
.filter(obj -> !ENTAXY_RUNTIME_OBJECT_STATE.ACTIVE.equals(getObjectState(obj)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (EntaxyRuntimeObject obj: dependents)
|
||||
result.put(obj.getObjectFullId(), ENTAXY_RUNTIME_OBJECT_OPERATION.START);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OperationResultImpl doExecute(OperationConfig operationConfig, EntaxyRuntimeObject runtimeObject) {
|
||||
|
||||
try {
|
||||
getBundleController(runtimeObject).startBundle(runtimeObject.getContainer().getName());
|
||||
} catch (Exception e) {
|
||||
log.error("ERROR stoping [" + runtimeObject.getObjectFullId() + "]", e);
|
||||
return OperationResultImpl.createFailed().message("ERROR stoping [" + runtimeObject.getObjectFullId()
|
||||
+ "]; ORIGINAL MESSAGE: " + e.getMessage());
|
||||
}
|
||||
|
||||
// start all compostion-dependent objects, not colocated with the current
|
||||
List<EntaxyRuntimeObject> parts = runtimeObject.getRelations(OBJECT_RELATION.COMPOSITION).stream()
|
||||
.map(rel -> rel.getDependent())
|
||||
.filter(obj -> !runtimeObject.isColocatedWith(obj))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (EntaxyRuntimeObject part: parts) {
|
||||
OperationResult result = objectManager.startForced(part.getObjectFullId());
|
||||
if (ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.FAILED.equals(result.getResult()))
|
||||
return OperationResultImpl.createFailed().message(
|
||||
"FAILED starting [" + part.getObjectFullId() + "]; ORIGINAL MESSAGE: " + result.getMessage());
|
||||
}
|
||||
|
||||
// start all affected objects
|
||||
for (String affectedId: operationConfig.getAffected().keySet()) {
|
||||
OperationResult result = objectManager.startForced(affectedId);
|
||||
if (ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.FAILED.equals(result.getResult()))
|
||||
return OperationResultImpl.createFailed().message(
|
||||
"FAILED starting [" + affectedId + "]; ORIGINAL MESSAGE: " + result.getMessage());
|
||||
}
|
||||
|
||||
return OperationResultImpl.createDone();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl.manager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_RELATION;
|
||||
import ru.entaxy.platform.core.artifact.legacy.BundleController;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject.ENTAXY_RUNTIME_OBJECT_STATE;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationConfig;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeRelation;
|
||||
import ru.entaxy.platform.objects.runtime.impl.EntaxyRuntimeObjectServiceImpl;
|
||||
|
||||
public class OperationExecutorStop extends OperationExecutor<OperationExecutorStop> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OperationExecutorStop.class);
|
||||
|
||||
@Override
|
||||
protected Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> doGetAffected(OperationConfig operationConfig,
|
||||
EntaxyRuntimeObject runtimeObject) {
|
||||
final Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> result = new HashMap<>();
|
||||
|
||||
List<EntaxyRuntimeRelation> relations = runtimeObject.getRelations(OBJECT_RELATION.AGGREGATION);
|
||||
relations.addAll(runtimeObject.getIncomiingRelations(OBJECT_RELATION.DEPENDENCY));
|
||||
relations.addAll(runtimeObject.getIncomiingRelations(OBJECT_RELATION.USE));
|
||||
|
||||
List<EntaxyRuntimeObject> objects = relations.stream()
|
||||
.map(rel -> rel.getDependent())
|
||||
.filter(obj -> ENTAXY_RUNTIME_OBJECT_STATE.ACTIVE.equals(getObjectState(obj)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (EntaxyRuntimeObject obj: objects)
|
||||
result.put(obj.getObjectFullId(), ENTAXY_RUNTIME_OBJECT_OPERATION.STOP);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OperationResultImpl doExecute(OperationConfig operationConfig, EntaxyRuntimeObject runtimeObject) {
|
||||
// stop all compostion-dependent objects, not colocated with the current
|
||||
List<EntaxyRuntimeObject> parts = runtimeObject.getRelations(OBJECT_RELATION.COMPOSITION).stream()
|
||||
.map(rel -> rel.getDependent())
|
||||
.filter(obj -> !runtimeObject.getContainer().getId().equals(obj.getContainer().getId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (EntaxyRuntimeObject part: parts) {
|
||||
OperationResult result = objectManager.stopForced(part.getObjectFullId());
|
||||
if (ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.FAILED.equals(result.getResult()))
|
||||
return OperationResultImpl.createFailed().message(
|
||||
"FAILED stopping [" + part.getObjectFullId() + "]; ORIGINAL MESSAGE: " + result.getMessage());
|
||||
}
|
||||
|
||||
// stop all affected objects
|
||||
for (String affectedId: operationConfig.getAffected().keySet()) {
|
||||
// EntaxyRuntimeObject affected = objectManager.getObjectService().getRuntimeObject(affectedId);
|
||||
OperationResult result = objectManager.stopForced(affectedId);
|
||||
if (ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.FAILED.equals(result.getResult()))
|
||||
return OperationResultImpl.createFailed().message(
|
||||
"FAILED stopping [" + affectedId + "]; ORIGINAL MESSAGE: " + result.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
getBundleController(runtimeObject).stopBundle(runtimeObject.getContainer().getName());
|
||||
return OperationResultImpl.createDone();
|
||||
} catch (Exception e) {
|
||||
log.error("ERROR stoping [" + runtimeObject.getObjectFullId() + "]", e);
|
||||
return OperationResultImpl.createFailed().message("ERROR stoping [" + runtimeObject.getObjectFullId()
|
||||
+ "]; ORIGINAL MESSAGE: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl.manager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_RELATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeRelation;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject.ENTAXY_RUNTIME_OBJECT_STATE;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationConfig;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
|
||||
public class OperationExecutorUninstall extends OperationExecutor<OperationExecutorUninstall> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OperationExecutorUninstall.class);
|
||||
|
||||
@Override
|
||||
protected Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> doGetAffected(OperationConfig operationConfig,
|
||||
EntaxyRuntimeObject runtimeObject) {
|
||||
final Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> result = new HashMap<>();
|
||||
|
||||
List<EntaxyRuntimeRelation> relations = runtimeObject.getRelations(OBJECT_RELATION.AGGREGATION);
|
||||
|
||||
List<EntaxyRuntimeObject> objects = relations.stream()
|
||||
.map(rel -> rel.getDependent())
|
||||
.filter(obj -> ENTAXY_RUNTIME_OBJECT_STATE.ACTIVE.equals(getObjectState(obj)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (EntaxyRuntimeObject obj: objects)
|
||||
result.put(obj.getObjectFullId(), ENTAXY_RUNTIME_OBJECT_OPERATION.UNINSTALL);
|
||||
|
||||
|
||||
relations = runtimeObject.getIncomiingRelations(OBJECT_RELATION.DEPENDENCY);
|
||||
relations.addAll(runtimeObject.getIncomiingRelations(OBJECT_RELATION.USE));
|
||||
|
||||
objects = relations.stream()
|
||||
.map(rel -> rel.getDependent())
|
||||
.filter(obj -> ENTAXY_RUNTIME_OBJECT_STATE.ACTIVE.equals(getObjectState(obj)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (EntaxyRuntimeObject obj: objects)
|
||||
result.put(obj.getObjectFullId(), ENTAXY_RUNTIME_OBJECT_OPERATION.STOP);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OperationResultImpl doExecute(OperationConfig operationConfig, EntaxyRuntimeObject runtimeObject) {
|
||||
|
||||
// uninstall all compostion-dependent objects, not colocated with the current
|
||||
List<EntaxyRuntimeObject> parts = runtimeObject.getRelations(OBJECT_RELATION.COMPOSITION).stream()
|
||||
.map(rel -> rel.getDependent())
|
||||
.filter(obj -> !runtimeObject.getContainer().getId().equals(obj.getContainer().getId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (EntaxyRuntimeObject part: parts) {
|
||||
OperationResult result = objectManager.uninstallForced(part.getObjectFullId());
|
||||
if (ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.FAILED.equals(result.getResult()))
|
||||
return OperationResultImpl.createFailed().message(
|
||||
"FAILED stopping [" + part.getObjectFullId() + "]; ORIGINAL MESSAGE: " + result.getMessage());
|
||||
}
|
||||
|
||||
// process (uninstall or stop) all affected objects
|
||||
for (Entry<String, ENTAXY_RUNTIME_OBJECT_OPERATION> entry: operationConfig.getAffected().entrySet()) {
|
||||
|
||||
String affectedId = entry.getKey();
|
||||
ENTAXY_RUNTIME_OBJECT_OPERATION operation = entry.getValue();
|
||||
|
||||
OperationConfigImpl config = new OperationConfigImpl(affectedId);
|
||||
config.forced(true);
|
||||
|
||||
OperationResult result = objectManager.execute(operation, config);
|
||||
if (ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.FAILED.equals(result.getResult()))
|
||||
return OperationResultImpl.createFailed().message(
|
||||
"FAILED operation [" + operation.name() + "] on [" + affectedId + "]; ORIGINAL MESSAGE: " + result.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
getBundleController(runtimeObject).uninstallBundle(runtimeObject.getContainer().getName());
|
||||
return OperationResultImpl.createDone();
|
||||
} catch (Exception e) {
|
||||
log.error("ERROR stoping [" + runtimeObject.getObjectFullId() + "]", e);
|
||||
return OperationResultImpl.createFailed().message("ERROR uninstalling [" + runtimeObject.getObjectFullId()
|
||||
+ "]; ORIGINAL MESSAGE: " + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-core
|
||||
* ==========
|
||||
* 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.objects.runtime.impl.manager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
|
||||
public class OperationResultImpl implements OperationResult {
|
||||
|
||||
public static OperationResultImpl createDone() {
|
||||
return (new OperationResultImpl()).result(ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.DONE);
|
||||
}
|
||||
|
||||
public static OperationResultImpl createFailed() {
|
||||
return (new OperationResultImpl()).result(ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.FAILED);
|
||||
}
|
||||
|
||||
public static OperationResultImpl createRequest() {
|
||||
return (new OperationResultImpl()).result(ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.REQUEST);
|
||||
}
|
||||
|
||||
public static OperationResultImpl createBlocked() {
|
||||
return (new OperationResultImpl()).result(ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT.BLOCKED);
|
||||
}
|
||||
|
||||
public static OperationResultImpl createRequest(Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> affected) {
|
||||
OperationResultImpl result = createRequest();
|
||||
result.getAffected().putAll(affected);
|
||||
return result;
|
||||
}
|
||||
|
||||
ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT result;
|
||||
|
||||
final Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> affected = new HashMap<>();
|
||||
|
||||
String message = "";
|
||||
|
||||
// OperationResult
|
||||
|
||||
@Override
|
||||
public ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> getAffected() {
|
||||
return affected;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
// others
|
||||
|
||||
public OperationResultImpl result(ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT result) {
|
||||
setResult(result);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setResult(ENTAXY_RUNTIME_OBJECT_OPERATION_RESULT result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public OperationResultImpl message(String messageValue) {
|
||||
this.setMessage(messageValue);
|
||||
return this;
|
||||
};
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public OperationResultImpl affected(Map<String, ENTAXY_RUNTIME_OBJECT_OPERATION> affected) {
|
||||
this.affected.putAll(affected);
|
||||
return this;
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения ENTAXY, принадлежащего
|
||||
Правообладателю – Обществу с ограниченной ответственностью "ЕМДЕВ" (ОГРН 1057810026658, ИНН
|
||||
7813313860, юридический адрес: 197022, Россия, г. Санкт-Петербург, ул. Профессора Попова,
|
||||
д. 23, литера В, помещение 3Н), расположенной в сети Интернет по адресу
|
||||
https://www.emdev.ru/about (далее - Компания).
|
||||
|
||||
Используя или получая доступ к Программному обеспечению, или нажав «Я согласен с Условиями»
|
||||
(или аналогичную кнопку или флажок) после загрузки или установки Программного обеспечения,
|
||||
Пользователь выражает свое согласие на обязательность условий и ограничений, изложенных в
|
||||
настоящем документе, в противном случае, он должен не использовать или не получать доступ
|
||||
к Программному обеспечению.
|
||||
|
||||
1. ТЕРМИНЫ И ОПРЕДЕЛЕНИЯ
|
||||
|
||||
a) ПО – Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) в любой ее версии
|
||||
или редакции, исключительные права на которую принадлежат Правообладателю.
|
||||
b) Правообладатель (Компания) – ООО «ЕМДЕВ», ОГРН 1057810026658, ИНН 7813313860, исключительные
|
||||
права которого подтверждаются Свидетельством о государственной регистрации в Реестре программ
|
||||
для ЭВМ № 2021610848 от 19.01.2021 года.
|
||||
c) Пользователь – юридическое или физическое лицо, получившее через скачивание с сайта
|
||||
https://entaxy.ru или иным образом, дистрибутив ПО, пользующееся ПО.
|
||||
d) ИС – интеллектуальная собственность – закреплённое законом исключительное право, а также
|
||||
личные неимущественные права авторов произведений на результат интеллектуальной деятельности.
|
||||
e) Подписка – это коммерческое предложение Правообладателя, состоящее из Лицензии на использование
|
||||
ПО и доступа к технической поддержке программного обеспечения на срок Подписки. Подписка
|
||||
включает предоставление Пользователю неисключительного права использования ПО, в том числе
|
||||
получение обновлений функционала ПО и безопасности ПО, исправление ошибок ПО и получение
|
||||
патчей с обновлениями и исправлениями программного обеспечения. Подписка приобретается
|
||||
Пользователем на период времени, указанный в Сертификате. Количество подписок устанавливается
|
||||
для каждого Пользователя индивидуально в Сертификате.
|
||||
f) Сертификат – документ, выдаваемый Дистрибъютором или Авторизованным партнёром (Партнёром),
|
||||
подтверждающий факт приобретения физическим или юридическим лицом Подписки на программное
|
||||
обеспечение в ограниченном объёме и на определённый период времени.
|
||||
g) Лицензия (простая (неисключительная) – совокупность ограниченных прав использования ПО,
|
||||
предоставленных Пользователю согласно условиям Подписки.
|
||||
h) Библиотека – совокупность подпрограмм и объектов, используемых для разработки программного
|
||||
обеспечения.
|
||||
i) Исходный код – текст компьютерной программы на каком-либо языке программирования, состоящий
|
||||
из одного или нескольких файлов, который может быть прочтён человеком.
|
||||
j) Объектный код – файл (часть машинного кода) с промежуточным представлением отдельного модуля
|
||||
программы, полученный в результате обработки исходного кода, еще не связанный в полную программу.
|
||||
Это машинный код для одной конкретной библиотеки или модуля, который будет составлять готовый
|
||||
продукт.
|
||||
k) Некоммерческое использование – индивидуальное личное использование Пользователем программного
|
||||
обеспечения с целью обучения работе с Программным обеспечением, для оценки или демонстрации
|
||||
возможностей Программного обеспечения, при котором, Пользователем не извлекается коммерческая
|
||||
выгода и/или не идёт в доход денежное вознаграждение при использовании Программного обеспечения.
|
||||
|
||||
2. ДОПУСТИМЫЕ СПОСОБЫ ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ
|
||||
|
||||
2.1. Правообладатель предоставляет Пользователю ограниченное право использования Программного
|
||||
обеспечения на условиях простой (неисключительной) лицензии в объёме, ограниченном правом
|
||||
воспроизведения полной рабочей версии программного обеспечения, новых версий программного обеспечения
|
||||
в памяти оборудования и его запуска на оборудовании в соответствии со ст. 1280 ГК РФ.
|
||||
2.2. Право на использование Программного обеспечения, предоставляемое Пользователю, носит
|
||||
неисключительный характер.
|
||||
2.3. Пользователю предоставляется всемирная, неисключительная, не подлежащая сублицензированию,
|
||||
лицензия на ограниченное использование Программного обеспечения.
|
||||
2.4. Пользователь, имеющий Базовую (некоммерческую) версию лицензии для пробного использования
|
||||
имеет право приобрести Подписку на программное обеспечение. В этом случае Пользователь обязан
|
||||
обратиться в службу поддержки Правообладателя по адресу: https://entaxy.ru/ для изменения
|
||||
вида лицензии с Базовой бесплатной версии на Подписки.
|
||||
2.5. Срок использования скачанной Пользователем базовой (некоммерческой) версии лицензии для
|
||||
пробного использования программного обеспечения – не ограничен.
|
||||
2.6. Использование Пользователем настоящего программного обеспечения в целях разработки,
|
||||
модификации, обновления другого ПО, принадлежащего третьим лицам, а не Правообладателю,
|
||||
без разрешения Правообладателя не допускается.
|
||||
|
||||
3. АВТОРСКОЕ ПРАВО.
|
||||
|
||||
3.1. Все авторские права, все права интеллектуальной собственности на Программное обеспечение
|
||||
и любые его копии принадлежат Правообладателю.
|
||||
3.2. Все авторские права, все права интеллектуальной собственности в отношении любого контента,
|
||||
к которому можно получить доступ с помощью Программного обеспечения, является собственностью
|
||||
соответствующего владельца контента и защищается применимым законодательством об авторском
|
||||
праве или другими законами и договорами об интеллектуальной собственности.
|
||||
3.3. Условия использования Программного обеспечения.
|
||||
Лицензия, предоставленная Пользователю, действительна только в том случае, если Пользователь
|
||||
придерживается следующих условий:
|
||||
3.3.1. Принятие уведомлений об авторских правах. Пользователю запрещается удалять или изменять
|
||||
какие-либо уведомления об авторских правах или лицензиях, которые появляются при использовании
|
||||
Программного обеспечения или на нем.
|
||||
3.3.2. Модификация. Пользователю запрещается модифицировать, изменять, декомпилировать,
|
||||
расшифровывать, дизассемблировать, переводить или реверсировать, перепроектировать
|
||||
Программное обеспечение.
|
||||
3.3.3. Распространение. Пользователю запрещается сублицензировать, передавать право использования
|
||||
ПО или иным образом распространять или предоставлять Программное обеспечение любой третьей стороне.
|
||||
3.3.4. SaaS. За исключением случаев, когда это разрешено Правообладателем, Пользователю запрещено
|
||||
использовать Программное обеспечение в коммерческих целях для оказания услуг третьим лицам.
|
||||
|
||||
4. ОТВЕТСТВЕННОСТЬ ПРАВООБЛАДАТЕЛЯ ПРИ НАРУШЕНИИ ПОЛЬЗОВАТЕЛЕМ ПРАВ «ИС»
|
||||
|
||||
4.1. Правообладатель не несет никаких обязательств в отношении каких-либо претензий к Пользователю
|
||||
на предмет нарушения последним прав Интеллектуальной собственности, возникших в связи с
|
||||
использованием Пользователем:
|
||||
4.1.1. Любых компонентов программного обеспечения с открытым исходным кодом, включенных в
|
||||
Программное обеспечение;
|
||||
4.1.2. Любого нарушения правил использования Программного обеспечения, установленного условиями
|
||||
настоящего соглашения;
|
||||
4.1.3. Любого использования Программного обеспечения в сочетании с другими ПО, оборудованием,
|
||||
или данными, не предоставленными Пользователю Правообладателем;
|
||||
4.1.4. Любого изменения Программного обеспечения любым третьим лицом, а не Правообладателем.
|
||||
|
||||
|
||||
5. НАСТОЯЩИМ ПРАВООБЛАДАТЕЛЬ ЗАЯВЛЯЕТ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ ПОЛЬЗОВАТЕЛЮ
|
||||
ПО ПРИНЦИПУ «AS IS» - «КАК ЕСТЬ». НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ НЕ ГАРАНТИРУЕТ
|
||||
И НЕ ОБЕЩАЕТ, ЧТО ПРЕДОСТАВЛЕННОЕ ИМ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ПОДХОДИТЬ ИЛИ НЕ ПОДХОДИТЬ
|
||||
ДЛЯ КОНКРЕТНЫХ ЦЕЛЕЙ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ОТВЕЧАТЬ ВСЕМ КОММЕРЧЕСКИМ
|
||||
И ЛИЧНЫМ СУБЪЕКТИВНЫМ ОЖИДАНИЯМ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ РАБОТАТЬ
|
||||
ИСПРАВНО, БЕЗ ТЕХНИЧЕСКИХ ОШИБОК, БЫСТРО И БЕСПЕРЕБОЙНО.
|
||||
|
||||
6. ОГРАНИЧЕНИЕ ОТВЕТСТВЕННОСТИ.
|
||||
НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ ИЛИ ЕГО АФФИЛЛИРОВАННЫЕ ЛИЦА НЕ НЕСУТ ПЕРЕД ПОЛЬЗОВАТЕЛЕМ
|
||||
ОТВЕТСТВЕННОСТИ ЗА ЛЮБЫЕ ПРЯМЫЕ ИЛИ КОСВЕННЫЕ УБЫТКИ ПОЛЬЗОВАТЕЛЯ, ЕГО РАСХОДЫ ИЛИ РЕАЛЬНЫЙ УЩЕРБ,
|
||||
ВКЛЮЧАЯ, ПОМИМО ПРОЧЕГО, ПРОСТОИ; УТРАТУ БИЗНЕСА; УПУЩЕННУЮ ВЫГОДУ; НЕДОПОЛУЧЕННУЮ ПРИБЫЛЬ;
|
||||
ПОТЕРЮ ИЛИ ПОВРЕЖДЕНИЕ ДАННЫХ, ИМУЩЕСТВА И ИНОЕ.
|
||||
ОГРАНИЧЕНИЯ ПРИМЕНЯЮТСЯ НЕЗАВИСИМО ОТ ОСНОВАНИЯ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ; В ТОМ ЧИСЛЕ ВСЛЕДСТВИЕ
|
||||
ДЕЙСТВИЯ ИЛИ БЕЗДЕЙСТВИЯ, НЕБРЕЖНОСТИ, УМЫСЛА, ПРЯМОГО ИЛИ КОСВЕННОГО; НЕОСТОРОЖНОСТИ; ЗАБЛУЖДЕНИЯ;
|
||||
КЛЕВЕТЫ; НАРУШЕНИЯ КОНФИДЕНЦИАЛЬНОСТИ ИЛИ ПРАВА ИНТЕЛЛЕКТУАЛЬНОЙ СОБСТВЕННОСТИ; ИЛИ ЛЮБОЕ ДРУГОЕ
|
||||
ОСНОВАНИЕ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ.
|
||||
|
||||
7. ОБЯЗАННОСТЬ ПОЛЬЗОВАТЕЛЯ:
|
||||
Не осуществлять самостоятельно и (или) с привлечением третьих лиц нижеследующие действия
|
||||
(включая, но не ограничиваясь) по:
|
||||
-дизассемблированию и (или) декомпилированию (преобразованию объектного кода в исходный код)
|
||||
Программного обеспечения;
|
||||
-модификации Программного обеспечения, в том числе вносить изменения в объектный код, исходный
|
||||
код Программного обеспечения, за исключением тех изменений, которые вносятся средствами,
|
||||
включёнными в Программное обеспечение и описанными непосредственно в документации к нему;
|
||||
-созданию условий для использования Программного обеспечения лицами, не имеющими прав на
|
||||
использование данного Программного обеспечения, включая (но не ограничиваясь) вмешательство
|
||||
третьих лиц в функционирование Программного обеспечения, предоставление третьим лицам доступа
|
||||
к исследованию и (или) замене настроек Программного обеспечения, включая его первичную установку;
|
||||
-распространению Программного обеспечения в целом или в части (включая приложенную к нему документацию).
|
||||
|
||||
8. БИБЛИОТЕКА ПО. ИСПОЛЬЗУЕМЫЕ ПРОГРАММНЫЕ СРЕДСТВА.
|
||||
|
||||
8.1. Настоящим, Правообладатель заверяет, что Библиотека программного обеспечения состоит из
|
||||
лицензионных продуктов, используемых на законных основаниях, а
|
||||
именно https://entaxy.ru/libs/licenses/root-aggregated.deps.
|
||||
8.2. Любые программные средства, применяемые Пользователем при работе с ПО, должны быть
|
||||
совместимы с библиотекой ПО, указанной в п.8.1. настоящего соглашения.
|
||||
8.3. Перечень внешних модулей ПО, указанный в п.8.1 настоящего соглашения, может изменяться
|
||||
Правообладателем в одностороннем порядке, в зависимости от выпуска релизов программного обеспечения,
|
||||
содержащих все изменения и дополнения программного обеспечения.
|
||||
|
||||
9. ВНЕСЕНИЕ ИЗМЕНЕНИЙ В ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ.
|
||||
|
||||
9.1. Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) является свободно распространяемым
|
||||
программным обеспечением.
|
||||
9.2. Пользователь имеет право вносить изменения в исходный код программного обеспечения исключительно
|
||||
с согласия Правообладателя в порядке предложения изменений/правок/дополнений через механизм
|
||||
«Pull Requests» в открытом репозитории Правообладателя по адресу: https://git.entaxy.ru/entaxy/entaxy-public.
|
||||
9.3. Любые изменения программного обеспечения, осуществляемые Пользователем без соблюдения условий
|
||||
пункта 9.2. настоящего документа, являются нарушением авторских и смежных прав Правообладателя,
|
||||
прав интеллектуальной собственности Правообладателя и влекут применение к Пользователю мер
|
||||
ответственности в соответствии с условиями настоящей Лицензии, а также применимого законодательства
|
||||
Российской Федерации.
|
||||
|
||||
10. ЗАКЛЮЧИТЕЛЬНЫЕ ПОЛОЖЕНИЯ.
|
||||
|
||||
10.1. В случае нарушения Пользователем любого из условий настоящей Лицензии, Правообладатель имеет
|
||||
право взыскать с Пользователя любые причинённые таким нарушением убытки, реальный ущерб,
|
||||
недополученную прибыль, упущенную выгоду, а также в случае нарушения Пользователем условий
|
||||
пункта 9.2 настоящего соглашения, в том числе, взыскать с Пользователя штраф в размере
|
||||
2 000 000 (Два миллиона) рублей за каждый установленный случай несанкционированного изменения
|
||||
исходного или объектного кода Программного обеспечения «Энтакси» (Entaxy).
|
||||
10.2. В рамках исполнения Пользователем обязательств по настоящей Лицензии, применимое
|
||||
законодательство – Российской Федерации.
|
||||
10.3. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -0,0 +1,34 @@
|
||||
<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>object-runtime</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</parent>
|
||||
<artifactId>object-runtime-shell</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECT RUNTIME SHELL</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECT RUNTIME SHELL</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>
|
||||
ru.entaxy.platform.objects.runtime.shell*
|
||||
</bundle.osgi.export.pkg>
|
||||
<bundle.osgi.remove.headers>none</bundle.osgi.remove.headers>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.karaf.shell</groupId>
|
||||
<artifactId>org.apache.karaf.shell.core</artifactId>
|
||||
<version>${karaf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>object-runtime-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,52 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Argument;
|
||||
import org.apache.karaf.shell.api.action.Completion;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
import ru.entaxy.platform.objects.runtime.shell.completers.ContainerCompleter;
|
||||
|
||||
public abstract class ContainerAwareCommand extends EntaxyRuntimeObjectServiceSupport {
|
||||
|
||||
@Argument(index = 0, required = true, name = "containerName")
|
||||
@Completion(caseSensitive = false, value = ContainerCompleter.class)
|
||||
String containerName;
|
||||
|
||||
protected EntaxyRuntimeObjectContainer getContainer() {
|
||||
return objectService.getContainer(containerName);
|
||||
}
|
||||
|
||||
public Object execute() throws Exception {
|
||||
EntaxyRuntimeObjectContainer container = getContainer();
|
||||
if (container == null)
|
||||
throw new IllegalArgumentException("Container [".concat(containerName).concat("] not found"));
|
||||
return doExecute(container);
|
||||
}
|
||||
|
||||
protected abstract Object doExecute(EntaxyRuntimeObjectContainer container);
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Action;
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
|
||||
@Service
|
||||
@Command(name = "container-info", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Get container info")
|
||||
public class ContainerInfo extends ContainerAwareCommand implements Action {
|
||||
|
||||
|
||||
@Override
|
||||
protected Object doExecute(EntaxyRuntimeObjectContainer container) {
|
||||
String message = "Container Info for ".concat(containerName)
|
||||
.concat("\n----------------------------------------")
|
||||
.concat("\nID: ".concat(container.getId()))
|
||||
.concat("\nTYPE: ".concat(container.getType()))
|
||||
.concat("\nNAME: ".concat(container.getName()))
|
||||
.concat("\nOBJECTS: ")
|
||||
.concat(
|
||||
container.getObjects().stream()
|
||||
.map(obj -> ("\n\t"+obj.getObjectFullId()))
|
||||
.collect(Collectors.joining())
|
||||
.concat("\nPARENT CONTAINERS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getParentContainers(), "\n\t")
|
||||
)
|
||||
.concat("\nDEPENDENCIES: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getDependencies(), "\n\t")
|
||||
)
|
||||
.concat("\nCHILD CONTAINERS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getChildContainers(), "\n\t")
|
||||
)
|
||||
.concat("\nDEPENDENTS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getDependent(), "\n\t")
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
|
||||
// output to console
|
||||
System.out.println(message);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Action;
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
import org.apache.karaf.shell.support.table.ShellTable;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
|
||||
@Service
|
||||
@Command (name = "container-list", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE)
|
||||
public class ContainerList extends EntaxyRuntimeObjectServiceSupport implements Action {
|
||||
|
||||
@Override
|
||||
public Object execute() throws Exception {
|
||||
ShellTable shellTable = new ShellTable();
|
||||
shellTable.column("Id");
|
||||
shellTable.column("Type");
|
||||
shellTable.column("Name");
|
||||
|
||||
for (EntaxyRuntimeObjectContainer roc: objectService.getContainers())
|
||||
shellTable.addRow().addContent(
|
||||
roc.getId()
|
||||
, roc.getType()
|
||||
, roc.getName()
|
||||
);
|
||||
|
||||
shellTable.print(System.out);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Reference;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectService;
|
||||
|
||||
public class EntaxyRuntimeObjectServiceSupport {
|
||||
|
||||
public static final String OBJECTS_SCOPE = "objects";
|
||||
|
||||
@Reference
|
||||
public EntaxyRuntimeObjectService objectService;
|
||||
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
import org.apache.karaf.shell.support.table.ShellTable;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectResource;
|
||||
|
||||
@Service
|
||||
@Command(name = "object-info", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Get object info")
|
||||
public class ObjectInfo extends RuntimeObjectAwareCommand {
|
||||
|
||||
@Override
|
||||
public Object doExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
|
||||
EntaxyRuntimeObjectContainer container = entaxyObject.getContainer();
|
||||
|
||||
String message = "Object Info for ".concat(entaxyObject.getObjectFullId())
|
||||
.concat("\n----------------------------------------")
|
||||
.concat("\nID: ".concat(entaxyObject.getId()))
|
||||
.concat("\nTYPE: ".concat(entaxyObject.getType()))
|
||||
.concat("\nFULL ID: ".concat(entaxyObject.getObjectFullId()))
|
||||
.concat("\nFACTORY ID: ".concat(entaxyObject.getFactoryId()))
|
||||
.concat("\nCONTAINER: ".concat(RuntimeObjectShellUtils.getContainerPrintString(container)))
|
||||
.concat("\nBUNDLE ID: ".concat(entaxyObject.getBundleInfo().getBundleId()+""))
|
||||
.concat("\nCOLOCATED WITH OBJECTS: ")
|
||||
.concat(
|
||||
container.getObjects().stream()
|
||||
.filter(obj-> !obj.getObjectFullId().equals(entaxyObject.getObjectFullId()))
|
||||
.map(obj -> ("\n\t" + obj.getObjectFullId()))
|
||||
.collect(Collectors.joining())
|
||||
.concat("\nPARENT OBJECTS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getRelationListMainPrintString(
|
||||
entaxyObject.getIncomiingSubordRelations()
|
||||
, "\n\t")
|
||||
)
|
||||
.concat("\nDEPENDENCIES: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getRelationListMainPrintString(
|
||||
RuntimeObjectShellUtils.getObjectDependenciesAndUses(entaxyObject)
|
||||
, "\n\t")
|
||||
)
|
||||
)
|
||||
.concat("\nCHILD OBJECTS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getRelationListDependentPrintString(
|
||||
entaxyObject.getSubordRelations()
|
||||
, "\n\t")
|
||||
)
|
||||
.concat("\nDEPENDENTS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getRelationListDependentPrintString(
|
||||
RuntimeObjectShellUtils.getObjectIncomingDependenciesAndUses(entaxyObject)
|
||||
, "\n\t")
|
||||
);
|
||||
|
||||
// object resources
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Scope");
|
||||
table.column("Exists");
|
||||
table.column("Url");
|
||||
|
||||
for (EntaxyRuntimeObjectResource res: entaxyObject.getResources())
|
||||
table.addRow().addContent(
|
||||
res.getScope().name(),
|
||||
(res.getResource().exists()?"*":""),
|
||||
res.getResourceUrl()
|
||||
);
|
||||
|
||||
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); PrintStream printStream = new PrintStream(outputStream)) {
|
||||
|
||||
table.print(printStream);
|
||||
message = message.concat("\nRESOURCES: \n").concat(outputStream.toString());
|
||||
}
|
||||
|
||||
// output to console
|
||||
System.out.println(message);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Option;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Reference;
|
||||
import org.apache.karaf.shell.support.table.ShellTable;
|
||||
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
|
||||
public abstract class ObjectOperationCommand extends RuntimeObjectAwareCommand {
|
||||
|
||||
@Option(name = "-f", required = false, description = "Force action on affected objects")
|
||||
boolean force;
|
||||
|
||||
@Option(name = "-s", required = false, description = "Skip action on affected objects")
|
||||
boolean soft;
|
||||
|
||||
@Reference
|
||||
EntaxyRuntimeObjectManager objectManager;
|
||||
|
||||
@Override
|
||||
public Object doExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
OperationResult result = doTargetExecute(entaxyObject);
|
||||
|
||||
// output result
|
||||
System.out.println("\t -> " + result.getResult().name());
|
||||
|
||||
switch (result.getResult()) {
|
||||
case DONE:
|
||||
|
||||
break;
|
||||
case REQUEST:
|
||||
outputForRequest(result, entaxyObject);
|
||||
break;
|
||||
case BLOCKED:
|
||||
outputForBlocked(result, entaxyObject);
|
||||
break;
|
||||
case FAILED:
|
||||
outputForFailed(result, entaxyObject);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected abstract OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject) throws Exception;
|
||||
|
||||
protected void outputForRequest(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key: result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nOperaton should be applied to the following affected objects:");
|
||||
table.print(System.out);
|
||||
|
||||
String message = "\n"
|
||||
.concat("Use\n")
|
||||
.concat("\t-f option to apply all operations on affected objects\n")
|
||||
.concat("or\n")
|
||||
.concat("\t-s option to skip all operations on affected objects\n");
|
||||
|
||||
// output
|
||||
System.out.println(message);
|
||||
}
|
||||
|
||||
protected void outputForBlocked(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key: result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nThe following operatons must be applied before invoking the current one:");
|
||||
table.print(System.out);
|
||||
|
||||
}
|
||||
|
||||
protected void outputForFailed(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
|
||||
// Output info
|
||||
System.out.println(
|
||||
"Operation failed with "
|
||||
.concat(CommonUtils.isValid(result.getMessage())?"the following ":"no ")
|
||||
.concat("message")
|
||||
.concat(
|
||||
CommonUtils.isValid(result.getMessage())
|
||||
?(": ".concat(result.getMessage()))
|
||||
:"."
|
||||
)
|
||||
);
|
||||
|
||||
if (!result.getAffected().isEmpty()) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key: result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nThe following suboperatons failed:");
|
||||
table.print(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
import org.apache.karaf.shell.support.table.ShellTable;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectResource;
|
||||
|
||||
@Service
|
||||
@Command(name = "object-resources", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Get object resources list")
|
||||
public class ObjectResources extends RuntimeObjectAwareCommand {
|
||||
|
||||
@Override
|
||||
public Object doExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Scope");
|
||||
table.column("Exists");
|
||||
table.column("Url");
|
||||
|
||||
for (EntaxyRuntimeObjectResource res: entaxyObject.getResources())
|
||||
table.addRow().addContent(
|
||||
res.getScope().name(),
|
||||
(res.getResource().exists()?"*":""),
|
||||
res.getResourceUrl()
|
||||
);
|
||||
|
||||
table.print(System.out);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
|
||||
@Service
|
||||
@Command(name = "object-start", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Start object")
|
||||
public class ObjectStart extends ObjectOperationCommand {
|
||||
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.startForced(entaxyObject.getObjectFullId());
|
||||
else if (soft)
|
||||
result = objectManager.startSoft(entaxyObject.getObjectFullId());
|
||||
else
|
||||
result = objectManager.start(entaxyObject.getObjectFullId());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
|
||||
@Service
|
||||
@Command(name = "object-stop", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Stop object")
|
||||
public class ObjectStop extends ObjectOperationCommand {
|
||||
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.stopForced(entaxyObject.getObjectFullId());
|
||||
else if (soft)
|
||||
result = objectManager.stopSoft(entaxyObject.getObjectFullId());
|
||||
else
|
||||
result = objectManager.stop(entaxyObject.getObjectFullId());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
|
||||
@Service
|
||||
@Command(name = "object-uninstall", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Uninstall object")
|
||||
public class ObjectUninstall extends ObjectOperationCommand {
|
||||
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.uninstallForced(entaxyObject.getObjectFullId());
|
||||
else if (soft)
|
||||
result = objectManager.uninstallSoft(entaxyObject.getObjectFullId());
|
||||
else
|
||||
result = objectManager.uninstall(entaxyObject.getObjectFullId());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* test-producers
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Action;
|
||||
import org.apache.karaf.shell.api.action.Argument;
|
||||
import org.apache.karaf.shell.api.action.Completion;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.shell.completers.RuntimeObjectCompleter;
|
||||
|
||||
public abstract class RuntimeObjectAwareCommand extends EntaxyRuntimeObjectServiceSupport implements Action {
|
||||
|
||||
@Argument (index = 0, name = "objectFullId", required = true)
|
||||
@Completion(caseSensitive = false, value = RuntimeObjectCompleter.class)
|
||||
String objectFullId;
|
||||
|
||||
@Override
|
||||
public Object execute() throws Exception {
|
||||
|
||||
List<EntaxyRuntimeObject> candidates = objectService.getObjects()
|
||||
.stream().filter(obj->obj.getObjectFullId().equals(objectFullId))
|
||||
.collect(Collectors.toList());
|
||||
if (candidates.size()>0) {
|
||||
return doExecute(candidates.get(0));
|
||||
} else {
|
||||
throw new IllegalArgumentException("Object not found by full Id: [" + objectFullId + "]");
|
||||
}
|
||||
}
|
||||
|
||||
public abstract Object doExecute(EntaxyRuntimeObject entaxyObject) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_RELATION;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeRelation;
|
||||
|
||||
public class RuntimeObjectShellUtils {
|
||||
|
||||
public static String getContainerPrintString(EntaxyRuntimeObjectContainer container) {
|
||||
return "[" + container.getId() + "]" + container.getName();
|
||||
}
|
||||
|
||||
public static String getContainerListPrintString(List<EntaxyRuntimeObjectContainer> containers) {
|
||||
return getContainerListPrintString(containers, "");
|
||||
}
|
||||
|
||||
public static String getContainerListPrintString(List<EntaxyRuntimeObjectContainer> containers, String prefix) {
|
||||
return containers.stream()
|
||||
.map(cnt -> prefix + getContainerPrintString(cnt))
|
||||
.collect(Collectors.joining());
|
||||
|
||||
}
|
||||
|
||||
public static String getObjectPrintString(EntaxyRuntimeObject object) {
|
||||
return object.getObjectFullId();
|
||||
}
|
||||
|
||||
public static String getObjectListPrintString(List<EntaxyRuntimeObject> objects) {
|
||||
return getObjectListPrintString(objects, "");
|
||||
}
|
||||
|
||||
public static String getObjectListPrintString(List<EntaxyRuntimeObject> objects, String prefix) {
|
||||
return objects.stream()
|
||||
.map(obj -> prefix + getObjectPrintString(obj))
|
||||
.collect(Collectors.joining());
|
||||
|
||||
}
|
||||
|
||||
public static String getRelationPrintString(EntaxyRuntimeRelation relation) {
|
||||
return relation.getType().name() + " [" + relation.getName() + " / " + relation.getGroup() + " : " + relation.getScope().name() + "]";
|
||||
}
|
||||
|
||||
public static String getRelationDependentPrintString(EntaxyRuntimeRelation relation) {
|
||||
return getRelationPrintString(relation) + " - " + getObjectPrintString(relation.getDependent());
|
||||
}
|
||||
|
||||
public static String getRelationMainPrintString(EntaxyRuntimeRelation relation) {
|
||||
return getRelationPrintString(relation) + " - " + getObjectPrintString(relation.getMain());
|
||||
}
|
||||
|
||||
public static String getRelationListMainPrintString(List<EntaxyRuntimeRelation> relations) {
|
||||
return getRelationListMainPrintString(relations, "");
|
||||
}
|
||||
|
||||
public static String getRelationListMainPrintString(List<EntaxyRuntimeRelation> relations, String prefix) {
|
||||
return relations.stream()
|
||||
.map(obj -> prefix + getRelationMainPrintString(obj))
|
||||
.collect(Collectors.joining());
|
||||
}
|
||||
|
||||
public static String getRelationListDependentPrintString(List<EntaxyRuntimeRelation> relations) {
|
||||
return getRelationListDependentPrintString(relations, "");
|
||||
}
|
||||
|
||||
public static String getRelationListDependentPrintString(List<EntaxyRuntimeRelation> relations, String prefix) {
|
||||
return relations.stream()
|
||||
.map(obj -> prefix + getRelationDependentPrintString(obj))
|
||||
.collect(Collectors.joining());
|
||||
}
|
||||
|
||||
public static List<EntaxyRuntimeRelation> getObjectDependenciesAndUses(EntaxyRuntimeObject object) {
|
||||
List<EntaxyRuntimeRelation> result = new ArrayList<>(object.getRelations(OBJECT_RELATION.DEPENDENCY));
|
||||
result.addAll(object.getRelations(OBJECT_RELATION.USE));
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List<EntaxyRuntimeRelation> getObjectIncomingDependenciesAndUses(EntaxyRuntimeObject object) {
|
||||
List<EntaxyRuntimeRelation> result = new ArrayList<>(object.getIncomiingRelations(OBJECT_RELATION.DEPENDENCY));
|
||||
result.addAll(object.getRelations(OBJECT_RELATION.USE));
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell.completers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
import org.apache.karaf.shell.api.console.CommandLine;
|
||||
import org.apache.karaf.shell.api.console.Completer;
|
||||
import org.apache.karaf.shell.api.console.Session;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.shell.EntaxyRuntimeObjectServiceSupport;
|
||||
|
||||
@Service
|
||||
public class ContainerCompleter extends EntaxyRuntimeObjectServiceSupport implements Completer {
|
||||
|
||||
@Override
|
||||
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
|
||||
candidates.addAll(
|
||||
objectService.getContainers().stream()
|
||||
.map(c -> c.getName())
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* 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.objects.runtime.shell.completers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
import org.apache.karaf.shell.api.console.CommandLine;
|
||||
import org.apache.karaf.shell.api.console.Completer;
|
||||
import org.apache.karaf.shell.api.console.Session;
|
||||
|
||||
import ru.entaxy.platform.objects.runtime.shell.EntaxyRuntimeObjectServiceSupport;
|
||||
|
||||
@Service
|
||||
public class RuntimeObjectCompleter extends EntaxyRuntimeObjectServiceSupport implements Completer {
|
||||
|
||||
@Override
|
||||
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
|
||||
candidates.addAll(objectService.getObjects().stream()
|
||||
.filter(obj -> !obj.isGhost())
|
||||
.map(obj -> obj.getObjectFullId())
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
33
platform/runtime/core/object-runtime/pom.xml
Normal file
33
platform/runtime/core/object-runtime/pom.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<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</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>object-runtime</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECT RUNTIME</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECT RUNTIME</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.base.objects-base
|
||||
</groupId>
|
||||
<artifactId>objects-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base.resources</groupId>
|
||||
<artifactId>resources-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<modules>
|
||||
<module>object-runtime-core</module>
|
||||
<module>object-runtime-shell</module>
|
||||
</modules>
|
||||
</project>
|
Reference in New Issue
Block a user