/** * Verify if the change is allowed by given owner and persists a given PropertyDescriptor, handles its encryption/decryption and manages its PropertyTags * * @throws AMWException is thrown when technical key is invalid or another PropertyDescriptor with same technical key already exists * @throws ForeignableOwnerViolationException is thrown when the change is not permitted by changing owner */ public PropertyDescriptorEntity savePropertyDescriptorForOwner(ForeignableOwner changingOwner, AbstractContext abstractContext, PropertyDescriptorEntity descriptor, List<PropertyTagEntity> tags, ResourceTypeEntity resourceType) throws AMWException { checkForValidTechnicalKey(descriptor); auditService.storeIdInThreadLocalForAuditLog(resourceType); if (descriptor.getId() == null) { preventDuplicateTechnicalKeys(abstractContext, descriptor); createNewPropertyDescriptor(changingOwner, descriptor, abstractContext, tags); } else { saveExistingPropertyDescriptor(descriptor, tags, resourceType); } return descriptor; }
/** * Verify if the change is allowed by given owner and persists a given PropertyDescriptor, handles its encryption/decryption and manages its PropertyTags * * @throws AMWException is thrown when technical key is invalid or another PropertyDescriptor with same technical key already exists * @throws ForeignableOwnerViolationException is thrown when the change is not permitted by changing owner */ public PropertyDescriptorEntity savePropertyDescriptorForOwner(ForeignableOwner changingOwner, AbstractContext abstractContext, PropertyDescriptorEntity descriptor, List<PropertyTagEntity> tags, ResourceEntity resource) throws AMWException { checkForValidTechnicalKey(descriptor); auditService.storeIdInThreadLocalForAuditLog(resource); if (descriptor.getId() == null) { preventDuplicateTechnicalKeys(abstractContext, descriptor); createNewPropertyDescriptor(changingOwner, descriptor, abstractContext, tags); } else { saveExistingPropertyDescriptor(descriptor, tags, resource); } return descriptor; }