Package org.switchyard.config.model.property

Examples of org.switchyard.config.model.property.PropertiesModel


    public static Properties getProperties(KnowledgeComponentImplementationModel model, Properties overrides) {
        Properties properties = new Properties();
        if (overrides != null) {
            overrideProperties(properties, overrides);
        }
        PropertiesModel propertiesModel  = model.getProperties();
        if (propertiesModel != null) {
            overrideProperties(properties, propertiesModel.toProperties());
        }
        return properties;
    }
View Full Code Here


     */
    protected PropertiesModel toPropertiesModel(Property[] propertyAnnotations, KnowledgeNamespace knowledgeNamespace) {
        if (propertyAnnotations == null || propertyAnnotations.length == 0) {
            return null;
        }
        PropertiesModel propertiesModel = new V1PropertiesModel(knowledgeNamespace.uri());
        for (Property propertyAnnotation : propertyAnnotations) {
            PropertyModel propertyModel = new V1PropertyModel(knowledgeNamespace.uri());
            String name = propertyAnnotation.name();
            if (!UNDEFINED.equals(name)) {
                propertyModel.setName(name);
            }
            String value = propertyAnnotation.value();
            if (!UNDEFINED.equals(value)) {
                propertyModel.setValue(value);
            }
            propertiesModel.addProperty(propertyModel);
        }
        return propertiesModel;
    }
View Full Code Here

        Class<? extends UserGroupCallback> userGroupCallbackClass = null;
        Properties properties = null;
        UserGroupCallbackModel userGroupCallbackModel = model.getUserGroupCallback();
        if (userGroupCallbackModel != null) {
            userGroupCallbackClass = (Class<? extends UserGroupCallback>)userGroupCallbackModel.getClazz(loader);
            PropertiesModel propertiesModel = userGroupCallbackModel.getProperties();
            properties = propertiesModel != null ? propertiesModel.toProperties() : null;
        }
        if (properties == null) {
            properties = new Properties();
        }
        if (userGroupCallbackClass != null) {
View Full Code Here

        Assert.assertEquals("stuff", smooks_config.getData());
        // Verify domain configuration
        DomainModel domain = switchyard.getDomain();
        Assert.assertEquals("TestDomain", domain.getName());
        // Verify property configuration
        PropertiesModel props = domain.getProperties();
        Assert.assertEquals(8, props.getProperties().size());
        Assert.assertEquals("bar", props.getPropertyValue("foo"));
        Assert.assertEquals("fish", props.getPropertyValue("tuna"));
        Assert.assertEquals(System.getProperty("user.name"), props.getPropertyValue("userName"));
        Assert.assertEquals(System.getProperty("os.name"), props.getPropertyValue("osName"));
        Assert.assertEquals("iam", props.getPropertyValue("whoIsWill"));
        Assert.assertEquals("stuff", props.getPropertyValue("smooksConfig"));
        Assert.assertEquals("MyWebService", props.getPropertyValue("soapServiceName"));
        Assert.assertEquals("service", props.getPropertyValue("soapWsdlName"));
        Assert.assertEquals(switchyard, domain.getSwitchYard());
        // Verify artifact configuration
        ArtifactsModel artifacts = switchyard.getArtifacts();
        Assert.assertEquals(1, artifacts.getArtifacts().size());
        ArtifactModel artifact = artifacts.getArtifact("OrderService");
View Full Code Here

     */
    @Override
    public void setDomainPropertyResolver() {
        DomainModel domain = getDomain();
        if (domain != null) {
            PropertiesModel properties = domain.getProperties();
            if (properties != null) {
                Configuration config = getModelConfiguration();
                config.setPropertyResolver(CompoundPropertyResolver.compact(config.getPropertyResolver(), properties));
            }
        }
View Full Code Here

            if (domain != null) {
                SecuritiesModel securities = domain.getSecurities();
                if (securities != null) {
                    for (SecurityModel security : securities.getSecurities()) {
                        if (security != null) {
                            PropertiesModel properties = security.getProperties();
                            ServiceSecurity value = new DefaultServiceSecurity()
                                .setName(security.getName())
                                .setCallbackHandler(security.getCallbackHandler(getClass().getClassLoader()))
                                .setProperties(properties != null ? properties.toMap() : null)
                                .setRolesAllowed(security.getRolesAllowed())
                                .setRunAs(security.getRunAs())
                                .setSecurityDomain(security.getSecurityDomain());
                            String key = value.getName();
                            if (!serviceSecurities.containsKey(key)) {
View Full Code Here

   
    protected Map<String, String> getDomainProperties(SwitchYardModel config) {
        if (config != null) {
            DomainModel domain = config.getDomain();
            if (domain != null) {
                PropertiesModel properties = domain.getProperties();
                if (properties != null) {
                    return properties.toMap();
                }
            }
        }
        return Collections.<String, String>emptyMap();
    }
View Full Code Here

TOP

Related Classes of org.switchyard.config.model.property.PropertiesModel

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.