-
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.
MID-8842 upgrade objects step, object processor added
- Loading branch information
Showing
8 changed files
with
82 additions
and
27 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...inja/src/main/java/com/evolveum/midpoint/ninja/action/upgrade/UpgradeObjectProcessor.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,28 @@ | ||
/* | ||
* Copyright (C) 2010-2023 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.ninja.action.upgrade; | ||
|
||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.schema.result.OperationResult; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
|
||
public interface UpgradeObjectProcessor<T extends ObjectType> { | ||
|
||
UpgradePhase getPhase(); | ||
|
||
<O extends ObjectType> boolean isApplicable(Class<O> type); | ||
|
||
/** | ||
* Updates object to correct form | ||
* | ||
* @param object | ||
* @param result | ||
* @return true if object needs to be updated (saved) in midpoint repository, false otherwise | ||
*/ | ||
boolean processObject(PrismObject<T> object, OperationResult result); | ||
} |
6 changes: 6 additions & 0 deletions
6
tools/ninja/src/main/java/com/evolveum/midpoint/ninja/action/upgrade/UpgradePhase.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,6 @@ | ||
package com.evolveum.midpoint.ninja.action.upgrade; | ||
|
||
public enum UpgradePhase { | ||
|
||
BEFORE, AFTER; | ||
} |
18 changes: 18 additions & 0 deletions
18
...com/evolveum/midpoint/ninja/action/upgrade/handler/AddRemoveAttributeValuesProcessor.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,18 @@ | ||
package com.evolveum.midpoint.ninja.action.upgrade.handler; | ||
|
||
import com.evolveum.midpoint.ninja.action.upgrade.UpgradePhase; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; | ||
|
||
public class AddRemoveAttributeValuesProcessor extends RemovedElementProcessor<ResourceType> { | ||
|
||
@Override | ||
public UpgradePhase getPhase() { | ||
return UpgradePhase.BEFORE; | ||
} | ||
|
||
@Override | ||
public <O extends ObjectType> boolean isApplicable(Class<O> type) { | ||
return ResourceType.class.isAssignableFrom(type); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...main/java/com/evolveum/midpoint/ninja/action/upgrade/handler/RemovedElementProcessor.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,14 @@ | ||
package com.evolveum.midpoint.ninja.action.upgrade.handler; | ||
|
||
import com.evolveum.midpoint.ninja.action.upgrade.UpgradeObjectProcessor; | ||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.schema.result.OperationResult; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
|
||
public abstract class RemovedElementProcessor<T extends ObjectType> implements UpgradeObjectProcessor<T> { | ||
|
||
@Override | ||
public boolean processObject(PrismObject<T> object, OperationResult result) { | ||
return true; | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
...rc/main/java/com/evolveum/midpoint/ninja/action/upgrade/handler/UpgradeObjectHandler.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
.../ninja/src/main/java/com/evolveum/midpoint/ninja/action/upgrade/handler/UpgradePhase.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
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