Package org.rhq.core.domain.resource

Examples of org.rhq.core.domain.resource.ProductVersion


            resource.setUuid("" + new Random().nextInt());
            resource.setVersion("1.0");
            em.persist(resource);

            // Product versions
            productVersion1 = new ProductVersion();
            productVersion1.setVersion("1.0");
            productVersion1.setResourceType(resourceType);
            em.persist(productVersion1);

            resource.setProductVersion(productVersion1);

            productVersion2 = new ProductVersion();
            productVersion2.setVersion("2.0");
            productVersion2.setResourceType(resourceType);
            em.persist(productVersion2);

            // Add package types to resource type
View Full Code Here


            // Nevertheless, let's make that check just to prevent disasters caused by "malicious" content
            // providers.                       
            if (resourceVersions != null && rt != null) {
                Map<String, ProductVersion> cachedProductVersions = knownProductVersions.get(rt); // we are guaranteed that this returns non-null
                for (String version : resourceVersions) {
                    ProductVersion productVersion = cachedProductVersions.get(version);
                    if (productVersion == null) {
                        productVersion = productVersionManager.addProductVersion(rt, version);
                        cachedProductVersions.put(version, productVersion);
                    }
View Full Code Here

            if (versionChanged) {
                LOG.info("Resource [" + resource + "] changed its version from [" + oldVersion + "] to [" + newVersion
                    + "]");
                resource.setVersion(newVersion);

                ProductVersion productVersion = null;
                if (newVersion.length() > 0) {
                    productVersion = productVersionManager.addProductVersion(resource.getResourceType(), newVersion);
                }
                resource.setProductVersion(productVersion);
            }
View Full Code Here

        entityManager.persist(resource);

        // Add a product version entry for the new resource.
        if ((resource.getVersion() != null) && (resource.getVersion().length() > 0)) {
            ProductVersion productVersion = productVersionManager
                .addProductVersion(resourceType, resource.getVersion());
            resource.setProductVersion(productVersion);
        }

        // Ensure the new resource has an owner and modifier of superUser.
View Full Code Here

        query.setParameter("resourceType", resourceType);
        query.setParameter("version", version);

        List resultList = query.getResultList();

        ProductVersion productVersion;
        if (resultList.size() == 0) {
            productVersion = new ProductVersion();
            productVersion.setResourceType(resourceType);
            productVersion.setVersion(version);

            entityManager.persist(productVersion);
        } else {
            productVersion = (ProductVersion) resultList.get(0);
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.resource.ProductVersion

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.