1 package org
.argeo
.slc
.core
.execution
.tasks
;
3 import java
.lang
.reflect
.Method
;
6 import org
.argeo
.slc
.SlcException
;
7 import org
.argeo
.slc
.deploy
.DeployedSystem
;
8 import org
.argeo
.slc
.deploy
.DeployedSystemManager
;
9 import org
.argeo
.slc
.process
.SlcExecution
;
10 import org
.argeo
.slc
.process
.SlcExecutionRelated
;
11 import org
.argeo
.slc
.process
.SlcExecutionStep
;
12 import org
.argeo
.slc
.structure
.StructureRegistry
;
14 public class SlcManager
implements Runnable
, SlcExecutionRelated
{
16 private String slcExecutionUuid
;
17 private String slcExecutionStepUuid
;
19 private String action
;
20 private DeployedSystemManager
<DeployedSystem
> manager
;
22 public final void run() {
23 uuid
= UUID
.randomUUID().toString();
24 executeActions(StructureRegistry
.ALL
);
27 protected void executeActions(String mode
) {
29 Method method
= manager
.getClass().getMethod(action
, null);
30 method
.invoke(manager
, null);
31 } catch (Exception e
) {
32 throw new SlcException("Cannot execute action " + action
33 + " for manager " + manager
, e
);
37 public void setAction(String action
) {
41 public void setManager(DeployedSystemManager
<DeployedSystem
> manager
) {
42 this.manager
= manager
;
45 public String
getUuid() {
49 public void setUuid(String uuid
) {
53 public String
getSlcExecutionUuid() {
54 return slcExecutionUuid
;
57 public void setSlcExecutionUuid(String slcExecutionUuid
) {
58 this.slcExecutionUuid
= slcExecutionUuid
;
61 public String
getSlcExecutionStepUuid() {
62 return slcExecutionStepUuid
;
65 public void setSlcExecutionStepUuid(String slcExecutionStepUuid
) {
66 this.slcExecutionStepUuid
= slcExecutionStepUuid
;
69 public void notifySlcExecution(SlcExecution slcExecution
) {
70 if (slcExecution
!= null) {
71 slcExecutionUuid
= slcExecution
.getUuid();
72 SlcExecutionStep step
= slcExecution
.currentStep();
74 slcExecutionStepUuid
= step
.getUuid();