Package com.senzing.sdk.core
Class SzCoreConfigManager
java.lang.Object
com.senzing.sdk.core.SzCoreConfigManager
- All Implemented Interfaces:
SzConfigManager
The package-protected implementation of
SzConfigManager
that works
with the SzCoreEnvironment
class.-
Method Summary
Modifier and TypeMethodDescriptionlong
Adds the configuration described by the specified JSON to the repository with the specified comment and returns the identifier for referencing the the config in the entity repository.getConfig
(long configId) Gets the configuration with the specified config ID and returns the configuration defintion as aString
.Gets the list of saved configuration ID's with their comments and timestamps and return the JSONString
describing them.long
Gets the configuration ID of the default configuration for the repository and returns it.protected boolean
Checks if this instance has been destroyed by the associatedSzCoreEnvironment
.void
replaceDefaultConfigId
(long currentDefaultConfigId, long newDefaultConfigId) Replaces the current configuration ID of the repository with the specified new configuration ID providing the current configuration ID of the repository is equal to the specified old configuration ID.void
setDefaultConfigId
(long configId) Sets the default configuration for the repository to the specified configuration ID.
-
Method Details
-
isDestroyed
protected boolean isDestroyed()Checks if this instance has been destroyed by the associatedSzCoreEnvironment
.- Returns:
true
if this instance has been destroyed, otherwisefalse
.
-
addConfig
Adds the configuration described by the specified JSON to the repository with the specified comment and returns the identifier for referencing the the config in the entity repository.Implemented to call the underlying native function.
- Specified by:
addConfig
in interfaceSzConfigManager
- Parameters:
configDefinition
- The JSON text describing the configuration.configComment
- The comments for the configuration.- Returns:
- The identifier for referncing the config in the entity repository.
- Throws:
SzException
- If a failure occurs.
-
getConfig
Gets the configuration with the specified config ID and returns the configuration defintion as aString
.Implemented to call the underlying native function.
- Specified by:
getConfig
in interfaceSzConfigManager
- Parameters:
configId
- The configuration ID of the configuration to retrieve.- Returns:
- The configuration definition as a
String
. - Throws:
SzException
- If a failure occurs.
-
getConfigs
Gets the list of saved configuration ID's with their comments and timestamps and return the JSONString
describing them. An example format for the response is:{ "CONFIGS": [ { "CONFIG_ID": 12345678912345, "SYS_CREATE_DT": "2021-03-25 18:35:00.743", "CONFIG_COMMENTS": "Added EMPLOYEES data source." }, { "CONFIG_ID": 23456789123456, "SYS_CREATE_DT": "2021-02-08 23:27:09.876", "CONFIG_COMMENTS": "Added CUSTOMERS data source." }, { "CONFIG_ID": 34567891234567, "SYS_CREATE_DT": "2021-02-08 23:27:05.212", "CONFIG_COMMENTS": "Initial Config" }, . . . ] }
Implemented to call the underlying native function.
- Specified by:
getConfigs
in interfaceSzConfigManager
- Returns:
- The JSON
String
describing the configurations registered in the entity repository with their identifiers, timestamps and comments. - Throws:
SzException
- If a failure occurs.
-
getDefaultConfigId
Gets the configuration ID of the default configuration for the repository and returns it. If the entity repository is in the initial state and the default configuration ID has not yet been set, then zero (0) is returned.Implemented to call the underlying native function.
- Specified by:
getDefaultConfigId
in interfaceSzConfigManager
- Returns:
- The current default cofiguration ID in the repository, or zero (0) if the entity repository is in the initial state with no default configuration ID having yet been set.
- Throws:
SzException
- If a failure occurs.
-
replaceDefaultConfigId
public void replaceDefaultConfigId(long currentDefaultConfigId, long newDefaultConfigId) throws SzException Replaces the current configuration ID of the repository with the specified new configuration ID providing the current configuration ID of the repository is equal to the specified old configuration ID. If the current configuration ID is not the same as the specified old configuration ID then this method fails to replace the default configuration ID with the new value and anSzReplaceConflictException
is thrown.Implemented to call the underlying native function.
- Specified by:
replaceDefaultConfigId
in interfaceSzConfigManager
- Parameters:
currentDefaultConfigId
- The configuration ID that is believed to be the current default configuration ID.newDefaultConfigId
- The new configuration ID for the repository.- Throws:
SzReplaceConflictException
- If the default configuration ID was not updated to the specified new value because the current default configuration ID found in the repository was not equal to the specified expected current default configuration ID value.SzException
- If a failure occurs.
-
setDefaultConfigId
Sets the default configuration for the repository to the specified configuration ID.Implemented to call the underlying native function.
- Specified by:
setDefaultConfigId
in interfaceSzConfigManager
- Parameters:
configId
- The configuration ID to set as the default configuration.- Throws:
SzException
- If a failure occurs.
-