Package org.rhq.core.domain.content.transfer

Examples of org.rhq.core.domain.content.transfer.DeployIndividualPackageResponse


    deleteBackupOfOriginalFile(backupOfOriginalFile);
    persistApplicationVersion(packageDetails, this.deploymentFile);

    DeployPackagesResponse response = new DeployPackagesResponse(
        ContentResponseResult.SUCCESS);
    DeployIndividualPackageResponse packageResponse = new DeployIndividualPackageResponse(
        packageDetails.getKey(), ContentResponseResult.SUCCESS);
    response.addPackageResponse(packageResponse);

    log.debug("Updated VDB file '" + this.deploymentFile //$NON-NLS-1$
        + "' successfully - returning response [" + response + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here


  private DeployPackagesResponse failApplicationDeployment(
      String errorMessage, ResourcePackageDetails packageDetails) {
    DeployPackagesResponse response = new DeployPackagesResponse(
        ContentResponseResult.FAILURE);

    DeployIndividualPackageResponse packageResponse = new DeployIndividualPackageResponse(
        packageDetails.getKey(), ContentResponseResult.FAILURE);
    packageResponse.setErrorMessage(errorMessage);

    response.addPackageResponse(packageResponse);

    return response;
  }
View Full Code Here

                        .setOverallRequestErrorMessage("When deploying a patch, no other packages may be deployed at the same time.");
                    return response;
                }

                try {
                    DeployIndividualPackageResponse response = getWorkflowManager().run(pkg);

                    if (response.getResult() == ContentResponseResult.FAILURE) {
                        overallResult = ContentResponseResult.FAILURE;
                    }

                    // just in case response is null, it would throw NPE on the getResult() check above but the item
                    // would already be a member in individualResponses; moving the add below the check ensures that
                    // only non-null instances of individualResponses will ever make it into the List
                    individualResponses.add(response);
                } catch (Throwable throwable) {
                    log.error("Error deploying package: " + pkg, throwable);

                    // Don't forget to provide an individual response for the failed package.
                    DeployIndividualPackageResponse response = new DeployIndividualPackageResponse(pkg.getKey(),
                        ContentResponseResult.FAILURE);
                    response.setErrorMessageFromThrowable(throwable);
                    individualResponses.add(response);

                    overallResult = ContentResponseResult.FAILURE;
                }
            } else if (packageTypeName.equals(PACKAGE_TYPE_LIBRARY)) {
                if (packages.size() > 1) {
                    log.warn("Attempt to install more than one patch at a time, installation aborted.");

                    DeployPackagesResponse response = new DeployPackagesResponse(ContentResponseResult.FAILURE);
                    response
                        .setOverallRequestErrorMessage("When deploying a patch, no other packages may be deployed at the same time.");
                    return response;
                } else {
                    deployJarLibrary(pkg, contentServices);
                }
            }
        }

        DeployPackagesResponse response = new DeployPackagesResponse(overallResult);
        response.getPackageResponses().addAll(individualResponses);

        return response;
    }
View Full Code Here

        try {
            downloadBits(packageDetails.getKey(), destinationFileLocation);
        } catch (Throwable throwable) {
            log.error("Error deploying package: " + packageDetails, throwable);
            DeployIndividualPackageResponse response = new DeployIndividualPackageResponse(packageDetails.getKey(),
                ContentResponseResult.FAILURE);
            response.setErrorMessageFromThrowable(throwable);
            individualResponses.add(response);
            overallResult = ContentResponseResult.FAILURE;
        }

        DeployPackagesResponse response = new DeployPackagesResponse(overallResult);
        response.getPackageResponses().addAll(individualResponses);
        return response;
    }
View Full Code Here

                        // to do it. Since I'm skipping the PC entirely for this test, I'll do it here.
                        response.setRequestId(request.getRequestId());

                        if (returnIndividualResponses) {
                            for (ResourcePackageDetails packageDetails : request.getPackages()) {
                                DeployIndividualPackageResponse individualResponse = new DeployIndividualPackageResponse(
                                    packageDetails.getKey(), responseReturnStatus);

                                individualResponse.setDeploymentSteps(deployPackageSteps);

                                response.addPackageResponse(individualResponse);
                            }
                        }
View Full Code Here

            log.error("Error received from the workflow", e);
        }

        // Parse the logs from the workflow execution into the domain model
        List logs = processInstance.getLoggingInstance().getLogs();
        DeployIndividualPackageResponse response = parseLogs(logs, unexecutedSteps, packageDetails.getKey());

        return response;
    }
View Full Code Here

        for (DeployPackageStep unexecutedStep : unexecutedSteps) {
            unexecutedStep.setStepResult(ContentResponseResult.NOT_PERFORMED);
            steps.add(unexecutedStep);
        }

        DeployIndividualPackageResponse response = new DeployIndividualPackageResponse(packageDetailsKey, overallResult);
        response.setDeploymentSteps(steps);

        return response;
    }
View Full Code Here

                        .setOverallRequestErrorMessage("When deploying a patch, no other packages may be deployed at the same time.");
                    return response;
                }

                try {
                    DeployIndividualPackageResponse response = workflowManager.run(pkg);

                    if (response.getResult() == ContentResponseResult.FAILURE) {
                        overallResult = ContentResponseResult.FAILURE;
                    }
                   
                    // just in case response is null, it would throw NPE on the getResult() check above but the item
                    // would already be a member in individualResponses; moving the add below the check ensures that
                    // only non-null instances of individualResponses will ever make it into the List
                    individualResponses.add(response);
                } catch (Throwable throwable) {
                    log.error("Error deploying package: " + pkg, throwable);

                    // Don't forget to provide an individual response for the failed package.
                    DeployIndividualPackageResponse response = new DeployIndividualPackageResponse(pkg.getKey(),
                        ContentResponseResult.FAILURE);
                    response.setErrorMessage(ThrowableUtil.getStackAsString(throwable));
                    individualResponses.add(response);

                    overallResult = ContentResponseResult.FAILURE;
                }
            } else if (packageTypeName.equals(PACKAGE_TYPE_LIBRARY)) {
                throw new UnsupportedOperationException("Deployment of new libraries is not supported by the plugin.");
            }
        }

        DeployPackagesResponse response = new DeployPackagesResponse(overallResult);
        response.getPackageResponses().addAll(individualResponses);

        return response;
    }
View Full Code Here

        // Deploy was successful!

        deleteBackupOfOriginalFile(backupFile);

        DeployPackagesResponse response = new DeployPackagesResponse(ContentResponseResult.SUCCESS);
        DeployIndividualPackageResponse packageResponse = new DeployIndividualPackageResponse(packageDetails.getKey(),
            ContentResponseResult.SUCCESS);
        response.addPackageResponse(packageResponse);

        return response;
    }
View Full Code Here

    }

    private DeployPackagesResponse failApplicationDeployment(String errorMessage, ResourcePackageDetails packageDetails) {
        DeployPackagesResponse response = new DeployPackagesResponse(ContentResponseResult.FAILURE);

        DeployIndividualPackageResponse packageResponse = new DeployIndividualPackageResponse(packageDetails.getKey(),
            ContentResponseResult.FAILURE);
        packageResponse.setErrorMessage(errorMessage);

        response.addPackageResponse(packageResponse);

        return response;
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.content.transfer.DeployIndividualPackageResponse

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.