Search in sources :

Example 1 with ThirdpartySoftwareOverrideFileAction

use of com.creditease.uav.feature.upgrade.action.thirdparty.ThirdpartySoftwareOverrideFileAction in project uavstack by uavorg.

the class UpgradeAgent method registerActionsAccordingUpgradeTarget.

@SuppressWarnings("unused")
private void registerActionsAccordingUpgradeTarget() {
    if (this.upgradeContext.isUAVContext()) {
        StopUAVProcessAction stopAction = new StopUAVProcessAction(this.feature, this.upgradeContext, engine);
        OverrideFileAction overrideFileAction = new UAVOverrideFileAction(this.feature, this.upgradeContext, engine);
        StartUAVProcessAction startAction = new StartUAVProcessAction(this.feature, this.upgradeContext, engine);
    } else {
        OverrideFileAction overrideFileAction = new ThirdpartySoftwareOverrideFileAction(this.feature, this.upgradeContext, engine);
    }
}
Also used : StopUAVProcessAction(com.creditease.uav.feature.upgrade.action.uav.StopUAVProcessAction) UAVOverrideFileAction(com.creditease.uav.feature.upgrade.action.uav.UAVOverrideFileAction) StartUAVProcessAction(com.creditease.uav.feature.upgrade.action.uav.StartUAVProcessAction) UAVOverrideFileAction(com.creditease.uav.feature.upgrade.action.uav.UAVOverrideFileAction) OverrideFileAction(com.creditease.uav.feature.upgrade.action.OverrideFileAction) ThirdpartySoftwareOverrideFileAction(com.creditease.uav.feature.upgrade.action.thirdparty.ThirdpartySoftwareOverrideFileAction) ThirdpartySoftwareOverrideFileAction(com.creditease.uav.feature.upgrade.action.thirdparty.ThirdpartySoftwareOverrideFileAction)

Example 2 with ThirdpartySoftwareOverrideFileAction

use of com.creditease.uav.feature.upgrade.action.thirdparty.ThirdpartySoftwareOverrideFileAction in project uavstack by uavorg.

the class UpgradeOperationRecordConsumer method handleThirdPartySoftwareOperationRecord.

@SuppressWarnings("unchecked")
private void handleThirdPartySoftwareOperationRecord(UpgradeOperationRecord oprRecord) {
    Map<String, Object> action = JSONHelper.toObject(String.valueOf(oprRecord.getAction()), Map.class);
    if (action.containsKey("override")) {
        JSONObject object = (JSONObject) action.get("override");
        String backupZip = String.valueOf(object.get("backup"));
        OverrideFileAction overrideFileAction = new ThirdpartySoftwareOverrideFileAction(this.feature, upgradeContext, this.engine);
        overrideFileAction.setBackupZipPath(Paths.get(backupZip));
        engine.execute(overrideFileAction.getName(), new ActionContext());
    }
}
Also used : JSONObject(com.alibaba.fastjson.JSONObject) JSONObject(com.alibaba.fastjson.JSONObject) UAVOverrideFileAction(com.creditease.uav.feature.upgrade.action.uav.UAVOverrideFileAction) ThirdpartySoftwareOverrideFileAction(com.creditease.uav.feature.upgrade.action.thirdparty.ThirdpartySoftwareOverrideFileAction) OverrideFileAction(com.creditease.uav.feature.upgrade.action.OverrideFileAction) ActionContext(com.creditease.agent.spi.ActionContext) ThirdpartySoftwareOverrideFileAction(com.creditease.uav.feature.upgrade.action.thirdparty.ThirdpartySoftwareOverrideFileAction)

Aggregations

OverrideFileAction (com.creditease.uav.feature.upgrade.action.OverrideFileAction)2 ThirdpartySoftwareOverrideFileAction (com.creditease.uav.feature.upgrade.action.thirdparty.ThirdpartySoftwareOverrideFileAction)2 UAVOverrideFileAction (com.creditease.uav.feature.upgrade.action.uav.UAVOverrideFileAction)2 JSONObject (com.alibaba.fastjson.JSONObject)1 ActionContext (com.creditease.agent.spi.ActionContext)1 StartUAVProcessAction (com.creditease.uav.feature.upgrade.action.uav.StartUAVProcessAction)1 StopUAVProcessAction (com.creditease.uav.feature.upgrade.action.uav.StopUAVProcessAction)1