Source:
public Owner updateOwner(@PathParam("owner_key") @Verify(Owner.class) String key, @ApiParam(name = "owner", required = true) Owner owner) { Owner toUpdate = findOwner(key); EventBuilder eventBuilder = eventFactory.getEventBuilder(Target.OWNER, Type.MODIFIED) .setOldEntity(toUpdate); log.debug("Updating owner: {}", key); if (owner.getDisplayName() != null) { toUpdate.setDisplayName(owner.getDisplayName()); } if (owner.getParentOwner() != null) { toUpdate.setParentOwner(owner.getParentOwner()); } if (owner.getDefaultServiceLevel() != null) { if (owner.getDefaultServiceLevel().equals("")) { toUpdate.setDefaultServiceLevel(null); } else { serviceLevelValidator.validate(toUpdate, owner.getDefaultServiceLevel()); toUpdate.setDefaultServiceLevel(owner.getDefaultServiceLevel()); } } if (owner.getAutobindDisabled() != null) { toUpdate.setAutobindDisabled(owner.getAutobindDisabled()); } if (config.getBoolean(ConfigProperties.STANDALONE) && !toUpdate.getContentAccessMode().equals(owner.getContentAccessMode()) && owner.getContentAccessMode() != null) { throw new BadRequestException( i18n.tr("The owner content access mode cannot be set directly in standalone mode.")); } boolean refreshContentAccess = false; if (owner.getContentAccessMode() != null) { if (toUpdate.isAllowedContentAccessMode(owner.getContentAccessMode())) { String before = toUpdate.getContentAccessMode(); String after = owner.getContentAccessMode(); if (!after.equals(before)) { toUpdate.setContentAccessMode(owner.getContentAccessMode()); refreshContentAccess = true; } } else { throw new BadRequestException( i18n.tr("The content access mode is not allowed for this owner.")); } } ownerCurator.merge(toUpdate); ownerCurator.flush(); if (refreshContentAccess) { ownerManager.refreshOwnerForContentAccess(toUpdate); } Event e = eventBuilder.setNewEntity(toUpdate).buildEvent(); sink.queueEvent(e); return toUpdate; }

Target:
public Owner updateOwner(@PathParam("owner_key") @Verify(Owner.class) String key, @ApiParam(name = "owner", required = true) Owner owner) { Owner toUpdate = findOwner(key); EventBuilder eventBuilder = eventFactory.getEventBuilder(Target.OWNER, Type.MODIFIED) .setOldEntity(toUpdate); log.debug("Updating owner: {}", key); if (owner.getDisplayName() != null) { toUpdate.setDisplayName(owner.getDisplayName()); } if (owner.getParentOwner() != null) { toUpdate.setParentOwner(owner.getParentOwner()); } if (owner.getDefaultServiceLevel() != null) { if (owner.getDefaultServiceLevel().equals("")) { toUpdate.setDefaultServiceLevel(null); } else { serviceLevelValidator.validate(toUpdate, owner.getDefaultServiceLevel()); toUpdate.setDefaultServiceLevel(owner.getDefaultServiceLevel()); } } if (owner.getAutobindDisabled() != null) { toUpdate.setAutobindDisabled(owner.getAutobindDisabled()); } if (config.getBoolean(ConfigProperties.STANDALONE) && toUpdate.getContentAccessMode() != null && !toUpdate.getContentAccessMode().equals(owner.getContentAccessMode()) && owner.getContentAccessMode() != null) { throw new BadRequestException( i18n.tr("The owner content access mode cannot be set directly in standalone mode.")); } boolean refreshContentAccess = false; if (owner.getContentAccessMode() != null) { if (toUpdate.isAllowedContentAccessMode(owner.getContentAccessMode())) { String before = toUpdate.getContentAccessMode(); String after = owner.getContentAccessMode(); if (!after.equals(before)) { toUpdate.setContentAccessMode(owner.getContentAccessMode()); refreshContentAccess = true; } } else { throw new BadRequestException( i18n.tr("The content access mode is not allowed for this owner.")); } } ownerCurator.merge(toUpdate); ownerCurator.flush(); if (refreshContentAccess) { ownerManager.refreshOwnerForContentAccess(toUpdate); } Event e = eventBuilder.setNewEntity(toUpdate).buildEvent(); sink.queueEvent(e); return toUpdate; }