release version 1.11.0

This commit is contained in:
2025-07-10 23:47:05 +03:00
parent 5cb6857fa1
commit 8dd9cf9cf2
3082 changed files with 278464 additions and 1833 deletions

View File

@ -0,0 +1,61 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ru.entaxy.esb.platform.runtime</groupId>
<artifactId>core</artifactId>
<version>1.11.0</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>artifact-management-extensions</artifactId>
<packaging>bundle</packaging>
<name>ENTAXY :: PLATFORM :: CORE :: ARTIFACT MANAGEMENT EXTENSIONS</name>
<description>ENTAXY :: PLATFORM :: CORE :: ARTIFACT MANAGEMENT EXTENSIONS</description>
<properties>
<bundle.osgi.export.pkg>
ru.entaxy.platform.core.artifact.ext.binary,
ru.entaxy.platform.core.artifact.ext.features,
ru.entaxy.platform.core.artifact.ext.impl,
ru.entaxy.platform.core.artifact.ext
</bundle.osgi.export.pkg>
<bundle.osgi.private.pkg>
ru.entaxy.platform.core.artifact.ext.internal,
ru.entaxy.platform.core.artifact.ext.features.impl,
ru.entaxy.platform.core.artifact.ext.binary.impl,
</bundle.osgi.private.pkg>
<bundle.osgi.import.pkg>
*,
org.apache.karaf.cellar.bundle
</bundle.osgi.import.pkg>
</properties>
<dependencies>
<dependency>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>artifact-management</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>org.apache.karaf.features.core</artifactId>
<version>${karaf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.cellar</groupId>
<artifactId>org.apache.karaf.cellar.features</artifactId>
<version>${cellar.version}</version>
</dependency>
<dependency>
<groupId>ru.entaxy.esb.platform.runtime.base</groupId>
<artifactId>cellar-extensions</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,33 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext;
public interface ArtifactExtended {
String ARTIFACT_CATEGORY_UNTYPED_BINARY = "UNTYPED_BINARY";
String ARTIFACT_CATEGORY_FEATURE = "FEATURE";
}

View File

@ -0,0 +1,67 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext;
import ru.entaxy.platform.core.artifact.Artifact;
import ru.entaxy.platform.core.artifact.ext.binary.UntypedBinaryInstaller;
import ru.entaxy.platform.core.artifact.ext.binary.impl.UntypedBinaryInstallerImpl;
import ru.entaxy.platform.core.artifact.ext.features.FeatureInstaller;
import ru.entaxy.platform.core.artifact.ext.features.FeaturesInstaller;
import ru.entaxy.platform.core.artifact.ext.features.impl.FeatureInstallerImpl;
import ru.entaxy.platform.core.artifact.ext.features.impl.FeaturesInstallerImpl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.AbstractTypedInstallerFactory;
import ru.entaxy.platform.core.artifact.installer.builder.typed.TypedInstaller;
import ru.entaxy.platform.core.artifact.installer.builder.typed.TypedInstallerFactoryDescriptor;
@TypedInstallerFactoryDescriptor(
supportedClasses = {FeaturesInstaller.class, FeatureInstaller.class, UntypedBinaryInstaller.class},
supportedTypes = {Artifact.ARTIFACT_CATEGORY_FEATURES, ArtifactExtended.ARTIFACT_CATEGORY_FEATURE,
ArtifactExtended.ARTIFACT_CATEGORY_UNTYPED_BINARY})
public class ExtTypedInstallerFactory extends AbstractTypedInstallerFactory {
@Override
protected TypedInstaller doCreate(String type) {
if (Artifact.ARTIFACT_CATEGORY_FEATURES.equalsIgnoreCase(type)) {
return new FeaturesInstallerImpl();
}
if (ArtifactExtended.ARTIFACT_CATEGORY_UNTYPED_BINARY.equalsIgnoreCase(type)) {
return new UntypedBinaryInstallerImpl();
}
return null;
}
@Override
protected TypedInstaller doCreate(Class<? extends TypedInstaller> targetClass) {
if (FeaturesInstaller.class.equals(targetClass))
return new FeaturesInstallerImpl();
if (FeatureInstaller.class.equals(targetClass))
return new FeatureInstallerImpl();
if (UntypedBinaryInstaller.class.equals(targetClass))
return new UntypedBinaryInstallerImpl();
return null;
}
}

View File

@ -0,0 +1,32 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext;
public interface SequenceSupport<T> {
T inSequence(String sequenceId);
}

View File

@ -0,0 +1,135 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.binary;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.entaxy.platform.core.artifact.DefaultArtifact;
/**
* Allowed content types: InputStream, File, byte[]
*/
public abstract class AbstractBinaryArtifact extends DefaultArtifact {
private static final Logger LOG = LoggerFactory.getLogger(AbstractBinaryArtifact.class);
@Override
public void setContent(Object content) {
super.setContent(content);
}
@Override
public void toFile(File destination) {
if (content == null)
return;
if (content instanceof File) {
try {
Files.copy(((File) content).getAbsoluteFile().toPath(), destination.getAbsoluteFile().toPath(),
StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
LOG.error("Error saving file", e);
}
return;
}
if (content instanceof InputStream) {
try {
InputStream is = (InputStream) content;
if (is.markSupported()) {
is.mark(0);
}
Files.copy((InputStream) content, destination.getAbsoluteFile().toPath(),
StandardCopyOption.REPLACE_EXISTING);
if (is.markSupported()) {
is.reset();
}
} catch (IOException e) {
LOG.error("Error saving file", e);
}
return;
}
if (content instanceof byte[]) {
try (InputStream is = new ByteArrayInputStream((byte[]) content)) {
Files.copy(is, destination.getAbsoluteFile().toPath(),
StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
LOG.error("Error saving file", e);
}
return;
}
super.toFile(destination);
}
@Override
public byte[] asByteArray() {
if (content == null)
return new byte[0];
if (content instanceof byte[])
return (byte[]) content;
if (content instanceof InputStream)
try {
byte[] byteArray;
InputStream is = (InputStream) content;
if (is.markSupported()) {
is.mark(0);
}
byteArray = IOUtils.toByteArray(is);
if (is.markSupported()) {
is.reset();
}
return byteArray;
} catch (IOException e) {
LOG.error("Error getting bytes", e);
return new byte[0];
}
if (content instanceof File)
try (InputStream is = new FileInputStream((File) content)) {
return IOUtils.toByteArray(is);
} catch (Exception e) {
LOG.error("Error getting bytes", e);
return new byte[0];
}
return super.asByteArray();
}
}

View File

@ -0,0 +1,39 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.binary;
import java.io.File;
import java.io.InputStream;
import ru.entaxy.platform.core.artifact.Artifact;
import ru.entaxy.platform.core.artifact.annotation.ArtifactSupport;
@ArtifactSupport(supportedCategory = Artifact.ARTIFACT_CATEGORY_JAR,
supportedContentClasses = {File.class, InputStream.class, byte[].class},
defaultArtifactType = "jar")
public class JarArtifact extends AbstractBinaryArtifact {
}

View File

@ -0,0 +1,39 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.binary;
import java.io.File;
import java.io.InputStream;
import ru.entaxy.platform.core.artifact.annotation.ArtifactSupport;
import ru.entaxy.platform.core.artifact.ext.ArtifactExtended;
@ArtifactSupport(supportedCategory = ArtifactExtended.ARTIFACT_CATEGORY_UNTYPED_BINARY,
supportedContentClasses = {File.class, InputStream.class, byte[].class},
defaultArtifactType = "jar")
public class UntypedBinaryArtifact extends AbstractBinaryArtifact {
}

View File

@ -0,0 +1,32 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.binary;
import ru.entaxy.platform.core.artifact.installer.builder.typed.CommonBundleInstaller;
public interface UntypedBinaryInstaller extends CommonBundleInstaller {
}

View File

@ -0,0 +1,32 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.binary.impl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.cluster.ClusterCommonBundleInstallerHelper;
public class UntypedBinaryInstallerHelperCellar extends ClusterCommonBundleInstallerHelper {
}

View File

@ -0,0 +1,32 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.binary.impl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.CommonBundleInstallerHelperConfig;
public interface UntypedBinaryInstallerHelperConfig extends CommonBundleInstallerHelperConfig {
}

View File

@ -0,0 +1,32 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.binary.impl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.local.LocalCommonBundleInstallerHelper;
public class UntypedBinaryInstallerHelperLocal extends LocalCommonBundleInstallerHelper {
}

View File

@ -0,0 +1,44 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.binary.impl;
import ru.entaxy.platform.core.artifact.ext.binary.UntypedBinaryInstaller;
import ru.entaxy.platform.core.artifact.installer.builder.impl.cluster.ClusterTypedInstallerHelper;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.CommonBundleInstallerImpl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.HelperCreator;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerHelperImpl;
public class UntypedBinaryInstallerImpl extends CommonBundleInstallerImpl
implements UntypedBinaryInstaller, UntypedBinaryInstallerHelperConfig, HelperCreator {
@Override
public <H extends TypedInstallerHelperImpl> H createHelper(Class<H> targetClass) {
if (ClusterTypedInstallerHelper.class.isAssignableFrom(targetClass))
return (H) new UntypedBinaryInstallerHelperCellar();
return (H) new UntypedBinaryInstallerHelperLocal();
}
}

View File

@ -0,0 +1,51 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features;
import ru.entaxy.platform.core.artifact.ext.SequenceSupport;
import ru.entaxy.platform.core.artifact.installer.builder.typed.TypedInstaller;
public interface FeatureInstaller extends TypedInstaller, SequenceSupport<FeatureInstaller> {
public interface FeatureInstallDescriptor extends TypedInstaller {
FeatureInstallDescriptor version(String version);
FeatureInstallDescriptor noRefresh();
FeatureInstallDescriptor noStart();
FeatureInstallDescriptor noManage();
FeatureInstallDescriptor upgrade();
FeatureInstallDescriptor feature(String name);
}
FeatureInstallDescriptor feature(String name);
}

View File

@ -0,0 +1,77 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import ru.entaxy.platform.base.support.xml.CommonXMLUtils;
import ru.entaxy.platform.core.artifact.Artifact;
import ru.entaxy.platform.core.artifact.annotation.ArtifactSupport;
import ru.entaxy.platform.core.artifact.ext.binary.AbstractBinaryArtifact;
@ArtifactSupport(supportedCategory = Artifact.ARTIFACT_CATEGORY_FEATURES,
supportedContentClasses = {File.class, InputStream.class, byte[].class, Document.class, String.class},
defaultArtifactType = "xml")
public class FeaturesArtifact extends AbstractBinaryArtifact {
private static final Logger LOG = LoggerFactory.getLogger(FeaturesArtifact.class);
@Override
public void toFile(File destination) {
if (content == null)
return;
if (content instanceof Document) {
String data = null;
try {
data = CommonXMLUtils.doc2string((Document) content);
} catch (Exception e) {
LOG.error("Error converting Document to String for artifact [" + getCoordinates().toMavenString() + "]",
e);
return;
}
try (InputStream is = new ByteArrayInputStream(data.getBytes())) {
Files.copy(is, destination.getAbsoluteFile().toPath(),
StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) {
LOG.error("Error saving to file for artifact [" + getCoordinates().toMavenString() + "]", e);
return;
}
return;
}
super.toFile(destination);
}
}

View File

@ -0,0 +1,39 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features;
import ru.entaxy.platform.core.artifact.ext.SequenceSupport;
import ru.entaxy.platform.core.artifact.installer.builder.typed.TypedInstaller;
public interface FeaturesInstaller extends TypedInstaller, SequenceSupport<FeaturesInstaller> {
FeaturesInstaller installAllFeatures();
FeaturesInstaller refresh();
FeaturesInstaller installFeatures(String... features);
}

View File

@ -0,0 +1,121 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import java.util.ArrayList;
import java.util.List;
import org.apache.karaf.cellar.features.management.CellarFeaturesMBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.entaxy.platform.base.support.CommonUtils;
import ru.entaxy.platform.base.support.osgi.OSGIUtils;
import ru.entaxy.platform.core.artifact.installer.builder.impl.InstallationResultImpl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.cluster.ClusterTypedInstallerHelper;
import ru.entaxy.platform.runtime.cellar.sequence.CellarSequenceManager;
public class CellarFeaturesInstallerHelper extends ClusterTypedInstallerHelper
implements FeaturesInstallerConfigurableHelper {
private static final Logger LOG = LoggerFactory.getLogger(CellarFeaturesInstallerHelper.class);
protected FeaturesInstallerHelperConfig config;
public FeaturesInstallerHelperConfig getConfig() {
return config;
}
@Override
public void setConfig(FeaturesInstallerHelperConfig config) {
this.config = config;
}
protected CellarFeaturesMBean getFeaturesService() throws Exception {
if (CommonUtils.isValid(config.getSequenceId())) {
CellarSequenceManager seqManager =
OSGIUtils.services().ofClass(CellarSequenceManager.class).waitService(2000).get();
return seqManager.getSequencedHelper(config.getSequenceId(), CellarFeaturesMBean.class);
}
return OSGIUtils.services().ofClass(CellarFeaturesMBean.class).waitService(2000).get();
}
@Override
public InstallationResultImpl install(InstallationResultImpl installationResult) {
CellarFeaturesMBean featuresService;
try {
featuresService = getFeaturesService();
} catch (Exception e) {
LOG.error("Error getting CellarFeaturesMBean service", e);
return installationResult.failed("Error getting CellarFeaturesMBean service").error(e);
}
List<String> groupsToInstall = new ArrayList<>();
for (String groupName : getGroups())
if (checkGroup(groupName))
if (!groupsToInstall.contains(groupName))
groupsToInstall.add(groupName);
if (groupsToInstall.size() == 0) {
return installationResult.failed("No groups to install to");
}
// TODO decide if we really need several groups
// now we use only the first one
String groupToInstall = groupsToInstall.get(0);
String repositoryUrl = config.getSourceLocation();
if (repositoryUrl.indexOf(':') < 0)
repositoryUrl = "mvn:" + repositoryUrl;
try {
if (featuresService.getRepositories(groupToInstall).contains(repositoryUrl)) {
if (config.isRefresh())
featuresService.refreshRepository(groupToInstall, repositoryUrl);
} else {
featuresService.addRepository(groupToInstall, repositoryUrl, null, config.isInstallAllFetures());
}
if (!config.isInstallAllFetures())
for (String feature : config.getFeaturesToInstall())
featuresService.installFeature(groupToInstall, feature);
return installationResult.installed();
} catch (Exception e) {
LOG.error("Error installing repository [" + repositoryUrl + "]", e);
return installationResult.failed("Error installing repository [" + repositoryUrl + "]").error(e);
}
}
@Override
public InstallationResultImpl uninstall(InstallationResultImpl installationResult) {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -0,0 +1,192 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import java.util.ArrayList;
import java.util.List;
import org.apache.karaf.cellar.features.management.CellarFeaturesMBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.entaxy.platform.base.support.CommonUtils;
import ru.entaxy.platform.base.support.osgi.OSGIUtils;
import ru.entaxy.platform.core.artifact.ext.features.impl.FeatureInstallerImpl.FeatureInstallDescriptorImpl;
import ru.entaxy.platform.core.artifact.ext.impl.ClusterTypedConfigurableHelper;
import ru.entaxy.platform.core.artifact.installer.builder.impl.InstallationResultImpl;
import ru.entaxy.platform.runtime.cellar.sequence.CellarSequenceManager;
public class FeatureInstallerClusterHelper extends ClusterTypedConfigurableHelper<FeatureInstallerImpl>
implements FeatureInstallerConfigurableHelper {
private static final Logger LOG = LoggerFactory.getLogger(FeatureInstallerClusterHelper.class);
protected CellarFeaturesMBean getFeaturesService() throws Exception {
if (CommonUtils.isValid(config.sequenceId)) {
CellarSequenceManager seqManager =
OSGIUtils.services().ofClass(CellarSequenceManager.class).waitService(2000).get();
return seqManager.getSequencedHelper(config.sequenceId, CellarFeaturesMBean.class);
}
return OSGIUtils.services().ofClass(CellarFeaturesMBean.class).waitService(2000).get();
}
@Override
public InstallationResultImpl install(InstallationResultImpl installationResult) {
CellarFeaturesMBean featuresService;
try {
featuresService = getFeaturesService();
} catch (Exception e) {
LOG.error("Error getting CellarFeaturesMBean service", e);
return installationResult.failed("Error getting CellarFeaturesMBean service").error(e);
}
List<String> groupsToInstall = new ArrayList<>();
for (String groupName : getGroups())
if (checkGroup(groupName))
if (!groupsToInstall.contains(groupName))
groupsToInstall.add(groupName);
if (groupsToInstall.size() == 0) {
return installationResult.failed("No groups to install to");
}
// TODO decide if we really need several groups
// now we use only the first one
String groupToInstall = groupsToInstall.get(0);
boolean hasFailed = false;
boolean hasSuccessfull = false;
for (FeatureInstallDescriptorImpl descriptor : config.descriptors.values()) {
InstallationResultImpl subResult = InstallationResultImpl.create();
subResult.object(descriptor.featureName);
try {
// convert version to OSGI-style version
// mj.mn.p-q -> mj.mn.p.q
String finalFeatureVersion = descriptor.featureVersion;
if (CommonUtils.isValid(finalFeatureVersion)) {
finalFeatureVersion = finalFeatureVersion.replace('-', '.');
}
featuresService.installFeature(groupToInstall, descriptor.featureName,
finalFeatureVersion,
descriptor.noRefresh,
descriptor.noStart,
descriptor.noManage,
descriptor.upgrade);
subResult.installed();
hasSuccessfull = true;
} catch (Exception e) {
LOG.error("Error installing repository [" + descriptor.featureName + "]", e);
subResult.failed("Error installing feature [" + descriptor.featureName + "]").error(e);
hasFailed = true;
}
installationResult.subResult(subResult);
}
if (!hasFailed)
installationResult.installed();
else {
if (hasSuccessfull) {
installationResult.message("HAS FAILED SUBRESULTS");
installationResult.installed();
} else {
installationResult.failed();
}
}
return installationResult;
}
@Override
public InstallationResultImpl uninstall(InstallationResultImpl installationResult) {
CellarFeaturesMBean featuresService;
try {
featuresService = getFeaturesService();
} catch (Exception e) {
LOG.error("Error getting CellarFeaturesMBean service", e);
return installationResult.failed("Error getting CellarFeaturesMBean service").error(e);
}
List<String> groupsToUninstall = new ArrayList<>();
for (String groupName : getGroups())
if (checkGroup(groupName))
if (!groupsToUninstall.contains(groupName))
groupsToUninstall.add(groupName);
if (groupsToUninstall.size() == 0) {
return installationResult.failed("No groups to uninstall from");
}
// TODO decide if we really need several groups
// now we use only the first one
String groupToUninstall = groupsToUninstall.get(0);
boolean hasFailed = false;
boolean hasSuccessfull = false;
for (FeatureInstallDescriptorImpl descriptor : config.descriptors.values()) {
InstallationResultImpl subResult = InstallationResultImpl.create();
subResult.object(descriptor.featureName);
try {
// convert version to OSGI-style version
// mj.mn.p-q -> mj.mn.p.q
String finalFeatureVersion = descriptor.featureVersion;
if (CommonUtils.isValid(finalFeatureVersion)) {
finalFeatureVersion = finalFeatureVersion.replace('-', '.');
}
featuresService.uninstallFeature(groupToUninstall, descriptor.featureName, finalFeatureVersion,
descriptor.noRefresh);
subResult.uninstalled();
hasSuccessfull = true;
} catch (Exception e) {
LOG.error("Error uninstalling repository [" + descriptor.featureName + "]", e);
subResult.failed("Error uninstalling feature [" + descriptor.featureName + "]").error(e);
hasFailed = true;
}
installationResult.subResult(subResult);
}
if (!hasFailed)
installationResult.uninstalled();
else {
if (hasSuccessfull) {
installationResult.message("HAS FAILED SUBRESULTS");
installationResult.uninstalled();
} else {
installationResult.failed();
}
}
return installationResult;
}
}

View File

@ -0,0 +1,36 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import ru.entaxy.platform.core.artifact.ext.impl.InstallerConfigurableHelper;
public interface FeatureInstallerConfigurableHelper extends InstallerConfigurableHelper<FeatureInstallerImpl> {
@Override
default Class<FeatureInstallerImpl> getConfigClass() {
return FeatureInstallerImpl.class;
}
}

View File

@ -0,0 +1,172 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import java.util.HashMap;
import java.util.Map;
import ru.entaxy.platform.core.artifact.DeployedArtifact;
import ru.entaxy.platform.core.artifact.ext.features.FeatureInstaller;
import ru.entaxy.platform.core.artifact.ext.impl.ExtendedTypedInstallerImpl;
import ru.entaxy.platform.core.artifact.installer.builder.InstallationResult;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerHelperImpl;
public class FeatureInstallerImpl
extends ExtendedTypedInstallerImpl<FeatureInstallerConfigurableHelper, FeatureInstallerImpl>
implements FeatureInstaller {
protected static class FeatureInstallDescriptorImpl implements FeatureInstallDescriptor {
FeatureInstallerImpl featureInstaller;
String featureName;
String featureVersion;
boolean noStart = false;
boolean noRefresh = false;
boolean noManage = false;
boolean upgrade = false;
protected FeatureInstallDescriptorImpl(FeatureInstallerImpl featureInstaller, String name) {
this.featureInstaller = featureInstaller;
this.featureName = name;
}
@Override
public void clearInstaller() {
featureInstaller.clearInstaller();
}
@Override
public void setSourceLocation(String sourceLocation) {}
@Override
public String getSourceLocation() {
return featureInstaller.getSourceLocation();
}
@Override
public void setArtifact(DeployedArtifact artifact) {
featureInstaller.setArtifact(artifact);
}
@Override
public DeployedArtifact getArtifact() {
return featureInstaller.getArtifact();
}
@Override
public String getTypedName() {
return featureInstaller.getTypedName();
}
@Override
public void setTypedName(String typedName) {
featureInstaller.setTypedName(typedName);
}
@Override
public InstallationResult install() {
return featureInstaller.install();
}
@Override
public InstallationResult uninstall() {
return featureInstaller.uninstall();
}
@Override
public FeatureInstallDescriptor version(String version) {
this.featureVersion = version;
return this;
}
@Override
public FeatureInstallDescriptor noRefresh() {
this.noRefresh = true;
return this;
}
@Override
public FeatureInstallDescriptor noStart() {
this.noStart = true;
return this;
}
@Override
public FeatureInstallDescriptor noManage() {
this.noManage = true;
return this;
}
@Override
public FeatureInstallDescriptor upgrade() {
this.upgrade = true;
return this;
}
@Override
public FeatureInstallDescriptor feature(String name) {
return featureInstaller.feature(name);
}
}
protected final Map<String, FeatureInstallDescriptorImpl> descriptors = new HashMap<>();
protected String sequenceId = null;
@Override
public FeatureInstaller inSequence(String sequenceId) {
this.sequenceId = sequenceId;
return this;
}
@Override
public FeatureInstallDescriptor feature(String name) {
if (descriptors.containsKey(name))
return descriptors.get(name);
FeatureInstallDescriptorImpl descriptor = new FeatureInstallDescriptorImpl(this, name);
descriptors.put(name, descriptor);
return descriptor;
}
@Override
protected Class<FeatureInstallerConfigurableHelper> getHelperClass() {
return FeatureInstallerConfigurableHelper.class;
}
@Override
protected <H extends TypedInstallerHelperImpl> H createClusterHelper(Class<H> targetClass) {
return (H) new FeatureInstallerClusterHelper();
}
@Override
protected <H extends TypedInstallerHelperImpl> H createLocalHelper(Class<H> targetClass) {
return (H) new FeatureInstallerLocalHelper();
}
}

View File

@ -0,0 +1,46 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import ru.entaxy.platform.core.artifact.ext.impl.LocalTypedConfigurableHelper;
import ru.entaxy.platform.core.artifact.installer.builder.impl.InstallationResultImpl;
public class FeatureInstallerLocalHelper extends LocalTypedConfigurableHelper<FeatureInstallerImpl>
implements FeatureInstallerConfigurableHelper {
@Override
public InstallationResultImpl install(InstallationResultImpl installationResult) {
// TODO Auto-generated method stub
return null;
}
@Override
public InstallationResultImpl uninstall(InstallationResultImpl installationResult) {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -0,0 +1,38 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.InstallationResultImpl;
public interface FeaturesInstallerConfigurableHelper {
void setConfig(FeaturesInstallerHelperConfig config);
public InstallationResultImpl install(InstallationResultImpl installationResult);
public InstallationResultImpl uninstall(InstallationResultImpl installationResult);
}

View File

@ -0,0 +1,42 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import java.util.List;
public interface FeaturesInstallerHelperConfig {
boolean isRefresh();
boolean isInstallAllFetures();
List<String> getFeaturesToInstall();
String getSourceLocation();
String getSequenceId();
}

View File

@ -0,0 +1,46 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerHelperImpl;
public abstract class FeaturesInstallerHelperImpl extends TypedInstallerHelperImpl
implements FeaturesInstallerConfigurableHelper {
protected FeaturesInstallerHelperConfig config;
public FeaturesInstallerHelperConfig getConfig() {
return config;
}
@Override
public void setConfig(FeaturesInstallerHelperConfig config) {
this.config = config;
}
}

View File

@ -0,0 +1,133 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import ru.entaxy.platform.core.artifact.ext.features.FeaturesInstaller;
import ru.entaxy.platform.core.artifact.installer.builder.InstallationResult;
import ru.entaxy.platform.core.artifact.installer.builder.impl.InstallationResultImpl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.cluster.ClusterTypedInstallerHelper;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.HelperCreator;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerHelperImpl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerImpl;
public class FeaturesInstallerImpl extends TypedInstallerImpl
implements FeaturesInstaller, HelperCreator, FeaturesInstallerHelperConfig {
protected boolean isInstallAllFeatures = false;
protected boolean isRefresh = false;
protected List<String> featuresToInstall = new ArrayList<>();
protected FeaturesInstallerConfigurableHelper featuresHelper;
protected String sequenceId = null;
@Override
public FeaturesInstaller inSequence(String sequenceId) {
this.sequenceId = sequenceId;
return this;
}
@Override
public InstallationResult install() {
InstallationResultImpl result = InstallationResultImpl.create();
if (this.featuresHelper == null)
result.failed("HELPER NOT FOUND");
else
this.featuresHelper.install(result);
return result.property("artifact", this.artifact);
}
@Override
public InstallationResult uninstall() {
InstallationResultImpl result = InstallationResultImpl.create();
if (this.featuresHelper == null)
result.failed("HELPER NOT FOUND");
else
this.featuresHelper.uninstall(result);
return result.property("artifact", this.artifact);
}
@Override
public void setHelper(TypedInstallerHelperImpl helper) {
if (helper instanceof FeaturesInstallerConfigurableHelper) {
featuresHelper = (FeaturesInstallerConfigurableHelper) helper;
featuresHelper.setConfig(this);
}
super.setHelper(helper);
}
@Override
public FeaturesInstaller installAllFeatures() {
isInstallAllFeatures = true;
return this;
}
@Override
public FeaturesInstaller installFeatures(String... features) {
if (features != null)
this.featuresToInstall = new ArrayList<>(Arrays.asList(features));
return this;
}
@Override
public <H extends TypedInstallerHelperImpl> H createHelper(Class<H> targetClass) {
if (ClusterTypedInstallerHelper.class.isAssignableFrom(targetClass))
return (H) new CellarFeaturesInstallerHelper();
return (H) new LocalFeaturesInstallerHelper();
}
@Override
public FeaturesInstaller refresh() {
isRefresh = true;
return this;
}
@Override
public boolean isRefresh() {
return isRefresh;
}
@Override
public boolean isInstallAllFetures() {
return isInstallAllFeatures;
}
@Override
public List<String> getFeaturesToInstall() {
return featuresToInstall;
}
@Override
public String getSequenceId() {
return sequenceId;
}
}

View File

@ -0,0 +1,44 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.features.impl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.InstallationResultImpl;
public class LocalFeaturesInstallerHelper extends FeaturesInstallerHelperImpl {
@Override
public InstallationResultImpl install(InstallationResultImpl installationResult) {
// TODO Auto-generated method stub
return null;
}
@Override
public InstallationResultImpl uninstall(InstallationResultImpl installationResult) {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -0,0 +1,40 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.impl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.cluster.ClusterTypedInstallerHelper;
public abstract class ClusterTypedConfigurableHelper<T> extends ClusterTypedInstallerHelper
implements InstallerConfigurableHelper<T> {
protected T config;
@Override
public void setConfig(T config) {
this.config = config;
}
}

View File

@ -0,0 +1,82 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.impl;
import ru.entaxy.platform.core.artifact.installer.builder.InstallationResult;
import ru.entaxy.platform.core.artifact.installer.builder.impl.InstallationResultImpl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.cluster.ClusterTypedInstallerHelper;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.HelperCreator;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerHelperImpl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerImpl;
public abstract class ExtendedTypedInstallerImpl<S extends InstallerConfigurableHelper<T>, T> extends TypedInstallerImpl
implements HelperCreator {
protected S localTypedHelper;
protected abstract Class<S> getHelperClass();
@Override
public InstallationResult install() {
InstallationResultImpl result = InstallationResultImpl.create();
if (localTypedHelper == null)
result.failed("HELPER NOT FOUND");
else
result = localTypedHelper.install(result);
return result;
}
@Override
public InstallationResult uninstall() {
InstallationResultImpl result = InstallationResultImpl.create();
if (localTypedHelper == null)
result.failed("HELPER NOT FOUND");
else
result = localTypedHelper.uninstall(result);
return result;
}
@Override
public void setHelper(TypedInstallerHelperImpl helper) {
if (getHelperClass().isInstance(helper)) {
this.localTypedHelper = (S) helper;
if (localTypedHelper.getConfigClass().isAssignableFrom(getClass()))
localTypedHelper.setConfig((T) this);
}
super.setHelper(helper);
}
@Override
public <H extends TypedInstallerHelperImpl> H createHelper(Class<H> targetClass) {
if (ClusterTypedInstallerHelper.class.isAssignableFrom(targetClass))
return (H) createClusterHelper(targetClass);
return (H) createLocalHelper(targetClass);
}
protected abstract <H extends TypedInstallerHelperImpl> H createClusterHelper(Class<H> targetClass);
protected abstract <H extends TypedInstallerHelperImpl> H createLocalHelper(Class<H> targetClass);
}

View File

@ -0,0 +1,41 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.impl;
import ru.entaxy.platform.core.artifact.installer.builder.impl.InstallationResultImpl;
public interface InstallerConfigurableHelper<T> {
void setConfig(T config);
Class<T> getConfigClass();
public InstallationResultImpl install(InstallationResultImpl installationResult);
public InstallationResultImpl uninstall(InstallationResultImpl installationResult);
}

View File

@ -0,0 +1,40 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.impl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerHelperImpl;
public abstract class LocalTypedConfigurableHelper<T> extends TypedInstallerHelperImpl
implements InstallerConfigurableHelper<T> {
protected T config;
@Override
public void setConfig(T config) {
this.config = config;
}
}

View File

@ -0,0 +1,55 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management-extensions
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.ext.internal;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import ru.entaxy.platform.core.artifact.Artifacts;
import ru.entaxy.platform.core.artifact.ext.ExtTypedInstallerFactory;
import ru.entaxy.platform.core.artifact.ext.binary.JarArtifact;
import ru.entaxy.platform.core.artifact.ext.binary.UntypedBinaryArtifact;
import ru.entaxy.platform.core.artifact.installer.builder.typed.TypedInstallerManager;
import ru.entaxy.platform.core.artifact.service.ArtifactService;
@Component(service = Registrator.class, immediate = true)
public class Registrator {
@Reference(cardinality = ReferenceCardinality.MANDATORY)
ArtifactService artifactService;
@Activate
public void activate() {
Artifacts.registerSupport(JarArtifact.class);
Artifacts.registerSupport(UntypedBinaryArtifact.class);
TypedInstallerManager.register(new ExtTypedInstallerFactory());
}
}

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime</groupId>
<artifactId>core</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>artifact-management</artifactId>

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* test-producers
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* test-producers
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* test-producers
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* test-producers
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -0,0 +1,74 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.installer.builder.typed;
import java.util.Arrays;
import java.util.List;
public abstract class AbstractTypedInstallerFactory implements TypedInstallerFactory {
protected List<Class<? extends TypedInstaller>> supportedClasses;
protected List<String> supportedTypes;
protected AbstractTypedInstallerFactory() {
super();
if (this.getClass().isAnnotationPresent(TypedInstallerFactoryDescriptor.class)) {
TypedInstallerFactoryDescriptor descriptor =
this.getClass().getAnnotation(TypedInstallerFactoryDescriptor.class);
this.supportedClasses = Arrays.asList(descriptor.supportedClasses());
this.supportedTypes = Arrays.asList(descriptor.supportedTypes());
}
}
@Override
public List<Class<? extends TypedInstaller>> getSupportedClasses() {
return supportedClasses;
}
@Override
public List<String> getSupportedTypes() {
return supportedTypes;
}
@Override
public TypedInstaller create(String type) {
if (!supportedTypes.contains(type))
return null;
return doCreate(type);
}
protected abstract TypedInstaller doCreate(String type);
@Override
public TypedInstaller create(Class<? extends TypedInstaller> targetClass) {
if (!supportedClasses.contains(targetClass))
return null;
return doCreate(targetClass);
}
protected abstract TypedInstaller doCreate(Class<? extends TypedInstaller> targetClass);
}

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -0,0 +1,98 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.installer.builder.typed;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
import ru.entaxy.platform.core.artifact.Artifact;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.BlueprintInstallerImpl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.BundleInstallerImpl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.JarInstallerImpl;
import ru.entaxy.platform.core.artifact.installer.builder.typed.impl.TypedInstallerImpl;
@TypedInstallerFactoryDescriptor(supportedTypes = {Artifact.ARTIFACT_CATEGORY_BLUEPRINT,
Artifact.ARTIFACT_CATEGORY_BUNDLE, Artifact.ARTIFACT_CATEGORY_JAR},
supportedClasses = {BlueprintInstaller.class, BundleInstaller.class, JarInstaller.class})
public class DefaultTypedInstallerFactory extends AbstractTypedInstallerFactory {
protected static DefaultTypedInstallerFactory INSTANCE;
public static DefaultTypedInstallerFactory getInstance() {
if (INSTANCE == null)
INSTANCE = new DefaultTypedInstallerFactory();
return INSTANCE;
}
protected static Map<String, Class<? extends TypedInstallerImpl>> typeToClassMap;
protected static Map<Class<? extends TypedInstaller>, Class<? extends TypedInstallerImpl>> classToClassMap;
static {
typeToClassMap = new HashMap<>();
typeToClassMap.put(Artifact.ARTIFACT_CATEGORY_BLUEPRINT, BlueprintInstallerImpl.class);
typeToClassMap.put(Artifact.ARTIFACT_CATEGORY_BUNDLE, BundleInstallerImpl.class);
typeToClassMap.put(Artifact.ARTIFACT_CATEGORY_JAR, JarInstallerImpl.class);
classToClassMap = new HashMap<>();
classToClassMap.put(BlueprintInstaller.class, BlueprintInstallerImpl.class);
classToClassMap.put(BundleInstaller.class, BundleInstallerImpl.class);
classToClassMap.put(JarInstaller.class, JarInstallerImpl.class);
}
protected DefaultTypedInstallerFactory() {
super();
}
@Override
protected TypedInstaller doCreate(String type) {
Class<? extends TypedInstallerImpl> clazz = typeToClassMap.get(type);
if (clazz == null)
return null;
return createOfClass(clazz);
}
@Override
protected TypedInstaller doCreate(Class<? extends TypedInstaller> targetClass) {
Class<? extends TypedInstallerImpl> clazz = classToClassMap.get(targetClass);
if (clazz == null)
return null;
return createOfClass(clazz);
}
protected TypedInstaller createOfClass(Class<? extends TypedInstallerImpl> clazz) {
try {
Constructor<?> constructor = clazz.getConstructor();
return (TypedInstaller) constructor.newInstance();
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
return null;
}
}
}

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -0,0 +1,40 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.installer.builder.typed;
import java.util.List;
public interface TypedInstallerFactory {
List<Class<? extends TypedInstaller>> getSupportedClasses();
List<String> getSupportedTypes();
TypedInstaller create(String type);
TypedInstaller create(Class<? extends TypedInstaller> targetClass);
}

View File

@ -0,0 +1,42 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.installer.builder.typed;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Retention(RUNTIME)
@Target(TYPE)
public @interface TypedInstallerFactoryDescriptor {
Class<? extends TypedInstaller>[] supportedClasses();
String[] supportedTypes();
}

View File

@ -0,0 +1,192 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.installer.builder.typed;
import java.util.HashMap;
import java.util.Map;
import ru.entaxy.platform.core.artifact.installer.builder.ClusterInstaller;
import ru.entaxy.platform.core.artifact.installer.builder.Installer;
import ru.entaxy.platform.core.artifact.installer.builder.LocalInstaller;
public class TypedInstallerManager {
protected static Map<Class<? extends Installer<?>>, TypedInstallerStorage> storages = new HashMap<>();
protected static TypedInstallerStorage commonStorage = new TypedInstallerStorage();
static {
storages.put(LocalInstaller.class, new TypedInstallerStorage());
storages.put(ClusterInstaller.class, new TypedInstallerStorage());
}
protected static Object storagesLock = new Object();
public static void register(String artifactType,
TypedInstallerFactory factory) {
register(commonStorage, artifactType, factory);
}
public static void register(TypedInstallerFactory factory) {
register(commonStorage, factory);
}
protected static TypedInstallerStorage getOrCreateStorage(Class<? extends Installer<?>> installerClass) {
if (!storages.containsKey(installerClass)) {
synchronized (storagesLock) {
storages.put(installerClass, new TypedInstallerStorage());
}
}
return storages.get(installerClass);
}
public static void register(Class<? extends Installer<?>> installerClass, String artifactType,
TypedInstallerFactory factory) {
register(getOrCreateStorage(installerClass), artifactType, factory);
}
public static void register(Class<? extends Installer<?>> installerClass,
TypedInstallerFactory factory) {
register(getOrCreateStorage(installerClass), factory);
}
protected static void register(TypedInstallerStorage storage, TypedInstallerFactory factory) {
for (String type : factory.getSupportedTypes())
register(storage, type, factory);
}
protected static void register(TypedInstallerStorage storage, String artifactType,
TypedInstallerFactory factory) {
storage.register(artifactType, factory);
}
public static TypedInstaller create(Object owner, String type) {
return create(owner, type, false);
}
public static TypedInstaller create(Object owner, String type, boolean strict) {
for (Class<? extends Installer<?>> installerClass : storages.keySet())
if (installerClass.isInstance(owner))
return create(installerClass, type, strict);
if (strict)
return null;
return create(null, type, strict);
}
public static TypedInstaller create(Class<? extends Installer<?>> installerClass, String type) {
return create(installerClass, type, false);
}
public static TypedInstaller create(Class<? extends Installer<?>> installerClass, String type, boolean strict) {
TypedInstallerStorage storage = installerClass == null ? null : storages.get(installerClass);
TypedInstaller result = null;
if (storage != null) {
result = storage.create(type);
}
if (result != null)
return result;
if (strict)
return null;
else
return commonStorage.create(type);
}
public static TypedInstaller create(Object owner, Class<? extends TypedInstaller> typedClass) {
return create(owner, typedClass, false);
}
public static TypedInstaller create(Object owner, Class<? extends TypedInstaller> typedClass, boolean strict) {
for (Class<? extends Installer<?>> installerClass : storages.keySet())
if (installerClass.isInstance(owner))
return create(installerClass, typedClass, strict);
if (strict)
return null;
return create(null, typedClass, strict);
}
public static TypedInstaller create(Class<? extends Installer<?>> installerClass,
Class<? extends TypedInstaller> typedClass) {
return create(installerClass, typedClass, false);
}
public static TypedInstaller create(Class<? extends Installer<?>> installerClass,
Class<? extends TypedInstaller> typedClass, boolean strict) {
TypedInstallerStorage storage = installerClass == null ? null : storages.get(installerClass);
TypedInstaller result = null;
if (storage != null) {
result = storage.create(typedClass);
}
if (result != null)
return result;
if (strict)
return null;
else
return commonStorage.create(typedClass);
}
protected static class TypedInstallerStorage {
protected Map<String, TypedInstallerFactory> factories = new HashMap<>();
protected Object factoriesLock = new Object();
public void register(String type, TypedInstallerFactory factory) {
synchronized (factoriesLock) {
factories.put(type, factory);
}
}
public TypedInstaller create(String type) {
if (!factories.containsKey(type))
return null;
return factories.get(type).create(type);
}
public TypedInstaller create(Class<? extends TypedInstaller> typedClass) {
TypedInstallerFactory factory = null;
for (TypedInstallerFactory f : factories.values())
if (f.getSupportedClasses().contains(typedClass)) {
factory = f;
break;
}
if (factory == null)
return null;
return factory.create(typedClass);
}
}
}

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -0,0 +1,32 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.installer.builder.typed.impl;
public interface HelperCreator {
<H extends TypedInstallerHelperImpl> H createHelper(Class<H> targetClass);
}

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -0,0 +1,34 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.installer.builder.typed.impl;
public interface TypedInstallerHelperAware {
TypedInstallerHelperImpl getHelper();
void setHelper(TypedInstallerHelperImpl helper);
}

View File

@ -0,0 +1,30 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.installer.builder.typed.impl;
public class TypedInstallerHelperImpl {
}

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* cellar-deployer
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
@ -52,7 +52,7 @@ public interface ArtifactRepository {
public boolean isSystem();
public DeployedArtifact deploy(Artifact artifact);
public DeployedArtifact deploy(Artifact artifact) throws Exception;
public List<String> getAvailableVersions(Artifact artifact);

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -0,0 +1,62 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.repository;
public interface RepositoryDescriptor {
String getName();
String getLocation();
String getUrl();
boolean isProxy();
boolean isMirror();
boolean isSnapshots();
String getRemotes();
boolean isReadOnly();
boolean isCopyOnChange();
boolean isEnabled();
String getUsername();
String getPassword();
String getRemoteHostSuffix();
boolean isSystem();
boolean isLookupEnabled();
}

View File

@ -0,0 +1,35 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.repository;
/*
* Internal interface to collect helpers managed by config files
*/
public interface RepositoryDescriptorCollector {
public void addRepositoryDescriptor(RepositoryDescriptor helper);
public void removeRepositoryDescriptor(RepositoryDescriptor helper);
}

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
@ -144,14 +144,14 @@ public class ArtifactRepositoryImpl implements ArtifactRepository {
}
@Override
public DeployedArtifact deploy(Artifact artifact) {
public DeployedArtifact deploy(Artifact artifact) throws Exception {
if (isHealthy() && isEnabled() && !isReadOnly()) {
return deployArtifact(artifact);
}
return new DeployedArtifactImpl(artifact);
}
protected DeployedArtifact deployArtifact(Artifact artifact) {
protected DeployedArtifact deployArtifact(Artifact artifact) throws Exception {
String location = "mvn:";
if (!repositoryDescriptor.isProxy() || repositoryDescriptor.isMirror())
@ -185,12 +185,13 @@ public class ArtifactRepositoryImpl implements ArtifactRepository {
}
}
protected void deployToRemoteMaven(Artifact artifact) {
protected void deployToRemoteMaven(Artifact artifact) throws Exception {
try {
initRemoteRepository();
this.remoteRepository.deploy(artifact);
} catch (Exception e) {
log.error("deployToRemoteMaven", e);
throw e;
}
}

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2024 EmDev LLC
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property

View File

@ -0,0 +1,188 @@
/*-
* ~~~~~~licensing~~~~~~
* artifact-management
* ==========
* Copyright (C) 2020 - 2025 EmDev LLC
* ==========
* You may not use this file except in accordance with the License Terms of the Copyright
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
* rights to the Software and any copies are the property of the Copyright Holder. Unless
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
* Software for commercial purposes to provide services to third parties.
*
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
* Under no circumstances does the Copyright Holder guarantee or promise that the
* Software provided by him will be suitable or not suitable for the specific purposes
* of the User, that the Software will meet all commercial and personal subjective
* expectations of the User, that the Software will work properly, without technical
* errors, quickly and uninterruptedly.
*
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
* to the User for any direct or indirect losses of the User, his expenses or actual
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
* or damage to data, property, etc.
* ~~~~~~/licensing~~~~~~
*/
package ru.entaxy.platform.core.artifact.repository.impl;
import ru.entaxy.platform.core.artifact.repository.RepositoryDescriptor;
public class RepositoryDescriptorImpl implements RepositoryDescriptor {
protected String name;
String location;
String url;
boolean isProxy;
boolean isMirror;
String remotes;
boolean isReadOnly = false;
boolean copyOnChange;
String username = "";
String password = "";
boolean isSnapshots = false;
boolean isEnabled = true;
String remoteHostSuffix = "";
boolean isSystem = true;
boolean isLookupEnabled = true;
@Override
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
@Override
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@Override
public boolean isProxy() {
return isProxy;
}
public void setProxy(boolean isProxy) {
this.isProxy = isProxy;
}
@Override
public boolean isMirror() {
return isMirror;
}
public void setMirror(boolean isMirror) {
this.isMirror = isMirror;
}
@Override
public boolean isSnapshots() {
return isSnapshots;
}
public void setSnapshots(boolean isSnapshots) {
this.isSnapshots = isSnapshots;
}
@Override
public String getRemotes() {
return remotes;
}
public void setRemotes(String remotes) {
this.remotes = remotes;
}
@Override
public boolean isReadOnly() {
return isReadOnly;
}
public void setReadOnly(boolean isReadOnly) {
this.isReadOnly = isReadOnly;
}
@Override
public boolean isCopyOnChange() {
return copyOnChange;
}
public void setCopyOnChange(boolean copyOnChange) {
this.copyOnChange = copyOnChange;
}
@Override
public boolean isEnabled() {
return isEnabled;
}
public void setEnabled(boolean isEnabled) {
this.isEnabled = isEnabled;
}
@Override
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String getRemoteHostSuffix() {
return remoteHostSuffix;
}
public void setRemoteHostSuffix(String remoteHostSuffix) {
this.remoteHostSuffix = remoteHostSuffix;
}
@Override
public boolean isSystem() {
return isSystem;
}
public void setSystem(boolean isSystem) {
this.isSystem = isSystem;
}
@Override
public boolean isLookupEnabled() {
return isLookupEnabled;
}
public void setLookupEnabled(boolean isLookupEnabled) {
this.isLookupEnabled = isLookupEnabled;
}
}

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