ENTAXY-374 release 1.8.2
This commit is contained in:
201
platform/runtime/core/objects-implementations/LICENSE.txt
Normal file
201
platform/runtime/core/objects-implementations/LICENSE.txt
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,38 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connection-implementation</artifactId>
|
||||
<version>1.8.2</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.connection-implementation</groupId>
|
||||
<artifactId>connection-producing</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTION :: PRODUCING</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTION :: PRODUCING</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.core.object-producing
|
||||
</groupId>
|
||||
<artifactId>object-producer-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.core.object-producing
|
||||
</groupId>
|
||||
<artifactId>object-producer-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.base.connecting.generator
|
||||
</groupId>
|
||||
<artifactId>generator-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,147 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.osgi.service.component.annotations.CollectionType;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ReferencePolicy;
|
||||
import org.osgi.service.component.annotations.ReferencePolicyOption;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.FIELDS;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_TYPES;
|
||||
import ru.entaxy.platform.base.objects.connection.producing.adapters.AdapterWrapperEntaxyFactory;
|
||||
import ru.entaxy.platform.base.objects.connection.producing.adapters.AdapterWrapperGenerationProcessor;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory.FieldInfo;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactoryException;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.core.artifact.ArtifactCoordinates;
|
||||
import ru.entaxy.platform.core.producer.api.EntaxyProducer;
|
||||
import ru.entaxy.platform.core.producer.api.EntaxyProducerService;
|
||||
import ru.entaxy.platform.core.producer.api.EntaxyWrappedFactory;
|
||||
import ru.entaxy.platform.core.producer.impl.CommonObjectProducer;
|
||||
import ru.entaxy.platform.core.producer.impl.EntaxyProducerInfo;
|
||||
import ru.entaxy.platform.core.producer.impl.FieldInfoImpl;
|
||||
import ru.entaxy.platform.core.producer.wrapper.AbstractFactoryWrapper;
|
||||
import ru.entaxy.platform.core.producer.wrapper.AbstractFactoryWrapper.GenerationProcessor;
|
||||
|
||||
@Component(service = {EntaxyProducer.class}, immediate = true)
|
||||
@EntaxyProducerInfo(supportedTypes = {OBJECT_TYPES.CONNECTION})
|
||||
public class ConnectionProducer extends CommonObjectProducer implements EntaxyProducer, GenerationProcessor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ConnectionProducer.class);
|
||||
|
||||
public static final String PROPERTY_OBJECT_ID = EntaxyObject.FIELDS.OBJECT_ID;
|
||||
public static final String PROPERTY_NAME = "name";
|
||||
public static final String TEMP_PREFIX = "TEMP-";
|
||||
|
||||
|
||||
@Reference(bind = "addFactory", unbind = "removeFactory", cardinality = ReferenceCardinality.MULTIPLE
|
||||
, collectionType = CollectionType.SERVICE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY)
|
||||
public void addFactory(EntaxyFactory factory) {
|
||||
AbstractFactoryWrapper wrapper = super.doAddFactory(factory);
|
||||
if (wrapper != null)
|
||||
if (factory instanceof AdapterWrapperEntaxyFactory) {
|
||||
AdapterWrapperGenerationProcessor processor = new AdapterWrapperGenerationProcessor();
|
||||
processor.setPreBefore(this);
|
||||
processor.setPostAfter(this);
|
||||
wrapper.setGenerationProcessor(processor);
|
||||
} else {
|
||||
wrapper.setGenerationProcessor(this);
|
||||
}
|
||||
}
|
||||
|
||||
// WE MUST DECLARE IT for @Reference annotation processor
|
||||
@Override
|
||||
public void removeFactory(EntaxyFactory factory) {
|
||||
super.removeFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate(EntaxyWrappedFactory wrappedFactory, String outputType, String scope, String objectType,
|
||||
Map<String, Object> parameters) throws EntaxyFactoryException {
|
||||
super.preGenerate(wrappedFactory, outputType, scope, objectType, parameters);
|
||||
|
||||
// create objectId if it's not set
|
||||
String connectionName = parameters.getOrDefault(PROPERTY_NAME, "").toString();
|
||||
String objectId = parameters.getOrDefault(PROPERTY_OBJECT_ID, "").toString();
|
||||
log.debug("connectionName:[{}], objectId:[{}]", connectionName, objectId);
|
||||
if (!CommonUtils.isValid(objectId) || objectId.startsWith(TEMP_PREFIX))
|
||||
if (CommonUtils.isValid(connectionName)) {
|
||||
parameters.put(PROPERTY_OBJECT_ID, connectionName);
|
||||
}
|
||||
if (!CommonUtils.isValid(connectionName) && CommonUtils.isValid(objectId))
|
||||
parameters.put(PROPERTY_NAME, objectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addFields(AbstractFactoryWrapper factoryWrapper) {
|
||||
super.addFields(factoryWrapper);
|
||||
if (factoryWrapper.getOrigin() instanceof AdapterWrapperEntaxyFactory) {
|
||||
|
||||
// factoryWrapper.getOrigin().getFields().forEach(fi -> log.info("\n\tFIELD: " + fi.getName()));
|
||||
|
||||
List<EntaxyFactory.FieldInfo> names = factoryWrapper.getOrigin().getFields().stream()
|
||||
.filter(fi -> PROPERTY_NAME.equals(fi.getName()))
|
||||
.collect(Collectors.toList());
|
||||
if (names.isEmpty()) {
|
||||
log.debug("\n\t ADDING NAME FOR " + factoryWrapper.getFactoryId());
|
||||
factoryWrapper.addField(
|
||||
(new FieldInfoImpl())
|
||||
.name(PROPERTY_NAME)
|
||||
.type("String")
|
||||
.required(true)
|
||||
.immutable(true)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void postGenerate(EntaxyWrappedFactory wrappedFactory, String outputType, String scope, String objectType,
|
||||
Map<String, Object> parameters, Generated generated) throws EntaxyFactoryException {
|
||||
super.postGenerate(wrappedFactory, outputType, scope, objectType, parameters, generated);
|
||||
generated.getProperties().put(
|
||||
EntaxyProducerService.INSTRUCTIONS.ARTIFACT.VERSION_POLICY,
|
||||
ArtifactCoordinates.VERSION_POLICY_DATED_EMBEDDED);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getFieldsToPublish(String outputType, String scope, String objectType,
|
||||
String objectId) {
|
||||
|
||||
Map<String, String> result = super.getFieldsToPublish(outputType, scope, objectType, objectId);
|
||||
result.put("name", "name");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing.adapters;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Deactivate;
|
||||
import org.osgi.util.tracker.BundleTracker;
|
||||
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleHeaderFilter;
|
||||
|
||||
@Component(service = AdapterWrapManager.class, immediate = true)
|
||||
public class AdapterWrapManager {
|
||||
|
||||
protected BundleContext bundleContext;
|
||||
|
||||
protected BundleTracker<List<TrackedAdapter>> adapterTracker;
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
this.bundleContext = componentContext.getBundleContext();
|
||||
this.adapterTracker = BundleTrackerUtils.<List<TrackedAdapter>>createBuilder()
|
||||
.addFilter(
|
||||
(new BundleHeaderFilter()).header("Entaxy-Adapter").value("true")
|
||||
)
|
||||
.customizer(
|
||||
(new TrackedAdapterCustomizer())
|
||||
.listener(new TrackedAdapterCustomizerListener(bundleContext))
|
||||
)
|
||||
.bundleState(Bundle.ACTIVE | Bundle.INSTALLED | Bundle.RESOLVED)
|
||||
.get();
|
||||
this.adapterTracker.open();
|
||||
}
|
||||
|
||||
@Deactivate
|
||||
public void deactivate() {
|
||||
this.adapterTracker.close();
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing.adapters;
|
||||
|
||||
import ru.entaxy.platform.base.objects.factory.impl.DefaultFactory;
|
||||
|
||||
public class AdapterWrapperDefaultFactory extends DefaultFactory implements AdapterWrapperEntaxyFactory {
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing.adapters;
|
||||
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
|
||||
public interface AdapterWrapperEntaxyFactory extends EntaxyFactory {
|
||||
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing.adapters;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory.OutputInfo;
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.objects.connection.producing.ConnectionProducer;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactoryException;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.core.producer.api.EntaxyWrappedFactory;
|
||||
import ru.entaxy.platform.core.producer.wrapper.AbstractFactoryWrapper.GenerationProcessor;
|
||||
|
||||
public class AdapterWrapperGenerationProcessor implements GenerationProcessor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AdapterWrapperGenerationProcessor.class);
|
||||
|
||||
public static final String PATH_PARAMETER_OUTPUT = "pathParameter";
|
||||
public static final String EXPRESSION_ATTRIBUTE = "expression";
|
||||
|
||||
public static final String PROPERTY_CONFIGURATION_PID = "configurationPid";
|
||||
public static final String PID_PREFIX = "ru.entaxy.esb.connection.";
|
||||
|
||||
protected GenerationProcessor preBefore, preAfter, postBefore, postAfter;
|
||||
|
||||
@Override
|
||||
public void preGenerate(EntaxyWrappedFactory wrappedFactory, String outputType, String scope, String objectType,
|
||||
Map<String, Object> parameters) throws EntaxyFactoryException {
|
||||
if (preBefore != null)
|
||||
preBefore.preGenerate(wrappedFactory, outputType, scope, objectType, parameters);
|
||||
|
||||
// add pathParameter based on config
|
||||
if (!parameters.containsKey(PATH_PARAMETER_OUTPUT)) {
|
||||
log.debug(">> ADDING " + PATH_PARAMETER_OUTPUT);
|
||||
OutputInfo outputInfo = wrappedFactory.getOutputByType(PATH_PARAMETER_OUTPUT);
|
||||
if (outputInfo != null) {
|
||||
log.debug(">> FOUND OUTPUT " + PATH_PARAMETER_OUTPUT
|
||||
+ ", CONFIG IS "
|
||||
+ (outputInfo.getConfig()!=null?"NOT ":"")
|
||||
+ "NULL");
|
||||
if (outputInfo.getConfig()!=null)
|
||||
log.debug(outputInfo.getConfig().toString());
|
||||
String expression = outputInfo.getConfig()!=null
|
||||
?outputInfo.getConfig().getOrDefault(EXPRESSION_ATTRIBUTE, "").toString()
|
||||
:"";
|
||||
log.debug(">> EXPRESSION: [" + expression + "]");
|
||||
if (CommonUtils.isValid(expression) && expression.startsWith("${")) {
|
||||
String lookup = expression.substring(2, expression.lastIndexOf("}"));
|
||||
log.debug(">> LOOKUP: [" + lookup + "]");
|
||||
if (CommonUtils.isValid(lookup))
|
||||
parameters.put(PATH_PARAMETER_OUTPUT, parameters.getOrDefault(lookup, ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
// set configurationPid to 'ru.entaxy.esb.connection.' + name.replace('-', '.')
|
||||
String name = parameters.getOrDefault("name", UUID.randomUUID()).toString();
|
||||
name = name.replace("-", ".");
|
||||
String configurationPid = PID_PREFIX + name;
|
||||
parameters.put(PROPERTY_CONFIGURATION_PID, configurationPid);
|
||||
|
||||
// remove 'name' from properties
|
||||
Map<String, Object> properties = (Map<String, Object>)parameters.get(EntaxyObject.FIELDS.PROPERTIES);
|
||||
properties.remove(ConnectionProducer.PROPERTY_NAME);
|
||||
|
||||
// copy all the parameters to 'connection'
|
||||
Map<String, Object> copy = new HashMap<>(parameters);
|
||||
parameters.put("connection", copy);
|
||||
|
||||
System.out.println("\n\n===>>>\n:" + parameters.toString() + "\n\n");
|
||||
|
||||
log.debug("RESULT PARAMETERS :: " + parameters.toString());
|
||||
|
||||
if (preAfter != null)
|
||||
preAfter.preGenerate(wrappedFactory, outputType, scope, objectType, parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postGenerate(EntaxyWrappedFactory wrappedFactory, String outputType, String scope, String objectType,
|
||||
Map<String, Object> parameters, Generated generated) throws EntaxyFactoryException {
|
||||
|
||||
if (postBefore != null)
|
||||
postBefore.postGenerate(wrappedFactory, outputType, scope, objectType, parameters, generated);
|
||||
|
||||
|
||||
if (postAfter != null)
|
||||
postAfter.postGenerate(wrappedFactory, outputType, scope, objectType, parameters, generated);
|
||||
|
||||
}
|
||||
|
||||
public void setPreBefore(GenerationProcessor preBefore) {
|
||||
this.preBefore = preBefore;
|
||||
}
|
||||
|
||||
public void setPreAfter(GenerationProcessor preAfter) {
|
||||
this.preAfter = preAfter;
|
||||
}
|
||||
|
||||
public void setPostBefore(GenerationProcessor postBefore) {
|
||||
this.postBefore = postBefore;
|
||||
}
|
||||
|
||||
public void setPostAfter(GenerationProcessor postAfter) {
|
||||
this.postAfter = postAfter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,326 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing.adapters;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_TYPES;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory.CONFIGURATION.OUTPUTS;
|
||||
import ru.entaxy.platform.base.objects.factory.configuration.FactoryElement;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.JSONUtils;
|
||||
|
||||
public class ConfigConverter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ConfigConverter.class);
|
||||
|
||||
public static Set<String> supportedRegulars = EntaxyFactory.CONFIGURATION.FIELDS.REGULAR_TYPES.asSet();
|
||||
|
||||
protected static Gson gson = new Gson();
|
||||
|
||||
public static String convertFromAdapter(String adapterMetadata) {
|
||||
|
||||
String result = "{}";
|
||||
|
||||
Map<String, Map<String, JsonObject>> fieldsForOutputs = new HashMap<>();
|
||||
|
||||
JsonObject metadataRoot = JSONUtils.getJsonRootObject(adapterMetadata);
|
||||
JsonObject configuration = new JsonObject();
|
||||
|
||||
JsonObject metadata = metadataRoot.get("adapter").getAsJsonObject();
|
||||
|
||||
log.info("CONVERTING CONFIG FOR: [" + metadata.get("id").getAsString() + "]");
|
||||
|
||||
// add 'factory' section
|
||||
|
||||
FactoryElement factoryElement = new FactoryElement();
|
||||
factoryElement.setId(metadata.get("id").getAsString());
|
||||
factoryElement.setType(OBJECT_TYPES.CONNECTION);
|
||||
|
||||
JsonElement factoryJson = gson.toJsonTree(factoryElement);
|
||||
configuration.add(EntaxyFactory.CONFIGURATION.FACTORY_SECTION_NAME, factoryJson);
|
||||
|
||||
// add type specific section
|
||||
|
||||
configuration.add(OBJECT_TYPES.CONNECTION, new JsonObject());
|
||||
|
||||
// add fields
|
||||
|
||||
JsonObject targetFields = new JsonObject();
|
||||
JsonArray sourceFields = metadata.get("fields").getAsJsonArray();
|
||||
|
||||
for (int i=0; i<sourceFields.size(); i++) {
|
||||
JsonObject sourceField = sourceFields.get(i).getAsJsonObject();
|
||||
ConvertedField convertedField = convertField(sourceField);
|
||||
targetFields.add(convertedField.name, convertedField.fieldObject);
|
||||
for (Entry<String, JsonObject> entry: convertedField.outputConfiguration.entrySet()) {
|
||||
if (!fieldsForOutputs.containsKey(entry.getKey()))
|
||||
fieldsForOutputs.put(entry.getKey(), new HashMap<>());
|
||||
((Map<String, JsonObject>)fieldsForOutputs.get(entry.getKey())).put(convertedField.name, entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
configuration.add(EntaxyFactory.CONFIGURATION.FIELDS_SECTION_NAME, targetFields);
|
||||
|
||||
// add outputs
|
||||
|
||||
JsonObject targetOutputs = new JsonObject();
|
||||
JsonArray sourceGenerators = metadata.get("generators").getAsJsonArray();
|
||||
|
||||
for (int i=0; i<sourceGenerators.size(); i++) {
|
||||
JsonObject sourceGenerator = sourceGenerators.get(i).getAsJsonObject();
|
||||
JsonObject targetOutput = new JsonObject();
|
||||
|
||||
log.info("GENERATOR: " + sourceGenerator.toString());
|
||||
|
||||
// name
|
||||
String name = sourceGenerator.get("type").getAsString();
|
||||
log.info("GENERATOR NAME: " + name);
|
||||
|
||||
// isDefault: true for 'init'
|
||||
if (EntaxyFactory.CONFIGURATION.OUTPUTS.OUTPUT_TYPE_INIT.equals(name))
|
||||
targetOutput.addProperty(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.IS_DEFAULT
|
||||
, true);
|
||||
|
||||
// generator
|
||||
if (sourceGenerator.has("generator"))
|
||||
targetOutput.add(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.GENERATOR
|
||||
, sourceGenerator.get("generator"));
|
||||
|
||||
// config
|
||||
if (sourceGenerator.has("config"))
|
||||
targetOutput.add(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.CONFIG
|
||||
, sourceGenerator.get("config"));
|
||||
|
||||
// fields for output
|
||||
if (fieldsForOutputs.containsKey(name)) {
|
||||
Map<String, JsonObject> fieldsForOutput = (Map<String, JsonObject>)fieldsForOutputs.get(name);
|
||||
if (!fieldsForOutput.isEmpty()) {
|
||||
JsonObject fields = new JsonObject();
|
||||
for (Entry<String, JsonObject> entry: fieldsForOutput.entrySet())
|
||||
fields.add(entry.getKey(), entry.getValue());
|
||||
targetOutput.add(EntaxyFactory.CONFIGURATION.OUTPUTS.ATTRIBUTES.FIELDS, fields);
|
||||
}
|
||||
}
|
||||
|
||||
targetOutputs.add(name, targetOutput);
|
||||
|
||||
}
|
||||
|
||||
configuration.add(EntaxyFactory.CONFIGURATION.OUTPUTS_SECTION_NAME, targetOutputs);
|
||||
|
||||
// return
|
||||
|
||||
result = configuration.toString();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected static class ConvertedField {
|
||||
String name;
|
||||
FieldType fieldType;
|
||||
JsonObject fieldObject;
|
||||
Map<String, JsonObject> outputConfiguration = new HashMap<>();
|
||||
|
||||
public void addToOutput(String outputName, JsonObject configuration) {
|
||||
outputConfiguration.put(outputName, configuration);
|
||||
}
|
||||
}
|
||||
|
||||
public static ConvertedField convertField(JsonObject sourceField) {
|
||||
ConvertedField result = new ConvertedField();
|
||||
JsonObject resultJson = new JsonObject();
|
||||
|
||||
// name
|
||||
|
||||
result.name = sourceField.get("name").getAsString();
|
||||
|
||||
// field type
|
||||
|
||||
String type = null;
|
||||
if (sourceField.has("type"))
|
||||
type = sourceField.get("type").getAsString();
|
||||
if (!CommonUtils.isValid(type))
|
||||
type = EntaxyFactory.CONFIGURATION.FIELDS.REGULAR_TYPES.STRING;
|
||||
|
||||
FieldType targetType = new FieldType(type);
|
||||
result.fieldType = targetType;
|
||||
|
||||
resultJson.addProperty(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.FIELD_TYPE, targetType.targetFieldType);
|
||||
if (targetType.isEntaxyType) {
|
||||
resultJson.addProperty(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.IS_REF, true);
|
||||
}
|
||||
|
||||
// default value
|
||||
|
||||
boolean hasDefaultValue = false;
|
||||
|
||||
if (sourceField.has("defaultValue")) {
|
||||
hasDefaultValue = true;
|
||||
String defaultValue = sourceField.get("defaultValue").getAsString();
|
||||
if (CommonUtils.isValid(defaultValue)) {
|
||||
Object targetDefaultValue = targetType.convertValue(defaultValue);
|
||||
JsonElement je = gson.toJsonTree(targetDefaultValue);
|
||||
resultJson.add(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.DEFAULT_VALUE, je);
|
||||
}
|
||||
}
|
||||
|
||||
// required and immutable
|
||||
|
||||
boolean isProperty = readBoolean(sourceField, "property", false);
|
||||
boolean isOption = readBoolean(sourceField, "option", false);
|
||||
|
||||
boolean isRequired = hasDefaultValue;
|
||||
boolean isImmutable = false;
|
||||
|
||||
if (isProperty) {
|
||||
|
||||
if (isOption) {
|
||||
// not immutable and needed for init
|
||||
isImmutable = false;
|
||||
result.addToOutput(OUTPUTS.OUTPUT_TYPE_INIT, new JsonObject());
|
||||
} else {
|
||||
// immutable and needed for init
|
||||
isImmutable = true;
|
||||
result.addToOutput(OUTPUTS.OUTPUT_TYPE_INIT, new JsonObject());
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (isOption) {
|
||||
// not immutable and not needed for init
|
||||
isImmutable = false;
|
||||
} else {
|
||||
// some hidden field, no idea how to process it
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resultJson.addProperty(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.REQUIRED, isRequired);
|
||||
resultJson.addProperty(EntaxyFactory.CONFIGURATION.FIELDS.ATTRIBUTES.IMMUTABLE, isImmutable);
|
||||
|
||||
result.fieldObject = resultJson;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected static boolean readBoolean(JsonObject sourceField, String name, boolean defaultValue) {
|
||||
boolean result = defaultValue;
|
||||
|
||||
if (sourceField.has(name))
|
||||
try {
|
||||
result = sourceField.get(name).getAsBoolean();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected static class FieldType {
|
||||
String targetFieldType;
|
||||
String sourceFieldType;
|
||||
boolean isEntaxyType = false;
|
||||
boolean isClassOrService = false;
|
||||
boolean isRegular = true;
|
||||
|
||||
public FieldType(String sourceFieldType) {
|
||||
this.sourceFieldType = sourceFieldType;
|
||||
|
||||
if (!checkRegular(this.sourceFieldType))
|
||||
if (!checkEntaxyRuntime(this.sourceFieldType)) {
|
||||
// assume as Service or Class type
|
||||
this.isRegular = false;
|
||||
this.isEntaxyType = false;
|
||||
this.isClassOrService = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean checkRegular(String sourceValue) {
|
||||
Set<String> foundRegulars = supportedRegulars.stream().filter(val -> val.equalsIgnoreCase(sourceValue))
|
||||
.collect(Collectors.toSet());
|
||||
if (foundRegulars.size() == 0) {
|
||||
this.isRegular = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
this.targetFieldType = foundRegulars.iterator().next();
|
||||
this.isRegular = true;
|
||||
this.isEntaxyType = false;
|
||||
this.isClassOrService = false;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
protected boolean checkEntaxyRuntime(String sourceValue) {
|
||||
boolean result = EntaxyObject.OBJECT_TYPES.isRuntimeType(sourceValue);
|
||||
if (result) {
|
||||
this.isRegular = false;
|
||||
this.isEntaxyType = true;
|
||||
this.isClassOrService = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Object convertValue(String value) {
|
||||
if (EntaxyFactory.CONFIGURATION.FIELDS.REGULAR_TYPES.BOOLEAN.equals(this.targetFieldType)) {
|
||||
try {
|
||||
Boolean result = Boolean.valueOf(value);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (EntaxyFactory.CONFIGURATION.FIELDS.REGULAR_TYPES.LONG.equals(this.targetFieldType)) {
|
||||
try {
|
||||
Long result = Long.valueOf(value);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return Long.valueOf(0);
|
||||
}
|
||||
}
|
||||
if (EntaxyFactory.CONFIGURATION.FIELDS.REGULAR_TYPES.DOUBLE.equals(this.targetFieldType)) {
|
||||
try {
|
||||
Double result = Double.valueOf(value);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return Double.valueOf(0);
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing.adapters;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.osgi.framework.ServiceRegistration;
|
||||
|
||||
import ru.entaxy.base.generator.template.Template;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
|
||||
public class TrackedAdapter {
|
||||
|
||||
protected String id;
|
||||
protected long bundleId;
|
||||
protected String metadata;
|
||||
protected String configuration;
|
||||
protected ServiceRegistration<? extends EntaxyFactory> serviceRegistration;
|
||||
|
||||
protected List<URL> templates = new ArrayList<>();
|
||||
protected List<ServiceRegistration<Template>> templateRegistrations = new ArrayList<>();;
|
||||
|
||||
|
||||
public void unregister() {
|
||||
try {
|
||||
this.serviceRegistration.unregister();
|
||||
} catch (Exception e) {
|
||||
|
||||
};
|
||||
|
||||
for (ServiceRegistration<Template> sr: templateRegistrations)
|
||||
try {
|
||||
sr.unregister();
|
||||
} catch (Exception e) {
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public long getBundleId() {
|
||||
return bundleId;
|
||||
}
|
||||
|
||||
public void setBundleId(long bundleId) {
|
||||
this.bundleId = bundleId;
|
||||
}
|
||||
|
||||
public String getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
public void setConfiguration(String configuration) {
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
public String getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public void setMetadata(String metadata) {
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
public ServiceRegistration<? extends EntaxyFactory> getServiceRegistration() {
|
||||
return serviceRegistration;
|
||||
}
|
||||
|
||||
public void setServiceRegistration(ServiceRegistration<EntaxyFactory> serviceRegistration) {
|
||||
this.serviceRegistration = serviceRegistration;
|
||||
}
|
||||
|
||||
public List<URL> getTemplates() {
|
||||
return templates;
|
||||
}
|
||||
|
||||
public List<ServiceRegistration<Template>> getTemplateRegistrations() {
|
||||
return templateRegistrations;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing.adapters;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleEvent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.base.generator.template.impl.ProvidedTemplate;
|
||||
import ru.entaxy.base.generator.template.impl.TemplateMetadata;
|
||||
import ru.entaxy.base.generator.template.impl.TemplateProvider;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.UniformBundleTrackerCustomizer;
|
||||
|
||||
public class TrackedAdapterCustomizer extends UniformBundleTrackerCustomizer<List<TrackedAdapter>> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TrackedAdapterCustomizer.class);
|
||||
|
||||
@Override
|
||||
protected List<TrackedAdapter> createManagedObject(Bundle bundle, BundleEvent event,
|
||||
Map<String, List<?>> filterResults) {
|
||||
|
||||
URL metadataUrl = bundle.getEntry("/ru/entaxy/adapter/metadata.json");
|
||||
log.debug("Json URL is {}", metadataUrl.toString());
|
||||
|
||||
try {
|
||||
|
||||
String metadata = new BufferedReader (
|
||||
new InputStreamReader(
|
||||
metadataUrl.openStream(), StandardCharsets.UTF_8))
|
||||
.lines()
|
||||
.collect(Collectors.joining("\n"));
|
||||
|
||||
TrackedAdapter trackedAdapter = new TrackedAdapter();
|
||||
trackedAdapter.setMetadata(metadata);
|
||||
trackedAdapter.setBundleId(bundle.getBundleId());
|
||||
|
||||
String configuration = ConfigConverter.convertFromAdapter(metadata);
|
||||
trackedAdapter.setConfiguration(configuration);
|
||||
|
||||
log.info("TrackedAdapter metadata: \n" + metadata);
|
||||
log.info("TrackedAdapter configuration: \n" + configuration);
|
||||
|
||||
Enumeration<URL> foundEntries = bundle.findEntries("/template/", "*.*", true);
|
||||
while (foundEntries.hasMoreElements()) {
|
||||
URL entry = foundEntries.nextElement();
|
||||
log.debug("FOUND :: " + entry.toString());
|
||||
if (entry.toString().endsWith("/")) {
|
||||
log.debug(":: .. is folder");
|
||||
continue;
|
||||
}
|
||||
trackedAdapter.getTemplates().add(entry);
|
||||
}
|
||||
|
||||
return Collections.<TrackedAdapter>singletonList(trackedAdapter);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to read adapter metadata from bundle [" + bundle.getBundleId() + "]", e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.connection.producing.adapters;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.Dictionary;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.base.generator.template.Template;
|
||||
import ru.entaxy.base.generator.template.TemplateImpl;
|
||||
import ru.entaxy.base.generator.template.TemplateService;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
import ru.entaxy.platform.base.objects.factory.impl.DefaultFactory;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerCustomizerListener;
|
||||
|
||||
public class TrackedAdapterCustomizerListener implements BundleTrackerCustomizerListener<List<TrackedAdapter>> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TrackedAdapterCustomizerListener.class);
|
||||
|
||||
protected BundleContext bundleContext;
|
||||
|
||||
public TrackedAdapterCustomizerListener(BundleContext bundleContext) {
|
||||
super();
|
||||
this.bundleContext = bundleContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void added(List<TrackedAdapter> managedObject) {
|
||||
|
||||
for (TrackedAdapter adapter: managedObject) {
|
||||
|
||||
// create factory
|
||||
|
||||
AdapterWrapperDefaultFactory factory = new AdapterWrapperDefaultFactory();
|
||||
// factory.setFactoryId(adapter.getId());
|
||||
factory.configure(adapter.configuration);
|
||||
adapter.setId(factory.getFactoryId());
|
||||
|
||||
if (!factory.isValid())
|
||||
continue;
|
||||
|
||||
Dictionary<String, String> props = new Hashtable<String, String>();
|
||||
props.put(EntaxyFactory.SERVICE.PROP_ID, factory.getFactoryId());
|
||||
props.put(EntaxyFactory.SERVICE.PROP_TYPE, factory.getFactoryType());
|
||||
props.put(EntaxyFactory.SERVICE.PROP_ORIGIN_BUNDLE, adapter.getBundleId()+"");
|
||||
|
||||
adapter.serviceRegistration = this.bundleContext.registerService(
|
||||
EntaxyFactory.class,
|
||||
factory,
|
||||
props);
|
||||
|
||||
// register templates
|
||||
|
||||
for (URL url: adapter.getTemplates())
|
||||
registerTemplate(url, adapter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modified(List<TrackedAdapter> managedObject) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed(List<TrackedAdapter> managedObject) {
|
||||
for (TrackedAdapter adapter: managedObject)
|
||||
adapter.unregister();
|
||||
}
|
||||
|
||||
protected void registerTemplate(URL templateUrl, TrackedAdapter adapter) {
|
||||
String templatePath = "/template";
|
||||
String localPath = templateUrl.toString();
|
||||
localPath = localPath.substring(localPath.indexOf(templatePath) + templatePath.length() + 1);
|
||||
String fullname = localPath.substring(localPath.lastIndexOf("/")+1);
|
||||
String path = localPath.lastIndexOf("/")>0
|
||||
?localPath.substring(0, localPath.lastIndexOf("/"))
|
||||
:"";
|
||||
String fullPath = templatePath + "/" + path;
|
||||
String fileName = fullname.substring(0, fullname.lastIndexOf("."));
|
||||
String fileType = fullname.substring(fullname.lastIndexOf(".")+1);
|
||||
String id = CommonUtils.isValid(path)
|
||||
?path.replace("/", ".") + "." + fileName
|
||||
:fileName;
|
||||
log.debug(":: localPath = " + localPath + "; fullName = " + fullname + "; fileName = " + fileName
|
||||
+ "; fileType = " + fileType + "; path = " + path);
|
||||
|
||||
/*
|
||||
* TemplateMetadata meta = new TemplateMetadata(); meta.setId(id);
|
||||
* meta.setFilename(fileName); meta.setFullname(fullname); meta.setName(id);
|
||||
* meta.setType(fileType); meta.setPath(fullPath);
|
||||
* meta.setDescription("Found in bundle [" + adapter.getBundleId() +
|
||||
* "] on path [" + localPath + "]"); ProvidedTemplate providedTemplate = new
|
||||
* ProvidedTemplate(meta);
|
||||
*/
|
||||
|
||||
TemplateImpl impl = new TemplateImpl();
|
||||
impl.setId(adapter.getId() + "." + id);
|
||||
impl.setPath(fullPath);
|
||||
impl.setTemplateFullName(fullname);
|
||||
impl.setTemplateLocation("bundle://" + adapter.getBundleId() + ".0:0" + templatePath + "/");
|
||||
impl.setTemplateName(fileName);
|
||||
impl.setType(fileType);
|
||||
|
||||
Dictionary<String, String> props = new Hashtable<String, String>();
|
||||
props.put(TemplateService.PROP_ID, impl.getId());
|
||||
props.put(TemplateService.PROP_NAME, fileName);
|
||||
props.put(TemplateService.PROP_TYPE, fileType);
|
||||
props.put(TemplateService.PROP_DESCRIPTION, "Template for adapter wrapper on bundle " + adapter.getBundleId());
|
||||
|
||||
|
||||
adapter.getTemplateRegistrations().add(
|
||||
this.bundleContext.registerService(Template.class, impl, props)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
<version>1.8.2</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connection-implementation</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTION</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTION</description>
|
||||
<modules>
|
||||
<module>connection-producing</module>
|
||||
</modules>
|
||||
</project>
|
45
platform/runtime/core/objects-implementations/pom.xml
Normal file
45
platform/runtime/core/objects-implementations/pom.xml
Normal file
@ -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</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.8.2</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.service.component.annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>org.apache.felix.scr</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base</groupId>
|
||||
<artifactId>base-support</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.base.objects-base
|
||||
</groupId>
|
||||
<artifactId>objects-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<modules>
|
||||
<module>profile-implementation</module>
|
||||
<module>connection-implementation</module>
|
||||
</modules>
|
||||
</project>
|
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,17 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
<version>1.8.2</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>profile-implementation</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE</description>
|
||||
<modules>
|
||||
<module>profile-producing</module>
|
||||
<module>profile-storage</module>
|
||||
</modules>
|
||||
</project>
|
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,58 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>profile-implementation</artifactId>
|
||||
<version>1.8.2</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
|
||||
<artifactId>profile-producing</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: PRODUCING</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: PRODUCING</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>ru.entaxy.platform.base.objects.profile.producing</bundle.osgi.export.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.core.object-producing
|
||||
</groupId>
|
||||
<artifactId>object-producer-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>
|
||||
ru.entaxy.esb.platform.runtime.core.object-producing
|
||||
</groupId>
|
||||
<artifactId>object-producer-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>artifact-management</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>${maven-bundle-plugin.version}</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Entaxy-Factory-Provider>true</Entaxy-Factory-Provider>
|
||||
<Entaxy-Template-Provider>true</Entaxy-Template-Provider>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,134 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* test-producers
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.profile.producing;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.service.component.annotations.CollectionType;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ReferencePolicy;
|
||||
import org.osgi.service.component.annotations.ReferencePolicyOption;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_TYPES;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactoryException;
|
||||
import ru.entaxy.platform.core.artifact.ArtifactCoordinates;
|
||||
import ru.entaxy.platform.core.producer.api.EntaxyProducer;
|
||||
import ru.entaxy.platform.core.producer.api.EntaxyProducerService;
|
||||
import ru.entaxy.platform.core.producer.api.EntaxyWrappedFactory;
|
||||
import ru.entaxy.platform.core.producer.impl.CommonObjectProducer;
|
||||
import ru.entaxy.platform.core.producer.impl.EntaxyProducerInfo;
|
||||
import ru.entaxy.platform.core.producer.wrapper.AbstractFactoryWrapper;
|
||||
import ru.entaxy.platform.core.producer.wrapper.AbstractFactoryWrapper.GenerationProcessor;
|
||||
|
||||
@Component(service = {EntaxyProducer.class}, immediate = true)
|
||||
@EntaxyProducerInfo(supportedTypes = {OBJECT_TYPES.PROFILE, OBJECT_TYPES.DEFAULT_ROUTE})
|
||||
public class ProfileProducer extends CommonObjectProducer implements EntaxyProducer, GenerationProcessor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProfileProducer.class);
|
||||
|
||||
public static final String PROPERTY_OBJECT_ID = "objectId";
|
||||
public static final String PROPERTY_SYSTEM_NAME = "systemName";
|
||||
public static final String TEMP_PREFIX = "TEMP-";
|
||||
|
||||
protected Map<String, Map<String, String>> publishedFields = new HashMap<>();
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public ProfileProducer() {
|
||||
super();
|
||||
publishedFields.put(OBJECT_TYPES.PROFILE, new HashMap<>() {{
|
||||
put("name", "systemName");
|
||||
put("system", "systemName");
|
||||
}});
|
||||
publishedFields.put(OBJECT_TYPES.DEFAULT_ROUTE, new HashMap<>() {{
|
||||
put("name", "systemName");
|
||||
put("system", "systemName");
|
||||
}});
|
||||
}
|
||||
|
||||
@Reference(bind = "addFactory", unbind = "removeFactory", cardinality = ReferenceCardinality.MULTIPLE
|
||||
, collectionType = CollectionType.SERVICE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY)
|
||||
public void addFactory(EntaxyFactory factory) {
|
||||
AbstractFactoryWrapper wrapper = super.doAddFactory(factory);
|
||||
if (wrapper != null)
|
||||
wrapper.setGenerationProcessor(this);
|
||||
}
|
||||
|
||||
// WE MUST DECLARE IT for @Reference annotation processor
|
||||
@Override
|
||||
public void removeFactory(EntaxyFactory factory) {
|
||||
super.removeFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate(EntaxyWrappedFactory wrappedFactory, String outputType, String scope, String objectType, Map<String, Object> parameters)
|
||||
throws EntaxyFactoryException {
|
||||
log.debug("PreGenerate");
|
||||
|
||||
if (OBJECT_TYPES.PROFILE.equals(objectType)) {
|
||||
// create objectId if it's not set
|
||||
String systemName = parameters.getOrDefault(PROPERTY_SYSTEM_NAME, "").toString();
|
||||
String objectId = parameters.getOrDefault(PROPERTY_OBJECT_ID, "").toString();
|
||||
log.debug("systemName:[{}], objectId:[{}]", systemName, objectId);
|
||||
if (!CommonUtils.isValid(objectId) || objectId.startsWith(TEMP_PREFIX))
|
||||
if (CommonUtils.isValid(systemName)) {
|
||||
parameters.put(PROPERTY_OBJECT_ID, systemName);
|
||||
}
|
||||
} else if (OBJECT_TYPES.DEFAULT_ROUTE.equals(objectType)) {
|
||||
// create objectId if it's not set
|
||||
String systemName = parameters.getOrDefault(PROPERTY_SYSTEM_NAME, "").toString();
|
||||
String objectId = parameters.getOrDefault(PROPERTY_OBJECT_ID, "").toString();
|
||||
log.debug("systemName:[{}], objectId:[{}]", systemName, objectId);
|
||||
if (!CommonUtils.isValid(objectId) || objectId.startsWith(TEMP_PREFIX))
|
||||
if (CommonUtils.isValid(systemName)) {
|
||||
parameters.put(PROPERTY_OBJECT_ID, systemName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postGenerate(EntaxyWrappedFactory wrappedFactory, String outputType, String scope, String objectType, Map<String, Object> parameters, Generated generated)
|
||||
throws EntaxyFactoryException {
|
||||
super.postGenerate(wrappedFactory, outputType, scope, objectType, parameters, generated);
|
||||
generated.getProperties().put(
|
||||
EntaxyProducerService.INSTRUCTIONS.ARTIFACT.VERSION_POLICY,
|
||||
ArtifactCoordinates.VERSION_POLICY_DATED_EMBEDDED);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getFieldsToPublish(String outputType, String scope, String objectType,
|
||||
String objectId) {
|
||||
|
||||
Map<String, String> result = super.getFieldsToPublish(outputType, scope, objectType, objectId);
|
||||
result.putAll(publishedFields.get(objectType));
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
{
|
||||
"factory": {
|
||||
"id": "common-profile",
|
||||
"type": "entaxy.runtime.profile"
|
||||
},
|
||||
"entaxy.runtime.profile": {
|
||||
"displayName": "Common system profile"
|
||||
},
|
||||
"fields": {
|
||||
"systemName": {
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"immutable": true
|
||||
},
|
||||
"description": {
|
||||
"type": "String"
|
||||
},
|
||||
"useDefaultRoute": {
|
||||
"type": "Boolean",
|
||||
"required": true,
|
||||
"defaultValue": true
|
||||
},
|
||||
"defaultRoute": {
|
||||
"type": "entaxy.runtime.default-route",
|
||||
"isRef": true,
|
||||
/* actually there's no reference, but the object must be in a model */
|
||||
/* so while producing we must check the defaultRoute is found */
|
||||
"isBackRef": true,
|
||||
/* but only if useDefaultRoute is set to true */
|
||||
"condition": "${useDefaultRoute}",
|
||||
"required": true,
|
||||
"immutable": true,
|
||||
"defaultValue": {
|
||||
"type": "entaxy.runtime.default-route",
|
||||
"factoryId": "default-route",
|
||||
"properties": {
|
||||
"description": "Default route for ${systemName}"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"init": {
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
{
|
||||
"factory": {
|
||||
"id": "default-route",
|
||||
"type": "entaxy.runtime.default-route"
|
||||
},
|
||||
"entaxy.runtime.default-route": {
|
||||
"displayName": "Default route for system profile"
|
||||
},
|
||||
"fields": {
|
||||
"systemName": {
|
||||
"type": "entaxy.runtime.profile",
|
||||
"isRef": true,
|
||||
"required": true,
|
||||
"immutable": true,
|
||||
"refField": "systemName",
|
||||
"isRefByValueOnly": true
|
||||
},
|
||||
"description": {
|
||||
"type": "String"
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"init": {
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
[#ftl attributes={"generated.type":"blueprint"}]
|
||||
[#--
|
||||
|
||||
~~~~~~licensing~~~~~~
|
||||
profile-producing
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
~~~~~~/licensing~~~~~~
|
||||
|
||||
--]
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
|
||||
|
||||
<reference-list id="outConnector"
|
||||
interface="ru.entaxy.esb.system.profile.commons.connectors.out.OutConnector"
|
||||
filter="(systemName=[=systemName])" availability="optional">
|
||||
<reference-listener ref="profileOutput"
|
||||
bind-method="register" unbind-method="unregister"/>
|
||||
</reference-list>
|
||||
|
||||
<reference-list id="inConnector"
|
||||
interface="ru.entaxy.esb.system.profile.commons.connectors.in.InConnector"
|
||||
filter="(systemName=[=systemName])" availability="optional">
|
||||
<reference-listener ref="inConnectorCollector"
|
||||
bind-method="register" unbind-method="unregister"/>
|
||||
</reference-list>
|
||||
|
||||
<bean id="inConnectorCollector" class="ru.entaxy.esb.system.profile.commons.InConnectorCollector"/>
|
||||
|
||||
<bean id="system-profile" class="ru.entaxy.esb.system.registry.systems.profile.impl.defaults.DefaultSystemProfile"
|
||||
activation="eager">
|
||||
<property name="systemName" value="[=systemName]"/>
|
||||
<property name="profileOutput" ref="profileOutput"/>
|
||||
<property name="inConnectorCollector" ref="inConnectorCollector"/>
|
||||
</bean>
|
||||
|
||||
<bean id="profileOutput" class="ru.entaxy.esb.system.profile.commons.profile_output.ProfileOutputImpl"
|
||||
activation="eager">
|
||||
<property name="systemName" value="[=systemName]"/>
|
||||
</bean>
|
||||
|
||||
<service activation="eager" auto-export="interfaces" ref="system-profile"/>
|
||||
|
||||
<reference id="pooledConnectionFactory" interface="javax.jms.ConnectionFactory"/>
|
||||
|
||||
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
|
||||
<property name="connectionFactory" ref="pooledConnectionFactory"/>
|
||||
</bean>
|
||||
|
||||
<camelContext id="profile-[=systemName]" xmlns="http://camel.apache.org/schema/blueprint">
|
||||
|
||||
<route>
|
||||
<from uri="direct-vm:profile-[=systemName]-exit-dispatcher"/>
|
||||
<log message="Message ${headers} send to profile dispatcher" loggingLevel="TRACE"/>
|
||||
<choice>
|
||||
<when>
|
||||
<simple>${headers.NTX_NextPoint} != null</simple>
|
||||
<setProperty name="NTX_Tmp">
|
||||
<simple>${headers.NTX_NextPoint}</simple>
|
||||
</setProperty>
|
||||
<removeHeader headerName="NTX_NextPoint"/>
|
||||
<toD uri="${exchangeProperty.NTX_Tmp}"/>
|
||||
</when>
|
||||
<otherwise>
|
||||
<to uri="direct-vm:profile-[=systemName]-exit-point"/>
|
||||
</otherwise>
|
||||
</choice>
|
||||
</route>
|
||||
|
||||
<route>
|
||||
<from uri="direct-vm:profile-[=systemName]-enter-point"/>
|
||||
<log message="Message ${headers} send to profile output" loggingLevel="TRACE"/>
|
||||
<choice>
|
||||
<when>
|
||||
<simple>${headers.NTX_Origin} == null</simple>
|
||||
<toD uri="permission:checkSystemAccessException?objectId=${headers.X-SystemId}&subjectId=[=systemName]"/>
|
||||
</when>
|
||||
</choice>
|
||||
<to uri="bean:profileOutput?method=sendTo"/>
|
||||
</route>
|
||||
</camelContext>
|
||||
</blueprint>
|
@ -0,0 +1,69 @@
|
||||
[#ftl attributes={"generated.type":"blueprint"}]
|
||||
[#--
|
||||
|
||||
~~~~~~licensing~~~~~~
|
||||
profile-producing
|
||||
==========
|
||||
Copyright (C) 2020 - 2021 EmDev LLC
|
||||
==========
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
~~~~~~/licensing~~~~~~
|
||||
|
||||
--]
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
|
||||
|
||||
<reference id="entaxy-broker" interface="org.apache.camel.Component"
|
||||
filter="(connection.name=entaxy-broker)"/>
|
||||
|
||||
<camelContext id="route-[=systemName]" xmlns="http://camel.apache.org/schema/blueprint">
|
||||
<route>
|
||||
<from uri="direct-vm:profile-[=systemName]-exit-point"/>
|
||||
<log message="Message ${headers} send to route" loggingLevel="TRACE"/>
|
||||
|
||||
<when>
|
||||
<simple>${headers.ENTAXY_Destination} == 'nsi'
|
||||
&& ${headers.ENTAXY_DestinationType} == null
|
||||
</simple>
|
||||
<setHeader name="NTX_NSI_Answer">
|
||||
<simple>true</simple>
|
||||
</setHeader>
|
||||
<to uri="entaxy-broker:queue:entaxy.nsi.entry.point?exchangePattern=InOnly"/>
|
||||
</when>
|
||||
|
||||
<choice>
|
||||
<when>
|
||||
<simple>${headers.ENTAXY_DestinationType} == 'system.name'</simple>
|
||||
<toD uri="system:${headers.ENTAXY_Destination}"/>
|
||||
</when>
|
||||
<when>
|
||||
<simple>${headers.ENTAXY_DestinationType} == 'system-group.name'</simple>
|
||||
<toD uri="system-group:${headers.ENTAXY_Destination}"/>
|
||||
</when>
|
||||
<when>
|
||||
<simple>${headers.ENTAXY_DestinationType} == 'queue.name'</simple>
|
||||
<toD uri="entaxy-broker:queue:${headers.ENTAXY_Destination}"/>
|
||||
</when>
|
||||
<when>
|
||||
<simple>${headers.ENTAXY_DestinationType} == 'topic.name'</simple>
|
||||
<toD uri="entaxy-broker:topic:${headers.ENTAXY_Destination}"/>
|
||||
</when>
|
||||
<otherwise>
|
||||
<toD uri="system:${headers.ENTAXY_Destination}"/>
|
||||
</otherwise>
|
||||
</choice>
|
||||
</route>
|
||||
</camelContext>
|
||||
</blueprint>
|
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,25 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>profile-implementation</artifactId>
|
||||
<version>1.8.2</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.profile-implementation</groupId>
|
||||
<artifactId>profile-storage</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: STORAGE</name>
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: PROFILE :: STORAGE</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.pkg>ru.entaxy.platform.base.objects.profile.storage</bundle.osgi.export.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.registry.systems</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,99 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* test-producers
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.platform.base.objects.profile.storage;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import org.osgi.service.component.annotations.CollectionType;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ru.entaxy.esb.system.jpa.SystemService;
|
||||
import ru.entaxy.esb.system.management.bundle.jpa.entity.BundleEntity;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObjectStorage;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@Component(service = EntaxyObjectStorage.class, immediate = true)
|
||||
public class SystemObjectStorage implements EntaxyObjectStorage {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SystemObjectStorage.class);
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY, collectionType = CollectionType.SERVICE)
|
||||
protected SystemService systemService;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
protected Map<String, String> fieldMap = new HashMap<>() {{
|
||||
put("uuid", "objectId");
|
||||
put("name", "systemName");
|
||||
put("description", "description");
|
||||
put("version", "artifact.version");
|
||||
put("isDefaultRoute", "useDefaultRoute");
|
||||
}};
|
||||
|
||||
protected Map<String, String> fieldBundleMap = new HashMap<>() {{
|
||||
put("name", "bundleId");
|
||||
put("type", "artifact.type");
|
||||
put("status", "artifact.status");
|
||||
put("version", "artifact.version");
|
||||
put("url", "bundleLocation");
|
||||
}};
|
||||
|
||||
@Override
|
||||
public String[] getObjectTypes() {
|
||||
return new String[]{EntaxyObject.OBJECT_TYPES.PROFILE};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object store(Map<String, Object> data) {
|
||||
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
Gson gson = new Gson();
|
||||
|
||||
for (Entry<String, String> entry : fieldMap.entrySet()) {
|
||||
if (data.containsKey(entry.getValue()))
|
||||
jsonObject.add(entry.getKey(), gson.toJsonTree(data.get(entry.getValue())));
|
||||
}
|
||||
JsonObject bundleJsonObject = new JsonObject();
|
||||
for (Entry<String, String> entry : fieldBundleMap.entrySet()) {
|
||||
if (data.containsKey(entry.getValue()))
|
||||
bundleJsonObject.add(entry.getKey(), gson.toJsonTree(data.get(entry.getValue())));
|
||||
}
|
||||
|
||||
log.debug("JSON :: " + jsonObject.toString());
|
||||
ru.entaxy.esb.system.jpa.entity.System system = gson.fromJson(jsonObject, ru.entaxy.esb.system.jpa.entity.System.class);
|
||||
system.setCreateDate(new Date());
|
||||
system.setCreatedBy("admin");
|
||||
|
||||
log.debug("JSON Bundle :: " + bundleJsonObject.toString());
|
||||
BundleEntity bundleEntity = gson.fromJson(bundleJsonObject, BundleEntity.class);
|
||||
system.setBundleEntity(bundleEntity);
|
||||
systemService.create(system);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user