/** * Unit test for checking if the {@link Configuration} property type is supported */ @Test public void testPropertiesType() { assertNotNull(_configProperties); List<String> propertyNames = _configProperties.getPropertyNames(); assertNotNull(propertyNames); // go through the properties and check the type propertyNames.forEach(propertyName -> { ConfigurationProperty property = _configProperties.getProperty(propertyName); assertNotNull(property); String typeName = property.getType().getName(); LOG.ok("Property: ''" + property.getName() + "'' type ''" + typeName + "''"); assertTrue(FrameworkUtil.isSupportedConfigurationType(property.getType()), "Type " + typeName + " not allowed in configuration!"); }); } }
@Override public ConfigurationProperties getConfigurationProperties(final ConnectorInfo info) { if (info == null) { throw new NotFoundException("Invalid: connector info is null"); } // create default configuration APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); // retrieve the ConfigurationProperties. ConfigurationProperties properties = apiConfig.getConfigurationProperties(); if (properties == null) { throw new NotFoundException("Configuration properties"); } if (LOG.isDebugEnabled()) { properties.getPropertyNames().forEach(propName -> { LOG.debug("Property Name: {}" + "\nProperty Type: {}", properties.getProperty(propName).getName(), properties.getProperty(propName).getType()); }); } return properties; } }
Class<?> type = property.getType(); if (type.isArray()) { Object[] connIdArray = convertToConnIdfArray(prismProperty, type.getComponentType());
/** * Unit test for checking if the {@link Configuration} property type is supported */ @Test public void testPropertiesType() { assertNotNull(_configProperties); List<String> propertyNames = _configProperties.getPropertyNames(); assertNotNull(propertyNames); //go through the properties and check the type for (String propertyName : propertyNames) { ConfigurationProperty property = _configProperties.getProperty(propertyName); assertNotNull(property); String typeName = property.getType().getName(); LOG.ok("Property: ''{0}'' type ''{1}''", property.getName(), typeName); assertTrue("Type " + typeName + " not allowed in configuration!", FrameworkUtil .isSupportedConfigurationType(property.getType())); } } }
/** * Unit test for checking if the {@link Configuration} property type is supported */ @Test public void testPropertiesType() { assertNotNull(_configProperties); List<String> propertyNames = _configProperties.getPropertyNames(); assertNotNull(propertyNames); //go through the properties and check the type for (String propertyName : propertyNames) { ConfigurationProperty property = _configProperties.getProperty(propertyName); assertNotNull(property); String typeName = property.getType().getName(); LOG.ok("Property: ''{0}'' type ''{1}''", property.getName(), typeName); assertTrue("Type " + typeName + " not allowed in configuration!", FrameworkUtil .isSupportedConfigurationType(property.getType())); } } }
ConfigurationProperty prop = properties.getProperty(propName); LOG.info("OldValue = " + propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'"); ConfigurationProperty prop = properties.getProperty(propName); LOG.info(propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'");
ConfigurationProperty prop = properties.getProperty(propName); LOG.info("OldValue = " + propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'"); ConfigurationProperty prop = properties.getProperty(propName); LOG.info(propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'"); });
@Override public ConnConfPropSchema build(final ConfigurationProperty property) { ConnConfPropSchema connConfPropSchema = new ConnConfPropSchema(); connConfPropSchema.setName(property.getName()); connConfPropSchema.setDisplayName(property.getDisplayName(property.getName())); connConfPropSchema.setHelpMessage(property.getHelpMessage(property.getName())); connConfPropSchema.setRequired(property.isRequired()); connConfPropSchema.setType(property.getType().getName()); connConfPropSchema.setOrder(((ConfigurationPropertyImpl) property).getOrder()); connConfPropSchema.setConfidential(property.isConfidential()); if (property.getValue() != null) { if (property.getValue().getClass().isArray()) { connConfPropSchema.getDefaultValues().addAll(Arrays.asList((Object[]) property.getValue())); } else if (property.getValue() instanceof Collection<?>) { connConfPropSchema.getDefaultValues().addAll((Collection<?>) property.getValue()); } else { connConfPropSchema.getDefaultValues().add(property.getValue()); } } return connConfPropSchema; }
ConfigurationProperty prop = properties.getProperty(propName); LOG.info("OldValue = " + propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'"); ConfigurationProperty prop = properties.getProperty(propName); LOG.info(propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'");
ConfigurationProperty prop = properties.getProperty(propName); LOG.info("OldValue = " + propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'"); ConfigurationProperty prop = properties.getProperty(propName); LOG.info(propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'");
propertyNames.forEach(propName -> { ConfigurationProperty prop = properties.getProperty(propName); LOG.info("OldValue = " + propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'"); propertyNames.forEach((propName) -> { ConfigurationProperty prop = properties.getProperty(propName); LOG.info(propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'"); });
for (String propName : propertyNames) { ConfigurationProperty prop = properties.getProperty(propName); LOG.info("OldValue = " + propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'"); for (String propName : propertyNames) { ConfigurationProperty prop = properties.getProperty(propName); LOG.info(propName + " = \'" + prop.getValue() + "\' type = \'" + prop.getType() + "\'");
ConfigurationProperty icfProperty = icfConfigurationProperties.getProperty(icfPropertyName); QName propXsdType = ConnIdUtil.icfTypeToXsdType(icfProperty.getType(), icfProperty.isConfidential()); LOGGER.trace("{}: Mapping ICF config schema property {} from {} to {}", this, icfPropertyName, icfProperty.getType(), propXsdType); MutablePrismPropertyDefinition<?> propertyDefinition = configPropertiesTypeDef.toMutable().createPropertyDefinition( icfPropertyName, propXsdType); propertyDefinition.setDisplayName(icfProperty.getDisplayName(null)); propertyDefinition.setHelp(icfProperty.getHelpMessage(null)); if (ConnIdUtil.isMultivaluedType(icfProperty.getType())) { propertyDefinition.setMaxOccurs(-1); } else {