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);
}
}
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());
}
}
Aggregations