Package com.senzing.sdk.core
Class SzCoreEnvironment
java.lang.Object
com.senzing.sdk.core.SzCoreEnvironment
- All Implemented Interfaces:
SzEnvironment
Provides the core implementation of
SzEnvironment
that directly
initializes the Senzing SDK modules and provides management of the Senzing
environment in this process.
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The builder class for creating an instance ofSzCoreEnvironment
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default instance name to use for the Senzing intialization.static final String
The default "bootstrap" settings with which to initialize theSzCoreEnvironment
when an explicit settings value has not been provided viaSzCoreEnvironment.Builder.settings(String)
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroys thisSzEnvironment
and invalidates any SDK singleton references that has previously provided.long
Gets the currently active configuration ID for theSzEnvironment
.static SzCoreEnvironment
Gets the current active instance ofSzCoreEnvironment
.Provides a reference to theSzConfig
instance associated with thisSzEnvironment
.Provides a reference to theSzConfigManager
instance associated with thisSzEnvironment
.Provides a reference to theSzDiagnostic
instance associated with thisSzEnvironment
.Provides a reference to theSzEngine
instance associated with thisSzEnvironment
.Provides a reference to theSzProduct
instance associated with thisSzEnvironment
.boolean
Checks if this instance has had itsSzEnvironment.destroy()
method called.static SzCoreEnvironment.Builder
Creates a new instance ofSzCoreEnvironment.Builder
for setting up an instance ofSzCoreEnvironment
.void
reinitialize
(long configId) Reinitializes theSzEnvironment
with the specified configuration ID.
-
Field Details
-
DEFAULT_INSTANCE_NAME
The default instance name to use for the Senzing intialization. The value is""Senzing Instance"
. An explicit value can be provided viaSzCoreEnvironment.Builder.instanceName(String)
during initialization. -
DEFAULT_SETTINGS
The default "bootstrap" settings with which to initialize theSzCoreEnvironment
when an explicit settings value has not been provided viaSzCoreEnvironment.Builder.settings(String)
. If this is used it will initialize Senzing for access to only theSzProduct
andSzConfig
interfaces when Senzing installed in the default location for the platform. The value of this constant is"{ }"
.NOTE: Using these settings is only useful for accessing the
SzProduct
andSzConfig
interfaces sinceSzEngine
,SzConfigManager
andSzDiagnostic
require database configuration to connect to the Senzing repository.The value of this constant is
"{ }"
.
-
-
Method Details
-
newBuilder
Creates a new instance ofSzCoreEnvironment.Builder
for setting up an instance ofSzCoreEnvironment
. Keep in mind that while multipleSzCoreEnvironment.Builder
instances can exists, only one active instance ofSzCoreEnvironment
can exist at time. An active instance is one that has not yet been destroyed.- Returns:
- The
SzCoreEnvironment.Builder
for configuring and initializing theSzCoreEnvironment
.
-
getActiveInstance
Gets the current active instance ofSzCoreEnvironment
. An active instance is is one that has been constructed and has not yet been destroyed. There can be at most one active instance. If no active instance exists thennull
is returned.- Returns:
- The current active instance of
SzCoreEnvironment
, ornull
if there is no active instance.
-
getConfig
Description copied from interface:SzEnvironment
Provides a reference to theSzConfig
instance associated with thisSzEnvironment
.- Specified by:
getConfig
in interfaceSzEnvironment
- Returns:
- The
SzProduct
instance associated with thisSzEnvironment
. - Throws:
IllegalStateException
- If thisSzEnvironment
instance has been destroyed.SzException
- If there was a failure in obtaining or initializing theSzConfig
instance.
-
getConfigManager
Description copied from interface:SzEnvironment
Provides a reference to theSzConfigManager
instance associated with thisSzEnvironment
.- Specified by:
getConfigManager
in interfaceSzEnvironment
- Returns:
- The
SzConfigManager
instance associated with thisSzEnvironment
. - Throws:
IllegalStateException
- If thisSzEnvironment
instance has been destroyed.SzException
- If there was a failure in obtaining or initializing theSzConfigManager
instance.
-
getDiagnostic
Description copied from interface:SzEnvironment
Provides a reference to theSzDiagnostic
instance associated with thisSzEnvironment
.- Specified by:
getDiagnostic
in interfaceSzEnvironment
- Returns:
- The
SzDiagnostic
instance associated with thisSzEnvironment
. - Throws:
IllegalStateException
- If thisSzEnvironment
instance has been destroyed.SzException
- If there was a failure in obtaining or initializing theSzDiagnostic
instance.
-
getEngine
Description copied from interface:SzEnvironment
Provides a reference to theSzEngine
instance associated with thisSzEnvironment
.- Specified by:
getEngine
in interfaceSzEnvironment
- Returns:
- The
SzEngine
instance associated with thisSzEnvironment
. - Throws:
IllegalStateException
- If thisSzEnvironment
instance has been destroyed.SzException
- If there was a failure in obtaining or initializing theSzEngine
instance.
-
getProduct
Description copied from interface:SzEnvironment
Provides a reference to theSzProduct
instance associated with thisSzEnvironment
.- Specified by:
getProduct
in interfaceSzEnvironment
- Returns:
- The
SzProduct
instance associated with thisSzEnvironment
. - Throws:
IllegalStateException
- If thisSzEnvironment
instance has been destroyed.SzException
- If there was a failure in obtaining or initializing theSzProduct
instance.
-
destroy
public void destroy()Description copied from interface:SzEnvironment
Destroys thisSzEnvironment
and invalidates any SDK singleton references that has previously provided. If this instance has already been destroyed then this method has no effect.- Specified by:
destroy
in interfaceSzEnvironment
-
isDestroyed
public boolean isDestroyed()Description copied from interface:SzEnvironment
Checks if this instance has had itsSzEnvironment.destroy()
method called.- Specified by:
isDestroyed
in interfaceSzEnvironment
- Returns:
true
if this instance has had itsSzEnvironment.destroy()
method called, otherwisefalse
.
-
getActiveConfigId
Description copied from interface:SzEnvironment
Gets the currently active configuration ID for theSzEnvironment
.- Specified by:
getActiveConfigId
in interfaceSzEnvironment
- Returns:
- The currently active configuration ID.
- Throws:
IllegalStateException
- If thisSzEnvironment
instance has been destroyed.SzException
- If there was a failure in obtaining or initializing theSzDiagnostic
instance.
-
reinitialize
Description copied from interface:SzEnvironment
Reinitializes theSzEnvironment
with the specified configuration ID.- Specified by:
reinitialize
in interfaceSzEnvironment
- Parameters:
configId
- The configuraiton ID with which to initialize.- Throws:
IllegalStateException
- If thisSzEnvironment
instance has been destroyed.SzException
- If there was a failure in obtaining or initializing theSzDiagnostic
instance.
-