Package net.solarnetwork.node.dao.jdbc
Class RestoreFromBackupSQLExceptionHandler
java.lang.Object
net.solarnetwork.node.dao.jdbc.AbstractSQLExceptionHandler
net.solarnetwork.node.dao.jdbc.RestoreFromBackupSQLExceptionHandler
- All Implemented Interfaces:
net.solarnetwork.dao.jdbc.SQLExceptionHandler
Recover from connection exceptions by restoring from backup.
- Version:
- 2.1
- Author:
- matt
-
Field Summary
Fields inherited from class net.solarnetwork.node.dao.jdbc.AbstractSQLExceptionHandler
log -
Constructor Summary
ConstructorsConstructorDescriptionRestoreFromBackupSQLExceptionHandler(org.osgi.framework.BundleContext bundleContext, int minimumExceptionCount) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidsetBackupResourceProviderFilter(String backupResourceProviderFilter) Set a filter to pass asBackupManager.RESOURCE_PROVIDER_FILTERto limit the scope of the backup.voidsetIdentityService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.IdentityService> identityService) Set anIdentityServiceto know the current node identity to associate backups with.voidsetRestoreDelaySeconds(int restoreDelaySeconds) Set the number of seconds to delay the restore from backup.Methods inherited from class net.solarnetwork.node.dao.jdbc.AbstractSQLExceptionHandler
exceptionMatchingSqlStatePattern, getSqlStatePatterns, setSqlStatePatterns, setSqlStateRegexMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.dao.jdbc.SQLExceptionHandler
handleConnectionException, handleGetConnectionException
-
Constructor Details
-
RestoreFromBackupSQLExceptionHandler
public RestoreFromBackupSQLExceptionHandler(org.osgi.framework.BundleContext bundleContext, int minimumExceptionCount) Constructor.- Parameters:
bundleContext- The active bundle context.minimumExceptionCount- The minimum number of exceptions to witness before attempting to restore from backup.
-
-
Method Details
-
handleGetConnectionException
-
handleConnectionException
-
setRestoreDelaySeconds
public void setRestoreDelaySeconds(int restoreDelaySeconds) Set the number of seconds to delay the restore from backup. This is mainly to give the framework a time to boot up and provide theBackupManagerservice.- Parameters:
restoreDelaySeconds- The number of seconds to delay attempting the restore from backup.
-
setBackupResourceProviderFilter
Set a filter to pass asBackupManager.RESOURCE_PROVIDER_FILTERto limit the scope of the backup.- Parameters:
backupResourceProviderFilter- The filter to set.
-
setIdentityService
public void setIdentityService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.IdentityService> identityService) Set anIdentityServiceto know the current node identity to associate backups with.- Parameters:
identityService- the identity service to use- Since:
- 1.1
-