private String getCipherAlgorithm(final ConnInstance connInstance) { Optional<ConnConfProperty> cipherAlgorithm = connInstance.getConf().stream(). filter(property -> "cipherAlgorithm".equals(property.getSchema().getName()) && property.getValues() != null && !property.getValues().isEmpty()).findFirst(); return cipherAlgorithm.isPresent() ? (String) cipherAlgorithm.get().getValues().get(0) : CLEARTEXT; }
private String getCipherAlgorithm(final ConnInstance connInstance) { Optional<ConnConfProperty> cipherAlgorithm = connInstance.getConf().stream(). filter(property -> "passwordHashAlgorithm".equals(property.getSchema().getName()) && property.getValues() != null && !property.getValues().isEmpty()).findFirst(); return cipherAlgorithm.isPresent() ? (String) cipherAlgorithm.get().getValues().get(0) : CLEARTEXT; }
private String getCipherAlgorithm(final ConnInstance connInstance) { Optional<ConnConfProperty> cipherAlgorithm = connInstance.getConf().stream(). filter(property -> "cipherAlgorithm".equals(property.getSchema().getName()) && property.getValues() != null && !property.getValues().isEmpty()).findFirst(); return cipherAlgorithm.isPresent() ? (String) cipherAlgorithm.get().getValues().get(0) : CLEARTEXT; }
/** * Allows easy subclassing for the ConnId AD connector bundle. * * @param connector A Connector instance to query for the groupMemberAttribute property name * @return the name of the attribute used to keep track of group memberships */ protected String getGroupMembershipAttrName(final Connector connector) { Optional<ConnConfProperty> groupMembership = connector.getConnInstance().getConf().stream(). filter(property -> "groupMemberAttribute".equals(property.getSchema().getName()) && !property.getValues().isEmpty()). findFirst(); return groupMembership.isPresent() ? (String) groupMembership.get().getValues().get(0) : "uniquemember"; }
/** * Allows easy subclassing for the ConnId AD connector bundle. * * @param connector A Connector instance to query for the groupMemberAttribute property name * @return the name of the attribute used to keep track of group memberships */ @Override protected String getGroupMembershipAttrName(final Connector connector) { Optional<ConnConfProperty> groupMembership = connector.getConnInstance().getConf().stream(). filter(property -> "groupMemberReferenceAttribute".equals(property.getSchema().getName()) && !property.getValues().isEmpty()). findFirst(); return groupMembership.isPresent() ? (String) groupMembership.get().getValues().get(0) : "member"; }
private List<ConnConfProperty> filterProperties(final Collection<ConnConfProperty> properties) { List<ConnConfProperty> newProperties = new ArrayList<>(); properties.stream().map(property -> { ConnConfProperty prop = new ConnConfProperty(); prop.setSchema(property.getSchema()); prop.setOverridable(property.isOverridable()); final List<Object> parsed = new ArrayList<>(); if (property.getValues() != null) { property.getValues().stream(). filter(obj -> (obj != null && !obj.toString().isEmpty())). forEachOrdered((obj) -> { parsed.add(obj); }); } prop.getValues().addAll(parsed); return prop; }).forEachOrdered(prop -> { newProperties.add(prop); }); return newProperties; }
/** * Get available configuration properties. * * @param instance connector instance. * @return configuration properties. */ @Override protected final List<ConnConfProperty> getConnProperties(final ConnInstanceTO instance) { return ConnectorWizardBuilder.getBundle(instance, bundles).getProperties().stream(). map(key -> { ConnConfProperty property = new ConnConfProperty(); property.setSchema(key); instance.getConf(key.getName()).ifPresent(conf -> { if (conf.getValues() != null) { property.getValues().addAll(conf.getValues()); property.setOverridable(conf.isOverridable()); } }); if (property.getValues().isEmpty() && !key.getDefaultValues().isEmpty()) { property.getValues().addAll(key.getDefaultValues()); } return property; }).collect(Collectors.toList()); } }
filter(prop -> overridable.containsKey(prop.getSchema().getName()) && !prop.getValues().isEmpty()). forEach(prop -> { conf.add(prop);
fieldPanel = multiFieldPanel; } else { setNewFieldModel(field, property.getValues()); item.add(field); fieldPanel = field;