Examples of BundleManagerLocal


Examples of org.rhq.enterprise.server.bundle.BundleManagerLocal

    }

    void createBundle(String bundleName, String bundleTypeName, String resourceTypeName, String pluginName)
        throws Exception {
        SubjectManagerLocal subjectMgr = LookupUtil.getSubjectManager();
        BundleManagerLocal bundleMgr = LookupUtil.getBundleManager();
        ResourceTypeManagerLocal resourceTypeMgr = LookupUtil.getResourceTypeManager();
        ResourceType resourceType = resourceTypeMgr.getResourceTypeByNameAndPlugin(resourceTypeName, pluginName);

        assertNotNull("Cannot create bundle. Unable to find resource type for [name: " + resourceTypeName
            + ", plugin: " + pluginName + "]", resourceType);

        BundleType bundleType = bundleMgr.getBundleType(subjectMgr.getOverlord(), bundleTypeName);
        assertNotNull("Cannot create bundle. Unable to find bundle type for [name: " + bundleTypeName + "]", bundleType);
        Bundle bundle = bundleMgr.createBundle(subjectMgr.getOverlord(), bundleName, "test bundle: " + bundleName,
            bundleType.getId(), null);

        assertNotNull("Failed create bundle for [name: " + bundleName + "]", bundle);
    }
View Full Code Here

Examples of org.rhq.enterprise.server.bundle.BundleManagerLocal

            String name = getFormField(formFields, "name", file.getName());
            String version = getFormField(formFields, "version", Integer.toString(bundleVersionId));
            Architecture architecture = new Architecture(getFormField(formFields, "arch", "noarch"));
            InputStream fileStream = new FileInputStream(file);
            try {
                BundleManagerLocal bundleManager = LookupUtil.getBundleManager();
                BundleFile bundleFile = bundleManager.addBundleFile(subject, bundleVersionId, name, version,
                    architecture, fileStream);
                successMsg = "success [" + bundleFile.getId() + "]";
            } finally {
                fileStream.close(); // I don't think this is necessary (seems BundleManager closes it for us) but do it anyway just in case
            }
View Full Code Here

Examples of org.rhq.enterprise.server.bundle.BundleManagerLocal

        try {
            // note that this assumes 1 and only 1 file is uploaded
            File file = files.values().iterator().next();

            BundleManagerLocal bundleManager = LookupUtil.getBundleManager();
            BundleVersion bundleVersion = bundleManager.createOrStoreBundleVersionViaFile(subject, file);
            successMsg = "success [" + bundleVersion.getId() + "]";

        } catch (BundleNotFoundException e) {
            writeExceptionResponse(response, "BundleNotFoundException " + e.getMessage(), e); // clients will look for this string!
            return;
View Full Code Here

Examples of org.rhq.enterprise.server.bundle.BundleManagerLocal

        return jobDetail;
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        BundleManagerLocal bundleManager = LookupUtil.getBundleManager();
        SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager();

        Subject overlord = subjectManager.getOverlord();

        PageList<BundleDeployment> deployments = bundleManager.findBundleDeploymentsByCriteria(overlord,
            getCriteriaFromContext(context));

        if (deployments.size() > 0) {
            BundleDeployment bundleDeployment = deployments.get(0);
            SchedulerLocal scheduler = LookupUtil.getSchedulerBean();
            JobDetail jobDetail = context.getJobDetail();

            BundleDeploymentStatus bundleDeploymentStatus = bundleManager.determineBundleDeploymentStatus(bundleDeployment.getId());
            if (bundleDeploymentStatus.isTerminal()) {
                // delete this job, we've assigned a final status
                try {
                    context.setResult(bundleDeploymentStatus); // Return status to possible listeners
                    scheduler.deleteJob(jobDetail.getName(), jobDetail.getGroup());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.