ENTAXY-480 release version 1.8.3

This commit is contained in:
2023-08-03 04:44:09 +03:00
parent 603889d627
commit 5844a2e5cf
2546 changed files with 11242 additions and 207556 deletions

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
<artifactId>object-producing</artifactId>
<version>1.8.2.2</version>
<version>1.8.3</version>
</parent>
<groupId>ru.entaxy.esb.platform.runtime.core.object-producing</groupId>
<artifactId>object-producing-management</artifactId>

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -25,6 +25,7 @@ import javax.management.openmbean.OpenDataException;
import javax.management.openmbean.TabularData;
import ru.entaxy.esb.platform.base.management.core.Qualifier;
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;
@ -41,6 +42,28 @@ public interface FactoryMBean {
return ProducerMBean.getQualifier(factoryType).attribute(FACTORY_KEY, factoryId);
}
@Attribute
boolean isAbstract();
@Attribute
boolean isDeprecated();
@Attribute
String getId();
@Attribute
String getType();
@Attribute
String getParent();
@Attribute
String getDisplayName();
@Attribute
String getDescription();
@Attribute
String getCategory();
@Attribute
String getLabel();
@Attribute
Map<String, Object> getTypeInfo();
@Operation(desc = "Creates and installs a new object")
public TabularData createObject(
@Parameter(name = "objectId", desc = "ObjectId for new object, can be omitted in some cases")
@ -50,6 +73,18 @@ public interface FactoryMBean {
@Parameter(name = "properties", desc = "Properties of the new object in JSON format")
Map<String, Object> properties
) throws EntaxyFactoryException, OpenDataException;
@Operation(desc = "Creates and installs a new object")
public TabularData createObjectByInstructions(
@Parameter(name = "objectId", desc = "ObjectId for new object, can be omitted in some cases")
String objectId,
@Parameter(name = "scope", desc = "Scope of the new object, 'public' by default")
String scope,
@Parameter(name = "instructions", desc = "Build instructions in JSON format, {\"install\":{}, \"store\":{}} by default")
Map<String, Object> instructions,
@Parameter(name = "properties", desc = "Properties of the new object in JSON format")
Map<String, Object> properties
) throws EntaxyFactoryException, OpenDataException;
@Operation(desc = "Get fields for creating a new object")
public String getFields(@Parameter(name = "outputType", desc = "Type of output") String outputType);

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,6 +19,7 @@
*/
package ru.entaxy.platform.core.producer.management.impl;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
@ -45,6 +46,7 @@ import ru.entaxy.platform.base.objects.EntaxyObject;
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
import ru.entaxy.platform.base.objects.factory.EntaxyFactory.SCOPE;
import ru.entaxy.platform.base.objects.factory.EntaxyFactoryException;
import ru.entaxy.platform.base.objects.factory.exceptions.NotSupportedForAbstractFactory;
import ru.entaxy.platform.base.support.CommonUtils;
import ru.entaxy.platform.core.producer.api.EntaxyProducerService;
import ru.entaxy.platform.core.producer.api.ProducerResult;
@ -62,8 +64,69 @@ public class FactoryMBeanImpl extends AnnotatedMBean<FactoryMBean> implements Fa
this.entaxyFactory = entaxyFactory;
}
@Override
public boolean isAbstract() {
return this.entaxyFactory.isAbstract();
}
@Override
public boolean isDeprecated() {
return this.entaxyFactory.isDeprecated();
}
@Override
public String getId() {
return this.entaxyFactory.getId();
}
@Override
public String getType() {
return this.entaxyFactory.getType();
}
@Override
public String getParent() {
return this.entaxyFactory.getParent();
}
@Override
public String getDisplayName() {
return this.entaxyFactory.getDisplayName();
}
@Override
public String getDescription() {
return this.entaxyFactory.getDescription();
}
@Override
public String getCategory() {
return this.entaxyFactory.getCategory();
}
@Override
public String getLabel() {
return this.entaxyFactory.getLabel();
}
@Override
public Map<String, Object> getTypeInfo() {
return this.entaxyFactory.getTypeInfo();
}
@Override
public TabularData createObject(String objectId, String scope, Map<String, Object> properties) throws EntaxyFactoryException, OpenDataException {
return createObjectByInstructions(objectId, scope, Collections.emptyMap(), properties);
}
@Override
public TabularData createObjectByInstructions(String objectId, String scope, Map<String, Object> instructions, Map<String, Object> properties) throws EntaxyFactoryException, OpenDataException {
if (this.isAbstract()) {
throw new NotSupportedForAbstractFactory(entaxyFactory, "createObject");
}
log.debug("\n\tCREATE OBJECT with \nid: [{}] \nscope: [{}] \nproperties: [{}]"
, CommonUtils.getValid(objectId, "null")
, CommonUtils.getValid(scope, SCOPE.PUBLIC.label)
@ -79,6 +142,13 @@ public class FactoryMBeanImpl extends AnnotatedMBean<FactoryMBean> implements Fa
if (CommonUtils.isValid(objectId))
configuration.addProperty(EntaxyObject.FIELDS.OBJECT_ID, objectId);
String instructionsString = "{\"install\": {}, \"store\":{}}";
if ((instructions != null) && !instructions.isEmpty()) {
JsonElement jo = (new Gson()).toJsonTree(instructions);
if (jo.isJsonObject())
instructionsString = jo.toString();
}
configuration.addProperty(EntaxyObject.FIELDS.FACTORY_ID, this.entaxyFactory.getFactoryId());
configuration.addProperty(EntaxyObject.FIELDS.OBJECT_TYPE, this.entaxyFactory.getFactoryType());
@ -87,7 +157,7 @@ public class FactoryMBeanImpl extends AnnotatedMBean<FactoryMBean> implements Fa
JsonElement propertiesValue = (new Gson()).toJsonTree(properties);
configuration.add(EntaxyObject.FIELDS.PROPERTIES, propertiesValue);
ProducerResult result = producerService.produce(configuration, "{\"install\": {}, \"store\":{}}");
ProducerResult result = producerService.produce(configuration, instructionsString);
CompositeType compositeType = new CompositeType(
"CommandResult"
@ -127,4 +197,5 @@ public class FactoryMBeanImpl extends AnnotatedMBean<FactoryMBean> implements Fa
}).collect(Collectors.toList()).toString();
}
}

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -59,7 +59,13 @@ public class FactoryMBeanPublisher {
props.put(ManagementCore.JMX_OBJECTNAME
, FactoryMBean.getQualifier(factory.getId(), factory.getType()).getValue());
result.add(this.bundleContext.registerService(FactoryMBean.class, service, props));
// catch and ignore exception typical for bundle refreshing process
try {
result.add(this.bundleContext.registerService(FactoryMBean.class, service, props));
} catch (IllegalStateException e) {
if (!CommonUtils.isValid(e.getMessage()) || !e.getMessage().contains("Invalid BundleContext"))
throw e;
}
if (CommonUtils.isValid(factory.getCategory())) {
props.put(ManagementCore.JMX_OBJECTNAME

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
* ~~~~~~licensing~~~~~~
* object-producing-management
* ==========
* Copyright (C) 2020 - 2022 EmDev LLC
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.