Package org.rhq.core.util.updater

Examples of org.rhq.core.util.updater.DeployDifferences


                    new PluginContainerHandoverTarget(request));
                executeDeploymentPhase(recipeFile, antProps, buildListeners, DeploymentPhase.START, null);

                // Send the diffs to the Server so it can store them as an entry in the deployment history.
                BundleManagerProvider bundleManagerProvider = request.getBundleManagerProvider();
                DeployDifferences diffs = project.getDeployDifferences();

                String msg = "Added files=" + diffs.getAddedFiles().size() + "; Deleted files="
                    + diffs.getDeletedFiles().size() + " (see attached details for more information)";
                String fullDetails = formatDiff(diffs);
                bundleManagerProvider.auditDeployment(resourceDeployment, "Deployment Differences", project.getName(),
                    DEPLOY_STEP, null, msg, fullDetails);
            } catch (Throwable t) {
                if (LOG.isDebugEnabled()) {
View Full Code Here


            try {
                DeploymentData deploymentData = new DeploymentData(deploymentProps, baseDir, deployDir, allFiles,
                    allRawFilesToReplace, allArchives, allArchiveReplacePatterns, templateEngine, this.ignorePattern,
                    allArchivesExploded);
                Deployer deployer = new Deployer(deploymentData);
                DeployDifferences diffs = getProject().getDeployDifferences();

                // we only want to emit audit trail when something is really going to happen on disk; don't log if doing a dry run
                if (!dryRun) {
                    getProject().auditLog(AuditStatus.SUCCESS, "Deployer Started", "The deployer has started its work",
                        null, null);
                }

                if (revert) {
                    deployer.redeployAndRestoreBackupFiles(diffs, clean, dryRun);
                } else {
                    deployer.deploy(diffs, clean, dryRun);
                }

                HandoverTarget handoverTarget = getProject().getHandoverTarget();
                if (handoverTarget != null) {
                    for (HasHandover hasHandoverReference : contentToHandover) {
                        Handover handoverTag = hasHandoverReference.getHandover();
                        File source = getFileSource(hasHandoverReference, downloadedFilesToHandover, templateEngine);
                        FileInputStream contentStream = new FileInputStream(source);

                        HandoverInfo.Builder builder = new HandoverInfo.Builder();
                        builder.setContent(contentStream);
                        builder.setFilename(source.getName());
                        builder.setAction(handoverTag.getAction());
                        builder.setParams(handoverTag.getHandoverParams());
                        builder.setRevert(revert);
                        HandoverInfo handoverInfo = builder.createHandoverInfo();

                        if (!dryRun) {
                            try {
                                boolean handoverSuccess = handoverTarget.handoverContent(handoverInfo);
                                String informationMessage = "Source: " + source.getName() + ", " + handoverTag;
                                if (handoverSuccess) {
                                    getProject().auditLog(AuditStatus.INFO, "Handover",
                                        "Handover target reported success", informationMessage, null);
                                } else {
                                    if (handoverTag.isFailonerror()) {
                                        getProject().auditLog(AuditStatus.FAILURE, "Handover",
                                            "Handover target reported a failure", informationMessage, null);
                                        throw new Exception("Handover failed: " + handoverTag);
                                    } else {
                                        getProject().auditLog(AuditStatus.WARN, "Handover",
                                            "Handover target reported a failure", informationMessage, null);
                                    }
                                }
                            } finally {
                                safeClose(contentStream);
                            }
                        }
                    }
                }

                // we only want to emit audit trail when something is really going to happen on disk; don't log if doing a dry run
                if (!dryRun) {
                    getProject().auditLog(AuditStatus.SUCCESS, "Deployer Finished",
                        "The deployer has finished its work", null, diffs.toString());
                }
            } catch (Throwable t) {
                try {
                    getProject().auditLog(AuditStatus.FAILURE, "Deployer Failed",
                        "The deployer encountered an error and could not finished", ThrowableUtil.getAllMessages(t),
View Full Code Here

TOP

Related Classes of org.rhq.core.util.updater.DeployDifferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.