-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix working with OperationResult in Handler
OperationResult should be filled-in according to the code call structure, i.e. called code should use the result of the parent. The use of Handler interface, passing values to be processed but without the corresponding OperationResult, is not correct in this respect. So here are the following changes: 1. Introduced ObjectHandler interface that contains not only the value but also the OperationResult instance. [TODO: better name?] 2. Used ObjectHandler for iterative processing in reports, instead of Handler. 3. Renamed ObjectHandler in UCF API to UcfObjectHandler, to avoid naming collisions. Related to MID-7737.
- Loading branch information
Showing
21 changed files
with
105 additions
and
82 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
infra/schema/src/main/java/com/evolveum/midpoint/schema/ObjectHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2010-2013 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.schema; | ||
|
||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.schema.result.OperationResult; | ||
|
||
/** | ||
* Classes implementing this interface are used to handle arbitrary objects (not always {@link PrismObject} instances), | ||
* typically - but not necessarily - coming from iterative search operation. | ||
* | ||
* TODO resolve class naming with {@link ResultHandler}; maybe ObjectHandler is not the best name at all? | ||
* | ||
* @param <T> type of the objects; intentionally general enough to cover both prism objects, containerables, and maybe | ||
* others in the future | ||
* | ||
* @see ResultHandler | ||
*/ | ||
@FunctionalInterface | ||
public interface ObjectHandler<T> { | ||
|
||
/** | ||
* Handle a single object. | ||
* | ||
* @param object Object to handle. | ||
* @param result Where to store the result of the processing. | ||
* | ||
* @return true if the operation should proceed, false if it should stop | ||
*/ | ||
boolean handle(T object, OperationResult result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
...oning/ucf-api/src/main/java/com/evolveum/midpoint/provisioning/ucf/api/ObjectHandler.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ng/ucf-api/src/main/java/com/evolveum/midpoint/provisioning/ucf/api/UcfObjectHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2010-2017 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.provisioning.ucf.api; | ||
|
||
import com.evolveum.midpoint.schema.ObjectHandler; | ||
|
||
/** | ||
* Handles UCF objects, typically coming from iterative search. | ||
* | ||
* @author Radovan Semancik | ||
*/ | ||
@FunctionalInterface | ||
public interface UcfObjectHandler extends ObjectHandler<UcfObjectFound> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.