private Map<QName, Object> filterMutableFields(Map<QName, Object> fields, FieldTypes fieldTypes) throws RecordException, TypeException, InterruptedException { Map<QName, Object> mutableFields = new HashMap<QName, Object>(); for (Entry<QName, Object> field : fields.entrySet()) { FieldType fieldType = fieldTypes.getFieldType(field.getKey()); if (Scope.VERSIONED_MUTABLE.equals(fieldType.getScope())) { mutableFields.put(field.getKey(), field.getValue()); } } return mutableFields; }
return false; } else if (!scope.equals(other.scope)) { return false;
if (Scope.NON_VERSIONED.equals(scope) || (mutableUpdate && Scope.VERSIONED_MUTABLE.equals(scope))) { if (originalValue != null) { Set<BlobReference> previouslyReferencedBlobs = getReferencedBlobs(fieldType, originalValue); if (Scope.NON_VERSIONED.equals(scope)) { fieldValueWriter.addFieldValue(fieldType, newValue, metadata, 1L); } else {
if (Scope.NON_VERSIONED.equals(scope)) {
private void checkImmutableFieldsCorrespond(FieldType userFieldType, FieldType latestFieldType) throws FieldTypeUpdateException { if (!userFieldType.getValueType().equals(latestFieldType.getValueType())) { throw new FieldTypeUpdateException("Changing the valueType of a fieldType '" + latestFieldType.getId() + "' (current name: " + latestFieldType.getName() + ") is not allowed; old '" + latestFieldType.getValueType() + "' new '" + userFieldType.getValueType() + "'"); } if (!userFieldType.getScope().equals(latestFieldType.getScope())) { throw new FieldTypeUpdateException("Changing the scope of a fieldType '" + latestFieldType.getId() + "' (current name: " + latestFieldType.getName() + ") is not allowed; old '" + latestFieldType.getScope() + "' new '" + userFieldType.getScope() + "'"); } }
if (!oldScope.equals(newScope)) { return ImportResult.conflict("scope", oldScope, newScope);