@Override protected RelationshipPatch newInstance() { return new RelationshipPatch(); }
public Builder relationshipTO(final RelationshipTO relationshipTO) { getInstance().setRelationshipTO(relationshipTO); return this; } }
if (relPatch.getRelationshipTO() == null) { LOG.warn("Invalid {} specified: {}", RelationshipPatch.class.getName(), relPatch); } else { result.getRelationships().remove(relPatch.getRelationshipTO()); if (relPatch.getOperation() == PatchOperation.ADD_REPLACE) { result.getRelationships().add(relPatch.getRelationshipTO());
if (relPatch.getRelationshipTO() == null) { LOG.warn("Invalid {} specified: {}", RelationshipPatch.class.getName(), relPatch); } else { result.getRelationships().remove(relPatch.getRelationshipTO()); if (relPatch.getOperation() == PatchOperation.ADD_REPLACE) { result.getRelationships().add(relPatch.getRelationshipTO());
filter(patch -> patch.getRelationshipTO() != null).forEachOrdered((patch) -> { RelationshipType relationshipType = relationshipTypeDAO.find(patch.getRelationshipTO().getType()); if (relationshipType == null) { LOG.debug("Ignoring invalid relationship type {}", patch.getRelationshipTO().getType()); } else { anyObject.getRelationship(relationshipType, patch.getRelationshipTO().getOtherEndKey()). ifPresent(relationship -> { anyObject.getRelationships().remove(relationship); }); if (patch.getOperation() == PatchOperation.ADD_REPLACE) { if (StringUtils.isBlank(patch.getRelationshipTO().getOtherEndType()) || AnyTypeKind.USER.name().equals(patch.getRelationshipTO().getOtherEndType()) || AnyTypeKind.GROUP.name().equals(patch.getRelationshipTO().getOtherEndType())) { + " not allowed for relationship: " + patch.getRelationshipTO().getOtherEndType()); scce.addException(invalidAnyType); } else { AnyObject otherEnd = anyObjectDAO.find(patch.getRelationshipTO().getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid any object {}", patch.getRelationshipTO().getOtherEndKey()); } else if (anyObject.getRealm().getFullPath().startsWith(otherEnd.getRealm().getFullPath())) { ARelationship newRelationship = entityFactory.newEntity(ARelationship.class);
filter(patch -> patch.getRelationshipTO() != null).forEachOrdered((patch) -> { RelationshipType relationshipType = relationshipTypeDAO.find(patch.getRelationshipTO().getType()); if (relationshipType == null) { LOG.debug("Ignoring invalid relationship type {}", patch.getRelationshipTO().getType()); } else { user.getRelationship(relationshipType, patch.getRelationshipTO().getOtherEndKey()). ifPresent(relationship -> { user.getRelationships().remove(relationship); }); if (patch.getOperation() == PatchOperation.ADD_REPLACE) { AnyObject otherEnd = anyObjectDAO.find(patch.getRelationshipTO().getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid any object {}", patch.getRelationshipTO().getOtherEndKey()); } else if (user.getRealm().getFullPath().startsWith(otherEnd.getRealm().getFullPath())) { URelationship newRelationship = entityFactory.newEntity(URelationship.class);