Skip to content

Commit

Permalink
Implemented the methods to start, stop and restart subsystems instances;
Browse files Browse the repository at this point in the history
New messages created in pt (my language). All the others were created in English.
  • Loading branch information
douglascrp authored and AFaust committed Mar 23, 2020
1 parent 53e2795 commit 442bf9f
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ ootbee-support-tools.command-console.subsystems.listProperties.description=Lists
ootbee-support-tools.command-console.subsystems.setProperty.description=Modifies the value of a property in a subsystem instance
ootbee-support-tools.command-console.subsystems.setProperties.description=Modifies the values of multiple properties in a subsystem instance
ootbee-support-tools.command-console.subsystems.removeProperties.description=Removes a list of properties in a subsystem instance (does not reset to their default configured values)
ootbee-support-tools.command-console.subsystems.revert.description=Resets all properties in a subsystem instance to their default configured values
ootbee-support-tools.command-console.subsystems.revert.description=Resets all properties in a subsystem instance to their default configured values
ootbee-support-tools.command-console.subsystems.stop.description=Stops an subsystem instance, if running
ootbee-support-tools.command-console.subsystems.start.description=Starts an subsystem instance, if stopped
ootbee-support-tools.command-console.subsystems.restart.description=Restarts an subsystem instance, if running
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ ootbee-support-tools.command-console.subsystems.listProperties.description=Liste
ootbee-support-tools.command-console.subsystems.setProperty.description=\u00C4ndert den Wert einer Einstellung einer Subsystem-Instanz.
ootbee-support-tools.command-console.subsystems.setProperties.description=\u00C4ndert die Werte mehrerer Einstellungen einer Subsystem-Instanz.
ootbee-support-tools.command-console.subsystems.removeProperties.description=Entfernt mehrere Einstellungen einer Subsystem-Instanz (kein Zur\u00fccksetzen auf Standardwerte.
ootbee-support-tools.command-console.subsystems.revert.description=Setzt alle Einstellungen einer Subsystem-Instanz auf die Standardwerte zur\u00fcck.
ootbee-support-tools.command-console.subsystems.revert.description=Setzt alle Einstellungen einer Subsystem-Instanz auf die Standardwerte zur\u00fcck.
ootbee-support-tools.command-console.subsystems.stop.description=Stops an subsystem instance, if running
ootbee-support-tools.command-console.subsystems.start.description=Starts an subsystem instance, if stopped
ootbee-support-tools.command-console.subsystems.restart.description=Restarts an subsystem instance, if running
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ ootbee-support-tools.command-console.subsystems.listProperties.description=Lists
ootbee-support-tools.command-console.subsystems.setProperty.description=Modifies the value of a property in a subsystem instance
ootbee-support-tools.command-console.subsystems.setProperties.description=Modifies the values of multiple properties in a subsystem instance
ootbee-support-tools.command-console.subsystems.removeProperties.description=Removes a list of properties in a subsystem instance (does not reset to their default configured values)
ootbee-support-tools.command-console.subsystems.revert.description=Resets all properties in a subsystem instance to their default configured values
ootbee-support-tools.command-console.subsystems.revert.description=Resets all properties in a subsystem instance to their default configured values
ootbee-support-tools.command-console.subsystems.stop.description=Stops an subsystem instance, if running
ootbee-support-tools.command-console.subsystems.start.description=Starts an subsystem instance, if stopped
ootbee-support-tools.command-console.subsystems.restart.description=Restarts an subsystem instance, if running
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ ootbee-support-tools.command-console.subsystems.listProperties.description=Lista
ootbee-support-tools.command-console.subsystems.setProperty.description=Modifica el valor de una propiedad en una instancia de un subsistema
ootbee-support-tools.command-console.subsystems.setProperties.description=Modifica los valores de propiedades m\u00FAltiples en una instancia de un subsistema
ootbee-support-tools.command-console.subsystems.removeProperties.description=Elimina una lista de propiedades en una instancia de un subsistema, pero no las devuelve a su valor configurado por defecto
ootbee-support-tools.command-console.subsystems.revert.description=Recupera todas las propiedades en una instancia de un subsistema a sus valores configurados por defecto
ootbee-support-tools.command-console.subsystems.revert.description=Recupera todas las propiedades en una instancia de un subsistema a sus valores configurados por defecto
ootbee-support-tools.command-console.subsystems.stop.description=Stops an subsystem instance, if running
ootbee-support-tools.command-console.subsystems.start.description=Starts an subsystem instance, if stopped
ootbee-support-tools.command-console.subsystems.restart.description=Restarts an subsystem instance, if running
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ ootbee-support-tools.command-console.subsystems.listProperties.description=Lists
ootbee-support-tools.command-console.subsystems.setProperty.description=Modifies the value of a property in a subsystem instance
ootbee-support-tools.command-console.subsystems.setProperties.description=Modifies the values of multiple properties in a subsystem instance
ootbee-support-tools.command-console.subsystems.removeProperties.description=Removes a list of properties in a subsystem instance (does not reset to their default configured values)
ootbee-support-tools.command-console.subsystems.revert.description=Resets all properties in a subsystem instance to their default configured values
ootbee-support-tools.command-console.subsystems.revert.description=Resets all properties in a subsystem instance to their default configured values
ootbee-support-tools.command-console.subsystems.stop.description=Stops an subsystem instance, if running
ootbee-support-tools.command-console.subsystems.start.description=Starts an subsystem instance, if stopped
ootbee-support-tools.command-console.subsystems.restart.description=Restarts an subsystem instance, if running
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ ootbee-support-tools.command-console.subsystems.setProperty.description=Modifica
ootbee-support-tools.command-console.subsystems.setProperties.description=Modifica o valor de m\u00faltiplas propriedades de uma inst\u00e2ncia de um susbsistema
ootbee-support-tools.command-console.subsystems.removeProperties.description=Remove uma lista de propriedades em uma inst\u00e2nia de um subsistema (n\u00e3o reajusta seus valores para os valores padr\u00e3o)
ootbee-support-tools.command-console.subsystems.revert.description=Reajusta todas as propriedades de uma inst\u00e2ncia de um subsistema para seus valores padr\u00e3o
ootbee-support-tools.command-console.subsystems.stop.description=Para uma inst\u00e2ncia de um subsistema, se estiver em execu\u00e7\u00e3o
ootbee-support-tools.command-console.subsystems.start.description=Inicia uma inst\u00e2ncia de um subsistema, se estiver parado
ootbee-support-tools.command-console.subsystems.restart.description=Reinicia uma inst\u00e2ncia de um subsistema, se estiver em execu\u00e7\u00e3o
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<url>/ootbee/admin/command-console/subsystems/setProperties</url>
<url>/ootbee/admin/command-console/subsystems/removeProperties</url>
<url>/ootbee/admin/command-console/subsystems/revert</url>
<url>/ootbee/admin/command-console/subsystems/stop</url>
<url>/ootbee/admin/command-console/subsystems/start</url>
<url>/ootbee/admin/command-console/subsystems/restart</url>
<family>OOTBee Support Tools</family>
<format default="json">any</format>
<negotiate accept="application/json">json</negotiate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ Copyright (C) 2005 - 2020 Alfresco Software Limited.
"\t${msg("ootbee-support-tools.command-console.subsystems.removeProperties.description")}",
"",
"revert <instanceId>",
"\t${msg("ootbee-support-tools.command-console.subsystems.revert.description")}"
"\t${msg("ootbee-support-tools.command-console.subsystems.revert.description")}",
"stop <instanceId>",
"\t${msg("ootbee-support-tools.command-console.subsystems.stop.description")}",
"start <instanceId>",
"\t${msg("ootbee-support-tools.command-console.subsystems.start.description")}",
"restart <instanceId>",
"\t${msg("ootbee-support-tools.command-console.subsystems.restart.description")}"
<#break>
<#case "listInstances">
<#list subsystemInstances as subsystemInstance>
Expand Down Expand Up @@ -138,6 +144,33 @@ Copyright (C) 2005 - 2020 Alfresco Software Limited.
<#else>
"${msg("ootbee-support-tools.command-console.subsystems.error.instanceIdRequired")}"
</#if>
<#break>
<#case "stop">
<#if requestedInstanceId?? && subsystemInstance??>
<@renderSubsystemInstanceRow subsystemInstance />
<#elseif requestedInstanceId??>
"${msg("ootbee-support-tools.command-console.subsystems.error.unknownInstance", requestedInstanceId)}"
<#else>
"${msg("ootbee-support-tools.command-console.subsystems.error.instanceIdRequired")}"
</#if>
<#break>
<#case "start">
<#if requestedInstanceId?? && subsystemInstance??>
<@renderSubsystemInstanceRow subsystemInstance />
<#elseif requestedInstanceId??>
"${msg("ootbee-support-tools.command-console.subsystems.error.unknownInstance", requestedInstanceId)}"
<#else>
"${msg("ootbee-support-tools.command-console.subsystems.error.instanceIdRequired")}"
</#if>
<#break>
<#case "restart">
<#if requestedInstanceId?? && subsystemInstance??>
<@renderSubsystemInstanceRow subsystemInstance />
<#elseif requestedInstanceId??>
"${msg("ootbee-support-tools.command-console.subsystems.error.unknownInstance", requestedInstanceId)}"
<#else>
"${msg("ootbee-support-tools.command-console.subsystems.error.instanceIdRequired")}"
</#if>
<#break>
</#switch>
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,58 @@ function revert(reqArgs)
}
}

function stop(reqArgs)
{
var factoryOrManager;

if (reqArgs.length >= 1)
{
model.requestedInstanceId = reqArgs[0];
factoryOrManager = resolveSubsystemInstance(model.requestedInstanceId);

if (factoryOrManager)
{
model.subsystemInstance = toInstance(factoryOrManager);
factoryOrManager.stop();
}
}
}

function start(reqArgs)
{
var factoryOrManager;

if (reqArgs.length >= 1)
{
model.requestedInstanceId = reqArgs[0];
factoryOrManager = resolveSubsystemInstance(model.requestedInstanceId);

if (factoryOrManager)
{
model.subsystemInstance = toInstance(factoryOrManager);
factoryOrManager.start();
}
}
}

function restart(reqArgs)
{
var factoryOrManager;

if (reqArgs.length >= 1)
{
model.requestedInstanceId = reqArgs[0];
factoryOrManager = resolveSubsystemInstance(model.requestedInstanceId);

if (factoryOrManager)
{
model.subsystemInstance = toInstance(factoryOrManager);
factoryOrManager.stop();
factoryOrManager.start();
}
}
}

function main()
{
var service, reqBody, reqArgs, argIdx;
Expand Down Expand Up @@ -452,6 +504,15 @@ function main()
case 'revert':
revert(reqArgs);
break;
case 'stop':
stop(reqArgs);
break;
case 'start':
start(reqArgs);
break;
case 'restart':
restart(reqArgs);
break;
case 'help': // no-op
break;
default:
Expand Down

0 comments on commit 442bf9f

Please sign in to comment.