public interface UpdateDeltaOp extends SPIOperation
Proper implementation of UpdateOp
and UpdateAttributeValuesOp
.
This operation updates the values in relative or absolute way. Modification
of each attribute is described by AttributeDelta
.
This operation is meant as a complete replacement of UpdateOp
and
UpdateAttributeValuesOp
that were poorly designed in the early
framework versions. The old operations have not provided any practical
way how to execute complex attribute changes in an efficient or atomic
way. The presence of a single operation in UpdateOp
could not
support any kind of relative changes. The two operations added in
UpdateAttributeValuesOp
did not really solve the problem either.
The fact that there are two operations made it impossible to implement
all scenarios due to operation ordering. E.g. invoking remove operation
first and add operation second will end up with an error when working
with mandatory multi-value attribute. On the other hand invoking add
operation first and remove operation second will cause issues with
attributes that represent some limited entitlements (e.g. groups that
may be assigned only once). Also the fact that the old update operations
returns just the Uid make it very hard to implement an efficient and
reliable connector. E.g. it is a common case that the name of the object
changes when some of the attributes are changed. The old update operations
provided no way how to indicate this change even if the connector was aware
of the change.
Modifier and Type | Method and Description |
---|---|
Set<AttributeDelta> |
updateDelta(ObjectClass objclass,
Uid uid,
Set<AttributeDelta> modifications,
OperationOptions options)
Update the object specified by the
ObjectClass and Uid ,
modifying the values according to the attribute deltas. |
Set<AttributeDelta> updateDelta(ObjectClass objclass, Uid uid, Set<AttributeDelta> modifications, OperationOptions options)
Update the object specified by the ObjectClass
and Uid
,
modifying the values according to the attribute deltas.
The connector is supposed to return side-effect changes as a return value from this operation. E.g. if the modification of some of the attributes changed other attribute then these changes should be returned. The connector must return a new value of primary identifier (Uid) if it is changed. But the connector should return other changes only if the connector has an efficient way how to detect them. Connector is not supposed to return all side-effect changes if it does not know about them or if additional operation is required to fetch them.
objclass
- the type of object to modify. Will never be null.uid
- the uid of the object to modify. Will never be null.modifications
- set of attribute deltas. Each delta describes modification
of one attribute. Each attribute will be in the set at most once.
The set will never be null.options
- additional options that impact the way this operation is run.
Will never be null.UnknownUidException
- if the Uid
does not exist on the resource.InvalidAttributeValueException
- if any of the specified values is not appropriate for the attribute,
if the delta execution would result in violation of the schema,
if the result would be missing mandatory attribute and in similar cases.Copyright © 2022. All rights reserved.