@Override protected GroupUR newInstance() { return new GroupUR(); }
public Builder typeExtensions(final TypeExtensionTO... typeExtensions) { getInstance().getTypeExtensions().addAll(Arrays.asList(typeExtensions)); return this; }
public Builder adynMembershipCond(final String type, final String fiql) { getInstance().getADynMembershipConds().put(type, fiql); return this; }
/** * Calculate modifications needed by first in order to be equal to second. * * @param updated updated GroupTO * @param original original GroupTO * @param incremental perform incremental diff (without removing existing info) * @return {@link GroupUR} containing differences */ public static GroupUR diff(final GroupTO updated, final GroupTO original, final boolean incremental) { GroupUR result = new GroupUR(); diff(updated, original, result, incremental); // 1. name result.setName(replacePatchItem(updated.getName(), original.getName(), new StringReplacePatchItem())); // 2. ownership result.setUserOwner( replacePatchItem(updated.getUserOwner(), original.getUserOwner(), new StringReplacePatchItem())); result.setGroupOwner( replacePatchItem(updated.getGroupOwner(), original.getGroupOwner(), new StringReplacePatchItem())); // 3. dynamic membership result.setUDynMembershipCond(updated.getUDynMembershipCond()); result.getADynMembershipConds().putAll(updated.getADynMembershipConds()); // 4. type extensions result.getTypeExtensions().addAll(updated.getTypeExtensions()); return result; }
public static GroupTO patch(final GroupTO groupTO, final GroupUR groupUR) { GroupTO result = SerializationUtils.clone(groupTO); patch(groupTO, groupUR, result); if (groupUR.getName() != null) { result.setName(groupUR.getName().getValue()); } if (groupUR.getUserOwner() != null) { result.setGroupOwner(groupUR.getUserOwner().getValue()); } if (groupUR.getGroupOwner() != null) { result.setGroupOwner(groupUR.getGroupOwner().getValue()); } result.setUDynMembershipCond(groupUR.getUDynMembershipCond()); result.getADynMembershipConds().clear(); result.getADynMembershipConds().putAll(groupUR.getADynMembershipConds()); return result; }
@Override public void onSubmit(final AjaxRequestTarget target) { GroupUR req = new GroupUR(); req.setKey(groupTO.getKey()); req.getTypeExtensions().addAll(groupTO.getTypeExtensions()); try { new GroupRestClient().update(groupTO.getETagValue(), req); this.baseModal.show(false); this.baseModal.close(target); SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED)); } catch (Exception e) { LOG.error("Group update failure", e); SyncopeConsoleSession.get().error(getString(Constants.ERROR) + ": " + e.getMessage()); } ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); }
if (groupUR.isEmpty() && !othersNotEqualsOrBlanks) { result = new ProvisioningResult<>(); result.setEntity(inner);
public Builder groupOwner(final StringReplacePatchItem groupOwner) { getInstance().setGroupOwner(groupOwner); return this; }
@Override protected Serializable onApplyInternal(final AnyWrapper<GroupTO> modelObject) { GroupTO inner = modelObject.getInnerObject(); ProvisioningResult<GroupTO> result; if (remediationTO.getAnyURPayload() == null) { GroupCR req = new GroupCR(); EntityTOUtils.toAnyCR(inner, req); result = restClient.remedy(remediationTO.getKey(), req); } else { GroupUR req = AnyOperations.diff(inner, previousGroupTO, false); // update just if it is changed if (req.isEmpty()) { result = new ProvisioningResult<>(); result.setEntity(inner); } else { result = restClient.remedy(remediationTO.getKey(), req); } } return result; } }
public Builder typeExtension(final TypeExtensionTO typeExtension) { getInstance().getTypeExtensions().add(typeExtension); return this; }
public Builder typeExtensions(final Collection<TypeExtensionTO> typeExtensions) { getInstance().getTypeExtensions().addAll(typeExtensions); return this; } }