Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/master'
- Loading branch information
Showing
36 changed files
with
1,690 additions
and
88 deletions.
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
infra/util/src/main/java/com/evolveum/midpoint/util/DOMUtilSettings.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,39 @@ | ||
/* | ||
* Copyright (c) 2010-2019 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.evolveum.midpoint.util; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class DOMUtilSettings { | ||
|
||
private static boolean addTransformerFactorySystemProperty = true; | ||
|
||
public static boolean isAddTransformerFactorySystemProperty() { | ||
return addTransformerFactorySystemProperty; | ||
} | ||
|
||
/** | ||
* Method used by MidPoint Studio to disable setting system property during {@link DOMUtil} initialization. | ||
* Not used within MidPoint as the default "true" value doesn't change the initialization behaviour. | ||
* | ||
* @param addTransformerFactorySystemProperty | ||
*/ | ||
public static void setAddTransformerFactorySystemProperty(boolean addTransformerFactorySystemProperty) { | ||
DOMUtilSettings.addTransformerFactorySystemProperty = addTransformerFactorySystemProperty; | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
...odel-api/src/main/java/com/evolveum/midpoint/model/api/expr/OptimizingTriggerCreator.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,51 @@ | ||
/* | ||
* Copyright (c) 2019 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.model.api.expr; | ||
|
||
import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; | ||
import com.evolveum.midpoint.util.exception.ObjectNotFoundException; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Adds recompute triggers to objects in an optimized way: | ||
* - The triggers are set to a given time in future (e.g. 1 minute from now). | ||
* - If more requests to create triggers to the same object come before that time comes (minus some safety margin, | ||
* e.g. 2 seconds), their creation is skipped. | ||
* | ||
* Currently we deal only with the recompute triggers. Other types can be added as necessary. | ||
* | ||
* The deduplication currently assumes the requests are of the same kind (i.e. either name-based or OID-based). | ||
*/ | ||
public interface OptimizingTriggerCreator { | ||
|
||
/** | ||
* Creates a trigger for the user with the given name. | ||
* @return true if the trigger was really added; false if it already existed or could not be added | ||
* | ||
* (Note that if the object cannot be found by the name, currently no exception is reported.) | ||
*/ | ||
boolean createForNamedUser(@NotNull String name) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException; | ||
|
||
/** | ||
* Creates a trigger for the object with the given name. | ||
* @return true if the trigger was really added; false if it already existed or could not be added | ||
* | ||
* (Note that if the object cannot be found by the name, currently no exception is reported.) | ||
*/ | ||
boolean createForNamedObject(@NotNull Class<? extends ObjectType> type, @NotNull String name) | ||
throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException; | ||
|
||
/** | ||
* Creates a trigger to the user with the given OID. | ||
* @return true if the trigger was really added; false if it already existed or could not be added | ||
*/ | ||
boolean createForObject(@NotNull Class<? extends ObjectType> type, @NotNull String oid) | ||
throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException; | ||
} |
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
50 changes: 50 additions & 0 deletions
50
...mpl/src/main/java/com/evolveum/midpoint/model/impl/expr/triggerSetter/CreatedTrigger.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,50 @@ | ||
/* | ||
* Copyright (c) 2019 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.model.impl.expr.triggerSetter; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Information on the trigger created for a given object. | ||
*/ | ||
class CreatedTrigger { | ||
|
||
/** | ||
* OID of the holder. It is sometimes resolved only when the trigger is being created. | ||
*/ | ||
@NotNull private final String holderOid; | ||
|
||
/** | ||
* This is the fire time of the trigger created. Of course there might exist other triggers as well: created on another node, | ||
* or created by a mechanism other than OptimizingTriggerCreator. We don't care. We have just one goal: to avoid redundant | ||
* triggers being added when they come in a series on a single node. | ||
*/ | ||
private final long fireTime; | ||
|
||
CreatedTrigger(@NotNull String holderOid, long fireTime) { | ||
this.holderOid = holderOid; | ||
this.fireTime = fireTime; | ||
} | ||
|
||
@NotNull | ||
String getHolderOid() { | ||
return holderOid; | ||
} | ||
|
||
long getFireTime() { | ||
return fireTime; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CreatedTrigger{" + | ||
"holderOid='" + holderOid + '\'' + | ||
", fireTime=" + fireTime + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.