ENTAXY-374 release 1.8.2

This commit is contained in:
2022-08-23 13:40:11 +03:00
parent b68642f81c
commit 1061b96c7e
616 changed files with 60896 additions and 3202 deletions

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>management</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
<artifactId>blueprint-generator-service</artifactId>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>management</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
<artifactId>cluster-node-management</artifactId>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>management</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>

View File

@ -19,7 +19,9 @@
*/
package ru.entaxy.esb.platform.core.management.connection;
public interface ConnectionMBean {
import ru.entaxy.esb.platform.base.management.core.api.RuntimeTypedMBean;
public interface ConnectionMBean extends RuntimeTypedMBean {
public static final String CONNECTION_KEY = "connection";

View File

@ -25,8 +25,11 @@ import javax.management.StandardMBean;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
import ru.entaxy.esb.platform.core.management.connection.ConnectionMBean;
//@TODO move string to constant
@EntaxyRuntimeTyped(name = "entaxy.runtime.connection")
public class ConnectionMBeanImpl extends StandardMBean implements ConnectionMBean {
protected ManagedConnection connection;

View File

@ -91,7 +91,7 @@ public class ConnectionsMBeanImpl extends StandardMBean
}
@Override
public void addded(ManagedConnections connections) {
public void added(ManagedConnections connections) {
Hashtable props = new Hashtable<>();
// String jmxObjectName = "jmx.objectname";
// String objectName = "ru.entaxy.esb:group=platform,category=connections,connection=";
@ -108,6 +108,7 @@ public class ConnectionsMBeanImpl extends StandardMBean
descriptor.registration = bundleContext.registerService(ConnectionMBean.class
, service
, props);
managed.put(connection.getName(), descriptor);
} catch (Exception e) {
log.error("Error adding connection [" + connection.getName() + "]", e);
}

View File

@ -21,7 +21,7 @@ package ru.entaxy.esb.platform.core.management.connection.impl;
public interface ManagedConnectionsListener {
public void addded(ManagedConnections connections);
public void added(ManagedConnections connections);
public void removed(ManagedConnections connections);
}

View File

@ -26,6 +26,8 @@ import org.osgi.framework.BundleEvent;
import org.osgi.framework.wiring.BundleCapability;
import org.osgi.framework.wiring.BundleRevision;
import org.osgi.util.tracker.BundleTrackerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.entaxy.esb.platform.core.management.connection.ConnectionsMBean;
import ru.entaxy.esb.platform.core.management.connection.impl.ManagedConnection;
@ -35,6 +37,8 @@ import ru.entaxy.platform.base.support.CommonUtils;
public class DeployedConnectionCustomizer implements BundleTrackerCustomizer<ManagedConnections> {
private static final Logger log = LoggerFactory.getLogger(DeployedConnectionCustomizer.class);
protected ManagedConnectionsListener listener;
public DeployedConnectionCustomizer(ManagedConnectionsListener listener) {
@ -43,16 +47,20 @@ public class DeployedConnectionCustomizer implements BundleTrackerCustomizer<Man
@Override
public ManagedConnections addingBundle(Bundle bundle, BundleEvent event) {
log.debug("INSPECTING: " + bundle.getBundleId());
BundleRevision revision = bundle.adapt(BundleRevision.class);
if (revision == null)
return null;
log.debug("REVISION FOUND: " + bundle.getBundleId());
List<BundleCapability> capabilities = revision.getDeclaredCapabilities(ConnectionsMBean.CAPABILITY_NAMESPACE);
if ((capabilities==null) || (capabilities.size()==0))
return null;
log.debug("CAPABILITIES FOUND: " + bundle.getBundleId());
ManagedConnections result = new ManagedConnections();
for (BundleCapability capability: capabilities) {
Object val = capability.getAttributes().get("name");
String name = val==null?"":val.toString();
log.debug("CAPABILITIES/NAME [" + name + "] : " + bundle.getBundleId());
if (!CommonUtils.isValid(name))
continue;
val = capability.getAttributes().get("platform");
@ -66,7 +74,7 @@ public class DeployedConnectionCustomizer implements BundleTrackerCustomizer<Man
.bundleId(bundle.getBundleId());
result.managedConnections.add(mc);
}
listener.addded(result);
listener.added(result);
return result;
}
@ -78,6 +86,7 @@ public class DeployedConnectionCustomizer implements BundleTrackerCustomizer<Man
@Override
public void removedBundle(Bundle bundle, BundleEvent event, ManagedConnections object) {
log.debug("BUNDLE [{}] REMOVING", bundle.getBundleId());
listener.removed(object);
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>management</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>

View File

@ -23,6 +23,7 @@ import ru.entaxy.esb.platform.runtime.base.connecting.connection.Connection;
import java.util.List;
@Deprecated
public interface ConnectionManager {
/*
@Deprecated

View File

@ -37,8 +37,11 @@ import ru.entaxy.esb.platform.runtime.base.connecting.generator.Generated;
import ru.entaxy.esb.platform.runtime.base.connecting.producer.connection.util.ConnectionProducerUtil;
import ru.entaxy.esb.platform.runtime.core.management.connection.api.ConnectionManager;
import ru.entaxy.platform.core.artifact.Artifact;
import ru.entaxy.platform.core.artifact.ArtifactManifest;
import ru.entaxy.platform.core.artifact.Artifacts;
import ru.entaxy.platform.core.artifact.DeployedArtifact;
import ru.entaxy.platform.core.artifact.Manifested;
import ru.entaxy.platform.core.artifact.capabilities.ManifestCapabilityHelper;
import ru.entaxy.platform.core.artifact.installer.builder.Installer;
import ru.entaxy.platform.core.artifact.installer.builder.typed.BlueprintInstaller;
import ru.entaxy.platform.core.artifact.service.ArtifactService;
@ -155,9 +158,16 @@ public class ConnectionManagerImpl implements ConnectionManager {
.timestampedVersion(version)
.groupId(Artifact.DEFAULT_RUNTIME_GROUP_ID + "." + type)
.artifactId(type + "-" + name);
artifact.provideCapability(artifact.getCoordinates().getGroupId())
.attribute("name",connection.getName())
.attribute("platform", connection.isPlatform()?"true":"false");
if (artifact.isManifested()) {
ArtifactManifest manifest = ((Manifested)artifact).getManifest();
ManifestCapabilityHelper capabilityHelper = new ManifestCapabilityHelper(manifest);
capabilityHelper.provideCapability(artifact.getCoordinates().getGroupId())
.attribute("name",connection.getName())
.attribute("platform", connection.isPlatform()?"true":"false");
capabilityHelper.save();
}
log.info("Artifact of category [{}] is prepared: [{}]", artifact.getCategory(), artifact.getCoordinates());
return artifact;
} else {

View File

@ -3,11 +3,10 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>management</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>
<artifactId>node-management</artifactId>
<version>1.8.1</version>
<packaging>bundle</packaging>
<name>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: MANAGEMENT :: NODE MANAGEMENT </name>
<description>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: MANAGEMENT :: NODE MANAGEMENT </description>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime</groupId>
<artifactId>core</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>management</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>

View File

@ -52,14 +52,14 @@ public class ConnectorManagerAdapter implements ru.entaxy.esb.platform.core.mana
ConnectorService connectorService;
@Override
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> paramaters)
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> parameters)
throws Exception {
System system = getSystemByIdOrName(idOrName);
if (system == null)
throw new IllegalArgumentException("System not found by Id or Name [" + idOrName + "]");
ConnectorDto connectorDto = new ConnectorDto();
connectorDto.setConnectorParams(paramaters);
connectorDto.setConnectorParams(parameters);
connectorDto.setSystemUuid(system.getUuid());
connectorDto.setTemplateName(connectorFactoryId);

View File

@ -85,7 +85,7 @@ public class PermissionManagerAdapter implements ru.entaxy.esb.platform.core.man
}
@Override
public void createPremission(String objectId, String subjectId) throws Exception {
public void createPermission(String objectId, String subjectId) throws Exception {
PermissionDto dto = new PermissionDto(objectId, subjectId);
permissionManager.createPermission(dto);
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>management</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.management</groupId>

View File

@ -24,10 +24,11 @@ import ru.entaxy.esb.platform.base.management.core.api.Attribute;
import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated;
import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy;
import ru.entaxy.esb.platform.base.management.core.api.Operation;
import ru.entaxy.esb.platform.base.management.core.api.RuntimeTypedMBean;
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBean;
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
public interface ConnectorMBean extends BundleAwareMBean {
public interface ConnectorMBean extends BundleAwareMBean, RuntimeTypedMBean {
public static interface Helper {

View File

@ -20,9 +20,10 @@
package ru.entaxy.esb.platform.core.management.profile;
import ru.entaxy.esb.platform.base.management.core.Qualifier;
import ru.entaxy.esb.platform.base.management.core.api.RuntimeTypedMBean;
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBean;
public interface DefaultRouteMBean extends BundleAwareMBean {
public interface DefaultRouteMBean extends BundleAwareMBean, RuntimeTypedMBean {
public static interface Helper {

View File

@ -30,10 +30,11 @@ import ru.entaxy.esb.platform.base.management.core.api.MBeanAnnotated;
import ru.entaxy.esb.platform.base.management.core.api.MBeanExportPolicy;
import ru.entaxy.esb.platform.base.management.core.api.Operation;
import ru.entaxy.esb.platform.base.management.core.api.Parameter;
import ru.entaxy.esb.platform.base.management.core.api.RuntimeTypedMBean;
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBean;
@MBeanAnnotated(policy = MBeanExportPolicy.ANNOTATION_ENRICH)
public interface ProfileMBean extends BundleAwareMBean {
public interface ProfileMBean extends BundleAwareMBean, RuntimeTypedMBean {
public static interface Helper {
@ -66,7 +67,7 @@ public interface ProfileMBean extends BundleAwareMBean {
@Operation(desc = "Adds connector to profile")
public void addConnector(
@Parameter(name = "factoryId", desc = "Connector factory ID") String connectorFactoryId
, @Parameter(name = "parameters", desc = "Connector parameters") Map<String, String> paramaters) throws Exception;
, @Parameter(name = "parameters", desc = "Connector parameters") Map<String, String> parameters) throws Exception;
@Operation(desc = "Removes connector from profile")
public void removeConnector(

View File

@ -23,7 +23,7 @@ import java.util.Map;
public interface ConnectorManager {
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> paramaters) throws Exception;
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> parameters) throws Exception;
public void removeConnector(String idOrName, String connectorName) throws Exception;

View File

@ -27,6 +27,6 @@ public interface PermissionManager {
public List<String> getSubjectPermissions(String subjectId) throws Exception;
public void createPremission(String objectId, String subjectId) throws Exception;
public void createPermission(String objectId, String subjectId) throws Exception;
}

View File

@ -30,6 +30,7 @@ import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBeanImpl;
import ru.entaxy.esb.platform.core.management.profile.ProfileMBean;
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
@ -37,6 +38,8 @@ import ru.entaxy.esb.system.auth.basic.jpa.api.entity.BasicAuthAccount;
import ru.entaxy.esb.system.jpa.entity.System;
import ru.entaxy.platform.base.support.CommonUtils;
// @TODO move string to constant
@EntaxyRuntimeTyped(name = "entaxy.runtime.profile")
public class ProfileMBeanImpl extends BundleAwareMBeanImpl<ManagedProfile, ProfileMBean> implements ProfileMBean {
private static final Logger log = LoggerFactory.getLogger(ProfileMBeanImpl.class);
@ -88,8 +91,8 @@ public class ProfileMBeanImpl extends BundleAwareMBeanImpl<ManagedProfile, Profi
}
@Override
public void addConnector(String connectorFactoryId, Map<String, String> paramaters) throws Exception {
this.helpers.connectorHelper.addConnector(getName(), connectorFactoryId, paramaters);
public void addConnector(String connectorFactoryId, Map<String, String> parameters) throws Exception {
this.helpers.connectorHelper.addConnector(getName(), connectorFactoryId, parameters);
}
@Override
@ -129,12 +132,12 @@ public class ProfileMBeanImpl extends BundleAwareMBeanImpl<ManagedProfile, Profi
@Override
public void allowSource(String idOrName) throws Exception {
helpers.permissionHelper.createPremission(idOrName, getUuid());
helpers.permissionHelper.createPermission(idOrName, getUuid());
}
@Override
public void allowTarget(String idOrName) throws Exception {
helpers.permissionHelper.createPremission(getUuid(), idOrName);
helpers.permissionHelper.createPermission(getUuid(), idOrName);
}

View File

@ -67,7 +67,7 @@ public class ConnectorHelperImpl implements ConnectorHelper {
}
@Override
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> paramaters)
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> parameters)
throws Exception {
throw new OperationNotSupportedException(EXPLANATION);
}
@ -95,9 +95,9 @@ public class ConnectorHelperImpl implements ConnectorHelper {
@Override
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> paramaters)
public void addConnector(String idOrName, String connectorFactoryId, Map<String, String> parameters)
throws Exception {
getEffectiveConnectorManager().addConnector(idOrName, connectorFactoryId, paramaters);
getEffectiveConnectorManager().addConnector(idOrName, connectorFactoryId, parameters);
}
@Override

View File

@ -23,10 +23,13 @@ import javax.management.NotCompliantMBeanException;
import org.osgi.framework.BundleContext;
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBeanImpl;
import ru.entaxy.esb.platform.core.management.profile.ConnectorMBean;
import ru.entaxy.esb.platform.core.management.profile.impl.helper.Helpers;
//@TODO move string to constant
@EntaxyRuntimeTyped(name = "entaxy.runtime.connector")
public class ConnectorMBeanImpl extends BundleAwareMBeanImpl<ManagedConnector, ConnectorMBean> implements ConnectorMBean {
protected Helpers helpers;

View File

@ -59,7 +59,7 @@ public class PermissionHelperImpl implements PermissionHelper {
throw new OperationNotSupportedException(EXPLANATION); }
@Override
public void createPremission(String objectId, String subjectId) throws Exception {
public void createPermission(String objectId, String subjectId) throws Exception {
throw new OperationNotSupportedException(EXPLANATION); }
};
}
@ -96,8 +96,8 @@ public class PermissionHelperImpl implements PermissionHelper {
}
@Override
public void createPremission(String objectId, String subjectId) throws Exception {
getEffectivePermissionManager().createPremission(objectId, subjectId);
public void createPermission(String objectId, String subjectId) throws Exception {
getEffectivePermissionManager().createPermission(objectId, subjectId);
}
}

View File

@ -23,9 +23,12 @@ import javax.management.NotCompliantMBeanException;
import org.osgi.framework.BundleContext;
import ru.entaxy.esb.platform.base.management.core.api.EntaxyRuntimeTyped;
import ru.entaxy.esb.platform.base.management.core.utils.BundleAwareMBeanImpl;
import ru.entaxy.esb.platform.core.management.profile.DefaultRouteMBean;
//@TODO move string to constant
@EntaxyRuntimeTyped(name = "entaxy.runtime.default-route")
public class DefaultRouteMBeanImpl extends BundleAwareMBeanImpl<ManagedRoute, DefaultRouteMBean> implements DefaultRouteMBean {