initial public commit

This commit is contained in:
2021-09-06 17:46:59 +03:00
commit b744b08829
824 changed files with 91593 additions and 0 deletions

201
system/registry/LICENSE.txt Normal file
View 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.

View 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.

View 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.

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>ru.entaxy.esb.system.registry.connector</groupId>
<artifactId>connectors</artifactId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-api</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: SYSTEM :: CONNECTOR :: API</name>
<description>SYSTEM :: ENTAXY :: SYSTEM :: CONNECTOR :: API</description>
<properties>
<bundle.osgi.export.pkg>
ru.entaxy.esb.system.connector.entity
</bundle.osgi.export.pkg>
<bundle.osgi.import.pkg>
javax.persistence;version="[2,3)",
org.hibernate.proxy,
javassist.util.proxy,
*
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>${jpa.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>${javax.transaction.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.management.bundle.jpa</groupId>
<artifactId>bundle-service</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,200 @@
/*-
* ~~~~~~licensing~~~~~~
* connector-api
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.connector.entity;
import ru.entaxy.esb.system.management.bundle.jpa.entity.BundleEntity;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@NamedEntityGraph(
name = "connector-entity-graph",
attributeNodes = {
@NamedAttributeNode("connectorParams"),
@NamedAttributeNode("bundleEntity")
}
)
@Entity
@Table(name = "connector")
public class Connector {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "name")
private String name;
@Column(name = "type")
private String type;
@Column(name = "version")
private String version;
@Column(name = "create_date")
private Date createDate;
@Column(name = "edit_date")
private Date editDate;
@Column(name = "created_by")
private String createdBy;
@Column(name = "edited_by")
private String editedBy;
@Column(name = "template_name")
private String templateName;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
@JoinColumn(name = "connector_id")
private List<ConnectorParam> connectorParams;
@OneToOne(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
@JoinColumn(name = "bundle_id")
private BundleEntity bundleEntity;
@Column(name = "system_id")
private long systemId;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getEditDate() {
return editDate;
}
public void setEditDate(Date editDate) {
this.editDate = editDate;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getEditedBy() {
return editedBy;
}
public void setEditedBy(String editedBy) {
this.editedBy = editedBy;
}
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public List<ConnectorParam> getConnectorParams() {
return connectorParams;
}
public void setConnectorParams(List<ConnectorParam> connectorParams) {
this.connectorParams = connectorParams;
}
public BundleEntity getBundleEntity() {
return bundleEntity;
}
public void setBundleEntity(BundleEntity bundleEntity) {
this.bundleEntity = bundleEntity;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public long getSystemId() {
return systemId;
}
public void setSystemId(long systemId) {
this.systemId = systemId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Connector connector = (Connector) o;
return id == connector.id &&
Objects.equals(name, connector.name) &&
Objects.equals(type, connector.type) &&
Objects.equals(createDate, connector.createDate) &&
Objects.equals(editDate, connector.editDate) &&
Objects.equals(createdBy, connector.createdBy) &&
Objects.equals(editedBy, connector.editedBy) &&
Objects.equals(templateName, connector.templateName) &&
Objects.equals(connectorParams, connector.connectorParams);
}
@Override
public int hashCode() {
return Objects.hash(id, name, type, createDate, editDate, createdBy, editedBy,
templateName, connectorParams);
}
@Override
public String toString() {
return "Connector{" +
"id=" + id +
", name='" + name + '\'' +
", type='" + type + '\'' +
", createDate=" + createDate +
", editDate=" + editDate +
", createdBy='" + createdBy + '\'' +
", editedBy='" + editedBy + '\'' +
", templateName='" + templateName +
'}';
}
}

View File

@ -0,0 +1,60 @@
/*-
* ~~~~~~licensing~~~~~~
* connector-api
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.connector.entity;
import javax.persistence.*;
@Entity
@Table(name = "connector_param")
public class ConnectorParam {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "name")
private String name;
@Column(name = "value")
private String value;
public void setId(long id) {
this.id = id;
}
public long getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View 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.

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>ru.entaxy.esb.system.registry.connector</groupId>
<artifactId>connectors</artifactId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-impl</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: SYSTEM :: CONNECTOR :: IMPL</name>
<description>SYSTEM :: ENTAXY :: SYSTEM :: CONNECTOR :: IMPL</description>
<properties>
<bundle.osgi.export.pkg>
ru.entaxy.esb.system.connector.impl.*
</bundle.osgi.export.pkg>
<bundle.osgi.import.pkg>
javax.persistence;version="[2,3)",
org.hibernate.proxy,
javassist.util.proxy,
*
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>${jpa.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>${javax.transaction.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.management.bundle.jpa</groupId>
<artifactId>bundle-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.registry.connector</groupId>
<artifactId>connector-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.registry.systems</groupId>
<artifactId>system-impl</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,44 @@
/*-
* ~~~~~~licensing~~~~~~
* connector-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.connector.impl;
import com.sun.istack.NotNull;
import ru.entaxy.esb.system.connector.entity.Connector;
import ru.entaxy.esb.system.jpa.entity.System;
import ru.entaxy.esb.system.management.bundle.jpa.entity.BundleEntity;
import java.util.List;
public interface ConnectorService {
List<Connector> getListConnector();
Connector getConnectorByName(String name);
Connector getConnectorByName(String systemUuid, String templateName);
void removeConnector(@NotNull Connector connector);
Connector saveOrUpdate(Connector connector);
Connector addConnector(System system, Connector connector);
Connector setBundleEntity(Connector connector, BundleEntity bundleEntity);
}

View File

@ -0,0 +1,180 @@
/*-
* ~~~~~~licensing~~~~~~
* connector-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.connector.impl;
import com.sun.istack.NotNull;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import ru.entaxy.esb.system.connector.entity.Connector;
import ru.entaxy.esb.system.jpa.entity.System;
import ru.entaxy.esb.system.management.bundle.jpa.entity.BundleEntity;
import javax.persistence.EntityGraph;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.Root;
import java.util.List;
public class ConnectorServiceImpl implements ConnectorService {
private static final String JAVAX_PERSISTENCE_LOADGRAPH = "javax.persistence.loadgraph";
private static final String CONNECTOR_ENTITY_GRAPH = "connector-entity-graph";
private SessionFactory sessionFactory;
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
public Session getSession() {
return sessionFactory.openSession();
}
@Override
public Connector getConnectorByName(String name) {
Connector connector;
try (Session session = getSession()) {
session.getTransaction().begin();
EntityGraph entityGraph = session.getEntityGraph(CONNECTOR_ENTITY_GRAPH);
CriteriaBuilder builder = session.getCriteriaBuilder();
CriteriaQuery<Connector> criteriaQuery = builder.createQuery(Connector.class);
Root<Connector> root = criteriaQuery.from(Connector.class);
criteriaQuery.where(builder.equal(root.get("name"), name));
TypedQuery<Connector> typedQuery = session.createQuery(criteriaQuery);
typedQuery.setHint(JAVAX_PERSISTENCE_LOADGRAPH, entityGraph);
connector = typedQuery.getSingleResult();
session.getTransaction().commit();
}
return connector;
}
@Override
public Connector getConnectorByName(String systemUuid, String templateName) {
Connector connector;
try (Session session = getSession()) {
session.getTransaction().begin();
CriteriaBuilder builder = session.getCriteriaBuilder();
CriteriaQuery<Connector> criteriaQuery = builder.createQuery(Connector.class);
Root<System> root = criteriaQuery.from(System.class);
Join<System, Connector> connectorJoin = root.join("connectors");
criteriaQuery.select(connectorJoin);
criteriaQuery.where(builder.and(builder.equal(root.get("uuid"), systemUuid),
builder.equal(connectorJoin.get("templateName"), templateName)));
connector = session.createQuery(criteriaQuery).getSingleResult();
session.getTransaction().commit();
}
return connector;
}
@Override
public void removeConnector(@NotNull Connector connector) {
try (Session session = getSession()) {
session.getTransaction().begin();
session.delete(Connector.class.getName(), connector);
session.getTransaction().commit();
}
}
@Override
public Connector saveOrUpdate(Connector connector) {
try (Session session = getSession()) {
session.getTransaction().begin();
session.saveOrUpdate(connector);
session.getTransaction().commit();
}
return connector;
}
private System saveOrUpdate(System system) {
try (Session session = getSession()) {
session.getTransaction().begin();
session.saveOrUpdate(system);
session.getTransaction().commit();
}
return system;
}
@Override
public Connector addConnector(System system, Connector connector) {
Connector connectorEntity = getConnector(system, connector.getTemplateName());
if (connectorEntity == null) {
connectorEntity = connector;
connectorEntity.setName(connector.getTemplateName() + "-" + system.getName());
connectorEntity.setSystemId(system.getId());
system.getConnectors().add(connectorEntity);
} else {
connectorEntity.setEditDate(connector.getCreateDate());
connectorEntity.setEditedBy(connector.getCreatedBy());
}
this.saveOrUpdate(system);
return connectorEntity;
}
@Override
public Connector setBundleEntity(Connector connector, BundleEntity bundleEntity) {
bundleEntity.setVersion(connector.getVersion());
BundleEntity origin = connector.getBundleEntity();
if (connector.getBundleEntity() != null) {
origin.setUrl(bundleEntity.getUrl());
origin.setStatus(bundleEntity.getStatus());
} else {
bundleEntity.setVersion(connector.getVersion());
connector.setBundleEntity(bundleEntity);
}
return saveOrUpdate(connector);
}
@Override
public List<Connector> getListConnector() {
List<Connector> list;
try (Session session = getSession()) {
session.getTransaction().begin();
EntityGraph entityGraph = session.getEntityGraph(CONNECTOR_ENTITY_GRAPH);
CriteriaQuery<Connector> criteriaQuery = session.getCriteriaBuilder().createQuery(Connector.class);
criteriaQuery.from(Connector.class);
TypedQuery<Connector> typedQuery = session.createQuery(criteriaQuery);
typedQuery.setHint(JAVAX_PERSISTENCE_LOADGRAPH, entityGraph);
list = typedQuery.getResultList();
session.getTransaction().commit();
}
return list;
}
private Connector getConnector(System system, String templateName) {
for (Connector connector : system.getConnectors()) {
if (templateName.equals(connector.getTemplateName()))
return connector;
}
return null;
}
}

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~~~~~~licensing~~~~~~
connector-impl
==========
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~~~~~~
-->
<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="sessionFactory"
interface="org.hibernate.SessionFactory"
timeout="30000"/>
<bean id="connectorService" class="ru.entaxy.esb.system.connector.impl.ConnectorServiceImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<service ref="connectorService" interface="ru.entaxy.esb.system.connector.impl.ConnectorService"/>
</blueprint>

View File

@ -0,0 +1,43 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
~~~~~~licensing~~~~~~
connector-impl
==========
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~~~~~~
-->
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">osgi:service/entaxy.esb.storage</property>
<property name="hibernate.hbm2ddl.auto">validate</property>
<property name="hibernate.enable_lazy_load_no_trans">true</property>
<property name="show_sql">${hibernate.show_sql}</property>
<property name="format_sql">${hibernate.format_sql}</property>
<mapping class="ru.entaxy.esb.system.jpa.entity.System"/>
<mapping class="ru.entaxy.esb.system.management.bundle.jpa.entity.BundleEntity"/>
<mapping class="ru.entaxy.esb.system.jpa.entity.ExportAllowed"/>
<mapping class="ru.entaxy.esb.system.connector.entity.Connector"/>
<mapping class="ru.entaxy.esb.system.connector.entity.ConnectorParam"/>
</session-factory>
</hibernate-configuration>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>ru.entaxy.esb.system.registry</groupId>
<artifactId>registry</artifactId>
<version>1.8.0</version>
<relativePath>../../registry/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<groupId>ru.entaxy.esb.system.registry.connector</groupId>
<artifactId>connectors</artifactId>
<name>SYSTEM :: ENTAXY :: REGISTRY :: CONNECTOR</name>
<description>SYSTEM :: ENTAXY :: REGISTRY :: CONNECTOR</description>
<modules>
<module>connector-api</module>
<module>connector-impl</module>
</modules>
</project>

29
system/registry/pom.xml Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ru.entaxy.esb.system</groupId>
<artifactId>system-parent</artifactId>
<version>1.8.0</version>
</parent>
<groupId>ru.entaxy.esb.system.registry</groupId>
<artifactId>registry</artifactId>
<packaging>pom</packaging>
<name>SYSTEM :: ENTAXY :: REGISTRIES</name>
<description>SYSTEM :: ENTAXY :: REGISTRIES</description>
<modules>
<module>systems</module>
<module>system-groups</module>
<module>processes</module>
<module>profile-commons</module>
<module>connectors</module>
<module>schema</module>
</modules>
</project>

View 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.

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ru.entaxy.esb.system.registry</groupId>
<artifactId>registry</artifactId>
<version>1.8.0</version>
<relativePath>../../registry/pom.xml</relativePath>
</parent>
<groupId>ru.entaxy.esb.system.registry.processes</groupId>
<artifactId>processes</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: REGISTRY :: PROCESSES</name>
<description>SYSTEM :: ENTAXY :: REGISTRY :: PROCESSES</description>
<properties>
<bundle.osgi.import.pkg>
ru.entaxy.esb.system.core.dispatcher
</bundle.osgi.import.pkg>
<bundle.osgi.export.pkg>
ru.entaxy.esb.system.registry.processes
</bundle.osgi.export.pkg>
</properties>
</project>

View File

@ -0,0 +1,23 @@
/*-
* ~~~~~~licensing~~~~~~
* processes
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.processes;
public interface EntryPoint {
}

View 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.

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ru.entaxy.esb.system.registry</groupId>
<artifactId>registry</artifactId>
<version>1.8.0</version>
<relativePath>../../registry/pom.xml</relativePath>
</parent>
<groupId>ru.entaxy.esb.system.registry.profile.commons</groupId>
<artifactId>profile-commons</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: PROFILE :: COMMONS</name>
<description>SYSTEM :: ENTAXY :: PROFILE :: COMMONS</description>
<properties>
<bundle.osgi.export.pkg>
ru.entaxy.esb.system.profile.commons,
ru.entaxy.esb.system.profile.commons.connectors,
ru.entaxy.esb.system.profile.commons.profile_output,
ru.entaxy.esb.system.profile.commons.connectors.in,
ru.entaxy.esb.system.profile.commons.connectors.out,
</bundle.osgi.export.pkg>
<bundle.osgi.import.pkg>
ru.entaxy.esb.system.common.exception,
org.apache.camel,
ru.entaxy.esb.system.common.osgi.impl;version="[1.0,2)",
org.apache.commons.logging,
org.osgi.service.blueprint;version="[1.0.0,2.0.0)",
ru.entaxy.esb.system.core.dispatcher
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-api</artifactId>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.commons</groupId>
<artifactId>system-commons</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,84 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons;
import ru.entaxy.esb.system.profile.commons.profile_output.ProfileOutput;
import java.util.Objects;
public abstract class CommonProfile implements Profile {
protected String systemName = "system";
protected ProfileOutput profileOutput;
protected InConnectorCollector inConnectorCollector;
@Override
public void send(Object request) {
doSend(request);
}
protected abstract void doSend(Object request);
@Override
public String getSystemName() {
return systemName;
}
public void setSystemName(String systemName) {
this.systemName = systemName;
}
@Override
public ProfileOutput getProfileOutput() {
return profileOutput;
}
public void setProfileOutput(ProfileOutput profileOutput) {
this.profileOutput = profileOutput;
}
public InConnectorCollector getInConnectorCollector() {
return inConnectorCollector;
}
public void setInConnectorCollector(InConnectorCollector inConnectorCollector) {
this.inConnectorCollector = inConnectorCollector;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CommonProfile that = (CommonProfile) o;
return Objects.equals(systemName, that.systemName);
}
@Override
public int hashCode() {
return Objects.hash(systemName);
}
@Override
public String toString() {
return "CommonProfile{" +
"systemName='" + systemName + '\'' +
'}';
}
}

View File

@ -0,0 +1,53 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons;
import org.apache.camel.Exchange;
import org.apache.camel.Header;
import ru.entaxy.esb.system.common.exception.ConnectorNotFound;
import ru.entaxy.esb.system.common.osgi.impl.CommonNamedReferenceListener;
import ru.entaxy.esb.system.profile.commons.connectors.Connector;
public class ConnectorRegistry extends CommonNamedReferenceListener<Connector> {
public String getParam(String systemName, String paramName) {
Connector connector = getReference(systemName);
if (connector != null) {
return connector.getParam(paramName);
} else {
throw new ConnectorNotFound("Connector for " + systemName + " not found");
}
}
public void send(@Header("X-SystemName") String systemName, Exchange exchange) {
Connector connector = getReference(systemName);
if (connector != null) {
connector.send(exchange);
} else {
throw new ConnectorNotFound("Connector for " + systemName + " not found");
}
}
@Override
protected String getObjectName(Connector Connector) {
return Connector.getSystemName();
}
}

View File

@ -0,0 +1,31 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons;
import ru.entaxy.esb.system.common.osgi.impl.CommonNamedReferenceListener;
import ru.entaxy.esb.system.profile.commons.connectors.in.InConnector;
public class InConnectorCollector extends CommonNamedReferenceListener<InConnector> {
@Override
protected String getObjectName(InConnector inConnector) {
return inConnector == null ? null : inConnector.getEndpointName();
}
}

View File

@ -0,0 +1,33 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons;
import ru.entaxy.esb.system.profile.commons.profile_output.ProfileOutput;
public interface Profile {
ProfileOutput getProfileOutput();
String getSystemName();
InConnectorCollector getInConnectorCollector();
void send(Object request);
}

View File

@ -0,0 +1,73 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons.connectors;
import ru.entaxy.esb.system.profile.commons.Profile;
import java.util.Map;
public abstract class CommonConnector implements Connector {
protected String endpointName;
protected Profile profile;
protected String systemName;
protected Map<String, String> params;
public void setEndpointName(String endpointName) {
this.endpointName = endpointName;
}
public void setProfile(Profile profile) {
this.profile = profile;
}
public void setSystemName(String systemName) {
this.systemName = systemName;
}
public void setParams(Map<String, String> params) {
this.params = params;
}
@Override
public String getEndpointName() {
return endpointName;
}
@Override
public Profile getProfile() {
return profile;
}
@Override
public String getSystemName() {
return systemName;
}
@Override
public Map<String, String> getParams() {
return params;
}
@Override
public String getParam(String paramName) {
return params.get(paramName);
}
}

View File

@ -0,0 +1,42 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons.connectors;
import org.apache.camel.Exchange;
import ru.entaxy.esb.system.profile.commons.Profile;
import java.util.Map;
public interface Connector {
String getEndpointName();
String getEndpointType();
Profile getProfile();
String getSystemName();
Map<String, String> getParams();
String getParam(String paramName);
void send(Exchange exchange);
}

View File

@ -0,0 +1,27 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons.connectors.in;
import ru.entaxy.esb.system.profile.commons.connectors.Connector;
public interface InConnector extends Connector {
String endpointType = "in";
}

View File

@ -0,0 +1,39 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons.connectors.in;
import org.apache.camel.Exchange;
import org.apache.camel.ProducerTemplate;
import ru.entaxy.esb.system.profile.commons.connectors.CommonConnector;
public class QueueInConnectorImpl extends CommonConnector implements InConnector {
@Override
public String getEndpointType() {
return endpointType;
}
@Override
public void send(Exchange exchange) {
ProducerTemplate template = exchange.getContext().createProducerTemplate();
template.send("direct-vm:" + endpointName + "-" + endpointType + "-connector-" + systemName +
"?block=true&timeout=60000", exchange);
}
}

View File

@ -0,0 +1,27 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons.connectors.out;
import ru.entaxy.esb.system.profile.commons.connectors.Connector;
public interface OutConnector extends Connector {
String endpointType = "out";
}

View File

@ -0,0 +1,39 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons.connectors.out;
import org.apache.camel.Exchange;
import org.apache.camel.ProducerTemplate;
import ru.entaxy.esb.system.profile.commons.connectors.CommonConnector;
public class QueueOutConnectorImpl extends CommonConnector implements OutConnector {
@Override
public String getEndpointType() {
return endpointType;
}
@Override
public void send(Exchange exchange) {
ProducerTemplate template = exchange.getContext().createProducerTemplate();
template.send("direct-vm:" + endpointName + "-" +
endpointType + "-connector-" + systemName + "?block=true&timeout=60000", exchange);
}
}

View File

@ -0,0 +1,36 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons.profile_output;
import org.apache.camel.Exchange;
import org.apache.camel.Header;
import ru.entaxy.esb.system.profile.commons.connectors.out.OutConnector;
import java.util.List;
public interface ProfileOutput {
OutConnector getOutConnector(String systemName);
void send(Exchange exchange);
void sendTo(@Header("EndpointName") String endpointName, Exchange exchange);
public List<String> getReferenceNames();
}

View File

@ -0,0 +1,66 @@
/*-
* ~~~~~~licensing~~~~~~
* profile-commons
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.profile.commons.profile_output;
import org.apache.camel.Exchange;
import org.apache.camel.Header;
import org.apache.camel.ProducerTemplate;
import ru.entaxy.esb.system.common.exception.ConnectorNotFound;
import ru.entaxy.esb.system.common.osgi.impl.CommonNamedReferenceListener;
import ru.entaxy.esb.system.profile.commons.connectors.out.OutConnector;
public class ProfileOutputImpl extends CommonNamedReferenceListener<OutConnector> implements ProfileOutput {
protected String systemName;
public void setSystemName(String systemName) {
this.systemName = systemName;
}
@Override
public OutConnector getOutConnector(String endpointName) {
if (endpointName == null || registeredReferences.get(endpointName) == null) {
for (OutConnector outConnector : registeredReferences.values()) {
return outConnector;
}
}
return registeredReferences.get(endpointName);
}
@Override
public void send(Exchange exchange) {
ProducerTemplate template = exchange.getContext().createProducerTemplate();
template.send("direct-vm:profile-" + systemName + "-enter-point?block=true&timeout=60000", exchange);
}
@Override
public void sendTo(@Header("ENTAXY_EndpointName") String endpointName, Exchange exchange) {
try {
getOutConnector(endpointName).send(exchange);
} catch (NullPointerException ex) {
throw new ConnectorNotFound("Out connector for " + systemName + " not found");
}
}
@Override
protected String getObjectName(OutConnector outConnector) {
return outConnector == null ? null : outConnector.getEndpointName();
}
}

View File

@ -0,0 +1,30 @@
###
# ~~~~~~licensing~~~~~~
# profile-commons
# ==========
# 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~~~~~~
###
appender.file.type=File
appender.file.name=file
appender.file.fileName=target/camel-test.log
appender.file.layout.type=PatternLayout
appender.file.layout.pattern=%d %-5p %c{1} - %m %n
appender.out.type=Console
appender.out.name=out
appender.out.layout.type=PatternLayout
appender.out.layout.pattern=[%30.30t] %-30.30c{1} %-5p %m%n
rootLogger.level=INFO
rootLogger.appenderRef.out.ref=out

View 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.

View File

@ -0,0 +1,33 @@
# Для использования wsdl, xsd и xsl, которые загружены в шину, необходимо:
**wsdl**
- для использования cxf необходимо подключить "xmlns:cxf="http://cxf.apache.org/blueprint/core"" данный
namespace и подключить к bus, используемый в cxf:
имя cxf необходимо сохранить, в связи с дублированием bus в context
<cxf:bus id="cxf" name="cxf" bus="cxf">
<cxf:features>
<cxf:logging/>
</cxf:features>
</cxf:bus>
также нужно подключить кастомный резолвер для корректного разрешения зависимостей(xsd, wsdl, загруженных ранее в шину)
предварительно мделать импорт пакетов в бандл: ru.entaxy.esb.integration.common.soap
<reference id="cxfDBResourceResolver" interface="org.apache.cxf.resource.ResourceResolver"/>
<bean id="resolver" class="DBResolverSettings" init-method="init">
<property name="bus" ref="cxf"/>
<property name="cxfDBResourceResolver" ref="cxfDBResourceResolver"/>
</bean>
**xslt**
- для использования xslt преобразования необходимо:
<reference id="xslUrlResolver" interface="javax.xml.transform.URIResolver"/>
и дополнительно прописать, при вызове самого компонента:
<to uri="xslt:lama.xsl?uriResolver=#xslUrlResolver"/>
**xsd**
- для использования xsd валидации был разработан отдельный компонент с дополнительными возможностями: динамическим
определением namespace и поиск необходимой xsd в базе данных: (более подробно можно почитать в system/registry/schema/schema-component/README.md)
<to uri="validatorWithDBStorage:namespace:http://www.entaxy.ru/registry-scheme-service/"/>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>ru.entaxy.esb.system.registry</groupId>
<artifactId>registry</artifactId>
<version>1.8.0</version>
<relativePath>../../registry/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<artifactId>schema</artifactId>
<name>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA</name>
<description>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA</description>
<modules>
<module>schema-component</module>
<module>schema-api</module>
<module>schema-impl</module>
<module>schema-soap</module>
</modules>
</project>

View 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.

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>schema</artifactId>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>schema-api</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA :: API</name>
<description>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA :: API</description>
<properties>
<bundle.osgi.import.pkg>
javax.persistence;version="[2,3)",
org.hibernate.proxy,
javassist.util.proxy,
*
</bundle.osgi.import.pkg>
<bundle.osgi.export.pkg>
ru.entaxy.esb.system.registry.schema.api.*
</bundle.osgi.export.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>${jpa.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>${hibernate.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,64 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-api
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.api;
import ru.entaxy.esb.system.registry.schema.api.entity.Resource;
import ru.entaxy.esb.system.registry.schema.api.entity.ResourceInfo;
import java.util.List;
import java.util.Optional;
public interface ResourceService {
long loadResource(Resource resource);
long reloadResource(Resource resource);
Optional<Resource> getResource(long id);
Optional<Resource> getResourceByNamespace(String namespace);
Optional<Resource> getResourceByName(String name);
Optional<Resource> getResourceByIdAndVersion(long id, String version);
void removeResource(long id);
long loadResourceInfo(ResourceInfo resourceInfo);
long editResourceInfo(ResourceInfo resourceInfo);
Optional<ResourceInfo> getResourceInfo(long id);
Optional<ResourceInfo> getResourceInfoByNamespace(String namespace);
Optional<ResourceInfo> getResourceInfoByName(String name);
Optional<ResourceInfo> getResourceInfoByIdAndVersion(long id, String version);
void removeResourceInfo(long id);
List<ResourceInfo> getListResourceInfo();
List<ResourceInfo> getListResourceInfoByName(String name);
List<ResourceInfo> getListResourceInfoByNamespace(String namespace);
}

View File

@ -0,0 +1,104 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-api
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.api.entity;
import javax.persistence.*;
import java.util.Arrays;
import java.util.Date;
@Entity
@Table(name = "resource")
public class Resource {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "resource_value")
private byte[] resourceValue;
@Column(name = "created_date")
private Date createdDate;
@Column(name = "created_by")
private String createdBy;
@Column(name = "edited_date")
private Date editedDate;
@Column(name = "edited_by")
private String editedBy;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public byte[] getResourceValue() {
return resourceValue;
}
public void setResourceValue(byte[] resourceValue) {
this.resourceValue = resourceValue;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getEditedDate() {
return editedDate;
}
public void setEditedDate(Date editedDate) {
this.editedDate = editedDate;
}
public String getEditedBy() {
return editedBy;
}
public void setEditedBy(String editedBy) {
this.editedBy = editedBy;
}
@Override
public String toString() {
return "Resource{" +
"id=" + id +
", resourceValue=" + Arrays.toString(resourceValue) +
", createdDate=" + createdDate +
", createdBy='" + createdBy + '\'' +
", editedDate=" + editedDate +
", editedBy='" + editedBy + '\'' +
'}';
}
}

View File

@ -0,0 +1,170 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-api
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.api.entity;
import javax.persistence.*;
import java.util.Date;
@Entity
@Table(name = "resource_info")
public class ResourceInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "name")
private String name;
@Column(name = "namespace")
private String namespace;
@Column(name = "description")
private String description;
@Column(name = "version")
private String version;
@Column(name = "convertor")
private Boolean convertor;
@Column(name = "created_date")
private Date createdDate;
@Column(name = "created_by")
private String createdBy;
@Column(name = "edited_date")
private Date editedDate;
@Column(name = "edited_by")
private String editedBy;
@Column(name = "namespace_out")
private String namespaceOut;
@Column(name = "resource_id")
private Long resourceId;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNamespace() {
return namespace;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public Boolean getConvertor() {
return convertor;
}
public void setConvertor(Boolean convertor) {
this.convertor = convertor;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getEditedDate() {
return editedDate;
}
public void setEditedDate(Date editedDate) {
this.editedDate = editedDate;
}
public String getEditedBy() {
return editedBy;
}
public void setEditedBy(String editedBy) {
this.editedBy = editedBy;
}
public String getNamespaceOut() {
return namespaceOut;
}
public void setNamespaceOut(String namespaceOut) {
this.namespaceOut = namespaceOut;
}
public Long getResourceId() {
return resourceId;
}
public void setResourceId(Long resourceId) {
this.resourceId = resourceId;
}
@Override
public String toString() {
return "ResourceInfo{" +
"id=" + id +
", name='" + name + '\'' +
", namespace='" + namespace + '\'' +
", description='" + description + '\'' +
", version='" + version + '\'' +
", convertor='" + convertor + '\'' +
", createdDate=" + createdDate +
", createdBy='" + createdBy + '\'' +
", editedDate=" + editedDate +
", editedBy='" + editedBy + '\'' +
", namespaceOut='" + namespaceOut + '\'' +
", resourceId=" + resourceId +
'}';
}
}

View 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.

View File

@ -0,0 +1,14 @@
# SCHEMA Component
Компонент для валидации xml с помощью xsd, ранее загруженных в бд через soap(/schema-management)
Сделан на основе camel validator, с заменой загрузчика xsd и ResourceResolver'a(для подгрузки зависимых xsd)
https://camel.apache.org/components/latest/validator-component.html
Компонент работает в двух режимах:
- статический, когда небходимую схему указывают в самом маршруте через namespace, uud или name(версию можно указывать через параметры)
validatorWithDBStorage:namespace:http://www.entaxy.ru/registry-scheme-service/
validatorWithDBStorage:uuid:a7ff793b-d996-42a5-a62b-fb44a2143e98?version=3.0
validatorWithDBStorage:name:lama.xsd?version=3.0
- динамический, если не было указано ничего из выше перечисленного, то будет выбран этот режим.
когда сообщение парсится при поступлении и с помощью namespace загружается его xsd, если xsd была
не найдена или namespace не был указан будет ошибка

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>schema</artifactId>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>schema-component</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA :: COMPONENT</name>
<description>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA :: COMPONENT</description>
<properties>
<bundle.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=schema</bundle.osgi.export.service>
<bundle.osgi.import.pkg>
ru.entaxy.esb.system.common.osgi,
ru.entaxy.esb.system.common.osgi.impl,
javax.persistence;version="[2,3)",
*
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<artifactId>schema-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.commons</groupId>
<artifactId>system-commons</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,450 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.component;
import org.apache.camel.*;
import org.apache.camel.converter.jaxp.XmlConverter;
import org.apache.camel.support.AsyncProcessorHelper;
import org.apache.camel.support.processor.validation.DefaultValidationErrorHandler;
import org.apache.camel.support.processor.validation.SchemaValidationException;
import org.apache.camel.support.processor.validation.ValidatorErrorHandler;
import org.apache.camel.util.IOHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import ru.entaxy.esb.system.registry.schema.component.exception.SchemaNotFoundException;
import ru.entaxy.esb.system.registry.schema.component.util.SchemaReaderFromDB;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stax.StAXSource;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
/**
* A processor which validates the XML version of the inbound message body
* against some schema either in XSD or RelaxNG
*/
public class ValidatingProcessor implements AsyncProcessor {
private static final Logger LOG = LoggerFactory.getLogger(ValidatingProcessor.class);
private final SchemaReaderFromDB schemaReaderFromDB;
private ValidatorErrorHandler errorHandler = new DefaultValidationErrorHandler();
private final XmlConverter converter = new XmlConverter();
private boolean useDom;
private boolean useSharedSchema = true;
private boolean failOnNullBody = true;
private boolean failOnNullHeader = true;
private String headerName;
private String uri;
private final Map<String, Schema> schemaMap = new HashMap<>();
public ValidatingProcessor() {
schemaReaderFromDB = new SchemaReaderFromDB();
}
public ValidatingProcessor(SchemaReaderFromDB schemaReaderFromDB, String uri) {
// schema reader can be a singelton per schema, therefore make reuse, see ValidatorEndpoint and ValidatorProducer
this.schemaReaderFromDB = schemaReaderFromDB;
this.uri = uri;
}
public void process(Exchange exchange) throws Exception {
AsyncProcessorHelper.process(this, exchange);
}
public boolean process(Exchange exchange, AsyncCallback callback) {
try {
doProcess(exchange);
} catch (Exception e) {
exchange.setException(e);
}
callback.done(true);
return true;
}
@Override
public CompletableFuture<Exchange> processAsync(Exchange exchange) {
return null;
}
protected void doProcess(Exchange exchange) throws Exception {
Schema schema = null;
Validator validator = null;
if (uri != null && !uri.isEmpty()) {
schema = getOrCreateSchema(schemaReaderFromDB.getSchemaResourceUri());
validator = getValidator(schema);
}
// the underlying input stream, which we need to close to avoid locking files or other resources
Source source = null;
InputStream is = null;
try {
Result result = null;
// only convert to input stream if really needed
if (isInputStreamNeeded(exchange)) {
is = getContentToValidate(exchange, InputStream.class);
if (is != null) {
source = getSource(exchange, is);
}
} else {
Object content = getContentToValidate(exchange);
if (content != null) {
source = getSource(exchange, content);
}
}
//CAMEL-7036 We don't need to set the result if the source is an instance of StreamSource
if (source instanceof DOMSource) {
result = new DOMResult();
} else if (source instanceof SAXSource) {
result = new SAXResult();
} else if (source instanceof StAXSource || source instanceof StreamSource) {
result = null;
}
if (source != null) {
if (validator == null) {
String namespace = "namespace:" + getNamespace(source);
schemaReaderFromDB.setSchemaResourceUri(namespace);
schema = getOrCreateSchema(namespace);
validator = getValidator(schema);
}
if (validator == null)
throw new SchemaNotFoundException("Schema not found for {" + schemaReaderFromDB.getSchemaResourceUri() + "}");
// create a new errorHandler and set it on the validator
// must be a local instance to avoid problems with concurrency (to be
// thread safe)
ValidatorErrorHandler handler = errorHandler.getClass().newInstance();
validator.setErrorHandler(handler);
try {
LOG.trace("Validating {}", source);
validator.validate(source, result);
handler.handleErrors(exchange, schema, result);
} catch (SAXParseException e) {
// can be thrown for non well formed XML
throw new SchemaValidationException(exchange, schema, Collections.singletonList(e),
Collections.emptyList(),
Collections.emptyList());
}
}
} finally {
IOHelper.close(is);
}
}
private String getNamespace(Source source) throws ParserConfigurationException, IOException, SAXException {
StreamSource domSource = (StreamSource) source;
domSource.getInputStream();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(domSource.getInputStream());
return document.getDocumentElement().getNamespaceURI();
}
private Schema getOrCreateSchema(String resourceUri) throws IOException, SAXException {
if (!schemaMap.containsKey(resourceUri) && resourceUri != null && !resourceUri.isEmpty()) {
schemaMap.put(resourceUri, createSchema());
}
return resourceUri == null ? null : schemaMap.get(resourceUri);
}
private Validator getValidator(Schema schema) {
return schema != null ? schema.newValidator() : null;
}
private Object getContentToValidate(Exchange exchange) {
if (shouldUseHeader()) {
return exchange.getIn().getHeader(headerName);
} else {
return exchange.getIn().getBody();
}
}
private <T> T getContentToValidate(Exchange exchange, Class<T> clazz) {
if (shouldUseHeader()) {
return exchange.getIn().getHeader(headerName, clazz);
} else {
return exchange.getIn().getBody(clazz);
}
}
private boolean shouldUseHeader() {
return headerName != null;
}
public void loadSchema() throws Exception {
schemaReaderFromDB.loadSchema();
}
// Properties
// -----------------------------------------------------------------------
public Schema getSchema() throws IOException, SAXException {
return schemaReaderFromDB.getSchema();
}
public void setSchema(Schema schema) {
schemaReaderFromDB.setSchema(schema);
}
public String getSchemaLanguage() {
return schemaReaderFromDB.getSchemaLanguage();
}
public void setSchemaLanguage(String schemaLanguage) {
schemaReaderFromDB.setSchemaLanguage(schemaLanguage);
}
public Source getSchemaSource() throws IOException {
return schemaReaderFromDB.getSchemaSource();
}
public void setSchemaSource(Source schemaSource) {
schemaReaderFromDB.setSchemaSource(schemaSource);
}
public URL getSchemaUrl() {
return schemaReaderFromDB.getSchemaUrl();
}
public void setSchemaUrl(URL schemaUrl) {
schemaReaderFromDB.setSchemaUrl(schemaUrl);
}
public File getSchemaFile() {
return schemaReaderFromDB.getSchemaFile();
}
public void setSchemaFile(File schemaFile) {
schemaReaderFromDB.setSchemaFile(schemaFile);
}
public byte[] getSchemaAsByteArray() {
return schemaReaderFromDB.getSchemaAsByteArray();
}
public void setSchemaAsByteArray(byte[] schemaAsByteArray) {
schemaReaderFromDB.setSchemaAsByteArray(schemaAsByteArray);
}
public SchemaFactory getSchemaFactory() {
return schemaReaderFromDB.getSchemaFactory();
}
public void setSchemaFactory(SchemaFactory schemaFactory) {
schemaReaderFromDB.setSchemaFactory(schemaFactory);
}
public ValidatorErrorHandler getErrorHandler() {
return errorHandler;
}
public void setErrorHandler(ValidatorErrorHandler errorHandler) {
this.errorHandler = errorHandler;
}
@Deprecated
public boolean isUseDom() {
return useDom;
}
/**
* Sets whether DOMSource and DOMResult should be used.
*
* @param useDom true to use DOM otherwise
*/
@Deprecated
public void setUseDom(boolean useDom) {
this.useDom = useDom;
}
public boolean isUseSharedSchema() {
return useSharedSchema;
}
public void setUseSharedSchema(boolean useSharedSchema) {
this.useSharedSchema = useSharedSchema;
}
public LSResourceResolver getResourceResolver() {
return schemaReaderFromDB.getResourceResolver();
}
public void setResourceResolver(LSResourceResolver resourceResolver) {
schemaReaderFromDB.setResourceResolver(resourceResolver);
}
public boolean isFailOnNullBody() {
return failOnNullBody;
}
public void setFailOnNullBody(boolean failOnNullBody) {
this.failOnNullBody = failOnNullBody;
}
public boolean isFailOnNullHeader() {
return failOnNullHeader;
}
public void setFailOnNullHeader(boolean failOnNullHeader) {
this.failOnNullHeader = failOnNullHeader;
}
public String getHeaderName() {
return headerName;
}
public void setHeaderName(String headerName) {
this.headerName = headerName;
}
// Implementation methods
// -----------------------------------------------------------------------
protected SchemaFactory createSchemaFactory() {
return schemaReaderFromDB.createSchemaFactory();
}
protected Source createSchemaSource() throws IOException {
return schemaReaderFromDB.createSchemaSource();
}
protected Schema createSchema() throws SAXException, IOException {
return schemaReaderFromDB.createSchema();
}
/**
* Checks whether we need an {@link InputStream} to access the message body or header.
* <p/>
* Depending on the content in the message body or header, we may not need to convert
* to {@link InputStream}.
*
* @param exchange the current exchange
* @return <tt>true</tt> to convert to {@link InputStream} beforehand converting to {@link Source} afterwards.
*/
protected boolean isInputStreamNeeded(Exchange exchange) {
Object content = getContentToValidate(exchange);
if (content == null) {
return false;
}
if (content instanceof InputStream) {
return true;
} else if (content instanceof Source) {
return false;
} else if (content instanceof String) {
return false;
} else if (content instanceof byte[]) {
return false;
} else //there is a direct and hopefully optimized converter to Source
if (content instanceof Node) {
return false;
} else return exchange.getContext().getTypeConverterRegistry().lookup(Source.class, content.getClass()) == null;
// yes an input stream is needed
}
/**
* Converts the inbound body or header to a {@link Source}, if it is <b>not</b> already a {@link Source}.
* <p/>
* This implementation will prefer to source in the following order:
* <ul>
* <li>DOM - DOM if explicit configured to use DOM</li>
* <li>SAX - SAX as 2nd choice</li>
* <li>Stream - Stream as 3rd choice</li>
* <li>DOM - DOM as 4th choice</li>
* </ul>
*/
protected Source getSource(Exchange exchange, Object content) {
if (isUseDom()) {
// force DOM
return exchange.getContext().getTypeConverter().tryConvertTo(DOMSource.class, exchange, content);
}
// body or header may already be a source
if (content instanceof Source) {
return (Source) content;
}
Source source = null;
if (content instanceof InputStream) {
return new StreamSource((InputStream) content);
}
if (content != null) {
TypeConverter tc = exchange.getContext().getTypeConverterRegistry().lookup(Source.class, content.getClass());
if (tc != null) {
source = tc.convertTo(Source.class, exchange, content);
}
}
if (source == null) {
// then try SAX
source = exchange.getContext().getTypeConverter().tryConvertTo(SAXSource.class, exchange, content);
}
if (source == null) {
// then try stream
source = exchange.getContext().getTypeConverter().tryConvertTo(StreamSource.class, exchange, content);
}
if (source == null) {
// and fallback to DOM
source = exchange.getContext().getTypeConverter().tryConvertTo(DOMSource.class, exchange, content);
}
if (source == null) {
if (isFailOnNullBody()) {
throw new ExpectedBodyTypeException(exchange, Source.class);
} else {
try {
source = converter.toDOMSource(converter.createDocument());
} catch (ParserConfigurationException e) {
throw new RuntimeTransformException(e);
}
}
}
return source;
}
}

View File

@ -0,0 +1,38 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.component;
import org.apache.camel.Endpoint;
import org.apache.camel.support.DefaultComponent;
import java.util.Map;
public class ValidatorWithDBStorageComponent extends DefaultComponent {
@Override
protected Endpoint createEndpoint(String uri, String xsdScheme, Map<String, Object> parameters) throws Exception {
ValidatorWithDBStorageEndpoint endpoint = new ValidatorWithDBStorageEndpoint(uri, this);
endpoint.setUri(uri);
setProperties(endpoint, parameters);
return endpoint;
}
}

View File

@ -0,0 +1,131 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.component;
import org.apache.camel.Component;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
import org.apache.camel.support.DefaultEndpoint;
import org.osgi.framework.FrameworkUtil;
import org.w3c.dom.ls.LSResourceResolver;
import ru.entaxy.esb.system.common.osgi.OSGIUtils;
import ru.entaxy.esb.system.registry.schema.api.ResourceService;
import ru.entaxy.esb.system.registry.schema.component.util.SchemaReaderFromDB;
@UriEndpoint(
scheme = "validatorWithDBStorage",
title = "ValidatorWithDBStorage",
syntax = "validatorWithDBStorage:namespace",
label = "Custom validator component with loader resources from db",
producerOnly = true)
public class ValidatorWithDBStorageEndpoint extends DefaultEndpoint {
@UriPath(description = "URL to a local resource on the classpath, or a reference to lookup a bean in the Registry,"
+ " or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.")
@Metadata(required = true)
private String uri;
@UriParam(description = "Version")
@Metadata(required = true)
private String version;
/**
* We need a one-to-one relation between endpoint and schema reader in order
* to be able to clear the cached schema in the schema reader. See method
*/
private final SchemaReaderFromDB schemaReaderFromDB;
private volatile boolean schemaReaderConfigured;
private ResourceService resourceService;
private LSResourceResolver resourceResolver;
public ValidatorWithDBStorageEndpoint(String uri, Component component) {
super(uri, component);
this.uri = uri.replace("validatorWithDBStorage://", "").replace("validatorWithDBStorage:", "").replace("validatorWithDBStorage", "");
schemaReaderFromDB = this.uri.isEmpty() ? new SchemaReaderFromDB() :
new SchemaReaderFromDB(getCamelContext(), this.uri, version);
}
public Producer createProducer() throws Exception {
if (!schemaReaderConfigured) {
if (resourceResolver != null) {
schemaReaderFromDB.setResourceResolver(getResourceResolver());
}
schemaReaderFromDB.setResourceService(getResourceService());
// force loading of schema at create time otherwise concurrent
// processing could cause thread safe issues for the
// javax.xml.validation.SchemaFactory
schemaReaderFromDB.loadSchema();
// configure only once
schemaReaderConfigured = true;
}
ValidatingProcessor validator = new ValidatingProcessor(schemaReaderFromDB, uri);
return new ValidatorWithDBStorageProducer(this, validator);
}
public Consumer createConsumer(Processor processor) throws Exception {
return null;
}
public boolean isSingleton() {
return true;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public ResourceService getResourceService() {
if (resourceService == null) {
resourceService = (ResourceService) OSGIUtils.getServiceReference(
FrameworkUtil.getBundle(ValidatorWithDBStorageEndpoint.class).getBundleContext(),
ResourceService.class.getName());
}
return resourceService;
}
private LSResourceResolver getResourceResolver() {
if (resourceResolver == null) {
resourceResolver = (LSResourceResolver) OSGIUtils.getServiceReference(
FrameworkUtil.getBundle(ValidatorWithDBStorageEndpoint.class).getBundleContext(),
LSResourceResolver.class.getName());
}
return resourceResolver;
}
public void setVersion(String version) {
this.version = version;
}
public String getVersion() {
return version;
}
}

View File

@ -0,0 +1,63 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.component;
import org.apache.camel.AsyncCallback;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultAsyncProducer;
import org.apache.camel.support.service.ServiceHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ValidatorWithDBStorageProducer extends DefaultAsyncProducer {
private static final Logger LOG = LoggerFactory.getLogger(ValidatorWithDBStorageProducer.class);
private final ValidatingProcessor validatingProcessor;
public ValidatorWithDBStorageProducer(Endpoint endpoint, ValidatingProcessor validatingProcessor) {
super(endpoint);
this.validatingProcessor = validatingProcessor;
}
@Override
public boolean process(Exchange exchange, AsyncCallback callback) {
return validatingProcessor.process(exchange, callback);
}
@Override
protected void doStart() throws Exception {
super.doStart();
ServiceHelper.startService(validatingProcessor);
}
@Override
protected void doStop() throws Exception {
super.doStop();
ServiceHelper.stopService(validatingProcessor);
}
@Override
protected void doShutdown() throws Exception {
super.doStop();
ServiceHelper.stopAndShutdownService(validatingProcessor);
}
}

View File

@ -0,0 +1,47 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.component.exception;
public class SchemaNotFoundException extends Exception {
private static final long serialVersionUID = 948229285513408917L;
public SchemaNotFoundException() {
super();
}
public SchemaNotFoundException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public SchemaNotFoundException(String message, Throwable cause) {
super(message, cause);
}
public SchemaNotFoundException(String message) {
super(message);
}
public SchemaNotFoundException(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,221 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.component.util;
import org.apache.camel.CamelContext;
import org.apache.camel.util.ObjectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.SAXException;
import ru.entaxy.esb.system.registry.schema.api.ResourceService;
import ru.entaxy.esb.system.registry.schema.api.entity.Resource;
import javax.xml.XMLConstants;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.Optional;
public class SchemaReaderFromDB {
/**
* Key of the global option to switch either off or on the access to external DTDs in the XML Validator for StreamSources.
* Only effective, if not a custom schema factory is used.
*/
public static final String ACCESS_EXTERNAL_DTD = "CamelXmlValidatorAccessExternalDTD";
private static final Logger LOG = LoggerFactory.getLogger(SchemaReaderFromDB.class);
private String schemaLanguage = XMLConstants.W3C_XML_SCHEMA_NS_URI;
// must be volatile because is accessed from different threads see ValidatorEndpoint.clearCachedSchema
private volatile Schema schema;
private Source schemaSource;
// must be volatile because is accessed from different threads see ValidatorEndpoint.clearCachedSchema
private volatile SchemaFactory schemaFactory;
private URL schemaUrl;
private File schemaFile;
private byte[] schemaAsByteArray;
private String schemaResourceUri;
private String version;
private LSResourceResolver resourceResolver;
private ResourceService resourceService;
private final CamelContext camelContext;
public SchemaReaderFromDB() {
this.camelContext = null;
this.schemaResourceUri = null;
}
/**
* Specify a camel context and a schema resource URI in order to read the schema via the class resolver specified in the Camel context.
*/
public SchemaReaderFromDB(CamelContext camelContext, String schemaResourceUri, String version) {
ObjectHelper.notNull(camelContext, "camelContext");
ObjectHelper.notNull(schemaResourceUri, "schemaResourceUri");
this.camelContext = camelContext;
this.schemaResourceUri = schemaResourceUri;
this.version = version;
}
public void loadSchema() throws Exception {
// force loading of schema
schema = createSchema();
}
// Properties
// -----------------------------------------------------------------------
public Schema getSchema() throws IOException, SAXException {
if (schema == null) {
synchronized (this) {
if (schema == null) {
schema = createSchema();
}
}
}
return schema;
}
public void setSchema(Schema schema) {
this.schema = schema;
}
public String getSchemaLanguage() {
return schemaLanguage;
}
public void setSchemaLanguage(String schemaLanguage) {
this.schemaLanguage = schemaLanguage;
}
public Source getSchemaSource() throws IOException {
if (schemaSource == null) {
schemaSource = createSchemaSource();
}
return schemaSource;
}
public void setSchemaSource(Source schemaSource) {
this.schemaSource = schemaSource;
}
public URL getSchemaUrl() {
return schemaUrl;
}
public void setSchemaUrl(URL schemaUrl) {
this.schemaUrl = schemaUrl;
}
public File getSchemaFile() {
return schemaFile;
}
public void setSchemaFile(File schemaFile) {
this.schemaFile = schemaFile;
}
public byte[] getSchemaAsByteArray() {
return schemaAsByteArray;
}
public void setSchemaAsByteArray(byte[] schemaAsByteArray) {
this.schemaAsByteArray = schemaAsByteArray;
}
public SchemaFactory getSchemaFactory() {
if (schemaFactory == null) {
synchronized (this) {
if (schemaFactory == null) {
schemaFactory = createSchemaFactory();
}
}
}
return schemaFactory;
}
public void setSchemaFactory(SchemaFactory schemaFactory) {
this.schemaFactory = schemaFactory;
}
public void setResourceService(ResourceService resourceService) {
this.resourceService = resourceService;
}
public LSResourceResolver getResourceResolver() {
return resourceResolver;
}
public void setResourceResolver(LSResourceResolver resourceResolver) {
this.resourceResolver = resourceResolver;
}
public void setSchemaResourceUri(String schemaResourceUri) {
this.schemaResourceUri = schemaResourceUri;
}
public String getSchemaResourceUri() {
return schemaResourceUri;
}
public SchemaFactory createSchemaFactory() {
SchemaFactory factory = SchemaFactory.newInstance(schemaLanguage);
if (getResourceResolver() != null) {
factory.setResourceResolver(getResourceResolver());
}
if (camelContext == null || !Boolean.parseBoolean(camelContext.getGlobalOptions().get(ACCESS_EXTERNAL_DTD))) {
try {
LOG.debug("Configuring SchemaFactory to not allow access to external DTD/Schema");
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
} catch (SAXException e) {
LOG.warn(e.getMessage(), e);
}
}
return factory;
}
public Source createSchemaSource() throws IOException {
throw new IllegalArgumentException("You must specify either a schema, schemaFile, schemaSource, schemaUrl, or schemaUri property");
}
public Schema createSchema() throws SAXException, IOException {
SchemaFactory factory = getSchemaFactory();
Optional<Resource> resource = Optional.empty();
if (schemaResourceUri != null && schemaResourceUri.contains("namespace:")) {
resource = resourceService.getResourceByNamespace(schemaResourceUri.replace("namespace:", ""));
}
if (schemaResourceUri != null && schemaResourceUri.contains("uuid:")) {
resource = resourceService.getResourceByNamespace(schemaResourceUri.replace("uuid:", ""));
}
if (resource.isPresent())
return factory.newSchema(new StreamSource(new ByteArrayInputStream(resource.get().getResourceValue())));
return null;
}
}

View File

@ -0,0 +1,30 @@
###
# ~~~~~~licensing~~~~~~
# schema-component
# ==========
# 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~~~~~~
###
appender.file.type=File
appender.file.name=file
appender.file.fileName=target/camel-test.log
appender.file.layout.type=PatternLayout
appender.file.layout.pattern=%d %-5p %c{1} - %m %n
appender.out.type=Console
appender.out.name=out
appender.out.layout.type=PatternLayout
appender.out.layout.pattern=[%30.30t] %-30.30c{1} %-5p %m%n
rootLogger.level=INFO
rootLogger.appenderRef.out.ref=out

View 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.

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>schema</artifactId>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>schema-impl</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA :: IMPL</name>
<description>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA :: IMPL</description>
<properties>
<bundle.osgi.import.pkg>
ru.entaxy.esb.system.registry.schema.api.*,
javax.persistence;version="[2,3)",
org.hibernate.proxy,
javassist.util.proxy,
*
</bundle.osgi.import.pkg>
<bundle.osgi.export.pkg>
ru.entaxy.esb.system.registry.schema.resolver.resource.*,
ru.entaxy.esb.system.registry.schema.impl.*,
</bundle.osgi.export.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>${jpa.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<artifactId>schema-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.deployer</groupId>
<artifactId>nexus-deployer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>${xerces.version}</version>
</dependency>
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>org.apache.aries.blueprint.api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,44 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.exception;
public class ResourceInfoNotFound extends RuntimeException {
public ResourceInfoNotFound() {
super();
}
public ResourceInfoNotFound(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public ResourceInfoNotFound(String message, Throwable cause) {
super(message, cause);
}
public ResourceInfoNotFound(String message) {
super(message);
}
public ResourceInfoNotFound(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,44 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.exception;
public class ResourceNotFound extends RuntimeException {
public ResourceNotFound() {
super();
}
public ResourceNotFound(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public ResourceNotFound(String message, Throwable cause) {
super(message, cause);
}
public ResourceNotFound(String message) {
super(message);
}
public ResourceNotFound(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,380 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.impl;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import ru.entaxy.esb.system.registry.schema.api.ResourceService;
import ru.entaxy.esb.system.registry.schema.api.entity.Resource;
import ru.entaxy.esb.system.registry.schema.api.entity.ResourceInfo;
import ru.entaxy.esb.system.registry.schema.exception.ResourceInfoNotFound;
import ru.entaxy.esb.system.registry.schema.exception.ResourceNotFound;
import javax.persistence.EntityNotFoundException;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import java.util.List;
import java.util.Optional;
public class ResourceServiceImpl implements ResourceService {
private SessionFactory sessionFactory;
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
public Session getSession() {
return sessionFactory.openSession();
}
@Override
public long loadResource(Resource resource) {
long id;
try (Session s = getSession()) {
s.getTransaction().begin();
id = (long) s.save(resource);
s.getTransaction().commit();
s.close();
}
return id;
}
@Override
public long reloadResource(Resource resource) {
try (Session s = getSession()) {
s.getTransaction().begin();
s.saveOrUpdate(reloadingResource(resource));
s.getTransaction().commit();
s.close();
}
return resource.getId();
}
@Override
public Optional<Resource> getResource(long id) {
Optional<Resource> resource;
try (Session s = getSession()) {
s.getTransaction().begin();
CriteriaBuilder builder = s.getCriteriaBuilder();
CriteriaQuery<Resource> criteriaQuery = builder.createQuery(Resource.class);
Root<Resource> root = criteriaQuery.from(Resource.class);
criteriaQuery.where(
builder.equal(root.get("id"), id)
);
resource = s.createQuery(criteriaQuery).uniqueResultOptional();
s.getTransaction().commit();
s.close();
}
return resource;
}
@Override
public Optional<Resource> getResourceByNamespace(String namespace) {
Optional<ResourceInfo> resourceInfo;
Optional<Resource> resource;
try (Session s = getSession()) {
s.getTransaction().begin();
CriteriaBuilder builder = s.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.equal(root.get("namespace"), namespace)
);
resourceInfo = s.createQuery(criteriaQuery).uniqueResultOptional();
if (resourceInfo.isEmpty()) {
throw new ResourceInfoNotFound();
}
resource = getResource(resourceInfo.get().getResourceId());
s.getTransaction().commit();
s.close();
}
return resource;
}
@Override
public Optional<Resource> getResourceByName(String name) {
Optional<ResourceInfo> resourceInfo;
Optional<Resource> resource;
try (Session s = getSession()) {
s.getTransaction().begin();
CriteriaBuilder builder = s.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.equal(root.get("name"), name)
);
resourceInfo = s.createQuery(criteriaQuery).uniqueResultOptional();
if (resourceInfo.isEmpty()) {
throw new ResourceInfoNotFound();
}
resource = getResource(resourceInfo.get().getResourceId());
s.getTransaction().commit();
s.close();
}
return resource;
}
@Override
public Optional<Resource> getResourceByIdAndVersion(long id, String version) {
Optional<ResourceInfo> resourceInfo;
Optional<Resource> resource;
try (Session s = getSession()) {
s.getTransaction().begin();
CriteriaBuilder builder = s.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.and(
builder.equal(root.get("id"), id),
builder.equal(root.get("version"), version)
)
);
resourceInfo = s.createQuery(criteriaQuery).uniqueResultOptional();
if (resourceInfo.isEmpty()) {
throw new ResourceInfoNotFound();
}
resource = getResource(resourceInfo.get().getResourceId());
s.getTransaction().commit();
s.close();
}
return resource;
}
@Override
public void removeResource(long id) {
try (Session session = getSession()) {
session.getTransaction().begin();
Optional<Resource> resource = getResource(id);
if (resource.isEmpty()) {
throw new ResourceNotFound("Resource not found with id {" + id + "}");
}
session.delete(Resource.class.getName(), resource.get());
session.getTransaction().commit();
}
}
@Override
public long loadResourceInfo(ResourceInfo resourceInfo) {
long id;
try (Session s = getSession()) {
s.getTransaction().begin();
if (resourceInfo.getResourceId() == null || getResource(resourceInfo.getResourceId()).isEmpty()) {
throw new ResourceNotFound("Resource not found id {" + resourceInfo.getResourceId() + "}");
}
id = (long) s.save(resourceInfo);
s.getTransaction().commit();
s.close();
}
return id;
}
@Override
public long editResourceInfo(ResourceInfo resourceInfo) {
try (Session s = getSession()) {
s.getTransaction().begin();
s.saveOrUpdate(editedResourceInfo(resourceInfo));
s.getTransaction().commit();
s.close();
}
return resourceInfo.getId();
}
@Override
public Optional<ResourceInfo> getResourceInfo(long id) {
Optional<ResourceInfo> resourceInfo;
try (Session s = getSession()) {
s.getTransaction().begin();
CriteriaBuilder builder = s.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.equal(root.get("id"), id)
);
resourceInfo = s.createQuery(criteriaQuery).uniqueResultOptional();
s.getTransaction().commit();
s.close();
}
return resourceInfo;
}
@Override
public Optional<ResourceInfo> getResourceInfoByNamespace(String namespace) {
Optional<ResourceInfo> resourceInfo;
try (Session s = getSession()) {
s.getTransaction().begin();
CriteriaBuilder builder = s.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.equal(root.get("namespace"), namespace)
);
resourceInfo = s.createQuery(criteriaQuery).uniqueResultOptional();
s.getTransaction().commit();
s.close();
}
return resourceInfo;
}
@Override
public Optional<ResourceInfo> getResourceInfoByName(String name) {
Optional<ResourceInfo> resourceInfo;
try (Session s = getSession()) {
s.getTransaction().begin();
CriteriaBuilder builder = s.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.equal(root.get("name"), name)
);
resourceInfo = s.createQuery(criteriaQuery).uniqueResultOptional();
s.getTransaction().commit();
s.close();
}
return resourceInfo;
}
@Override
public Optional<ResourceInfo> getResourceInfoByIdAndVersion(long id, String version) {
Optional<ResourceInfo> resourceInfo;
try (Session s = getSession()) {
s.getTransaction().begin();
CriteriaBuilder builder = s.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.and(
builder.equal(root.get("id"), id),
builder.equal(root.get("version"), version)
)
);
resourceInfo = s.createQuery(criteriaQuery).uniqueResultOptional();
s.getTransaction().commit();
s.close();
}
return resourceInfo;
}
@Override
public void removeResourceInfo(long id) {
try (Session session = getSession()) {
session.getTransaction().begin();
Optional<ResourceInfo> resourceInfo = getResourceInfo(id);
if (resourceInfo.isEmpty()) {
throw new ResourceInfoNotFound("Resource info not found with id {" + id + "}");
}
session.delete(ResourceInfo.class.getName(), resourceInfo.get());
session.getTransaction().commit();
}
}
@Override
public List<ResourceInfo> getListResourceInfo() {
List<ResourceInfo> list;
try (Session session = getSession()) {
session.getTransaction().begin();
CriteriaQuery<ResourceInfo> criteriaQuery = session.getCriteriaBuilder().createQuery(ResourceInfo.class);
criteriaQuery.from(ResourceInfo.class);
list = session.createQuery(criteriaQuery).getResultList();
session.getTransaction().commit();
}
return list;
}
@Override
public List<ResourceInfo> getListResourceInfoByName(String name) {
List<ResourceInfo> list;
try (Session session = getSession()) {
session.getTransaction().begin();
CriteriaBuilder builder = session.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.like(root.get("name"), "%" + name + "%")
);
list = session.createQuery(criteriaQuery).getResultList();
session.getTransaction().commit();
}
return list;
}
@Override
public List<ResourceInfo> getListResourceInfoByNamespace(String namespace) {
List<ResourceInfo> list;
try (Session session = getSession()) {
session.getTransaction().begin();
CriteriaBuilder builder = session.getCriteriaBuilder();
CriteriaQuery<ResourceInfo> criteriaQuery = builder.createQuery(ResourceInfo.class);
Root<ResourceInfo> root = criteriaQuery.from(ResourceInfo.class);
criteriaQuery.where(
builder.like(root.get("namespace"), "%" + namespace + "%")
);
list = session.createQuery(criteriaQuery).getResultList();
session.getTransaction().commit();
}
return list;
}
private ResourceInfo editedResourceInfo(ResourceInfo newResourceInfo) {
Optional<ResourceInfo> oldResource = getResourceInfo(newResourceInfo.getId());
if (oldResource.isPresent()) {
newResourceInfo.setCreatedBy(oldResource.get().getCreatedBy());
newResourceInfo.setCreatedDate(oldResource.get().getCreatedDate());
} else {
throw new EntityNotFoundException();
}
return newResourceInfo;
}
private Resource reloadingResource(Resource newResource) {
Optional<Resource> oldResource = getResource(newResource.getId());
if (oldResource.isPresent()) {
newResource.setCreatedBy(oldResource.get().getCreatedBy());
newResource.setCreatedDate(oldResource.get().getCreatedDate());
newResource.setResourceValue(oldResource.get().getResourceValue());
} else {
throw new EntityNotFoundException();
}
return newResource;
}
}

View File

@ -0,0 +1,58 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.resolver.resource;
import org.apache.cxf.resource.ResourceResolver;
import ru.entaxy.esb.system.registry.schema.api.ResourceService;
import ru.entaxy.esb.system.registry.schema.api.entity.Resource;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Optional;
public class CxfDBResourceResolver implements ResourceResolver {
private ResourceService resourceService;
@Override
public <T> T resolve(String resourceName, Class<T> resourceType) {
// null - because we need only resource from db
return null;
}
@Override
public InputStream getAsStream(String name) {
Optional<Resource> resource = resourceService.getResourceByName(name);
if (resource.isPresent()) {
return new ByteArrayInputStream(resource.get().getResourceValue());
} else {
Optional<Resource> xsd = resourceService.getResourceByName(name);
return xsd.map(value -> new ByteArrayInputStream(value.getResourceValue())).orElse(null);
}
}
public ResourceService getResourceService() {
return resourceService;
}
public void setResourceService(ResourceService resourceService) {
this.resourceService = resourceService;
}
}

View File

@ -0,0 +1,47 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.resolver.resource;
import org.apache.cxf.Bus;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
public class DBResolverSettings {
private Bus bus;
private ResourceResolver resourceResolver;
public void init() {
if (bus != null) {
ResourceManager resourceManager = bus.getExtension(org.apache.cxf.resource.ResourceManager.class);
if (resourceManager != null) {
resourceManager.addResourceResolver(resourceResolver);
}
}
}
public void setBus(Bus bus) {
this.bus = bus;
}
public void setResourceResolver(ResourceResolver resourceResolver) {
this.resourceResolver = resourceResolver;
}
}

View File

@ -0,0 +1,58 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.resolver.resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSInput;
import org.w3c.dom.ls.LSResourceResolver;
import ru.entaxy.esb.system.registry.schema.api.ResourceService;
import ru.entaxy.esb.system.registry.schema.api.entity.Resource;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.ByteArrayInputStream;
import java.util.Optional;
public class DBResourceResolver implements LSResourceResolver {
private static final Log LOG = LogFactory.getLog(DBResourceResolver.class);
private ResourceService resourceService;
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
try {
Optional<Resource> resource = resourceService.getResourceByName(systemId);
if (resource.isPresent()) {
DOMImplementationLS dils = (DOMImplementationLS) DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation();
LSInput input = dils.createLSInput();
input.setByteStream(new ByteArrayInputStream(resource.get().getResourceValue()));
return input;
}
} catch (Exception e) {
LOG.error(e);
}
return null;
}
public void setResourceService(ResourceService resourceService) {
this.resourceService = resourceService;
}
}

View File

@ -0,0 +1,56 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-impl
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.resolver.resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import ru.entaxy.esb.system.registry.schema.api.ResourceService;
import ru.entaxy.esb.system.registry.schema.api.entity.Resource;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
import javax.xml.transform.URIResolver;
import javax.xml.transform.stream.StreamSource;
import java.io.ByteArrayInputStream;
import java.util.Optional;
public class XslUrlResolver implements URIResolver {
private static final Log LOG = LogFactory.getLog(XslUrlResolver.class);
private ResourceService resourceService;
@Override
public Source resolve(String href, String base) throws TransformerException {
try {
Optional<Resource> resource = resourceService.getResourceByName(href);
if (resource.isPresent()) {
return new StreamSource(new ByteArrayInputStream(resource.get().getResourceValue()));
}
} catch (Exception e) {
LOG.error(e);
}
return null;
}
public void setResourceService(ResourceService resourceService) {
this.resourceService = resourceService;
}
}

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~~~~~~licensing~~~~~~
schema-impl
==========
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~~~~~~
-->
<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="sessionFactory"
interface="org.hibernate.SessionFactory"
timeout="30000"/>
<bean id="resourceService" class="ru.entaxy.esb.system.registry.schema.impl.ResourceServiceImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<service ref="resourceService" interface="ru.entaxy.esb.system.registry.schema.api.ResourceService"/>
<bean id="cxfDBResourceResolver"
class="ru.entaxy.esb.system.registry.schema.resolver.resource.CxfDBResourceResolver">
<property name="resourceService" ref="resourceService"/>
</bean>
<service ref="cxfDBResourceResolver" interface="org.apache.cxf.resource.ResourceResolver"/>
<bean id="dbResourceResolver" class="ru.entaxy.esb.system.registry.schema.resolver.resource.DBResourceResolver">
<property name="resourceService" ref="resourceService"/>
</bean>
<service ref="dbResourceResolver" interface="org.w3c.dom.ls.LSResourceResolver"/>
<bean id="xslUrlResolver" class="ru.entaxy.esb.system.registry.schema.resolver.resource.XslUrlResolver">
<property name="resourceService" ref="resourceService"/>
</bean>
<service ref="xslUrlResolver" interface="javax.xml.transform.URIResolver"/>
</blueprint>

View File

@ -0,0 +1,38 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
~~~~~~licensing~~~~~~
schema-impl
==========
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~~~~~~
-->
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">osgi:service/entaxy.esb.storage</property>
<property name="hibernate.hbm2ddl.auto">validate</property>
<property name="hibernate.enable_lazy_load_no_trans">true</property>
<mapping class="ru.entaxy.esb.system.registry.schema.api.entity.ResourceInfo"/>
<mapping class="ru.entaxy.esb.system.registry.schema.api.entity.Resource"/>
</session-factory>
</hibernate-configuration>

View 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.

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>schema</artifactId>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>schema-soap</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA :: SOAP</name>
<description>SYSTEM :: ENTAXY :: REGISTRY :: SCHEMA :: SOAP</description>
<properties>
<bundle.osgi.import.pkg>
!com.sun.org.apache.xml.internal.dtm.ref,
!org.mapstruct.*,
javax.jws.*;version="[2.0.0,3.0.0)",
javax.jws.soap.*;version="[2.0.0,3.0.0)",
javax.xml.ws.*;version="[2.2.0,3.0.0)",
org.apache.commons.logging,
org.osgi.service.blueprint;version="[1.0.0,2.0.0)",
*
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<artifactId>schema-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.registry.schema</groupId>
<artifactId>schema-impl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>dev</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/registry-schema-service.wsdl</wsdl>
<extraargs>
<extraarg>-p</extraarg>
<extraarg>ru.entaxy.esb.system.registry.schema.soap.cxf</extraarg>
<extraarg>-bareMethods</extraarg>
</extraargs>
<extendedSoapHeaders>true</extendedSoapHeaders>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,165 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap;
import ru.entaxy.esb.system.registry.schema.api.ResourceService;
import ru.entaxy.esb.system.registry.schema.api.entity.Resource;
import ru.entaxy.esb.system.registry.schema.api.entity.ResourceInfo;
import ru.entaxy.esb.system.registry.schema.soap.cxf.*;
import ru.entaxy.esb.system.registry.schema.soap.mapper.ResourceMapper;
import java.util.Optional;
public class RegistrySchemaServiceImpl implements RegistrySchemaService {
private ResourceService resourceService;
private ResourceMapper resourceMapper;
@Override
public String loadResource(LoadResourceType request, String header) {
try {
Resource resource = resourceMapper.toResource(request);
resource.setCreatedBy(header);
return String.valueOf(resourceService.loadResource(resource));
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public String reloadResource(ResourceType request, String header) {
try {
Resource resource = resourceMapper.toEditedResource(request);
resource.setEditedBy(header);
return String.valueOf(resourceService.reloadResource(resource));
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public String removeResource(long request) {
try {
resourceService.removeResource(request);
return String.valueOf(request);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public FullResourceType getResource(long id) {
try {
Optional<Resource> resource = resourceService.getResource(id);
return resource.map(value -> resourceMapper.toFullResourceType(value)).orElse(null);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public String loadResourceInfo(ResourceInfoType request, String header) {
try {
ResourceInfo resourceInfo = resourceMapper.toResourceInfo(request);
resourceInfo.setCreatedBy(header);
return String.valueOf(resourceService.loadResourceInfo(resourceInfo));
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public String editResourceInfo(EditedResourceInfoFullType request, String header) {
try {
ResourceInfo resourceInfo = resourceMapper.editedResourceInfoFullTypeResourceInfo(request);
resourceInfo.setEditedBy(header);
return String.valueOf(resourceService.editResourceInfo(resourceInfo));
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public String removeResourceInfo(String request) {
try {
resourceService.removeResourceInfo(Long.valueOf(request));
return request;
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public ResourceInfoFullType getResourceInfo(String id) {
try {
Optional<ResourceInfo> resource = resourceService.getResourceInfo(Long.valueOf(id));
return resource.map(value -> resourceMapper.toResourceInfoFullType(value)).orElse(null);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public GetResourceInfoList getResourceInfoList(GetResourceInfoListRequest request) {
try {
GetResourceInfoList list = new GetResourceInfoList();
for (ResourceInfo resourceInfo : resourceService.getListResourceInfo()) {
list.getResourceInfoFullType().add(resourceMapper.toResourceInfoFullType(resourceInfo));
}
return list;
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public GetResourceInfoList getResourceInfoListByName(GetResourceInfoListByNameRequest request) {
try {
GetResourceInfoList list = new GetResourceInfoList();
for (ResourceInfo resourceInfo : resourceService.getListResourceInfoByName(request.getName())) {
list.getResourceInfoFullType().add(resourceMapper.toResourceInfoFullType(resourceInfo));
}
return list;
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public GetResourceInfoList getResourceInfoListByNamespace(GetResourceInfoListByNamespaceRequest request) {
try {
GetResourceInfoList list = new GetResourceInfoList();
for (ResourceInfo resourceInfo : resourceService.getListResourceInfoByNamespace(request.getNamespace())) {
list.getResourceInfoFullType().add(resourceMapper.toResourceInfoFullType(resourceInfo));
}
return list;
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
public void setResourceService(ResourceService resourceService) {
this.resourceService = resourceService;
}
public void setResourceMapper(ResourceMapper resourceMapper) {
this.resourceMapper = resourceMapper;
}
}

View File

@ -0,0 +1,241 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for EditedResourceInfoFullType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="EditedResourceInfoFullType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/&gt;
* &lt;element name="idResource" type="{http://www.w3.org/2001/XMLSchema}long"/&gt;
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="convertor" type="{http://www.w3.org/2001/XMLSchema}boolean"/&gt;
* &lt;element name="namespace" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="namespaceOut" type="{http://www.w3.org/2001/XMLSchema}boolean"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EditedResourceInfoFullType", propOrder = {
"id",
"idResource",
"name",
"version",
"description",
"convertor",
"namespace",
"namespaceOut"
})
public class EditedResourceInfoFullType {
protected long id;
protected long idResource;
@XmlElement(required = true)
protected String name;
@XmlElement(required = true)
protected String version;
@XmlElement(required = true)
protected String description;
protected boolean convertor;
@XmlElement(required = true)
protected String namespace;
protected boolean namespaceOut;
/**
* Gets the value of the id property.
*
*/
public long getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
public void setId(long value) {
this.id = value;
}
/**
* Gets the value of the idResource property.
*
*/
public long getIdResource() {
return idResource;
}
/**
* Sets the value of the idResource property.
*
*/
public void setIdResource(long value) {
this.idResource = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
return version;
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the convertor property.
*
*/
public boolean isConvertor() {
return convertor;
}
/**
* Sets the value of the convertor property.
*
*/
public void setConvertor(boolean value) {
this.convertor = value;
}
/**
* Gets the value of the namespace property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNamespace() {
return namespace;
}
/**
* Sets the value of the namespace property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNamespace(String value) {
this.namespace = value;
}
/**
* Gets the value of the namespaceOut property.
*
*/
public boolean isNamespaceOut() {
return namespaceOut;
}
/**
* Sets the value of the namespaceOut property.
*
*/
public void setNamespaceOut(boolean value) {
this.namespaceOut = value;
}
}

View File

@ -0,0 +1,210 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for FullResourceType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="FullResourceType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/&gt;
* &lt;element name="createdBy" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="createdDate" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="editedBy" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="editedDate" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="resourceValue" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FullResourceType", propOrder = {
"id",
"createdBy",
"createdDate",
"editedBy",
"editedDate",
"resourceValue"
})
public class FullResourceType {
protected long id;
@XmlElement(required = true)
protected String createdBy;
@XmlElement(required = true)
protected String createdDate;
@XmlElement(required = true)
protected String editedBy;
@XmlElement(required = true)
protected String editedDate;
@XmlElement(required = true)
protected byte[] resourceValue;
/**
* Gets the value of the id property.
*
*/
public long getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
public void setId(long value) {
this.id = value;
}
/**
* Gets the value of the createdBy property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCreatedBy() {
return createdBy;
}
/**
* Sets the value of the createdBy property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCreatedBy(String value) {
this.createdBy = value;
}
/**
* Gets the value of the createdDate property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCreatedDate() {
return createdDate;
}
/**
* Sets the value of the createdDate property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCreatedDate(String value) {
this.createdDate = value;
}
/**
* Gets the value of the editedBy property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEditedBy() {
return editedBy;
}
/**
* Sets the value of the editedBy property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEditedBy(String value) {
this.editedBy = value;
}
/**
* Gets the value of the editedDate property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEditedDate() {
return editedDate;
}
/**
* Sets the value of the editedDate property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEditedDate(String value) {
this.editedDate = value;
}
/**
* Gets the value of the resourceValue property.
*
* @return
* possible object is
* byte[]
*/
public byte[] getResourceValue() {
return resourceValue;
}
/**
* Sets the value of the resourceValue property.
*
* @param value
* allowed object is
* byte[]
*/
public void setResourceValue(byte[] value) {
this.resourceValue = value;
}
}

View File

@ -0,0 +1,88 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for getResourceInfoList complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="getResourceInfoList"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="ResourceInfoFullType" type="{http://www.entaxy.ru/registry-schema-service/}ResourceInfoFullType" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getResourceInfoList", propOrder = {
"resourceInfoFullType"
})
public class GetResourceInfoList {
@XmlElement(name = "ResourceInfoFullType")
protected List<ResourceInfoFullType> resourceInfoFullType;
/**
* Gets the value of the resourceInfoFullType property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the resourceInfoFullType property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getResourceInfoFullType().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ResourceInfoFullType }
*
*
*/
public List<ResourceInfoFullType> getResourceInfoFullType() {
if (resourceInfoFullType == null) {
resourceInfoFullType = new ArrayList<ResourceInfoFullType>();
}
return this.resourceInfoFullType;
}
}

View File

@ -0,0 +1,83 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"name"
})
@XmlRootElement(name = "getResourceInfoListByNameRequest")
public class GetResourceInfoListByNameRequest {
@XmlElement(required = true)
protected String name;
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
}

View File

@ -0,0 +1,83 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="namespace" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"namespace"
})
@XmlRootElement(name = "getResourceInfoListByNamespaceRequest")
public class GetResourceInfoListByNamespaceRequest {
@XmlElement(required = true)
protected String namespace;
/**
* Gets the value of the namespace property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNamespace() {
return namespace;
}
/**
* Sets the value of the namespace property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNamespace(String value) {
this.namespace = value;
}
}

View File

@ -0,0 +1,53 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "getResourceInfoListRequest")
public class GetResourceInfoListRequest {
}

View File

@ -0,0 +1,79 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for LoadResourceType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="LoadResourceType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="resourceValue" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LoadResourceType", propOrder = {
"resourceValue"
})
public class LoadResourceType {
@XmlElement(required = true)
protected byte[] resourceValue;
/**
* Gets the value of the resourceValue property.
*
* @return
* possible object is
* byte[]
*/
public byte[] getResourceValue() {
return resourceValue;
}
/**
* Sets the value of the resourceValue property.
*
* @param value
* allowed object is
* byte[]
*/
public void setResourceValue(byte[] value) {
this.resourceValue = value;
}
}

View File

@ -0,0 +1,316 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the ru.entaxy.esb.system.registry.schema.soap.cxf package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
private final static QName _LoadResourceRequest_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "loadResourceRequest");
private final static QName _ResourceType_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "ResourceType");
private final static QName _FullResourceType_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "FullResourceType");
private final static QName _RemoveResourceRequest_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "removeResourceRequest");
private final static QName _GetResourceRequest_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "getResourceRequest");
private final static QName _LoadResourceInfoRequest_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "loadResourceInfoRequest");
private final static QName _EditResourceInfoRequest_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "editResourceInfoRequest");
private final static QName _RemoveResourceInfoRequest_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "removeResourceInfoRequest");
private final static QName _GetResourceInfoRequest_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "getResourceInfoRequest");
private final static QName _GetResourceInfoResponse_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "getResourceInfoResponse");
private final static QName _GetResourceInfoListResponse_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "getResourceInfoListResponse");
private final static QName _CreatedBy_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "createdBy");
private final static QName _Response_QNAME = new QName("http://www.entaxy.ru/registry-schema-service/", "response");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: ru.entaxy.esb.system.registry.schema.soap.cxf
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link LoadResourceType }
*
*/
public LoadResourceType createLoadResourceType() {
return new LoadResourceType();
}
/**
* Create an instance of {@link ResourceType }
*
*/
public ResourceType createResourceType() {
return new ResourceType();
}
/**
* Create an instance of {@link FullResourceType }
*
*/
public FullResourceType createFullResourceType() {
return new FullResourceType();
}
/**
* Create an instance of {@link ResourceInfoType }
*
*/
public ResourceInfoType createResourceInfoType() {
return new ResourceInfoType();
}
/**
* Create an instance of {@link EditedResourceInfoFullType }
*
*/
public EditedResourceInfoFullType createEditedResourceInfoFullType() {
return new EditedResourceInfoFullType();
}
/**
* Create an instance of {@link ResourceInfoFullType }
*
*/
public ResourceInfoFullType createResourceInfoFullType() {
return new ResourceInfoFullType();
}
/**
* Create an instance of {@link GetResourceInfoListRequest }
*
*/
public GetResourceInfoListRequest createGetResourceInfoListRequest() {
return new GetResourceInfoListRequest();
}
/**
* Create an instance of {@link GetResourceInfoListByNameRequest }
*
*/
public GetResourceInfoListByNameRequest createGetResourceInfoListByNameRequest() {
return new GetResourceInfoListByNameRequest();
}
/**
* Create an instance of {@link GetResourceInfoListByNamespaceRequest }
*
*/
public GetResourceInfoListByNamespaceRequest createGetResourceInfoListByNamespaceRequest() {
return new GetResourceInfoListByNamespaceRequest();
}
/**
* Create an instance of {@link GetResourceInfoList }
*
*/
public GetResourceInfoList createGetResourceInfoList() {
return new GetResourceInfoList();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link LoadResourceType }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link LoadResourceType }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "loadResourceRequest")
public JAXBElement<LoadResourceType> createLoadResourceRequest(LoadResourceType value) {
return new JAXBElement<LoadResourceType>(_LoadResourceRequest_QNAME, LoadResourceType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ResourceType }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link ResourceType }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "ResourceType")
public JAXBElement<ResourceType> createResourceType(ResourceType value) {
return new JAXBElement<ResourceType>(_ResourceType_QNAME, ResourceType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link FullResourceType }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link FullResourceType }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "FullResourceType")
public JAXBElement<FullResourceType> createFullResourceType(FullResourceType value) {
return new JAXBElement<FullResourceType>(_FullResourceType_QNAME, FullResourceType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Long }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link Long }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "removeResourceRequest")
public JAXBElement<Long> createRemoveResourceRequest(Long value) {
return new JAXBElement<Long>(_RemoveResourceRequest_QNAME, Long.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Long }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link Long }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "getResourceRequest")
public JAXBElement<Long> createGetResourceRequest(Long value) {
return new JAXBElement<Long>(_GetResourceRequest_QNAME, Long.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ResourceInfoType }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link ResourceInfoType }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "loadResourceInfoRequest")
public JAXBElement<ResourceInfoType> createLoadResourceInfoRequest(ResourceInfoType value) {
return new JAXBElement<ResourceInfoType>(_LoadResourceInfoRequest_QNAME, ResourceInfoType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link EditedResourceInfoFullType }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link EditedResourceInfoFullType }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "editResourceInfoRequest")
public JAXBElement<EditedResourceInfoFullType> createEditResourceInfoRequest(EditedResourceInfoFullType value) {
return new JAXBElement<EditedResourceInfoFullType>(_EditResourceInfoRequest_QNAME, EditedResourceInfoFullType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "removeResourceInfoRequest")
public JAXBElement<String> createRemoveResourceInfoRequest(String value) {
return new JAXBElement<String>(_RemoveResourceInfoRequest_QNAME, String.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "getResourceInfoRequest")
public JAXBElement<String> createGetResourceInfoRequest(String value) {
return new JAXBElement<String>(_GetResourceInfoRequest_QNAME, String.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ResourceInfoFullType }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link ResourceInfoFullType }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "getResourceInfoResponse")
public JAXBElement<ResourceInfoFullType> createGetResourceInfoResponse(ResourceInfoFullType value) {
return new JAXBElement<ResourceInfoFullType>(_GetResourceInfoResponse_QNAME, ResourceInfoFullType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link GetResourceInfoList }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link GetResourceInfoList }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "getResourceInfoListResponse")
public JAXBElement<GetResourceInfoList> createGetResourceInfoListResponse(GetResourceInfoList value) {
return new JAXBElement<GetResourceInfoList>(_GetResourceInfoListResponse_QNAME, GetResourceInfoList.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "createdBy")
public JAXBElement<String> createCreatedBy(String value) {
return new JAXBElement<String>(_CreatedBy_QNAME, String.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "http://www.entaxy.ru/registry-schema-service/", name = "response")
public JAXBElement<String> createResponse(String value) {
return new JAXBElement<String>(_Response_QNAME, String.class, null, value);
}
}

View File

@ -0,0 +1,135 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlSeeAlso;
/**
* This class was generated by Apache CXF 3.3.6
* 2021-02-03T15:56:39.006+07:00
* Generated source version: 3.3.6
*
*/
@WebService(targetNamespace = "http://www.entaxy.ru/registry-schema-service/", name = "registry-schema-service")
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface RegistrySchemaService {
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/get-resourceInfo-info-list-by-namespace")
@WebResult(name = "getResourceInfoListResponse", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public GetResourceInfoList getResourceInfoListByNamespace(
@WebParam(partName = "request", name = "getResourceInfoListByNamespaceRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
GetResourceInfoListByNamespaceRequest request
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/remove-resourceInfo")
@WebResult(name = "response", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public java.lang.String removeResource(
@WebParam(partName = "request", name = "removeResourceRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
long request
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/get-resourceInfo-info-list")
@WebResult(name = "getResourceInfoListResponse", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public GetResourceInfoList getResourceInfoList(
@WebParam(partName = "request", name = "getResourceInfoListRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
GetResourceInfoListRequest request
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/reload-resourceInfo")
@WebResult(name = "response", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public java.lang.String reloadResource(
@WebParam(partName = "request", name = "ResourceType", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
ResourceType request,
@WebParam(partName = "header", name = "createdBy", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", header = true)
java.lang.String header
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/get-resourceInfo")
@WebResult(name = "FullResourceType", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public FullResourceType getResource(
@WebParam(partName = "request", name = "getResourceRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
long request
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/load-resourceInfo-info")
@WebResult(name = "response", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public java.lang.String loadResourceInfo(
@WebParam(partName = "request", name = "loadResourceInfoRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
ResourceInfoType request,
@WebParam(partName = "header", name = "createdBy", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", header = true)
java.lang.String header
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/edit-resourceInfo-info")
@WebResult(name = "response", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public java.lang.String editResourceInfo(
@WebParam(partName = "request", name = "editResourceInfoRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
EditedResourceInfoFullType request,
@WebParam(partName = "header", name = "createdBy", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", header = true)
java.lang.String header
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/remove-resourceInfo-info")
@WebResult(name = "response", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public java.lang.String removeResourceInfo(
@WebParam(partName = "request", name = "removeResourceInfoRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
java.lang.String request
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/load-resourceInfo")
@WebResult(name = "response", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public java.lang.String loadResource(
@WebParam(partName = "request", name = "loadResourceRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
LoadResourceType request,
@WebParam(partName = "header", name = "createdBy", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", header = true)
java.lang.String header
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/get-resourceInfo-info-list-by-name")
@WebResult(name = "getResourceInfoListResponse", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public GetResourceInfoList getResourceInfoListByName(
@WebParam(partName = "request", name = "getResourceInfoListByNameRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
GetResourceInfoListByNameRequest request
);
@WebMethod(action = "http://www.entaxy.ru/registry-schema-service/get-resourceInfo-info")
@WebResult(name = "getResourceInfoResponse", targetNamespace = "http://www.entaxy.ru/registry-schema-service/", partName = "response")
public ResourceInfoFullType getResourceInfo(
@WebParam(partName = "request", name = "getResourceInfoRequest", targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
java.lang.String request
);
}

View File

@ -0,0 +1,106 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;
/**
* This class was generated by Apache CXF 3.3.6
* 2021-02-03T15:56:39.112+07:00
* Generated source version: 3.3.6
*
*/
@WebServiceClient(name = "registry-schema-service",
wsdlLocation = "file:/C:/Projects/entaxy-framework/system/registry/schema/schema-soap/src/main/resources/wsdl/registry-schema-service.wsdl",
targetNamespace = "http://www.entaxy.ru/registry-schema-service/")
public class RegistrySchemaService_Service extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://www.entaxy.ru/registry-schema-service/", "registry-schema-service");
public final static QName RegistrySchemaServiceSOAP = new QName("http://www.entaxy.ru/registry-schema-service/", "registry-schema-serviceSOAP");
static {
URL url = null;
try {
url = new URL("file:/C:/Projects/entaxy-framework/system/registry/schema/schema-soap/src/main/resources/wsdl/registry-schema-service.wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(RegistrySchemaService_Service.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "file:/C:/Projects/entaxy-framework/system/registry/schema/schema-soap/src/main/resources/wsdl/registry-schema-service.wsdl");
}
WSDL_LOCATION = url;
}
public RegistrySchemaService_Service(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public RegistrySchemaService_Service(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public RegistrySchemaService_Service() {
super(WSDL_LOCATION, SERVICE);
}
public RegistrySchemaService_Service(WebServiceFeature ... features) {
super(WSDL_LOCATION, SERVICE, features);
}
public RegistrySchemaService_Service(URL wsdlLocation, WebServiceFeature ... features) {
super(wsdlLocation, SERVICE, features);
}
public RegistrySchemaService_Service(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns RegistrySchemaService
*/
@WebEndpoint(name = "registry-schema-serviceSOAP")
public RegistrySchemaService getRegistrySchemaServiceSOAP() {
return super.getPort(RegistrySchemaServiceSOAP, RegistrySchemaService.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns RegistrySchemaService
*/
@WebEndpoint(name = "registry-schema-serviceSOAP")
public RegistrySchemaService getRegistrySchemaServiceSOAP(WebServiceFeature... features) {
return super.getPort(RegistrySchemaServiceSOAP, RegistrySchemaService.class, features);
}
}

View File

@ -0,0 +1,362 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ResourceInfoFullType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ResourceInfoFullType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/&gt;
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="idResource" type="{http://www.w3.org/2001/XMLSchema}long"/&gt;
* &lt;element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="convertor" type="{http://www.w3.org/2001/XMLSchema}boolean"/&gt;
* &lt;element name="namespace" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="namespaceOut" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="createdBy" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="createdDate" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="editedBy" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="editedDate" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ResourceInfoFullType", propOrder = {
"id",
"name",
"idResource",
"version",
"description",
"convertor",
"namespace",
"namespaceOut",
"createdBy",
"createdDate",
"editedBy",
"editedDate"
})
public class ResourceInfoFullType {
protected long id;
@XmlElement(required = true)
protected String name;
protected long idResource;
@XmlElement(required = true)
protected String version;
@XmlElement(required = true)
protected String description;
protected boolean convertor;
@XmlElement(required = true)
protected String namespace;
@XmlElement(required = true)
protected String namespaceOut;
@XmlElement(required = true)
protected String createdBy;
@XmlElement(required = true)
protected String createdDate;
@XmlElement(required = true)
protected String editedBy;
@XmlElement(required = true)
protected String editedDate;
/**
* Gets the value of the id property.
*
*/
public long getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
public void setId(long value) {
this.id = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the idResource property.
*
*/
public long getIdResource() {
return idResource;
}
/**
* Sets the value of the idResource property.
*
*/
public void setIdResource(long value) {
this.idResource = value;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
return version;
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the convertor property.
*
*/
public boolean isConvertor() {
return convertor;
}
/**
* Sets the value of the convertor property.
*
*/
public void setConvertor(boolean value) {
this.convertor = value;
}
/**
* Gets the value of the namespace property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNamespace() {
return namespace;
}
/**
* Sets the value of the namespace property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNamespace(String value) {
this.namespace = value;
}
/**
* Gets the value of the namespaceOut property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNamespaceOut() {
return namespaceOut;
}
/**
* Sets the value of the namespaceOut property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNamespaceOut(String value) {
this.namespaceOut = value;
}
/**
* Gets the value of the createdBy property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCreatedBy() {
return createdBy;
}
/**
* Sets the value of the createdBy property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCreatedBy(String value) {
this.createdBy = value;
}
/**
* Gets the value of the createdDate property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCreatedDate() {
return createdDate;
}
/**
* Sets the value of the createdDate property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCreatedDate(String value) {
this.createdDate = value;
}
/**
* Gets the value of the editedBy property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEditedBy() {
return editedBy;
}
/**
* Sets the value of the editedBy property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEditedBy(String value) {
this.editedBy = value;
}
/**
* Gets the value of the editedDate property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEditedDate() {
return editedDate;
}
/**
* Sets the value of the editedDate property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEditedDate(String value) {
this.editedDate = value;
}
}

View File

@ -0,0 +1,231 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ResourceInfoType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ResourceInfoType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="idResource" type="{http://www.w3.org/2001/XMLSchema}long"/&gt;
* &lt;element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="convertor" type="{http://www.w3.org/2001/XMLSchema}boolean"/&gt;
* &lt;element name="namespace" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="namespaceOut" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ResourceInfoType", propOrder = {
"name",
"idResource",
"version",
"description",
"convertor",
"namespace",
"namespaceOut"
})
public class ResourceInfoType {
@XmlElement(required = true)
protected String name;
protected long idResource;
@XmlElement(required = true)
protected String version;
@XmlElement(required = true)
protected String description;
protected boolean convertor;
@XmlElement(required = true)
protected String namespace;
@XmlElement(required = true)
protected String namespaceOut;
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the idResource property.
*
*/
public long getIdResource() {
return idResource;
}
/**
* Sets the value of the idResource property.
*
*/
public void setIdResource(long value) {
this.idResource = value;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
return version;
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the convertor property.
*
*/
public boolean isConvertor() {
return convertor;
}
/**
* Sets the value of the convertor property.
*
*/
public void setConvertor(boolean value) {
this.convertor = value;
}
/**
* Gets the value of the namespace property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNamespace() {
return namespace;
}
/**
* Sets the value of the namespace property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNamespace(String value) {
this.namespace = value;
}
/**
* Gets the value of the namespaceOut property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNamespaceOut() {
return namespaceOut;
}
/**
* Sets the value of the namespaceOut property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNamespaceOut(String value) {
this.namespaceOut = value;
}
}

View File

@ -0,0 +1,98 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ResourceType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ResourceType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/&gt;
* &lt;element name="resourceValue" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ResourceType", propOrder = {
"id",
"resourceValue"
})
public class ResourceType {
protected long id;
@XmlElement(required = true)
protected byte[] resourceValue;
/**
* Gets the value of the id property.
*
*/
public long getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
public void setId(long value) {
this.id = value;
}
/**
* Gets the value of the resourceValue property.
*
* @return
* possible object is
* byte[]
*/
public byte[] getResourceValue() {
return resourceValue;
}
/**
* Sets the value of the resourceValue property.
*
* @param value
* allowed object is
* byte[]
*/
public void setResourceValue(byte[] value) {
this.resourceValue = value;
}
}

View File

@ -0,0 +1,21 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.entaxy.ru/registry-schema-service/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package ru.entaxy.esb.system.registry.schema.soap.cxf;

View File

@ -0,0 +1,63 @@
/*-
* ~~~~~~licensing~~~~~~
* schema-soap
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.registry.schema.soap.mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import ru.entaxy.esb.system.registry.schema.api.entity.Resource;
import ru.entaxy.esb.system.registry.schema.api.entity.ResourceInfo;
import ru.entaxy.esb.system.registry.schema.soap.cxf.*;
@org.mapstruct.Mapper
public interface ResourceMapper {
@Mappings({
@Mapping(target = "createdDate", expression = "java(new java.util.Date())"),
@Mapping(target = "resourceId", source = "idResource"),
})
ResourceInfo toResourceInfo(ResourceInfoType resourceInfoType);
@Mappings({
@Mapping(source = "resourceId", target = "idResource"),
})
ResourceInfoFullType toResourceInfoFullType(ResourceInfo resourceInfo);
@Mappings({
@Mapping(target = "resourceId", source = "idResource"),
@Mapping(target = "editedDate", expression = "java(new java.util.Date())"),
})
ResourceInfo editedResourceInfoFullTypeResourceInfo(EditedResourceInfoFullType resourceInfoFullType);
@Mappings({
@Mapping(target = "createdDate", expression = "java(new java.util.Date())"),
@Mapping(target = "resourceValue", source = "resourceValue"),
})
Resource toResource(LoadResourceType request);
@Mappings({
@Mapping(target = "editedDate", expression = "java(new java.util.Date())"),
})
Resource toEditedResource(ResourceType request);
@Mappings({
@Mapping(source = "resourceValue", target = "resourceValue"),
})
FullResourceType toFullResourceType(Resource resource);
}

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~~~~~~licensing~~~~~~
schema-soap
==========
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~~~~~~
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/blueprint/core"
xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
">
<cm:property-placeholder persistent-id="ru.entaxy.esb.system.schema" update-strategy="reload">
<cm:default-properties>
<cm:property name="schema-management.endpoint.address" value="/schema-management"/>
</cm:default-properties>
</cm:property-placeholder>
<reference id="resourceService"
interface="ru.entaxy.esb.system.registry.schema.api.ResourceService"
timeout="30000"
availability="mandatory"/>
<reference id="serviceInterceptor" interface="org.apache.cxf.phase.PhaseInterceptor"
filter="(type=service)"/>
<bean id="soapHeaderInterceptor" class="ru.entaxy.esb.system.common.interceptor.SoapHeaderInterceptor">
<property name="namespaceUri" value="http://www.entaxy.ru/registry-schema-service/"/>
</bean>
<bean id="resourceMapper" class="ru.entaxy.esb.system.registry.schema.soap.mapper.ResourceMapperImpl"/>
<cxf:bus>
<cxf:features>
<cxf:logging/>
</cxf:features>
</cxf:bus>
<jaxws:server serviceClass="ru.entaxy.esb.system.registry.schema.soap.cxf.RegistrySchemaService"
address="${schema-management.endpoint.address}">
<jaxws:serviceBean>
<ref component-id="registrySchemaService"/>
</jaxws:serviceBean>
<jaxws:inInterceptors>
<ref component-id="serviceInterceptor"/>
<ref component-id="soapHeaderInterceptor"/>
</jaxws:inInterceptors>
</jaxws:server>
<bean id="registrySchemaService" class="ru.entaxy.esb.system.registry.schema.soap.RegistrySchemaServiceImpl">
<property name="resourceService" ref="resourceService"/>
<property name="resourceMapper" ref="resourceMapper"/>
</bean>
</blueprint>

View File

@ -0,0 +1,373 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.entaxy.ru/registry-schema-service/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="system-management-service" targetNamespace="http://www.entaxy.ru/registry-schema-service/">
<wsdl:types>
<xsd:schema targetNamespace="http://www.entaxy.ru/registry-schema-service/" elementFormDefault="qualified">
<xsd:element name="loadResourceRequest" type="tns:LoadResourceType"/>
<xsd:complexType name="LoadResourceType">
<xsd:sequence>
<xsd:element name="resourceValue" type="xsd:base64Binary"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ResourceType" type="tns:ResourceType"/>
<xsd:complexType name="ResourceType">
<xsd:sequence>
<xsd:element name="id" type="xsd:long"/>
<xsd:element name="resourceValue" type="xsd:base64Binary"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="FullResourceType" type="tns:FullResourceType"/>
<xsd:complexType name="FullResourceType">
<xsd:sequence>
<xsd:element name="id" type="xsd:long"/>
<xsd:element name="createdBy" type="xsd:string"/>
<xsd:element name="createdDate" type="xsd:string"/>
<xsd:element name="editedBy" type="xsd:string" wsdl:required="false"/>
<xsd:element name="editedDate" type="xsd:string" wsdl:required="false"/>
<xsd:element name="resourceValue" type="xsd:base64Binary"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="removeResourceRequest" type="xsd:long"/>
<xsd:element name="getResourceRequest" type="xsd:long"/>
<xsd:element name="loadResourceInfoRequest" type="tns:ResourceInfoType"/>
<xsd:complexType name="ResourceInfoType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="idResource" type="xsd:long"/>
<xsd:element name="version" type="xsd:string" wsdl:required="false"/>
<xsd:element name="description" type="xsd:string" wsdl:required="false"/>
<xsd:element name="convertor" type="xsd:boolean" wsdl:required="false"/>
<xsd:element name="namespace" type="xsd:string" wsdl:required="false"/>
<xsd:element name="namespaceOut" type="xsd:string" wsdl:required="false"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="editResourceInfoRequest" type="tns:EditedResourceInfoFullType"/>
<xsd:complexType name="EditedResourceInfoFullType">
<xsd:sequence>
<xsd:element name="id" type="xsd:long"/>
<xsd:element name="idResource" type="xsd:long"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="version" type="xsd:string" wsdl:required="false"/>
<xsd:element name="description" type="xsd:string" wsdl:required="false"/>
<xsd:element name="convertor" type="xsd:boolean" wsdl:required="false"/>
<xsd:element name="namespace" type="xsd:string" wsdl:required="false"/>
<xsd:element name="namespaceOut" type="xsd:boolean" wsdl:required="false"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="removeResourceInfoRequest" type="xsd:string"/>
<xsd:element name="getResourceInfoRequest" type="xsd:string"/>
<xsd:element name="getResourceInfoResponse" type="tns:ResourceInfoFullType"/>
<xsd:complexType name="ResourceInfoFullType">
<xsd:sequence>
<xsd:element name="id" type="xsd:long"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="idResource" type="xsd:long"/>
<xsd:element name="version" type="xsd:string" wsdl:required="false"/>
<xsd:element name="description" type="xsd:string" wsdl:required="false"/>
<xsd:element name="convertor" type="xsd:boolean" wsdl:required="false"/>
<xsd:element name="namespace" type="xsd:string" wsdl:required="false"/>
<xsd:element name="namespaceOut" type="xsd:string" wsdl:required="false"/>
<xsd:element name="createdBy" type="xsd:string"/>
<xsd:element name="createdDate" type="xsd:string"/>
<xsd:element name="editedBy" type="xsd:string" wsdl:required="false"/>
<xsd:element name="editedDate" type="xsd:string" wsdl:required="false"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getResourceInfoListRequest">
<xsd:complexType>
<xsd:sequence/>
</xsd:complexType>
</xsd:element>
<xsd:element name="getResourceInfoListByNameRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getResourceInfoListByNamespaceRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="namespace" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getResourceInfoListResponse" type="tns:getResourceInfoList"/>
<xsd:complexType name="getResourceInfoList">
<xsd:sequence>
<xsd:element name="ResourceInfoFullType" type="tns:ResourceInfoFullType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="createdBy" type="xsd:string"/>
<xsd:element name="response" type="xsd:string"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="loadResourceRequest">
<wsdl:part name="request" element="tns:loadResourceRequest"/>
</wsdl:message>
<wsdl:message name="loadResourceResponse">
<wsdl:part name="response" element="tns:response"/>
</wsdl:message>
<wsdl:message name="reloadResourceRequest">
<wsdl:part name="request" element="tns:ResourceType"/>
</wsdl:message>
<wsdl:message name="reloadResourceResponse">
<wsdl:part name="response" element="tns:response"/>
</wsdl:message>
<wsdl:message name="removeResourceRequest">
<wsdl:part name="request" element="tns:removeResourceRequest"/>
</wsdl:message>
<wsdl:message name="removeResourceResponse">
<wsdl:part name="response" element="tns:response"/>
</wsdl:message>
<wsdl:message name="getResourceRequest">
<wsdl:part name="request" element="tns:getResourceRequest"/>
</wsdl:message>
<wsdl:message name="getResourceResponse">
<wsdl:part name="response" element="tns:FullResourceType"/>
</wsdl:message>
<wsdl:message name="loadResourceInfoRequest">
<wsdl:part name="request" element="tns:loadResourceInfoRequest"/>
</wsdl:message>
<wsdl:message name="loadResourceInfoResponse">
<wsdl:part name="response" element="tns:response"/>
</wsdl:message>
<wsdl:message name="editResourceInfoRequest">
<wsdl:part name="request" element="tns:editResourceInfoRequest"/>
</wsdl:message>
<wsdl:message name="editResourceInfoResponse">
<wsdl:part name="response" element="tns:response"/>
</wsdl:message>
<wsdl:message name="removeResourceInfoRequest">
<wsdl:part name="request" element="tns:removeResourceInfoRequest"/>
</wsdl:message>
<wsdl:message name="removeResourceInfoResponse">
<wsdl:part name="response" element="tns:response"/>
</wsdl:message>
<wsdl:message name="getResourceInfoRequest">
<wsdl:part name="request" element="tns:getResourceInfoRequest"/>
</wsdl:message>
<wsdl:message name="getResourceInfoResponse">
<wsdl:part name="response" element="tns:getResourceInfoResponse"/>
</wsdl:message>
<wsdl:message name="getResourceInfoListRequest">
<wsdl:part name="request" element="tns:getResourceInfoListRequest"/>
</wsdl:message>
<wsdl:message name="getResourceInfoListResponse">
<wsdl:part name="response" element="tns:getResourceInfoListResponse"/>
</wsdl:message>
<wsdl:message name="getResourceInfoListByNameRequest">
<wsdl:part name="request" element="tns:getResourceInfoListByNameRequest"/>
</wsdl:message>
<wsdl:message name="getResourceInfoListByNameResponse">
<wsdl:part name="response" element="tns:getResourceInfoListResponse"/>
</wsdl:message>
<wsdl:message name="getResourceInfoListByNamespaceRequest">
<wsdl:part name="request" element="tns:getResourceInfoListByNamespaceRequest"/>
</wsdl:message>
<wsdl:message name="getResourceInfoListByNamespaceResponse">
<wsdl:part name="response" element="tns:getResourceInfoListResponse"/>
</wsdl:message>
<wsdl:message name="createdBy">
<wsdl:part name="header" element="tns:createdBy"/>
</wsdl:message>
<wsdl:binding name="registry-schema-serviceSOAP" type="tns:registry-schema-service">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="loadResource">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/load-resourceInfo"/>
<wsdl:input>
<soap:header message="tns:createdBy" part="header" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="reloadResource">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/reload-resourceInfo"/>
<wsdl:input>
<soap:header message="tns:createdBy" part="header" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="removeResource">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/remove-resourceInfo"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getResource">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/get-resourceInfo"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="loadResourceInfo">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/load-resourceInfo-info"/>
<wsdl:input>
<soap:header message="tns:createdBy" part="header" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="editResourceInfo">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/edit-resourceInfo-info"/>
<wsdl:input>
<soap:header message="tns:createdBy" part="header" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="removeResourceInfo">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/remove-resourceInfo-info"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getResourceInfo">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/get-resourceInfo-info"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getResourceInfoList">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/get-resourceInfo-info-list"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getResourceInfoListByName">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/get-resourceInfo-info-list-by-name"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getResourceInfoListByNamespace">
<soap:operation soapAction="http://www.entaxy.ru/registry-schema-service/get-resourceInfo-info-list-by-namespace"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="registry-schema-service">
<wsdl:port name="registry-schema-serviceSOAP" binding="tns:registry-schema-serviceSOAP">
<soap:address location="http://dev.esbHost.ru/"/>
</wsdl:port>
</wsdl:service>
<wsdl:portType name="registry-schema-service">
<!--Resource-->
<wsdl:operation name="loadResource">
<wsdl:input message="tns:loadResourceRequest"/>
<wsdl:output message="tns:loadResourceResponse"/>
</wsdl:operation>
<wsdl:operation name="reloadResource">
<wsdl:input message="tns:reloadResourceRequest"/>
<wsdl:output message="tns:reloadResourceResponse"/>
</wsdl:operation>
<wsdl:operation name="removeResource">
<wsdl:input message="tns:removeResourceRequest"/>
<wsdl:output message="tns:removeResourceResponse"/>
</wsdl:operation>
<wsdl:operation name="getResource">
<wsdl:input message="tns:getResourceRequest"/>
<wsdl:output message="tns:getResourceResponse"/>
</wsdl:operation>
<!--Resource Info-->
<wsdl:operation name="loadResourceInfo">
<wsdl:input message="tns:loadResourceInfoRequest"/>
<wsdl:output message="tns:loadResourceInfoResponse"/>
</wsdl:operation>
<wsdl:operation name="editResourceInfo">
<wsdl:input message="tns:editResourceInfoRequest"/>
<wsdl:output message="tns:editResourceInfoResponse"/>
</wsdl:operation>
<wsdl:operation name="removeResourceInfo">
<wsdl:input message="tns:removeResourceInfoRequest"/>
<wsdl:output message="tns:removeResourceInfoResponse"/>
</wsdl:operation>
<wsdl:operation name="getResourceInfo">
<wsdl:input message="tns:getResourceInfoRequest"/>
<wsdl:output message="tns:getResourceInfoResponse"/>
</wsdl:operation>
<wsdl:operation name="getResourceInfoList">
<wsdl:input message="tns:getResourceInfoListRequest"/>
<wsdl:output message="tns:getResourceInfoListResponse"/>
</wsdl:operation>
<wsdl:operation name="getResourceInfoListByName">
<wsdl:input message="tns:getResourceInfoListByNameRequest"/>
<wsdl:output message="tns:getResourceInfoListByNameResponse"/>
</wsdl:operation>
<wsdl:operation name="getResourceInfoListByNamespace">
<wsdl:input message="tns:getResourceInfoListByNamespaceRequest"/>
<wsdl:output message="tns:getResourceInfoListByNamespaceResponse"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>

View 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.

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ru.entaxy.esb.system.registry</groupId>
<artifactId>registry</artifactId>
<version>1.8.0</version>
<relativePath>../../registry/pom.xml</relativePath>
</parent>
<groupId>ru.entaxy.esb.system.registry.system-groups</groupId>
<artifactId>system-groups</artifactId>
<packaging>pom</packaging>
<name>SYSTEM :: ENTAXY :: GROUP :: REGISTRY</name>
<description>SYSTEM :: ENTAXY :: GROUP :: REGISTRY</description>
<modules>
<module>system-group-api</module>
<module>system-group-impl</module>
<module>system-group-component</module>
<module>system-group-profile</module>
</modules>
</project>

View 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.

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>system-groups</artifactId>
<groupId>ru.entaxy.esb.system.registry.system-groups</groupId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>system-group-api</artifactId>
<name>SYSTEM :: ENTAXY :: SYSTEM :: GROUP :: API</name>
<packaging>bundle</packaging>
<properties>
<bundle.osgi.export.pkg>
ru.entaxy.esb.system.groups.registry.jpa,
ru.entaxy.esb.system.groups.registry.jpa.entity
</bundle.osgi.export.pkg>
<bundle.osgi.import.pkg>
javax.persistence;version="[2,3)",
org.hibernate.proxy,
javassist.util.proxy,
*
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>${jpa.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,46 @@
/*-
* ~~~~~~licensing~~~~~~
* system-group-api
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.groups.registry.jpa;
import ru.entaxy.esb.system.groups.registry.jpa.entity.SystemGroupRegistry;
import java.util.Date;
import java.util.List;
/**
* Simple interface systemGroupRegistry service.
*/
public interface SystemGroupRegistryService {
List<SystemGroupRegistry> list();
SystemGroupRegistry get(long id);
SystemGroupRegistry getByUuid(String uuid);
SystemGroupRegistry add(SystemGroupRegistry systemGroupRegistry);
SystemGroupRegistry add(String uuid, String name, String description, Date createDate, Date editDate, String createdBy,
String editedBy, double version, String type, String connectorId, String descriptionFileUrl,
String endpointName, String address, String responseType);
void remove(long id);
}

View File

@ -0,0 +1,87 @@
/*-
* ~~~~~~licensing~~~~~~
* system-group-api
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.groups.registry.jpa.entity;
import javax.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "system_method_registry")
public class SystemGroupMethodRegistry {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "method_name")
private String methodName;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_system_group_registry", referencedColumnName = "id")
private SystemGroupRegistry systemGroupRegistry;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public SystemGroupRegistry getSystemGroupRegistry() {
return systemGroupRegistry;
}
public void setSystemGroupRegistry(SystemGroupRegistry systemGroupRegistry) {
this.systemGroupRegistry = systemGroupRegistry;
}
@Override
public int hashCode() {
return Objects.hash(id, methodName, systemGroupRegistry);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SystemGroupMethodRegistry other = (SystemGroupMethodRegistry) obj;
return id == other.id && Objects.equals(methodName, other.methodName);
}
@Override
public String toString() {
return "SystemGroupMethodRegistry [id=" + id + ", methodName=" + methodName + "]";
}
}

View File

@ -0,0 +1,238 @@
/*-
* ~~~~~~licensing~~~~~~
* system-group-api
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.groups.registry.jpa.entity;
import com.sun.istack.NotNull;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Entity
@Table(name = "system_group_registry")
public class SystemGroupRegistry {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@NotNull
@Column(name = "uuid")
private String uuid;
@NotNull
@Column(name = "name")
private String name;
@Column(name = "description")
private String description;
@NotNull
@Column(name = "create_date")
private Date createDate;
@Column(name = "edit_date")
private Date editDate;
@NotNull
@Column(name = "created_by")
private String createdBy;
@Column(name = "edited_by")
private String editedBy;
@Column(name = "version")
private double version;
@Column(name = "type")
private String type;
@Column(name = "connector_id")
private String connectorId;
@Column(name = "description_file_url")
private String descriptionFileUrl;
@Column(name = "endpoint_name")
private String endpointName;
@Column(name = "address")
private String address;
@Column(name = "response_type")
private String responseType;
@OneToMany(mappedBy = "systemGroupRegistry", cascade = CascadeType.ALL, orphanRemoval = true)
private List<SystemGroupMethodRegistry> systemGroupMethodRegistries;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getEditDate() {
return editDate;
}
public void setEditDate(Date editDate) {
this.editDate = editDate;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getEditedBy() {
return editedBy;
}
public void setEditedBy(String editedBy) {
this.editedBy = editedBy;
}
public double getVersion() {
return version;
}
public void setVersion(double version) {
this.version = version;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getConnectorId() {
return connectorId;
}
public void setConnectorId(String connectorId) {
this.connectorId = connectorId;
}
public String getDescriptionFileUrl() {
return descriptionFileUrl;
}
public void setDescriptionFileUrl(String descriptionFileUrl) {
this.descriptionFileUrl = descriptionFileUrl;
}
public String getEndpointName() {
return endpointName;
}
public void setEndpointName(String endpointName) {
this.endpointName = endpointName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getResponseType() {
return responseType;
}
public void setResponseType(String responseType) {
this.responseType = responseType;
}
public List<SystemGroupMethodRegistry> getSystemGroupMethodRegistries() {
return systemGroupMethodRegistries;
}
public void setSystemGroupMethodRegistries(List<SystemGroupMethodRegistry> systemGroupMethodRegistries) {
this.systemGroupMethodRegistries = systemGroupMethodRegistries;
}
@Override
public int hashCode() {
return Objects.hash(address, connectorId, createDate, createdBy, description, descriptionFileUrl, editDate,
editedBy, endpointName, uuid, id, name, responseType, systemGroupMethodRegistries, type, version);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SystemGroupRegistry other = (SystemGroupRegistry) obj;
return Objects.equals(address, other.address) && Objects.equals(connectorId, other.connectorId)
&& Objects.equals(createDate, other.createDate) && Objects.equals(createdBy, other.createdBy)
&& Objects.equals(description, other.description)
&& Objects.equals(descriptionFileUrl, other.descriptionFileUrl)
&& Objects.equals(editDate, other.editDate) && Objects.equals(editedBy, other.editedBy)
&& Objects.equals(endpointName, other.endpointName) && Objects.equals(uuid, other.uuid)
&& id == other.id && Objects.equals(name, other.name)
&& Objects.equals(responseType, other.responseType)
&& Objects.equals(type, other.type)
&& Double.doubleToLongBits(version) == Double.doubleToLongBits(other.version);
}
@Override
public String toString() {
return "SystemGroupRegistry [id=" + id + ", uuid=" + uuid + ", name=" + name + ", description=" + description
+ ", createDate=" + createDate + ", editDate=" + editDate + ", createdBy=" + createdBy + ", editedBy="
+ editedBy + ", version=" + version + ", type=" + type + ", connectorId=" + connectorId
+ ", descriptionFileUrl=" + descriptionFileUrl + ", endpointName=" + endpointName + ", address="
+ address + ", responseType=" + responseType + ", systemGroupMethodRegistries=" + systemGroupMethodRegistries
+ "]";
}
}

View 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.

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>system-groups</artifactId>
<groupId>ru.entaxy.esb.system.registry.system-groups</groupId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>system-group-component</artifactId>
<packaging>bundle</packaging>
<name>SYSTEM :: ENTAXY :: SYSTEM :: GROUP :: COMPONENT</name>
<description>SYSTEM :: ENTAXY :: SYSTEM :: GROUP :: COMPONENT</description>
<properties>
<bundle.osgi.export.service>
org.apache.camel.spi.ComponentResolver;component=SystemScheme
</bundle.osgi.export.service>
<bundle.osgi.import.pkg>
ru.entaxy.esb.system.groups.registry.system.groups.profile,
ru.entaxy.esb.system.groups.registry.system.groups.profile.collector,
ru.entaxy.esb.system.common.osgi,
ru.entaxy.esb.system.common.osgi.impl,
javax.persistence;version="[2,3)",
*
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<!-- <dependency>-->
<!-- <groupId>ru.entaxy.esb.system.registry.system-groups</groupId>-->
<!-- <artifactId>system-group-registry-api</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>ru.entaxy.esb.system.registry.system-groups.profile</groupId>
<artifactId>system-group-profile-collector</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.registry.system-groups.profile</groupId>
<artifactId>system-group-profile-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.commons</groupId>
<artifactId>system-commons</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,38 @@
/*-
* ~~~~~~licensing~~~~~~
* system-group-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.groups.component;
import org.apache.camel.Endpoint;
import org.apache.camel.support.DefaultComponent;
import java.util.Map;
public class SystemGroupComponent extends DefaultComponent {
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
SystemGroupEndpoint endpoint = new SystemGroupEndpoint(uri, this);
endpoint.setSystemName(remaining);
setProperties(endpoint, parameters);
return endpoint;
}
}

View File

@ -0,0 +1,65 @@
/*-
* ~~~~~~licensing~~~~~~
* system-group-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.groups.component;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.support.ScheduledPollConsumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SystemGroupConsumer extends ScheduledPollConsumer {
private static final Logger LOG = LoggerFactory.getLogger(SystemGroupConsumer.class);
private final SystemGroupEndpoint endpoint;
public SystemGroupConsumer(SystemGroupEndpoint endpoint, Processor processor) {
super(endpoint, processor);
this.endpoint = endpoint;
}
@Override
protected int poll() throws Exception {
Exchange exchange = endpoint.createExchange();
// create a message body
exchange.getIn().setBody(readOptions());
LOG.info("In SystemGroupConsumer ++++ " + exchange.getIn().getBody());
try {
// send message to next processor in the route
getProcessor().process(exchange);
return 1; // number of messages polled
} finally {
// log exception if an exception occurred and was not handled
if (exchange.getException() != null) {
getExceptionHandler().handleException(
"Error processing exchange", exchange,
exchange.getException());
}
}
}
private String readOptions() {
return "Operation name " + endpoint.getSystemName();
}
}

View File

@ -0,0 +1,80 @@
/*-
* ~~~~~~licensing~~~~~~
* system-group-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.groups.component;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
import org.apache.camel.support.DefaultEndpoint;
@UriEndpoint(
scheme = "system-group",
title = "System",
syntax = "system-group:systemName",
label = "custom",
producerOnly = true)
public class SystemGroupEndpoint extends DefaultEndpoint {
@UriPath
@Metadata(required = true)
private String systemName;
@UriParam
private String preferredConnector = null;
public SystemGroupEndpoint() {
}
public SystemGroupEndpoint(String uri, SystemGroupComponent component) {
super(uri, component);
}
public Producer createProducer() throws Exception {
return new SystemGroupProducer(this);
}
public Consumer createConsumer(Processor processor) throws Exception {
return null;
}
public boolean isSingleton() {
return true;
}
public String getSystemName() {
return systemName;
}
public void setSystemName(String systemName) {
this.systemName = systemName;
}
public String getPreferredConnector() {
return preferredConnector;
}
public void setPreferredConnector(String preferredConnector) {
this.preferredConnector = preferredConnector;
}
}

View File

@ -0,0 +1,82 @@
/*-
* ~~~~~~licensing~~~~~~
* system-group-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.groups.component;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultProducer;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.entaxy.esb.system.common.exception.ProfileNotFound;
import ru.entaxy.esb.system.groups.registry.system.groups.profile.SystemGroupCollectorListener;
import ru.entaxy.esb.system.groups.registry.system.groups.profile.SystemGroupProfile;
public class SystemGroupProducer extends DefaultProducer {
private static final Logger LOG = LoggerFactory.getLogger(SystemGroupProducer.class);
private final SystemGroupEndpoint endpoint;
private SystemGroupCollectorListener systemGroupCollectorListener;
public SystemGroupProducer(SystemGroupEndpoint endpoint) {
super(endpoint);
this.endpoint = endpoint;
}
public void process(Exchange exchange) throws Exception {
LOG.debug("In SystemGroupProducer " + exchange.getIn().getBody());
//get System Group Profile from systemRegistry endpoint.getSystemName()
SystemGroupProfile systemGroupProfile = null;
systemGroupProfile = getSystemGroupProfile(endpoint.getSystemName());
LOG.debug("Called system group profile " + (systemGroupProfile != null ? systemGroupProfile.getProfileName() : "NULL"));
systemGroupProfile.send(exchange);
}
public SystemGroupProfile getSystemGroupProfile(String nameSystem) throws ProfileNotFound {
systemGroupCollectorListener = getSystemGroupCollectorListener();
LOG.info("Registry SystemGroupProfile {}; services count {}", nameSystem, systemGroupCollectorListener.getReferenceNames().size());
SystemGroupProfile systemGroupProfile = null;
if (systemGroupCollectorListener.isRegistered(nameSystem)) {
systemGroupProfile = (SystemGroupProfile) systemGroupCollectorListener.getReference(nameSystem);
} else {
throw new ProfileNotFound("Profile for group system " + nameSystem + " not found");
}
return systemGroupProfile;
}
public SystemGroupCollectorListener getSystemGroupCollectorListener() {
if (systemGroupCollectorListener == null) {
BundleContext bundleContext = FrameworkUtil.getBundle(SystemGroupProducer.class).getBundleContext();
ServiceReference<SystemGroupCollectorListener> systemGroupCollectorListenerServiceReference =
bundleContext.getServiceReference(SystemGroupCollectorListener.class);
systemGroupCollectorListener = bundleContext.getService(systemGroupCollectorListenerServiceReference);
}
return systemGroupCollectorListener;
}
}

View File

@ -0,0 +1,28 @@
/*-
* ~~~~~~licensing~~~~~~
* system-group-component
* ==========
* 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~~~~~~
*/
package ru.entaxy.esb.system.groups.component.util;
public class SystemGroupConstants {
public static final String PARAMETER_PREFERRED_CONNECTOR = "preferredConnector";
private SystemGroupConstants() {
}
}

View File

@ -0,0 +1 @@
class=ru.entaxy.esb.system.groups.component.SystemGroupComponent

View File

@ -0,0 +1,30 @@
###
# ~~~~~~licensing~~~~~~
# system-group-component
# ==========
# 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~~~~~~
###
appender.file.type=File
appender.file.name=file
appender.file.fileName=target/camel-test.log
appender.file.layout.type=PatternLayout
appender.file.layout.pattern=%d %-5p %c{1} - %m %n
appender.out.type=Console
appender.out.name=out
appender.out.layout.type=PatternLayout
appender.out.layout.pattern=[%30.30t] %-30.30c{1} %-5p %m%n
rootLogger.level=INFO
rootLogger.appenderRef.out.ref=out

View 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.

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>system-groups</artifactId>
<groupId>ru.entaxy.esb.system.registry.system-groups</groupId>
<version>1.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>system-group-impl</artifactId>
<name>SYSTEM :: ENTAXY :: SYSTEM :: GROUP :: IMPL</name>
<packaging>bundle</packaging>
<properties>
<bundle.osgi.import.pkg>
ru.entaxy.esb.system.common.exception,
ru.entaxy.esb.system.registry.jpa,
ru.entaxy.esb.system.registry.jpa.entity,
javax.xml.bind;version="[2,3)",
javax.xml.bind.annotation;version="[2,3)",
javax.persistence;version="[2,3)",
org.hibernate,
org.hibernate.cfg,
org.hibernate.service,
org.hibernate.jpa,
org.hibernate.proxy,
javassist.util.proxy,
*
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>${osgi.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.system.registry.system-groups</groupId>
<artifactId>system-group-api</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>${jpa.version}</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>${javax.transaction.version}</version>
</dependency>
<dependency>
<groupId>javax.interceptor</groupId>
<artifactId>javax.interceptor-api</artifactId>
<version>${javax.interceptor.version}</version>
</dependency>
</dependencies>
<profiles>
<!-- Development settings, -Denv=dev -->
<profile>
<id>dev</id>
<activation>
<property>
<name>env</name>
<value>dev</value>
</property>
</activation>
<properties>
<hibernate.show_sql>true</hibernate.show_sql>
<hibernate.format_sql>true</hibernate.format_sql>
</properties>
</profile>
<!-- Production settings, -Denv=prod -->
<profile>
<id>prod</id>
<activation>
<property>
<name>env</name>
<value>!dev</value>
</property>
</activation>
<properties>
<hibernate.show_sql>false</hibernate.show_sql>
<hibernate.format_sql>false</hibernate.format_sql>
</properties>
</profile>
</profiles>
</project>

Some files were not shown because too many files have changed in this diff Show More