Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Evolveum/midpoint
- Loading branch information
Showing
10 changed files
with
156 additions
and
52 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
29 changes: 0 additions & 29 deletions
29
...po-api/src/main/java/com/evolveum/midpoint/repo/api/SystemConfigurationChangeApplier.java
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
...api/src/main/java/com/evolveum/midpoint/repo/api/SystemConfigurationChangeDispatcher.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,53 @@ | ||
/* | ||
* Copyright (c) 2010-2018 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.repo.api; | ||
|
||
import com.evolveum.midpoint.schema.result.OperationResult; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
|
||
/** | ||
* Central point of dispatching notifications about changes to the system configuration object. | ||
* | ||
* @author mederly | ||
*/ | ||
public interface SystemConfigurationChangeDispatcher { | ||
|
||
/** | ||
* Dispatches information on system configuration object change. | ||
* | ||
* Basically this directly pushes information to lower layers (prism, schema, repo, etc), and calls registered | ||
* listeners that originate in upper layers. | ||
* | ||
* @param ignoreVersion If false, the information is dispatched unconditionally. If true, we dispatch the notification only | ||
* if the system configuration version was really changed. This is to easily support sources that | ||
* "ping" sysconfig object in regular intervals, e.g. the cluster manager thread. | ||
* @param allowNotFound If true, we take non-existence of sysconfig object more easily. To be used e.g. on system init or | ||
* during tests execution. | ||
*/ | ||
void dispatch(boolean ignoreVersion, boolean allowNotFound, OperationResult result) throws SchemaException; | ||
|
||
/** | ||
* Registers a listener that will be updated on system configuration object changes. | ||
*/ | ||
void registerListener(SystemConfigurationChangeListener listener); | ||
|
||
/** | ||
* Unregisters a listener. | ||
*/ | ||
void unregisterListener(SystemConfigurationChangeListener listener); | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...o-api/src/main/java/com/evolveum/midpoint/repo/api/SystemConfigurationChangeListener.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,37 @@ | ||
/* | ||
* Copyright (c) 2010-2018 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.repo.api; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Listener that needs to receive notifications related to system configuration object changes. | ||
*/ | ||
public interface SystemConfigurationChangeListener { | ||
/** | ||
* Updates the listener's internal state with the configuration provided. | ||
* | ||
* @param value Current value of the system configuration object. It is 'null' if the object does not exist. | ||
* Usually listeners keep their current state in such cases, but if needed, it will have the information | ||
* about missing sysconfig object, so it could act accordingly. | ||
* | ||
* @return false if the update was not successful, so it needs to be repeated. The same effect is when | ||
* a runtime exception is thrown. | ||
*/ | ||
boolean update(@Nullable SystemConfigurationType value); | ||
} |
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