Search in sources :

Example 1 with DeployCompoundCommand

use of org.talend.mdm.repository.core.command.deploy.DeployCompoundCommand in project tmdm-studio-se by Talend.

the class DeployService method updateForStatus.

private void updateForStatus(boolean isUpdateServer, List<DeployStatus> deployStatuses) {
    if (deployStatuses == null || deployStatuses.size() == 0) {
        return;
    }
    for (DeployStatus deployStatus : deployStatuses) {
        if (deployStatus != null && deployStatus.isOK()) {
            ICommand command = deployStatus.getCommand();
            if (command != null) {
                CommandManager manager = CommandManager.getInstance();
                manager.removeCommandStack(command, ICommand.PHASE_DEPLOY);
                if (isUpdateServer) {
                    MDMServerDef serverDef = null;
                    if (command instanceof AbstractDeployCommand) {
                        serverDef = ((AbstractDeployCommand) command).getServerDef();
                    } else if (command instanceof DeployCompoundCommand) {
                        serverDef = ((DeployCompoundCommand) command).getServerDef();
                    }
                    if (command instanceof BatchDeployJobCommand) {
                        BatchDeployJobCommand deployJobCommand = (BatchDeployJobCommand) command;
                        pushRestoreCommand(manager, deployJobCommand.getSubCmds(), serverDef);
                        pushRestoreCommand(manager, deployJobCommand.getSubDeleteCmds(), serverDef);
                    } else {
                        // updateserver
                        pushRestoreCommand(manager, command, serverDef);
                    }
                }
            }
        }
    }
}
Also used : DeployCompoundCommand(org.talend.mdm.repository.core.command.deploy.DeployCompoundCommand) CommandManager(org.talend.mdm.repository.core.command.CommandManager) ICommand(org.talend.mdm.repository.core.command.ICommand) BatchDeployJobCommand(org.talend.mdm.repository.core.command.deploy.job.BatchDeployJobCommand) AbstractDeployCommand(org.talend.mdm.repository.core.command.deploy.AbstractDeployCommand) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Example 2 with DeployCompoundCommand

use of org.talend.mdm.repository.core.command.deploy.DeployCompoundCommand in project tmdm-studio-se by Talend.

the class CommandManager method convertToDeployCompoundCommand.

public ICommand convertToDeployCompoundCommand(AbstractDeployCommand cmd) {
    CompoundCommand compoundCommand = new DeployCompoundCommand(cmd);
    compoundCommand.setCommandType(cmd.getCommandType());
    compoundCommand.init();
    if (compoundCommand.breakUpCommand()) {
        return compoundCommand;
    }
    return cmd;
}
Also used : DeployCompoundCommand(org.talend.mdm.repository.core.command.deploy.DeployCompoundCommand) DeployCompoundCommand(org.talend.mdm.repository.core.command.deploy.DeployCompoundCommand)

Aggregations

DeployCompoundCommand (org.talend.mdm.repository.core.command.deploy.DeployCompoundCommand)2 CommandManager (org.talend.mdm.repository.core.command.CommandManager)1 ICommand (org.talend.mdm.repository.core.command.ICommand)1 AbstractDeployCommand (org.talend.mdm.repository.core.command.deploy.AbstractDeployCommand)1 BatchDeployJobCommand (org.talend.mdm.repository.core.command.deploy.job.BatchDeployJobCommand)1 MDMServerDef (org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)1