Package com.netscape.cmscore.selftests
Class SelfTestSubsystem
java.lang.Object
com.netscape.cmscore.selftests.SelfTestSubsystem
- All Implemented Interfaces:
ISubsystem
,ISelfTestSubsystem
This class implements a container for self tests.
- Version:
- $Revision$, $Date$
- Author:
- mharmsen, thomask
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.slf4j.Logger
Fields inherited from interface com.netscape.certsrv.selftests.ISelfTestSubsystem
ID, PROP_CONTAINER, PROP_INSTANCE, PROP_LOGGER, PROP_LOGGER_CLASS, PROP_ON_DEMAND, PROP_ORDER, PROP_STARTUP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
deregisterSelfTestAtStartup
(String instanceName) Deregister an individual self test on the instances list AND on the "startup" list (note that the specified self test will be removed from each list).void
deregisterSelfTestOnDemand
(String instanceName) Deregister an individual self test on the instances list AND on the "on demand" list (note that the specified self test will be removed from each list).void
disableSelfTestAtStartup
(String instanceName) Disable the specified self test at server startup.void
disableSelfTestOnDemand
(String instanceName) Disable the specified self test from being able to be executed on demand.void
enableSelfTestAtStartup
(String instanceName, boolean isCritical) Enable the specified self test at server startup.void
enableSelfTestOnDemand
(String instanceName, boolean isCritical) Enable the specified self test to be executed on demand.Returns the root configuration storage of this subsystem.getId()
This method retrieves the name of this subsystem.getSelfTest
(String instanceName) Retrieve an individual self test from the instances list given its instance name.Returns the ILogEventListener of this subsystem.void
init
(ConfigStore config) This method initializes this subsystem.boolean
isSelfTestCriticalAtStartup
(String instanceName) Determine if failure of the specified self test is fatal to server startup.boolean
isSelfTestCriticalOnDemand
(String instanceName) Determine if failure of the specified self test is fatal when it is executed on demand.boolean
isSelfTestEnabledAtStartup
(String instanceName) Determine if the specified self test is executed automatically at server startup.boolean
isSelfTestEnabledOnDemand
(String instanceName) Determine if the specified self test is enabled to be executed on demand.String[]
List the instance names of all the self tests enabled to run at server startup (in execution order); may return null.String[]
List the instance names of all the self tests enabled to run on demand (in execution order); may return null.void
void
log
(ILogEventListener logger, String msg) This method represents the log interface for the self test subsystem.void
registerSelfTestAtStartup
(String instanceName, boolean isCritical, ISelfTest instance) Register an individual self test on the instances list AND on the "startup" list (note that the specified self test will be appended to the end of each list).void
registerSelfTestOnDemand
(String instanceName, boolean isCritical, ISelfTest instance) Register an individual self test on the instances list AND on the "on demand" list (note that the specified self test will be appended to the end of each list).void
runSelfTest
(String instanceName) Execute a self test.void
Execute all self tests specified to be run at server startup.void
Execute all self tests specified to be run on demand.void
This method sets information specific to this subsystem.void
shutdown()
Stops this subsystem.void
startup()
Notifies this subsystem if owner is in running mode.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
mSelfTestInstances
-
mOnDemandOrder
-
mStartupOrder
-
-
Constructor Details
-
SelfTestSubsystem
public SelfTestSubsystem()
-
-
Method Details
-
audit
-
getSelfTestNames
- Specified by:
getSelfTestNames
in interfaceISelfTestSubsystem
-
listSelfTestsEnabledOnDemand
List the instance names of all the self tests enabled to run on demand (in execution order); may return null.- Specified by:
listSelfTestsEnabledOnDemand
in interfaceISelfTestSubsystem
- Returns:
- list of self test instance names run on demand
-
enableSelfTestOnDemand
public void enableSelfTestOnDemand(String instanceName, boolean isCritical) throws EInvalidSelfTestException, EMissingSelfTestException Enable the specified self test to be executed on demand.- Parameters:
instanceName
- instance name of self testisCritical
- isCritical is either a critical failure (true) or a non-critical failure (false)- Throws:
EInvalidSelfTestException
- subsystem has invalid name/valueEMissingSelfTestException
- subsystem has missing name/value
-
disableSelfTestOnDemand
Disable the specified self test from being able to be executed on demand.- Parameters:
instanceName
- instance name of self test- Throws:
EMissingSelfTestException
- subsystem has missing name
-
isSelfTestEnabledOnDemand
Determine if the specified self test is enabled to be executed on demand.- Specified by:
isSelfTestEnabledOnDemand
in interfaceISelfTestSubsystem
- Parameters:
instanceName
- instance name of self test- Returns:
- true if the specified self test is enabled on demand
- Throws:
EMissingSelfTestException
- subsystem has missing name
-
isSelfTestCriticalOnDemand
Determine if failure of the specified self test is fatal when it is executed on demand.- Specified by:
isSelfTestCriticalOnDemand
in interfaceISelfTestSubsystem
- Parameters:
instanceName
- instance name of self test- Returns:
- true if failure of the specified self test is fatal when it is executed on demand
- Throws:
EMissingSelfTestException
- subsystem has missing name
-
runSelfTestsOnDemand
Execute all self tests specified to be run on demand.- Specified by:
runSelfTestsOnDemand
in interfaceISelfTestSubsystem
- Throws:
EMissingSelfTestException
- subsystem has missing nameESelfTestException
- self test exception
-
runSelfTest
Description copied from interface:ISelfTestSubsystem
Execute a self test.- Specified by:
runSelfTest
in interfaceISelfTestSubsystem
- Throws:
Exception
- self test exception
-
listSelfTestsEnabledAtStartup
List the instance names of all the self tests enabled to run at server startup (in execution order); may return null.- Specified by:
listSelfTestsEnabledAtStartup
in interfaceISelfTestSubsystem
- Returns:
- list of self test instance names run at server startup
-
enableSelfTestAtStartup
public void enableSelfTestAtStartup(String instanceName, boolean isCritical) throws EInvalidSelfTestException, EMissingSelfTestException Enable the specified self test at server startup.- Parameters:
instanceName
- instance name of self testisCritical
- isCritical is either a critical failure (true) or a non-critical failure (false)- Throws:
EInvalidSelfTestException
- subsystem has invalid name/valueEMissingSelfTestException
- subsystem has missing name/value
-
disableSelfTestAtStartup
Disable the specified self test at server startup.- Parameters:
instanceName
- instance name of self test- Throws:
EMissingSelfTestException
- subsystem has missing name
-
isSelfTestEnabledAtStartup
Determine if the specified self test is executed automatically at server startup.- Specified by:
isSelfTestEnabledAtStartup
in interfaceISelfTestSubsystem
- Parameters:
instanceName
- instance name of self test- Returns:
- true if the specified self test is executed at server startup
- Throws:
EMissingSelfTestException
- subsystem has missing name
-
isSelfTestCriticalAtStartup
Determine if failure of the specified self test is fatal to server startup.- Specified by:
isSelfTestCriticalAtStartup
in interfaceISelfTestSubsystem
- Parameters:
instanceName
- instance name of self test- Returns:
- true if failure of the specified self test is fatal to server startup
- Throws:
EMissingSelfTestException
- subsystem has missing name
-
runSelfTestsAtStartup
Execute all self tests specified to be run at server startup.- signed.audit LOGGING_SIGNED_AUDIT_SELFTESTS_EXECUTION used when self tests are run at server startup
- Specified by:
runSelfTestsAtStartup
in interfaceISelfTestSubsystem
- Throws:
EMissingSelfTestException
- subsystem has missing nameException
- self test exception
-
log
-
getSelfTest
Retrieve an individual self test from the instances list given its instance name. This method may return null.- Specified by:
getSelfTest
in interfaceISelfTestSubsystem
- Parameters:
instanceName
- instance name of self test- Returns:
- individual self test
-
getSelfTestLogger
Returns the ILogEventListener of this subsystem. This method may return null.- Specified by:
getSelfTestLogger
in interfaceISelfTestSubsystem
- Returns:
- ILogEventListener of this subsystem
-
log
This method represents the log interface for the self test subsystem.- Specified by:
log
in interfaceISelfTestSubsystem
- Parameters:
logger
- log event listenermsg
- self test log message
-
registerSelfTestOnDemand
public void registerSelfTestOnDemand(String instanceName, boolean isCritical, ISelfTest instance) throws EDuplicateSelfTestException, EInvalidSelfTestException, EMissingSelfTestException Register an individual self test on the instances list AND on the "on demand" list (note that the specified self test will be appended to the end of each list).- Parameters:
instanceName
- instance name of self testisCritical
- isCritical is either a critical failure (true) or a non-critical failure (false)instance
- individual self test- Throws:
EDuplicateSelfTestException
- subsystem has duplicate nameEInvalidSelfTestException
- subsystem has invalid name/valueEMissingSelfTestException
- subsystem has missing name/value
-
deregisterSelfTestOnDemand
Deregister an individual self test on the instances list AND on the "on demand" list (note that the specified self test will be removed from each list).- Parameters:
instanceName
- instance name of self test- Throws:
EMissingSelfTestException
- subsystem has missing name
-
registerSelfTestAtStartup
public void registerSelfTestAtStartup(String instanceName, boolean isCritical, ISelfTest instance) throws EDuplicateSelfTestException, EInvalidSelfTestException, EMissingSelfTestException Register an individual self test on the instances list AND on the "startup" list (note that the specified self test will be appended to the end of each list).- Parameters:
instanceName
- instance name of self testisCritical
- isCritical is either a critical failure (true) or a non-critical failure (false)instance
- individual self test- Throws:
EDuplicateSelfTestException
- subsystem has duplicate nameEInvalidSelfTestException
- subsystem has invalid name/valueEMissingSelfTestException
- subsystem has missing name/value
-
deregisterSelfTestAtStartup
Deregister an individual self test on the instances list AND on the "startup" list (note that the specified self test will be removed from each list).- Parameters:
instanceName
- instance name of self test- Throws:
EMissingSelfTestException
- subsystem has missing name
-
getId
This method retrieves the name of this subsystem. This method may return null.- Specified by:
getId
in interfaceISubsystem
- Returns:
- identification of this subsystem
-
setId
This method sets information specific to this subsystem.- Specified by:
setId
in interfaceISubsystem
- Parameters:
id
- identification of this subsystem- Throws:
EBaseException
- base CMS exception
-
init
This method initializes this subsystem.- Specified by:
init
in interfaceISubsystem
- Parameters:
config
- configuration store- Throws:
EBaseException
- base CMS exception
-
startup
Notifies this subsystem if owner is in running mode.- Specified by:
startup
in interfaceISubsystem
- Throws:
EBaseException
- base CMS exception
-
shutdown
public void shutdown()Stops this subsystem. The owner may call shutdown anytime after initialization.- Specified by:
shutdown
in interfaceISubsystem
-
getConfigStore
Returns the root configuration storage of this subsystem. This method may return null.- Specified by:
getConfigStore
in interfaceISubsystem
- Returns:
- configuration store of this subsystem
-