Package org.eblocker.server.http.service
Class ConfigurationBackupService
java.lang.Object
org.eblocker.server.http.service.ConfigurationBackupService
This service exports/imports configuration to/from a JAR file.
The configuration version is written to the JAR's manifest file.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurationBackupService(DataSource dataSource, BackupProviderFactory providerFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidexportConfiguration(OutputStream outputStream, String password) Exports the configuration to the given OutputStream.importConfiguration(InputStream inputStream, String password) Imports the configuration from the given InputStream.booleanrequiresPassword(InputStream inputStream) Reads the manifest from the given InputStream and returns whether a password is required to read the contained private keysverifyConfiguration(InputStream inputStream, String password) Verifies the configuration from the given InputStream.
-
Constructor Details
-
ConfigurationBackupService
@Inject public ConfigurationBackupService(DataSource dataSource, BackupProviderFactory providerFactory)
-
-
Method Details
-
exportConfiguration
Exports the configuration to the given OutputStream. The user can provide a password in order to export private keys.- Parameters:
outputStream-password-- Throws:
IOException
-
requiresPassword
Reads the manifest from the given InputStream and returns whether a password is required to read the contained private keys- Parameters:
inputStream-- Returns:
- Throws:
IOException
-
verifyConfiguration
public ConfigBackupImportResult verifyConfiguration(InputStream inputStream, String password) throws IOException Verifies the configuration from the given InputStream. If the user has provided a password, private keys are verified.- Parameters:
inputStream-password-- Throws:
IOException
-
importConfiguration
public ConfigBackupImportResult importConfiguration(InputStream inputStream, String password) throws IOException Imports the configuration from the given InputStream. If the user has provided a password, private keys are imported.- Parameters:
inputStream-password-- Throws:
IOException
-