@JsonIgnore public Optional<ConnConfProperty> getConf(final String schemaName) { return conf.stream().filter(property -> property.getSchema().getName().equals(schemaName)).findFirst(); }
@JsonIgnore public Optional<ConnConfProperty> getConf(final String schemaName) { return conf.stream().filter(property -> property.getSchema().getName().equals(schemaName)).findFirst(); }
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; }
final ConnConfProperty property = item.getModelObject(); final String label = StringUtils.isBlank(property.getSchema().getDisplayName()) ? property.getSchema().getName() : property.getSchema().getDisplayName(); if (property.getSchema().isConfidential() || Constants.GUARDED_STRING.equalsIgnoreCase(property.getSchema().getType()) || Constants.GUARDED_BYTE_ARRAY.equalsIgnoreCase(property.getSchema().getType())) { required = property.getSchema().isRequired(); } else { Class<?> propertySchemaClass; try { propertySchemaClass = ClassUtils.getClass(property.getSchema().getType()); if (ClassUtils.isPrimitiveOrWrapper(propertySchemaClass)) { propertySchemaClass = org.apache.commons.lang3.ClassUtils.primitiveToWrapper(propertySchemaClass); Class<Number> numberClass = (Class<Number>) propertySchemaClass; field = new AjaxSpinnerFieldPanel.Builder<>().build("panel", label, numberClass, new Model<>()); required = property.getSchema().isRequired(); } else if (ClassUtils.isAssignable(Boolean.class, propertySchemaClass)) { field = new AjaxCheckBoxPanel("panel", label, new Model<>()); } else { field = new AjaxTextFieldPanel("panel", label, new Model<>()); required = property.getSchema().isRequired(); field.setTitle(property.getSchema().getHelpMessage(), true);