Package org.openengsb.core.api.model

Examples of org.openengsb.core.api.model.ConnectorConfiguration


        desc1.getProperties().put("the answer to live", 42);
        desc1.getProperties().put("basic", "value");
        desc1.setConnectorType("connectorType1");
        desc1.setDomainType("domainType1");
        String id = UUID.randomUUID().toString();
        ConnectorConfiguration conf1 = new ConnectorConfiguration(id, desc1);
        persist(conf1);

        List<ConfigItem<ConnectorDescription>> loaded = service
            .load(ImmutableMap.of(Constants.CONNECTOR_PERSISTENT_ID, id));
        assertThat(loaded.size(), is(1));
        ConnectorConfiguration conf = (ConnectorConfiguration) loaded.get(0);
        assertEquals(conf.getConnectorId(), id);

        ConnectorDescription loadedDesc = conf.getContent();
        assertEquals("connectorType1", loadedDesc.getConnectorType());
        assertEquals("domainType1", loadedDesc.getDomainType());
        assertEquals(desc1.getAttributes(), loadedDesc.getAttributes());
        assertEquals(42, loadedDesc.getProperties().get("the answer to live"));
        assertEquals("value", loadedDesc.getProperties().get("basic"));
View Full Code Here


        String[] property2 = new String[]{ "a", "b", "c" };
        desc2.getProperties().put("prop1", property);
        desc2.getProperties().put("prop2", property2);
        desc2.setConnectorType("connectorType2");
        desc2.setDomainType("domainType2");
        ConnectorConfiguration conf2 = new ConnectorConfiguration(id2, desc2);
        persist(conf2);

        List<ConfigItem<ConnectorDescription>> loaded = service
            .load(ImmutableMap.of(Constants.CONNECTOR_PERSISTENT_ID, id2));
        assertThat(loaded.size(), is(1));
        ConnectorConfiguration conf = (ConnectorConfiguration) loaded.get(0);
        assertEquals(conf.getConnectorId(), id2);

        ConnectorDescription loadedDesc = conf.getContent();
        assertEquals(desc2.getAttributes(), loadedDesc.getAttributes());
        assertTrue(Arrays.equals(property, (int[]) loadedDesc.getProperties()
            .get("prop1")));
        assertTrue(Arrays.equals(property2, (String[]) loadedDesc
            .getProperties().get("prop2")));
View Full Code Here

        desc3.getProperties().put("prop1", stringSet);
        List<Integer> intList = new LinkedList<Integer>();
        intList.add(5);
        intList.add(33);
        desc3.getProperties().put("prop2", intList);
        ConnectorConfiguration conf3 = new ConnectorConfiguration(id3, desc3);
        persist(conf3);

        List<ConfigItem<ConnectorDescription>> loaded = service
            .load(ImmutableMap.of(Constants.CONNECTOR_PERSISTENT_ID, id3));
        assertThat(loaded.size(), is(1));
        ConnectorConfiguration conf = (ConnectorConfiguration) loaded.get(0);
        assertEquals(conf.getConnectorId(), id3);

        ConnectorDescription loadedDesc = conf.getContent();
        assertEquals(desc3.getAttributes(), loadedDesc.getAttributes());

        Set<String> loadedSet = (HashSet<String>) loadedDesc.getProperties()
            .get("prop1");
        assertThat(loadedSet.size(), is(2));
View Full Code Here

        desc.getAttributes().put("attr", "attr");
        Set<String> stringSet = new HashSet<String>();
        stringSet.add("foo");
        stringSet.add("bar");
        desc.getProperties().put("prop", stringSet);
        ConnectorConfiguration conf = new ConnectorConfiguration(id4, desc);
        persist(conf);

        List<Integer> intList = new ArrayList<Integer>();
        intList.add(42);
        desc.getProperties().put("prop", intList);
        persist(conf);

        List<ConfigItem<ConnectorDescription>> loaded = service
            .load(ImmutableMap.of(Constants.CONNECTOR_PERSISTENT_ID, id4));
        assertThat(loaded.size(), is(1));
        ConnectorConfiguration loadedConf = (ConnectorConfiguration) loaded
            .get(0);
        assertEquals(conf.getConnectorId(), id4);

        ConnectorDescription loadedDesc = loadedConf.getContent();
        assertEquals(desc.getAttributes(), loadedDesc.getAttributes());
        assertThat(loadedDesc.getProperties().size(), is(1));
        List<Integer> loadedList = (ArrayList<Integer>) loadedDesc
            .getProperties().get("prop");
        assertThat(loadedList.size(), is(1));
View Full Code Here

        desc.getAttributes().put("attr", "attr");
        Set<String> stringSet = new HashSet<String>();
        stringSet.add("foo");
        stringSet.add("bar");
        desc.getProperties().put("prop", stringSet);
        ConnectorConfiguration conf = new ConnectorConfiguration(id5, desc);

        persist(conf);
        List<ConfigItem<ConnectorDescription>> loaded = service
            .load(ImmutableMap.of(Constants.CONNECTOR_PERSISTENT_ID, id5));
        assertThat(loaded.size(), is(1));
View Full Code Here

        desc.setConnectorType(entity.getConnectorType());
        desc.setDomainType(entity.getDomainType());
        desc.setAttributes(entity.getAttributes());
        desc.setProperties(readProperties(entity.getProperties()));

        ConnectorConfiguration config = new ConnectorConfiguration(metaData,
            desc);
        return config;
    }
View Full Code Here

        try {
            registrationManager.updateRegistration(id, connectorDescription);
        } catch (ConnectorValidationFailedException e) {
            throw new RuntimeException(e);
        }
        ConnectorConfiguration configuration = new ConnectorConfiguration(id, connectorDescription);
        try {
            configPersistence.persist(configuration);
        } catch (PersistenceException e) {
            throw new IllegalArgumentException(e);
        }
View Full Code Here

    @Override
    public void forceCreateWithId(String id, ConnectorDescription connectorDescription) {
        checkForExistingServices(id);
        registrationManager.forceUpdateRegistration(id, connectorDescription);
        ConnectorConfiguration configuration = new ConnectorConfiguration(id, connectorDescription);
        try {
            configPersistence.persist(configuration);
        } catch (PersistenceException e) {
            throw new IllegalArgumentException(e);
        }
View Full Code Here

        } catch (ConnectorValidationFailedException e) {
            throw new RuntimeException(e);
        }
        applyConfigChanges(old, connectorDescpription);
        try {
            configPersistence.persist(new ConnectorConfiguration(id, connectorDescpription));
        } catch (PersistenceException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    public void forceUpdate(String id, ConnectorDescription connectorDescription) throws IllegalArgumentException {
        ConnectorDescription old = getOldConfig(id);
        registrationManager.forceUpdateRegistration(id, connectorDescription);
        applyConfigChanges(old, connectorDescription);
        try {
            configPersistence.persist(new ConnectorConfiguration(id, connectorDescription));
        } catch (PersistenceException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.model.ConnectorConfiguration

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.