Examples of DeploymentVersionObject


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 StatefulTargetObject.UNKNOWN_VERSION;
        }
        else {
            return version.getVersion();
        }
    }
View Full Code Here

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

        }
    }

    public DeploymentArtifact[] getArtifactsFromDeployment() {
        synchronized(m_lock) {
            DeploymentVersionObject mostRecentDeploymentVersion = m_repository.getMostRecentDeploymentVersion(getID());
            if (mostRecentDeploymentVersion != null) {
                return mostRecentDeploymentVersion.getDeploymentArtifacts();
            }
            return new DeploymentArtifact[0];
        }
    }
View Full Code Here

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

    private void determineStoreState(DeploymentVersionObject deploymentVersionObject) {
        synchronized(m_lock) {
            List<String> fromShop = new ArrayList<String>();
            ArtifactObject[] artifactsFromShop = m_repository.getNecessaryArtifacts(getID());
            DeploymentVersionObject mostRecentVersion;
            if (deploymentVersionObject == null) {
                mostRecentVersion = m_repository.getMostRecentDeploymentVersion(getID());
            }
            else {
                mostRecentVersion = deploymentVersionObject;
            }
            if (artifactsFromShop == null) {
                if (mostRecentVersion == null) {
                    setStoreState(StoreState.New);
                }
                else {
                    setStoreState(StoreState.Unapproved);
                }
                return;
            }

            for (ArtifactObject ao : artifactsFromShop) {
                fromShop.add(ao.getURL());
            }

            List<String> fromDeployment = new ArrayList<String>();
            for (DeploymentArtifact da : getArtifactsFromDeployment()) {
                fromDeployment.add(da.getDirective(DeploymentArtifact.DIRECTIVE_KEY_BASEURL));
            }

            if ((mostRecentVersion == null) && fromShop.isEmpty()) {
                setStoreState(StoreState.New);
            }
            else if (fromShop.containsAll(fromDeployment) && fromDeployment.containsAll(fromShop)) {
                // great, we have the same artifacts. But... do they need to be reprocessed?
                for (ArtifactObject ao : artifactsFromShop) {
                    if (m_repository.needsNewVersion(ao, getID(), mostRecentVersion.getVersion())) {
                        setStoreState(StoreState.Unapproved);
                        return;
                    }
                }
                setStoreState(StoreState.Approved);
View Full Code Here

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

        return result;
    }

    public DeploymentVersionObject getMostRecentDeploymentVersion(String targetID) {
        List<DeploymentVersionObject> versions = getDeploymentVersions(targetID);
        DeploymentVersionObject result = null;
        if ((versions != null) && (versions.size() > 0)) {
            result = versions.get(versions.size() - 1);
        }
        return result;
    }
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.TOPIC_ADDED.equals(topic) || DeploymentVersionObject.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

        ArtifactObject b2 = m_artifactRepository.create(attr, tags);

        sgo.approve();

        DeploymentVersionObject dep = m_deploymentVersionRepository.getMostRecentDeploymentVersion(sgo.getID());

        DeploymentArtifact[] toDeploy = dep.getDeploymentArtifacts();

        assertEquals("We expect to find four artifacts to deploy;", 4, toDeploy.length);
        DeploymentArtifact bundle1 = toDeploy[0];
        assertEquals(b1.getURL(), bundle1.getUrl());
       
View Full Code Here

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

                return null;
            }
        }, false, TOPIC_STATUS_CHANGED);

        // find the deployment version
        DeploymentVersionObject dvo = m_deploymentVersionRepository.getMostRecentDeploymentVersion("templatetarget2");
        String inFile = tryGetStringFromURL(findXmlUrlInDeploymentObject(dvo), 10, 100);

        assertEquals(xmlHeader + noTemplateProcessed + xmlFooter, inFile);

        // try the simple template
View Full Code Here

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

        assert artifacts.size() == 0 : "The artifacts list should be empty; if not, the ArtifactObject's equals() could be broken.";
    }

    @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
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.