Examples of TargetObject


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

        }
    }

    public StatefulTargetObject preregister(Map<String, String> attributes, Map<String, String> tags) {
        synchronized (m_repository) {
            TargetObject to = m_targetRepository.create(attributes, tags);
            return createStateful(to.getID());
        }
    }
View Full Code Here

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

        }
    }

    public void unregister(String targetID) {
        synchronized (m_repository) {
            TargetObject to = getTargetObject(targetID);
            if (to == null) {
                throw new IllegalArgumentException(targetID + " does not represent a TargetObject.");
            }
            else {
                m_targetRepository.remove(to);
View Full Code Here

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

     * @param targetID A string representing a target.
     * @return An array of artifact URLs.
     * @throws java.io.IOException When there is a problem processing an artifact for deployment.
     */
    DeploymentArtifact[] getNecessaryDeploymentArtifacts(String targetID, String version) throws IOException {
        TargetObject to = getTargetObject(targetID);

        Map<ArtifactObject, String> bundles = new HashMap<ArtifactObject, String>();
        Map<ArtifactObject, String> artifacts = new HashMap<ArtifactObject, String>();
        Map<ArtifactObject, Map<FeatureObject, List<DistributionObject>>> path =
            new HashMap<ArtifactObject, Map<FeatureObject, List<DistributionObject>>>();

        // First, find all basic bundles and artifacts. An while we're traversing the
        // tree of objects, build the tree of properties.
        if (to != null) {
            for (DistributionObject distribution : to.getDistributions()) {
                for (FeatureObject feature : distribution.getFeatures()) {
                    for (ArtifactObject artifact : feature.getArtifacts()) {
                        if (m_bundleHelper.canUse(artifact)) {
                            bundles.put(artifact, m_bundleHelper.getResourceProcessorPIDs(artifact));
                        }
View Full Code Here

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

    /**
     * Quick method to find all artifacts that need to be deployed to a target.
     */
    ArtifactObject[] getNecessaryArtifacts(String targetID) {
        List<ArtifactObject> result = new ArrayList<ArtifactObject>();
        TargetObject to = getTargetObject(targetID);

        Map<String, ArtifactObject> allProcessors = new HashMap<String, ArtifactObject>();
        for (ArtifactObject bundle : m_artifactRepository.getResourceProcessors()) {
            allProcessors.put(m_bundleHelper.getResourceProcessorPIDs(bundle), bundle);
        }

        if (to != null) {
            for (DistributionObject distribution : to.getDistributions()) {
                for (FeatureObject feature : distribution.getFeatures()) {
                    for (ArtifactObject artifact : feature.getArtifacts()) {
                        result.add(artifact);
                        if (!m_bundleHelper.canUse(artifact)) {
                            String processorPID = artifact.getProcessorPID();
View Full Code Here

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

            public FeatureObject call() throws Exception {
                ArtifactObject b1 = createBasicBundleObject("myBundle");
                createBasicBundleObject("myProcessor", "1.0.0", "org.osgi.deployment.rp.autoconf");
                FeatureObject go = createBasicFeatureObject("myfeature");
                DistributionObject lo = createBasicDistributionObject("mydistribution");
                TargetObject gwo = createBasicTargetObject("templatetarget2");
                m_artifact2featureRepository.create(b1, go);
                // note that we do not associate b2: this is a resource processor, so it will be packed
                // implicitly. It should not be available to a preprocessor either.
                m_feature2distributionRepository.create(go, lo);
                m_distribution2targetRepository.create(lo, gwo);
View Full Code Here

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

        createBasicBundleObject("myProcessor", "1.0.0", "myProcessor.pid");
        final ArtifactObject b1 = createBasicBundleObject("myBundle");
        final ArtifactObject a1 = createBasicArtifactObject("myArtifact", "mymime", "myProcessor.pid");
        final FeatureObject go = createBasicFeatureObject("myfeature");
        final DistributionObject lo = createBasicDistributionObject("mydistribution");
    final TargetObject gwo = createBasicTargetObject(targetId);

        // create some tree from artifacts to a target
        runAndWaitForEvent(new Callable<Object>() {
            public Object call() throws Exception {
                m_artifact2featureRepository.create(b1, go);
View Full Code Here

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

     */
    @Test( groups = { TestUtils.UNIT } )
    public void testDistribution2TargetAssociations() {
        initializeRepositoryAdmin();
        DistributionObject d1 = createBasicDistributionObject("distribution1");
        TargetObject t1 = createBasicTargetObject("target1");
        m_distribution2TargetRepository.create(d1, t1);

        assert d1.getFeatures().size() == 0 : "Distribution 1 should not be associated with any features; it is associated with " + d1.getFeatures().size() + ".";
        assert d1.getTargets().size() == 1 : "Distribution 1 should be associated with exactly one target; it is associated with " + d1.getTargets().size() + ".";

        assert t1.getDistributions().size() == 1 : "Target 1 should be associated with exactly one distribution; it is associated with " + t1.getDistributions().size() + ".";
    }
View Full Code Here

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

            public FeatureObject call() throws Exception {
                ArtifactObject b1 = createBasicBundleObject("myBundle");
                createBasicBundleObject("myProcessor", "1.0.0", "org.osgi.deployment.rp.autoconf");
                FeatureObject go = createBasicFeatureObject("myfeature");
                DistributionObject lo = createBasicDistributionObject("mydistribution");
                TargetObject gwo = createBasicTargetObject("templatetarget2");
                m_artifact2featureRepository.create(b1, go);
                // note that we do not associate b2: this is a resource processor, so it will be packed
                // implicitly. It should not be available to a preprocessor either.
                m_feature2distributionRepository.create(go, lo);
                m_distribution2targetRepository.create(lo, gwo);
View Full Code Here

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

        createBasicBundleObject("myProcessor", "1.0.0", "myProcessor.pid");
        final ArtifactObject b1 = createBasicBundleObject("myBundle");
        final ArtifactObject a1 = createBasicArtifactObject("myArtifact", "mymime", "myProcessor.pid");
        final FeatureObject go = createBasicFeatureObject("myfeature");
        final DistributionObject lo = createBasicDistributionObject("mydistribution");
    final TargetObject gwo = createBasicTargetObject(targetId);

        // create some tree from artifacts to a target
        runAndWaitForEvent(new Callable<Object>() {
            public Object call() throws Exception {
                m_artifact2featureRepository.create(b1, go);
View Full Code Here

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

        events.add(new Event("myNewTarget3", 1, 3, 3, AuditEvent.TARGETPROPERTIES_SET, props3));
        m_auditLogStore.put(events);
        m_statefulTargetRepository.refresh();

        // do checks
        TargetObject to = sgo1.getTargetObject();
        assertNotNull("Stateful target should be backed by a target object.", to);
        assertEquals("Target should have a property mykey with value myvalue.", "myvalue", to.getTag("target.mykey"));
        assertNull("This old key should no longer have been associated with this target.", to.getTag("target.myoldkey"));
        assertTrue("Adding auditlog data for a target does not influence its isRegistered().", sgo1.isRegistered());

        // add auditlog data for other target
        events = new ArrayList<Event>();
        events.add(new Event("myNewTarget4", 1, 1, 1, AuditEvent.FRAMEWORK_STARTED));
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.