release version 1.12.0
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>object-runtime</artifactId>
|
||||
<version>1.11.0</version>
|
||||
<version>1.12.0</version>
|
||||
</parent>
|
||||
<artifactId>object-runtime-shell</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
@@ -34,6 +34,10 @@
|
||||
<artifactId>object-runtime-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.cave.repository</groupId>
|
||||
<artifactId>org.apache.karaf.cave.repository.api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2026 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.objects.runtime.shell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.karaf.cave.repository.RepositorySearchService;
|
||||
import org.apache.karaf.cave.repository.SearchRequest;
|
||||
import org.apache.karaf.cave.repository.SearchResult;
|
||||
import org.apache.karaf.shell.api.action.Action;
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Reference;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
|
||||
import ru.entaxy.platform.base.support.karaf.shell.ShellTableExt;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectUtils;
|
||||
|
||||
@Service
|
||||
@Command(name = "container-available-versions", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE,
|
||||
description = "Get container info")
|
||||
public class ContainerIAvailableVersions extends ContainerAwareCommand implements Action {
|
||||
|
||||
@Reference
|
||||
RepositorySearchService repositorySearchService;
|
||||
|
||||
@Override
|
||||
protected Object doExecute(EntaxyRuntimeObjectContainer container) {
|
||||
|
||||
String url = container.getUrl();
|
||||
url = EntaxyRuntimeObjectUtils.extractMavenUrl(url);
|
||||
if (url == null || url.isBlank()) {
|
||||
System.out.println("Container url is not maven: " + url);
|
||||
return null;
|
||||
}
|
||||
|
||||
SearchRequest request = EntaxyRuntimeObjectUtils.createRequest(url);
|
||||
|
||||
ShellTableExt table = new ShellTableExt();
|
||||
table.column("Installed");
|
||||
table.column("Version");
|
||||
table.column("Last modified");
|
||||
table.column("Repository");
|
||||
|
||||
String currentVersion = request.getVersion();
|
||||
request.version(null);
|
||||
|
||||
List<SearchResult> result = repositorySearchService.search(request);
|
||||
if (result != null) {
|
||||
for (SearchResult sr : result) {
|
||||
table.addRow().addContent(
|
||||
currentVersion.equals(sr.getVersion()) ? "*" : "",
|
||||
sr.getVersion(),
|
||||
sr.lastModified,
|
||||
sr.getRepositoryName());
|
||||
}
|
||||
}
|
||||
|
||||
table.print(System.out);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
@@ -25,7 +25,6 @@
|
||||
*/
|
||||
package ru.entaxy.platform.objects.runtime.shell;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Action;
|
||||
@@ -35,46 +34,49 @@ import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
|
||||
@Service
|
||||
@Command(name = "container-info", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Get container info")
|
||||
@Command(name = "container-info", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE,
|
||||
description = "Get container info")
|
||||
public class ContainerInfo extends ContainerAwareCommand implements Action {
|
||||
|
||||
|
||||
@Override
|
||||
protected Object doExecute(EntaxyRuntimeObjectContainer container) {
|
||||
String message = "Container Info for ".concat(containerName)
|
||||
.concat("\n----------------------------------------")
|
||||
.concat("\nID: ".concat(container.getId()))
|
||||
.concat("\nTYPE: ".concat(container.getType()))
|
||||
.concat("\nNAME: ".concat(container.getName()))
|
||||
.concat("\nOBJECTS: ")
|
||||
.concat(
|
||||
container.getObjects().stream()
|
||||
.map(obj -> ("\n\t"+obj.getObjectFullId()))
|
||||
.collect(Collectors.joining())
|
||||
.concat("\nPARENT CONTAINERS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getParentContainers(), "\n\t")
|
||||
)
|
||||
.concat("\nDEPENDENCIES: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getDependencies(), "\n\t")
|
||||
)
|
||||
.concat("\nCHILD CONTAINERS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getChildContainers(), "\n\t")
|
||||
)
|
||||
.concat("\nDEPENDENTS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getDependent(), "\n\t")
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
|
||||
// output to console
|
||||
System.out.println(message);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doExecute(EntaxyRuntimeObjectContainer container) {
|
||||
String message = "Container Info for ".concat(containerName)
|
||||
.concat("\n----------------------------------------")
|
||||
.concat("\nID: ".concat(container.getId()))
|
||||
.concat("\nTYPE: ".concat(container.getType()))
|
||||
.concat("\nNAME: ".concat(container.getName()))
|
||||
.concat("\nURL: ".concat(container.getUrl()))
|
||||
.concat("\nVERSION: ".concat(container.getVersion().toString()))
|
||||
.concat("\nOBJECTS: ")
|
||||
.concat(
|
||||
container.getObjects().stream()
|
||||
.map(obj -> ("\n\t" + obj.getObjectFullId()))
|
||||
.collect(Collectors.joining())
|
||||
.concat("\nPARENT CONTAINERS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils
|
||||
.getContainerListPrintString(container.getParentContainers(), "\n\t"))
|
||||
.concat("\nDEPENDENCIES: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getDependencies(),
|
||||
"\n\t"))
|
||||
.concat("\nCHILD CONTAINERS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils
|
||||
.getContainerListPrintString(container.getChildContainers(), "\n\t"))
|
||||
.concat("\nDEPENDENTS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getContainerListPrintString(container.getDependent(),
|
||||
"\n\t"))
|
||||
|
||||
);
|
||||
|
||||
|
||||
// output to console
|
||||
System.out.println(message);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
@@ -38,6 +38,7 @@ import org.apache.karaf.shell.support.table.ShellTable;
|
||||
import ru.entaxy.platform.base.support.JSONUtils;
|
||||
import ru.entaxy.platform.base.support.karaf.shell.ShellTableExt;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectClusterInfo;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectContainer;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectResource;
|
||||
|
||||
@@ -50,6 +51,8 @@ public class ObjectInfo extends RuntimeObjectAwareCommand {
|
||||
|
||||
EntaxyRuntimeObjectContainer container = entaxyObject.getContainer();
|
||||
|
||||
EntaxyRuntimeObjectClusterInfo clusterInfo = objectService.getClusterInfo(entaxyObject.getObjectFullId());
|
||||
|
||||
String message = "Object Info for ".concat(entaxyObject.getObjectFullId())
|
||||
.concat("\n----------------------------------------")
|
||||
.concat("\nID: ".concat(entaxyObject.getId()))
|
||||
@@ -80,7 +83,13 @@ public class ObjectInfo extends RuntimeObjectAwareCommand {
|
||||
.concat("\nDEPENDENTS: ")
|
||||
.concat(
|
||||
RuntimeObjectShellUtils.getRelationListDependentPrintString(
|
||||
RuntimeObjectShellUtils.getObjectIncomingDependenciesAndUses(entaxyObject), "\n\t"));
|
||||
RuntimeObjectShellUtils.getObjectIncomingDependenciesAndUses(entaxyObject), "\n\t"))
|
||||
.concat("\nDEPLOYMENT: ")
|
||||
.concat(clusterInfo == null || clusterInfo.isLocal() ? "local" : "cluster")
|
||||
.concat("\nCLUSTER GROUPS: ")
|
||||
.concat(clusterInfo == null || clusterInfo.isLocal() ? ""
|
||||
: clusterInfo.getGroups().stream().map(g -> g.getGroupString())
|
||||
.collect(Collectors.joining(", ")));
|
||||
|
||||
// object resources
|
||||
ShellTable table = new ShellTable();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
@@ -25,6 +25,9 @@
|
||||
*/
|
||||
package ru.entaxy.platform.objects.runtime.shell;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Option;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Reference;
|
||||
import org.apache.karaf.shell.support.table.ShellTable;
|
||||
@@ -36,102 +39,109 @@ import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationRe
|
||||
|
||||
public abstract class ObjectOperationCommand extends RuntimeObjectAwareCommand {
|
||||
|
||||
@Option(name = "-f", required = false, description = "Force action on affected objects")
|
||||
boolean force;
|
||||
|
||||
@Option(name = "-s", required = false, description = "Skip action on affected objects")
|
||||
boolean soft;
|
||||
|
||||
@Reference
|
||||
EntaxyRuntimeObjectManager objectManager;
|
||||
@Option(name = "-f", required = false, description = "Force action on affected objects")
|
||||
boolean force;
|
||||
|
||||
@Override
|
||||
public Object doExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
OperationResult result = doTargetExecute(entaxyObject);
|
||||
|
||||
// output result
|
||||
System.out.println("\t -> " + result.getResult().name());
|
||||
@Option(name = "-s", required = false, description = "Skip action on affected objects")
|
||||
boolean soft;
|
||||
|
||||
switch (result.getResult()) {
|
||||
case DONE:
|
||||
|
||||
break;
|
||||
case REQUEST:
|
||||
outputForRequest(result, entaxyObject);
|
||||
break;
|
||||
case BLOCKED:
|
||||
outputForBlocked(result, entaxyObject);
|
||||
break;
|
||||
case FAILED:
|
||||
outputForFailed(result, entaxyObject);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected abstract OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject) throws Exception;
|
||||
|
||||
protected void outputForRequest(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key: result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nOperation should be applied to the following affected objects:");
|
||||
table.print(System.out);
|
||||
|
||||
String message = "\n"
|
||||
.concat("Use\n")
|
||||
.concat("\t-f option to apply all operations on affected objects\n")
|
||||
.concat("or\n")
|
||||
.concat("\t-s option to skip all operations on affected objects\n");
|
||||
|
||||
// output
|
||||
System.out.println(message);
|
||||
}
|
||||
@Option(name = "-g", required = false, description = "Cluster groups to apply action")
|
||||
String[] clusterGroups;
|
||||
|
||||
protected void outputForBlocked(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key: result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nThe following operations must be applied before invoking the current one:");
|
||||
table.print(System.out);
|
||||
|
||||
}
|
||||
@Reference
|
||||
EntaxyRuntimeObjectManager objectManager;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Object doExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
|
||||
List<String> operationTarget = clusterGroups == null ? null : Arrays.asList(clusterGroups);
|
||||
|
||||
OperationResult result = doTargetExecute(entaxyObject, operationTarget);
|
||||
|
||||
// output result
|
||||
System.out.println("\t -> " + result.getResult().name());
|
||||
|
||||
switch (result.getResult()) {
|
||||
case DONE:
|
||||
|
||||
break;
|
||||
case REQUEST:
|
||||
outputForRequest(result, entaxyObject);
|
||||
break;
|
||||
case BLOCKED:
|
||||
outputForBlocked(result, entaxyObject);
|
||||
break;
|
||||
case FAILED:
|
||||
outputForFailed(result, entaxyObject);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected abstract OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject, List<String> target)
|
||||
throws Exception;
|
||||
|
||||
protected void outputForRequest(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key : result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nOperation should be applied to the following affected objects:");
|
||||
table.print(System.out);
|
||||
|
||||
String message = "\n"
|
||||
.concat("Use\n")
|
||||
.concat("\t-f option to apply all operations on affected objects\n")
|
||||
.concat("or\n")
|
||||
.concat("\t-s option to skip all operations on affected objects\n");
|
||||
|
||||
// output
|
||||
System.out.println(message);
|
||||
}
|
||||
|
||||
protected void outputForBlocked(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key : result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nThe following operations must be applied before invoking the current one:");
|
||||
table.print(System.out);
|
||||
|
||||
}
|
||||
|
||||
protected void outputForFailed(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
|
||||
// Output info
|
||||
System.out.println(
|
||||
"Operation failed with "
|
||||
.concat(CommonUtils.isValid(result.getMessage()) ? "the following " : "no ")
|
||||
.concat("message")
|
||||
.concat(
|
||||
CommonUtils.isValid(result.getMessage())
|
||||
? (": ".concat(result.getMessage()))
|
||||
: "."));
|
||||
|
||||
if (!result.getAffected().isEmpty()) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key : result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nThe following suboperations failed:");
|
||||
table.print(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
protected void outputForFailed(OperationResult result, EntaxyRuntimeObject entaxyObject) {
|
||||
|
||||
// Output info
|
||||
System.out.println(
|
||||
"Operation failed with "
|
||||
.concat(CommonUtils.isValid(result.getMessage())?"the following ":"no ")
|
||||
.concat("message")
|
||||
.concat(
|
||||
CommonUtils.isValid(result.getMessage())
|
||||
?(": ".concat(result.getMessage()))
|
||||
:"."
|
||||
)
|
||||
);
|
||||
|
||||
if (!result.getAffected().isEmpty()) {
|
||||
ShellTable table = new ShellTable();
|
||||
table.column("Object");
|
||||
table.column("Action");
|
||||
for (String key: result.getAffected().keySet())
|
||||
table.addRow().addContent(key, result.getAffected().get(key).name());
|
||||
|
||||
// output
|
||||
System.out.println("\nThe following suboperations failed:");
|
||||
table.print(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
package ru.entaxy.platform.objects.runtime.shell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
|
||||
@@ -35,19 +37,19 @@ import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationRe
|
||||
@Command(name = "object-start", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Start object")
|
||||
public class ObjectStart extends ObjectOperationCommand {
|
||||
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.startForced(entaxyObject.getObjectFullId());
|
||||
else if (soft)
|
||||
result = objectManager.startSoft(entaxyObject.getObjectFullId());
|
||||
else
|
||||
result = objectManager.start(entaxyObject.getObjectFullId());
|
||||
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject, List<String> target) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.startForced(entaxyObject.getObjectFullId(), target);
|
||||
else if (soft)
|
||||
result = objectManager.startSoft(entaxyObject.getObjectFullId(), target);
|
||||
else
|
||||
result = objectManager.start(entaxyObject.getObjectFullId(), target);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
package ru.entaxy.platform.objects.runtime.shell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
|
||||
@@ -35,19 +37,19 @@ import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationRe
|
||||
@Command(name = "object-stop", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Stop object")
|
||||
public class ObjectStop extends ObjectOperationCommand {
|
||||
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.stopForced(entaxyObject.getObjectFullId());
|
||||
else if (soft)
|
||||
result = objectManager.stopSoft(entaxyObject.getObjectFullId());
|
||||
else
|
||||
result = objectManager.stop(entaxyObject.getObjectFullId());
|
||||
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject, List<String> target) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.stopForced(entaxyObject.getObjectFullId(), target);
|
||||
else if (soft)
|
||||
result = objectManager.stopSoft(entaxyObject.getObjectFullId(), target);
|
||||
else
|
||||
result = objectManager.stop(entaxyObject.getObjectFullId(), target);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
package ru.entaxy.platform.objects.runtime.shell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.karaf.shell.api.action.Command;
|
||||
import org.apache.karaf.shell.api.action.lifecycle.Service;
|
||||
|
||||
@@ -32,22 +34,23 @@ import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObject;
|
||||
import ru.entaxy.platform.objects.runtime.EntaxyRuntimeObjectManager.OperationResult;
|
||||
|
||||
@Service
|
||||
@Command(name = "object-uninstall", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE, description = "Uninstall object")
|
||||
@Command(name = "object-uninstall", scope = EntaxyRuntimeObjectServiceSupport.OBJECTS_SCOPE,
|
||||
description = "Uninstall object")
|
||||
public class ObjectUninstall extends ObjectOperationCommand {
|
||||
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.uninstallForced(entaxyObject.getObjectFullId());
|
||||
else if (soft)
|
||||
result = objectManager.uninstallSoft(entaxyObject.getObjectFullId());
|
||||
else
|
||||
result = objectManager.uninstall(entaxyObject.getObjectFullId());
|
||||
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
protected OperationResult doTargetExecute(EntaxyRuntimeObject entaxyObject, List<String> target) throws Exception {
|
||||
|
||||
OperationResult result;
|
||||
|
||||
if (force)
|
||||
result = objectManager.uninstallForced(entaxyObject.getObjectFullId(), target);
|
||||
else if (soft)
|
||||
result = objectManager.uninstallSoft(entaxyObject.getObjectFullId(), target);
|
||||
else
|
||||
result = objectManager.uninstall(entaxyObject.getObjectFullId(), target);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* test-producers
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* object-runtime-shell
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2025 EmDev LLC
|
||||
* Copyright (C) 2020 - 2026 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
|
||||
|
||||
Reference in New Issue
Block a user