Examples of BundleDestination


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

        BundleVersion bundleVersion = entityManager.find(BundleVersion.class, bundleVersionId);
        if (null == bundleVersion) {
            throw new IllegalArgumentException("Invalid bundleVersionId: " + bundleVersionId);
        }
        BundleDestination bundleDestination = entityManager.find(BundleDestination.class, bundleDestinationId);
        if (null == bundleDestination) {
            throw new IllegalArgumentException("Invalid bundleDestinationId: " + bundleDestinationId);
        }

        return createBundleDeploymentImpl(subject, bundleVersion, bundleDestination, name, description, configuration);
View Full Code Here

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

        BundleVersion bundleVersion = entityManager.find(BundleVersion.class, bundleVersionId);
        if (null == bundleVersion) {
            throw new IllegalArgumentException("Invalid bundleVersionId: " + bundleVersionId);
        }
        BundleDestination bundleDestination = entityManager.find(BundleDestination.class, bundleDestinationId);
        if (null == bundleDestination) {
            throw new IllegalArgumentException("Invalid bundleDestinationId: " + bundleDestinationId);
        }

        checkDeployBundleAuthz(subject, bundleVersion.getBundle().getId(), bundleDestination.getGroup().getId());

        String name = getBundleDeploymentNameImpl(subject, bundleDestination, bundleVersion, null);
        return this.createBundleDeploymentImpl(subject, bundleVersion, bundleDestination, name, description,
            configuration);
    }
View Full Code Here

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

                + "' from resource type '" + rt.getName() + "' (plugin '" + rt.getPlugin()
                + "') is not compatible with bundle type '" + bundleType + "'.");

        }

        BundleDestination dest = new BundleDestination(bundle, name, group, destinationSpecification, deployDir);
        dest.setDescription(description);
        entityManager.persist(dest);

        return dest;
    }
View Full Code Here

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

    }

    @Override
    public String getBundleDeploymentName(Subject subject, int bundleDestinationId, int bundleVersionId,
        int prevDeploymentId) {
        BundleDestination bundleDestination = entityManager.find(BundleDestination.class, bundleDestinationId);
        if (null == bundleDestination) {
            throw new IllegalArgumentException("Invalid bundleDestinationId: " + bundleDestinationId);
        }

        BundleVersion bundleVersion = null;
        BundleDeployment prevDeployment = null;

        if (bundleVersionId > 0) {
            bundleVersion = entityManager.find(BundleVersion.class, bundleVersionId);
            if (null == bundleVersion) {
                throw new IllegalArgumentException("Invalid bundleVersionId: " + bundleVersionId);
            }
        } else if (prevDeploymentId > 0) {
            prevDeployment = entityManager.find(BundleDeployment.class, prevDeploymentId);
            if (null == prevDeployment) {
                throw new IllegalArgumentException("Invalid prevDeploymentId: " + prevDeploymentId);
            }
        } else {
            throw new IllegalArgumentException("Must specify either a valid bundleVersionId [" + bundleVersionId
                + "] or prevDeploymentId [" + prevDeploymentId + "]");
        }

        if (bundleVersion != null) {
            checkDeployBundleAuthz(subject, bundleVersion.getBundle().getId(), bundleDestination.getGroup().getId());
        }

        return getBundleDeploymentNameImpl(subject, bundleDestination, bundleVersion, prevDeployment);
    }
View Full Code Here

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

        BundleDeployment newDeployment = entityManager.find(BundleDeployment.class, bundleDeploymentId);
        if (null == newDeployment) {
            throw new IllegalArgumentException("Invalid bundleDeploymentId: " + bundleDeploymentId);
        }

        BundleDestination destination = newDeployment.getDestination();
        ResourceGroup group = destination.getGroup();

        // Create and persist updates for each of the group members.
        Set<Resource> groupMembers = group.getExplicitResources();
        if (groupMembers.isEmpty()) {
            throw new IllegalArgumentException("Destination [" + destination
                + "] group has no members. Invalid deployment destination");
        }

        checkDeployBundleAuthz(subject, newDeployment.getBundleVersion().getBundle().getId(), group.getId());

        for (Resource groupMember : groupMembers) {
            try {
                scheduleBundleResourceDeployment(subject, newDeployment, groupMember, isCleanDeployment, isRevert);
            } catch (Throwable t) {
                LOG.error("Failed to complete scheduling of bundle deployment to [" + groupMember
                    + "]. Other bundle deployments to other resources may have been scheduled. ", t);
            }
        }

        // make sure the new deployment is set as the live deployment and properly replaces the
        // previously live deployment.
        destination = entityManager.find(BundleDestination.class, destination.getId());
        List<BundleDeployment> currentDeployments = destination.getDeployments();
        if (null != currentDeployments) {
            for (BundleDeployment d : currentDeployments) {
                if (d.isLive()) {
                    d.setLive(false);
                    if (!isRevert) {
View Full Code Here

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

        }
    }

    @Override
    public void deleteBundleDestination(Subject subject, int destinationId) throws Exception {
        BundleDestination doomed = this.entityManager.find(BundleDestination.class, destinationId);
        if (null == doomed) {
            return;
        }

        checkDeployBundleAuthz(subject, doomed.getBundle().getId(), doomed.getGroup().getId());

        // deployments replace other deployments and have a self-referring FK.  The deployments
        // need to be removed in a way that will ensure that a replaced deployment is not removed
        // prior to the replacer.  To do this we'll just blanket update all the doomed deployments
        // to break the FK dependency with nulls.
View Full Code Here

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

        return null;
    }

    private String getConnectionString(BundleResourceDeployment resourceDeployment) {
        ResourceContainer rc = inventoryManager.getResourceContainer(resourceDeployment.getResource());
        BundleDestination dest = resourceDeployment.getBundleDeployment().getDestination();
        ResourceType type = rc.getResource().getResourceType();
        String specName = dest.getDestinationSpecificationName();
        String relativeDeployDir = dest.getDeployDir();

        Configuration config = new Configuration();
        config.put(new PropertySimple("deployDir", relativeDeployDir));

        ConnectionStringAvailableProperties props = new ConnectionStringAvailableProperties(rc, measurementManager,
View Full Code Here

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

     * @param bundleResourceDeployment describes where the bundle should be or is deployed
     *
     * @return absolute directory location where the bundle should be deployed
     */
    private File getAbsoluteDestinationDir(BundleResourceDeployment bundleResourceDeployment) {
        BundleDestination dest = bundleResourceDeployment.getBundleDeployment().getDestination();
        String destBaseDirName = dest.getDestinationBaseDirectoryName();
        String relativeDeployDir = dest.getDeployDir();

        // paranoia, if no deploy dir is given, as assume it will be directly under the base location
        if (relativeDeployDir == null || relativeDeployDir.trim().length() == 0) {
            relativeDeployDir = File.separator;
        }
View Full Code Here

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

    public void testNonPlatformBundleDeploy_FileSystem_AbsolutePath() throws Exception {

        BundleType bundleType = new BundleType("bundleTypeName", im.bundleHandlerType);
        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);
View Full Code Here

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

    public void testNonPlatformBundleDeploy_FileSystem_RelativePath() throws Exception {
        BundleType bundleType = new BundleType("bundleTypeName", im.bundleHandlerType);
        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);
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.