Class JdbcTableBackupResourceProvider

java.lang.Object
net.solarnetwork.node.dao.jdbc.JdbcTableBackupResourceProvider
All Implemented Interfaces:
net.solarnetwork.node.backup.BackupResourceProvider

public class JdbcTableBackupResourceProvider extends Object implements net.solarnetwork.node.backup.BackupResourceProvider
Backup support for JDBC tables.
Since:
1.17
Version:
1.3
Author:
matt
  • Constructor Summary

    Constructors
    Constructor
    Description
    JdbcTableBackupResourceProvider(String key, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.springframework.core.task.TaskExecutor taskExecutor)
    Constructor.
    JdbcTableBackupResourceProvider(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.springframework.core.task.TaskExecutor taskExecutor)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Iterable<net.solarnetwork.node.backup.BackupResource>
     
     
    net.solarnetwork.node.backup.BackupResourceProviderInfo
     
    net.solarnetwork.node.backup.BackupResourceInfo
    resourceInfo(net.solarnetwork.node.backup.BackupResource resource, Locale locale)
     
    boolean
    restoreBackupResource(net.solarnetwork.node.backup.BackupResource resource)
     
    void
    setMessageSource(org.springframework.context.MessageSource messageSource)
    Set a MessageSource to use for resolving backup info messages.
    void
    setTableNames(String[] tableNames)
    Set the list of table names to back up.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JdbcTableBackupResourceProvider

      public JdbcTableBackupResourceProvider(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.springframework.core.task.TaskExecutor taskExecutor)
      Constructor.

      This will default to a backup provider key of net.solarnetwork.node.dao.jdbc.JdbcTableBackupResourceProvider.

      Parameters:
      jdbcTemplate - The JDBC template to use.
      transactionTemplate - A transaction template to use, for supporting savepoints.
      taskExecutor - A task executor to use.
    • JdbcTableBackupResourceProvider

      public JdbcTableBackupResourceProvider(String key, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.springframework.core.task.TaskExecutor taskExecutor)
      Constructor.
      Parameters:
      key - the backup provider key to use
      jdbcTemplate - The JDBC template to use.
      transactionTemplate - A transaction template to use, for supporting savepoints.
      taskExecutor - A task executor to use.
      Since:
      1.3
  • Method Details

    • getKey

      public String getKey()
      Specified by:
      getKey in interface net.solarnetwork.node.backup.BackupResourceProvider
    • getBackupResources

      public Iterable<net.solarnetwork.node.backup.BackupResource> getBackupResources()
      Specified by:
      getBackupResources in interface net.solarnetwork.node.backup.BackupResourceProvider
    • restoreBackupResource

      public boolean restoreBackupResource(net.solarnetwork.node.backup.BackupResource resource)
      Specified by:
      restoreBackupResource in interface net.solarnetwork.node.backup.BackupResourceProvider
    • providerInfo

      public net.solarnetwork.node.backup.BackupResourceProviderInfo providerInfo(Locale locale)
      Specified by:
      providerInfo in interface net.solarnetwork.node.backup.BackupResourceProvider
    • resourceInfo

      public net.solarnetwork.node.backup.BackupResourceInfo resourceInfo(net.solarnetwork.node.backup.BackupResource resource, Locale locale)
      Specified by:
      resourceInfo in interface net.solarnetwork.node.backup.BackupResourceProvider
    • setTableNames

      public void setTableNames(String[] tableNames)
      Set the list of table names to back up. The names should be fully-qualified like schema.table.
      Parameters:
      tableNames - The tables to back up.
    • setMessageSource

      public void setMessageSource(org.springframework.context.MessageSource messageSource)
      Set a MessageSource to use for resolving backup info messages.
      Parameters:
      messageSource - The message source to use.
      Since:
      1.2