private void applyFromCustomization(final UserTO userTO, final Map<String, CustomAttributesInfo> customFormAttributes) { if (customFormAttributes != null && !customFormAttributes.isEmpty()) { // filter PLAIN attributes customizeAttrTOs(userTO.getPlainAttrs(), customFormAttributes.get(SchemaType.PLAIN.name())); // filter DERIVED attributes customizeAttrTOs(userTO.getDerAttrs(), customFormAttributes.get(SchemaType.DERIVED.name())); // filter VIRTUAL attributes customizeAttrTOs(userTO.getVirAttrs(), customFormAttributes.get(SchemaType.VIRTUAL.name())); } }
private void applyFromCustomization(final UserTO userTO, final Map<String, CustomAttributesInfo> customFormAttributes) { if (customFormAttributes != null && !customFormAttributes.isEmpty()) { // filter PLAIN attributes customizeAttrs(userTO.getPlainAttrs(), customFormAttributes.get(SchemaType.PLAIN.name())); // filter DERIVED attributes customizeAttrs(userTO.getDerAttrs(), customFormAttributes.get(SchemaType.DERIVED.name())); // filter VIRTUAL attributes customizeAttrs(userTO.getVirAttrs(), customFormAttributes.get(SchemaType.VIRTUAL.name())); } }
private void setAttribute(final UserTO userTO, final String schema, final String value) { switch (schema) { case "username": userTO.setUsername(value); break; default: userTO.getPlainAttrs().add(new AttrTO.Builder().schema(schema).value(value).build()); } }
private void completeUserObject(final UserTO userTO, final UserTO selfTO) { // memberships plain and virtual attrs userTO.getMemberships().forEach(updatedTOMemb -> { selfTO.getMemberships().stream(). filter(oldTOMemb -> updatedTOMemb.getGroupKey().equals(oldTOMemb.getGroupKey())). findFirst().ifPresent(oldTOMatchedMemb -> { if (!updatedTOMemb.getPlainAttrs().isEmpty()) { completeAttrs(updatedTOMemb.getPlainAttrs(), oldTOMatchedMemb.getPlainAttrs()); } if (!updatedTOMemb.getVirAttrs().isEmpty()) { completeAttrs(updatedTOMemb.getVirAttrs(), oldTOMatchedMemb.getVirAttrs()); } }); }); // plain attrs completeAttrs(userTO.getPlainAttrs(), selfTO.getPlainAttrs()); // virtual attrs completeAttrs(userTO.getVirAttrs(), selfTO.getVirAttrs()); }
private void completeUserObject(final UserTO userTO, final UserTO selfTO) { // memberships plain and virtual attrs userTO.getMemberships().forEach(updatedTOMemb -> { selfTO.getMemberships().stream(). filter(oldTOMemb -> updatedTOMemb.getGroupKey().equals(oldTOMemb.getGroupKey())). findFirst().ifPresent(oldTOMatchedMemb -> { if (!updatedTOMemb.getPlainAttrs().isEmpty()) { completeAttrs(updatedTOMemb.getPlainAttrs(), oldTOMatchedMemb.getPlainAttrs()); } if (!updatedTOMemb.getVirAttrs().isEmpty()) { completeAttrs(updatedTOMemb.getVirAttrs(), oldTOMatchedMemb.getVirAttrs()); } }); }); // plain attrs completeAttrs(userTO.getPlainAttrs(), selfTO.getPlainAttrs()); // virtual attrs completeAttrs(userTO.getVirAttrs(), selfTO.getVirAttrs()); }
public static boolean isCompliant( final UserTO userTO, final Map<String, CustomAttributesInfo> customFormAttributes, final boolean checkDefaultValues) { if (customFormAttributes == null || customFormAttributes.isEmpty()) { return true; } return validateAttributes(EntityTOUtils.buildAttrMap(userTO.getPlainAttrs()), customFormAttributes.get(SchemaType.PLAIN.name()), checkDefaultValues) && validateAttributes(EntityTOUtils.buildAttrMap(userTO.getDerAttrs()), customFormAttributes.get(SchemaType.DERIVED.name()), checkDefaultValues) && validateAttributes(EntityTOUtils.buildAttrMap(userTO.getVirAttrs()), customFormAttributes.get(SchemaType.VIRTUAL.name()), checkDefaultValues); }
public static boolean isCompliant( final UserTO userTO, final Map<String, CustomAttributesInfo> customFormAttributes, final boolean checkDefaultValues) { if (customFormAttributes == null || customFormAttributes.isEmpty()) { return true; } return validateAttributes(EntityTOUtils.buildAttrMap(userTO.getPlainAttrs()), customFormAttributes.get(SchemaType.PLAIN.name()), checkDefaultValues) && validateAttributes(EntityTOUtils.buildAttrMap(userTO.getDerAttrs()), customFormAttributes.get(SchemaType.DERIVED.name()), checkDefaultValues) && validateAttributes(EntityTOUtils.buildAttrMap(userTO.getVirAttrs()), customFormAttributes.get(SchemaType.VIRTUAL.name()), checkDefaultValues); }
} else { attr = Optional.of(new AttrTO.Builder().schema(intAttrName.getSchemaName()).build()); userTO.getPlainAttrs().add(attr.get());
} else { attr = Optional.of(new AttrTO.Builder().schema(intAttrName.getSchemaName()).build()); userTO.getPlainAttrs().add(attr.get());
userTO.getPlainAttrs().stream(). filter(attr -> (attr.getSchema(). contains(SyncopeEnduserConstants.MEMBERSHIP_ATTR_SEPARATOR))). membAttrs.add(attr); }); userTO.getPlainAttrs().removeAll(membAttrs); millisToDate(userTO.getPlainAttrs(), plainSchema); return plainSchema; }).forEachOrdered(plainSchema -> {
return attr; }).forEachOrdered(attr -> { userTO.getPlainAttrs().add(attr); }); membership.getPlainAttrs().clear(); dateToMillis(userTO.getPlainAttrs(), plainSchema);
return attr; }).forEachOrdered(attr -> { userTO.getPlainAttrs().add(attr); }); membership.getPlainAttrs().clear(); dateToMillis(userTO.getPlainAttrs(), plainSchema);
userTO.getPlainAttrs().stream(). filter(attr -> (attr.getSchema().contains(SyncopeEnduserConstants.MEMBERSHIP_ATTR_SEPARATOR))). forEach(attr -> { membAttrs.add(attr); }); userTO.getPlainAttrs().removeAll(membAttrs); millisToDate(userTO.getPlainAttrs(), plainSchema); return plainSchema; }).forEach(plainSchema -> {
userTO.getPlainAttrs().stream(). filter(attr -> (attr.getSchema().contains(SyncopeEnduserConstants.MEMBERSHIP_ATTR_SEPARATOR))). forEachOrdered((attr) -> { membAttrs.add(attr); }); userTO.getPlainAttrs().removeAll(membAttrs); millisToDate(userTO.getPlainAttrs(), plainSchema); return plainSchema; }).forEachOrdered(plainSchema -> {
userTO.getPlainAttrs().stream(). filter(attr -> (attr.getSchema(). contains(SyncopeEnduserConstants.MEMBERSHIP_ATTR_SEPARATOR))). membAttrs.add(attr); }); userTO.getPlainAttrs().removeAll(membAttrs); millisToDate(userTO.getPlainAttrs(), plainSchema); return plainSchema; }).forEach(plainSchema -> { securityAnswer(userTO.getSecurityAnswer()). auxClasses(userTO.getAuxClasses()). plainAttrs(userTO.getPlainAttrs()). virAttrs(userTO.getVirAttrs()). memberships(userTO.getMemberships()).
responseTO.getAttrs().addAll(userTO.getPlainAttrs()); responseTO.getAttrs().addAll(userTO.getVirAttrs()); if (StringUtils.isNotBlank(userTO.getUsername())) {
responseTO.getAttrs().addAll(userTO.getPlainAttrs()); responseTO.getAttrs().addAll(userTO.getVirAttrs()); if (StringUtils.isNotBlank(userTO.getUsername())) {
attrs.putAll(EntityTOUtils.buildAttrMap(userTO.getPlainAttrs())); attrs.putAll(EntityTOUtils.buildAttrMap(userTO.getDerAttrs())); attrs.putAll(EntityTOUtils.buildAttrMap(userTO.getVirAttrs()));
fill(userTO.getPlainAttrs(), conf.getUserConf().getEmails(), user.getEmails()); fill(userTO.getPlainAttrs(), conf.getUserConf().getPhoneNumbers(), user.getPhoneNumbers()); fill(userTO.getPlainAttrs(), conf.getUserConf().getIms(), user.getIms()); fill(userTO.getPlainAttrs(), conf.getUserConf().getPhotos(), user.getPhotos());