Interface SzConfigManager
Defines the C# interface to the Senzing config manager functions.
public interface SzConfigManager
Remarks
The Senzing config functions provide means to manage the configurations that are stored in the Senzing repository including the default configuration that will be loaded if no config ID is specified during initialization.
Methods
AddConfig(string, string)
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.
long AddConfig(string configDefinition, string configComment)
Parameters
configDefinition
stringThe JSON text describing the configuration.
configComment
stringThe comments for the configuration.
Returns
- long
The identifier for referncing the config in the entity repository.
Exceptions
- SzException
If a failure occurs.
GetConfig(long)
Gets the configuration with the specified config ID and returns the
configuration defintion as a string
.
string GetConfig(long configID)
Parameters
configID
longThe configuration ID of the configuration to retrieve.
Returns
- string
The configuration definition as a
string
Exceptions
- SzException
If a failure occurs.
GetConfigs()
Gets the list of saved configuration ID's with their comments and
timestamps and return the JSON string
describing them.
string GetConfigs()
Returns
- string
The JSON
string
describing the configurations registered in the entity repository with their identifiers, timestamps and comments.
Remarks
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"
},
. . .
]
}
Exceptions
- SzException
If a failure occurs.
GetDefaultConfigID()
Gets the configuration ID of the default configuration for the repository and returns it.
long GetDefaultConfigID()
Returns
- long
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.
Remarks
If the entity repository is in the initial state and the default configuration ID has not yet been set, then zero (0) is returned.
Exceptions
- SzException
If a failure occurs.
ReplaceDefaultConfigID(long, long)
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 ReplaceDefaultConfigID(long currentDefaultConfigID, long newDefaultConfigID)
Parameters
currentDefaultConfigID
longThe configuration ID that is believed to be the current default configuration ID.
newDefaultConfigID
longThe new configuration ID for the repository.
Remarks
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 an SzReplaceConflictException.
Exceptions
- 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(long)
Sets the default configuration for the repository to the specified configuration ID.
void SetDefaultConfigID(long configID)
Parameters
configID
longThe configuration ID to set as the default configuration.
Exceptions
- SzException
If a failure occurs.