Examples of DeploymentVersionObject


Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

     * @return The version identifier of the new deployment package.
     * @throws java.io.IOException
     *             When there is a problem generating the deployment version.
     */
    String approve(String targetID) throws IOException {
        DeploymentVersionObject mostRecentDeploymentVersion = getMostRecentDeploymentVersion(targetID);
        String nextVersion;
        if (mostRecentDeploymentVersion == null) {
            nextVersion = nextVersion(null);
        }
        else {
            nextVersion = nextVersion(mostRecentDeploymentVersion.getVersion());
        }
        return nextVersion;
        // return generateDeploymentVersion(targetID).getVersion();
    }
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

    DeploymentVersionObject generateDeploymentVersion(String targetID) throws IOException {
        Map<String, String> attr = new HashMap<String, String>();
        attr.put(DeploymentVersionObject.KEY_TARGETID, targetID);
        Map<String, String> tags = new HashMap<String, String>();

        DeploymentVersionObject mostRecentDeploymentVersion = getMostRecentDeploymentVersion(targetID);
        String nextVersion;
        if (mostRecentDeploymentVersion == null) {
            nextVersion = nextVersion(null);
        }
        else {
            nextVersion = nextVersion(mostRecentDeploymentVersion.getVersion());
        }
        attr.put(DeploymentVersionObject.KEY_VERSION, nextVersion);

        synchronized (m_repository) {
            DeploymentVersionObject result = m_deploymentRepository.create(attr, tags, getNecessaryDeploymentArtifacts(targetID, nextVersion));

            StatefulTargetObjectImpl stoi = getStatefulTargetObject(targetID);
            if (stoi == null) {
                createStateful(targetID);
            }
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

                    }
                }
            }
            else if (DeploymentVersionObject.PRIVATE_TOPIC_ADDED.equals(topic) || DeploymentVersionObject.PRIVATE_TOPIC_REMOVED.equals(topic)) {
                synchronized (m_repository) {
                    DeploymentVersionObject deploymentVersionObject = ((DeploymentVersionObject) event.getProperty(RepositoryObject.EVENT_ENTITY));
                    String id = deploymentVersionObject.getTargetID();
                    StatefulTargetObjectImpl stoi = getStatefulTargetObject(id);
                    if (stoi == null) {
                        createStateful(id);
                    }
                    else {
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

    /**
     * Performs the actual verification.
     */
    final String verify(String targetId, String manifestText) throws Exception {
        DeploymentVersionObject version = m_repo.getMostRecentDeploymentVersion(targetId);
        if (version == null) {
            return "No deployment version available to verify.";
        }

        VerificationResult result = new VerificationResult();
        Map<String, String> manifestMap = getManifestEntries(manifestText);

        VerifyEnvironment env = createVerifyEnvironment(manifestMap, result);

        // Add the main entry...
        result.addBundle(env, manifestMap);

        processArtifacts(version.getDeploymentArtifacts(), env, result);

        StringBuilder sb = new StringBuilder();
        if (result.hasCustomizers()) {
            if (!result.allCustomizerMatch()) {
                sb.append("<p><b>Not all bundle customizers match!</b><br/>");
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

        assert !foundArtifacts.contains(b3) : "g1 should not be associated with b3";
    }

    @Test(groups = { TestUtils.UNIT })
    public void testDeploymentRepository() {
        DeploymentVersionObject version11 = createBasicDeploymentVersionObject("target1", "1", new String[] { "artifact1", "artifact2" });
        DeploymentVersionObject version12 = createBasicDeploymentVersionObject("target1", "2", new String[] { "artifact3", "artifact4" });
        // Note the different order in adding the versions for target2.
        DeploymentVersionObject version22 = createBasicDeploymentVersionObject("target2", "2", new String[] { "artifactC", "artifactD" });
        DeploymentVersionObject version21 = createBasicDeploymentVersionObject("target2", "1", new String[] { "artifactA", "artifactB" });

        assert m_deploymentVersionRepository.getDeploymentVersions("NotMyTarget").size() == 0 : "The deployment repository should not return" +
            "any versions when we ask for a target that does not exist, but it returns " + m_deploymentVersionRepository.getDeploymentVersions("NotMyTarget").size();

        List<DeploymentVersionObject> for1 = m_deploymentVersionRepository.getDeploymentVersions("target1");
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

    @Test(groups = { TestUtils.UNIT })
    public void testDeploymentRepositoryFilter() {

        String gwId = "\\ ( * ) target1)";
        DeploymentVersionObject version1 = createBasicDeploymentVersionObject(gwId, "1", new String[] { "artifact1", "artifact2" });

        List<DeploymentVersionObject> for1 = m_deploymentVersionRepository.getDeploymentVersions(gwId);
        assert for1.size() == 1 : "We expect one version for" + gwId + ", but we find " + for1.size();
        assert for1.get(0) == version1 : "The only version for" + gwId + "should be version1";
    }
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

        assert for1.get(0) == version1 : "The only version for" + gwId + "should be version1";
    }

    @Test(groups = { TestUtils.UNIT })
    public void testDeploymentVersion() throws IOException {
        DeploymentVersionObject version = createBasicDeploymentVersionObject("target1", "1", new String[] { "artifact1", "artifact2" });

        assert version.getDeploymentArtifacts().length == 2 : "We expect to find two artifacts, but we find " + version.getDeploymentArtifacts().length;
        assert version.getDeploymentArtifacts()[0].getUrl().equals("artifact1");
        assert version.getDeploymentArtifacts()[1].getUrl().equals("artifact2");

        ((DeploymentArtifactImpl) version.getDeploymentArtifacts()[0]).addDirective("myDirective", "myValue");

        try {
            createBasicDeploymentVersionObject("target1", "1", new String[] { "artifact1", "artifact2" });
            assert false : "Creating a deployment version with a target and version that already exists should not be allowed.";
        }
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

        m_deploymentVersionRepository = new DeploymentVersionRepositoryImpl(m_mockChangeNotifier, repoConfig);
        TestUtils.configureObject(m_deploymentVersionRepository, BundleContext.class, m_mockBundleContext);

        // Add several bundles, but not enough to get any deployment version purged...
        DeploymentVersionObject target1_v1 = createBasicDeploymentVersionObject("target1", "1", new String[] { "artifact1", "artifact2" });
        DeploymentVersionObject target1_v2 = createBasicDeploymentVersionObject("target1", "2", new String[] { "artifact1", "artifact2" });
        DeploymentVersionObject target1_v3 = createBasicDeploymentVersionObject("target1", "3", new String[] { "artifact1", "artifact2" });
        DeploymentVersionObject target2_v1 = createBasicDeploymentVersionObject("target2", "1", new String[] { "artifact3", "artifact4" });
        DeploymentVersionObject target2_v2 = createBasicDeploymentVersionObject("target2", "2", new String[] { "artifact3", "artifact5" });

        List<DeploymentVersionObject> repo = m_deploymentVersionRepository.get();
        // All created deployment versions should be present...
        assertEquals(repo.size(), 5);
        assertTrue(repo.contains(target1_v1));
        assertTrue(repo.contains(target1_v2));
        assertTrue(repo.contains(target1_v3));
        assertTrue(repo.contains(target2_v1));
        assertTrue(repo.contains(target2_v2));

        // Add a new deployment version, which should cause the oldest (= version 1) of target1 to be purged...
        DeploymentVersionObject target1_v4 = createBasicDeploymentVersionObject("target1", "4", new String[] { "artifact1", "artifact2" });

        repo = m_deploymentVersionRepository.get();
        // Still 5 deployment versions, without version 1 of target1...
        assertEquals(repo.size(), 5);
        assertFalse(repo.contains(target1_v1));
        assertTrue(repo.contains(target1_v2));
        assertTrue(repo.contains(target1_v3));
        assertTrue(repo.contains(target1_v4));
        assertTrue(repo.contains(target2_v1));
        assertTrue(repo.contains(target2_v2));

        // Add yet another deployment version, which should cause the oldest (= version 2) of target1 to be purged...
        DeploymentVersionObject target1_v5 = createBasicDeploymentVersionObject("target1", "5", new String[] { "artifact1", "artifact2" });

        repo = m_deploymentVersionRepository.get();
        // Still 5 deployment versions, without versions 1 & 2 of target1...
        assertEquals(repo.size(), 5);
        assertFalse(repo.contains(target1_v1));
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

        RepositoryConfiguration repoConfig = new RepositoryConfigurationImpl();

        m_deploymentVersionRepository = new DeploymentVersionRepositoryImpl(m_mockChangeNotifier, repoConfig);
        TestUtils.configureObject(m_deploymentVersionRepository, BundleContext.class, m_mockBundleContext);

        DeploymentVersionObject target1_v1 = createBasicDeploymentVersionObject("target1", "1", new String[] { "artifact1", "artifact2" });
        DeploymentVersionObject target1_v2 = createBasicDeploymentVersionObject("target1", "2", new String[] { "artifact1", "artifact2" });
        DeploymentVersionObject target1_v3 = createBasicDeploymentVersionObject("target1", "3", new String[] { "artifact1", "artifact2" });
        DeploymentVersionObject target2_v1 = createBasicDeploymentVersionObject("target2", "1", new String[] { "artifact3", "artifact4" });
        DeploymentVersionObject target2_v2 = createBasicDeploymentVersionObject("target2", "2", new String[] { "artifact3", "artifact5" });

        List<DeploymentVersionObject> repo = m_deploymentVersionRepository.get();
        assertEquals(repo.size(), 5);
        assertTrue(repo.contains(target1_v1));
        assertTrue(repo.contains(target1_v2));
        assertTrue(repo.contains(target1_v3));
        assertTrue(repo.contains(target2_v1));
        assertTrue(repo.contains(target2_v2));

        DeploymentVersionObject target1_v4 = createBasicDeploymentVersionObject("target1", "4", new String[] { "artifact1", "artifact2" });

        repo = m_deploymentVersionRepository.get();
        assertEquals(repo.size(), 6);
        assertTrue(repo.contains(target1_v1));
        assertTrue(repo.contains(target1_v2));
        assertTrue(repo.contains(target1_v3));
        assertTrue(repo.contains(target1_v4));
        assertTrue(repo.contains(target2_v1));
        assertTrue(repo.contains(target2_v2));

        DeploymentVersionObject target1_v5 = createBasicDeploymentVersionObject("target1", "5", new String[] { "artifact1", "artifact2" });

        repo = m_deploymentVersionRepository.get();
        assertEquals(repo.size(), 7);
        assertTrue(repo.contains(target1_v1));
        assertTrue(repo.contains(target1_v2));
View Full Code Here

Examples of org.apache.ace.client.repository.object.DeploymentVersionObject

    public List<LogEvent> getAuditEvents() {
        return m_repository.getAuditEvents(getID());
    }

    public String getCurrentVersion() {
        DeploymentVersionObject version = m_repository.getMostRecentDeploymentVersion(getID());
        if (version == null) {
            return StatefulGatewayObject.UNKNOWN_VERSION;
        }
        else {
            return version.getVersion();
        }
    }
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.