Package org.rhq.core.domain.bundle

Examples of org.rhq.core.domain.bundle.BundleResourceDeployment


    @Override
    public BundlePurgeResponse purge(BundlePurgeRequest request) {
        final BundlePurgeResponse response = new BundlePurgeResponse();

        try {
            final BundleResourceDeployment resourceDeployment = request.getLiveBundleResourceDeployment();
            final BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment();

            // find the resource that will purge the bundle
            BundleType bundleType = bundleDeployment.getBundleVersion().getBundle().getBundleType();
            ResourceType resourceType = bundleType.getResourceType();
            Set<Resource> resources = inventoryManager.getResourcesWithType(resourceType);
            if (resources.isEmpty()) {
                throw new Exception("No bundle plugin supports bundle type [" + bundleType + "]");
            }
            final int bundleHandlerResourceId = resources.iterator().next().getId();
            final ResourceContainer resourceContainer = inventoryManager.getResourceContainer(bundleHandlerResourceId);
            if (null == resourceContainer.getResourceContext()) {
                throw new Exception("No bundle plugin resource available to handle purge for bundle type ["
                    + bundleType
                    + "]. Ensure the bundle plugin is deployed and its resource is imported into inventory.");
            }

            // purge the bundle utilizing the bundle facet object
            String deploymentMessage = "Deployment [" + bundleDeployment + "] to be purged via ["
                + resourceDeployment.getResource() + "]";
            auditDeployment(resourceDeployment, AUDIT_PURGE_STARTED, bundleDeployment.getName(), deploymentMessage);

            org.rhq.core.pluginapi.bundle.BundlePurgeRequest purgeRequest = new org.rhq.core.pluginapi.bundle.BundlePurgeRequest();
            purgeRequest.setBundleManagerProvider(this);
            purgeRequest.setLiveResourceDeployment(resourceDeployment);
View Full Code Here


        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_FS, getPath("/tmp/dest")); // ABSOLUTE PATH
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
        BundleResourceDeployment resourceDeployment = new BundleResourceDeployment(bundleDeployment, im.serverFS);
        BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment);

        // No matter what the CONTEXT_VALUE_FS is (i.e. the default context value in the plugin descriptor),
        // if the user specifies an absolute path for the destination, that will be used explicitly. So here in this test,
        // the destination was specified with a destDir that had an absolute path of /tmp/dest and it will be used as-is
View Full Code Here

        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_FS, "relative/path"); // RELATIVE PATH
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
        BundleResourceDeployment resourceDeployment = new BundleResourceDeployment(bundleDeployment, im.serverFS);
        BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment);

        // in the real world, the context value for fileSystem contexts will probably always be "/" but
        // to test that we are really using this context value, our tests set it to something other than "/".
        // That's why we prepend CONTEXT_VALUE_FS to the front of the destination's destDir
View Full Code Here

        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_PC, "relative/path/pc");
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
        BundleResourceDeployment resourceDeployment = new BundleResourceDeployment(bundleDeployment, im.serverPC);
        BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment);

        mockBundleManager.absolutePathToAssert = BUNDLE_CONFIG_LOCATION_PC + "/relative/path/pc";
        BundleScheduleResponse response = mockBundleManager.schedule(request);
        assertSuccess(response);
View Full Code Here

        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_RC, "relative/path/rc");
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
        BundleResourceDeployment resourceDeployment = new BundleResourceDeployment(bundleDeployment, im.serverRC);
        BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment);

        mockBundleManager.absolutePathToAssert = BUNDLE_CONFIG_LOCATION_RC + "/relative/path/rc";
        BundleScheduleResponse response = mockBundleManager.schedule(request);
        assertSuccess(response);
View Full Code Here

        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_MT, "relative/path/mt");
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
        BundleResourceDeployment resourceDeployment = new BundleResourceDeployment(bundleDeployment, im.serverMT);
        BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment);

        mockBundleManager.absolutePathToAssert = BUNDLE_CONFIG_LOCATION_MT + "/relative/path/mt";
        BundleScheduleResponse response = mockBundleManager.schedule(request);
        assertSuccess(response);
View Full Code Here

        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_FS, getPath("/tmp/dest")); // ABSOLUTE PATH
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
        BundleResourceDeployment resourceDeployment = new BundleResourceDeployment(bundleDeployment, im.serverFS);
        BundleScheduleRequest request = new BundleScheduleRequest(resourceDeployment);

        mockBundleManager.absolutePathToAssert = "/should_fail_to_match"; // this will not match the /tmp/dest that we set the destination to
        BundleScheduleResponse response = mockBundleManager.schedule(request);
        assertSuccess(response);
View Full Code Here

        String destBaseDirName = "destBaseDirName";
        String installDir = "installDir";
        BundleDestination bundleDestination = new BundleDestination(bundle, "destName", new ResourceGroup("groupName"),
            destBaseDirName, installDir);
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, bundleDestination, name);
        BundleResourceDeployment deployment = new BundleResourceDeployment(bundleDeployment, resource);

        ProcessingRecipeContext context = new ProcessingRecipeContext(getRecipe(), packageVersionFiles, sysinfo, cwd,
            deployment, new DummyBundleManagerProvider());
        return context;
    }
View Full Code Here

        ASConnection connection = new ASConnection(
            ASConnectionParams.createFrom(new ServerPluginConfiguration(request.getReferencedConfiguration())));

        ProcessExecutionResults results;
        BundleManagerProvider bmp = request.getBundleManagerProvider();
        BundleResourceDeployment rd = request.getResourceDeployment();

        Result<Boolean> stop = stopIfNeeded(connection, control,
            request.getResourceDeployment().getBundleDeployment().getConfiguration(), bmp, rd);
        if (stop.failed()) {
            result.setErrorMessage(stop.errorMessage);
View Full Code Here

        listGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
            @Override
            public void onSelectionChanged(SelectionEvent selectionEvent) {
                if (selectionEvent.getState()) {

                    BundleResourceDeployment bundleResourceDeployment = (BundleResourceDeployment) selectionEvent
                        .getRecord().getAttributeAsObject("object");
                    BundleResourceDeploymentHistoryListView detailView = new BundleResourceDeploymentHistoryListView(
                        bundleResourceDeployment);

                    detail.removeMembers(detail.getMembers());
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.bundle.BundleResourceDeployment

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.