Package com.morpheusdata.core.backup
Class AbstractBackupProvider
- java.lang.Object
-
- com.morpheusdata.core.backup.AbstractBackupProvider
-
- All Implemented Interfaces:
BackupProvider
,PluginProvider
public abstract class AbstractBackupProvider extends java.lang.Object implements BackupProvider
Provides a standard set of methods for aBackupProvider
. A backup provider is the primary connection to the external provider services. The backup provider supplies providers for provision types and/or container types via theBackupTypeProviders
implemented within the provider.- Since:
- 0.13.4
-
-
Field Summary
-
Fields inherited from interface com.morpheusdata.core.backup.BackupProvider
scopedProviders
-
-
Constructor Summary
Constructors Constructor Description AbstractBackupProvider(Plugin plugin, MorpheusContext context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addScopedProvider(BackupTypeProvider backupTypeProvider, java.lang.String provisionTypeCode, java.lang.String containerTypeCode)
Add a scoped backup provider.void
addScopedProvider(BackupIntegration backupIntegration)
Add a scoped backup provider.ServiceResponse
addToBackupJob(BackupJob backupJobModel, java.util.Map opts)
ServiceResponse
cloneBackupJob(BackupJob sourceBackupJobModel, BackupJob backupJobModel, java.util.Map opts)
ServiceResponse
configureBackupJob(BackupJob backupJobModel, java.util.Map config, java.util.Map opts)
ServiceResponse
configureBackupProvider(BackupProvider backupProviderModel, java.util.Map config, java.util.Map opts)
ServiceResponse
createBackupJob(BackupJob backupJobModel, java.util.Map opts)
ServiceResponse
deleteBackupJob(BackupJob backupJobModel, java.util.Map opts)
ServiceResponse
executeBackupJob(BackupJob backupJobModel, java.util.Map opts)
abstract BackupJobProvider
getBackupJobProvider()
Get theBackupJobProvider
responsible for all backup job operations in this backup provider TheDefaultBackupJobProvider
can be used if the provider would like morpheus to handle all job operations.java.util.Collection<BackupTypeProvider>
getBackupProviders()
Get the list ofBackupTypeProviders
associated with this backup providerjava.lang.Boolean
getCreatable()
Is this backup provider creatable by the end user.java.lang.String
getDefaultJobType()
java.lang.Boolean
getDownloadEnabled()
Does this provider allow the end user to download a backup.java.lang.Boolean
getEnabled()
Sets the enabled state of the provider for consumer use.java.lang.Boolean
getHasAddToJob()
java.lang.Boolean
getHasBackups()
java.lang.Boolean
getHasCloneJob()
java.lang.Boolean
getHasCopyToStore()
java.lang.Boolean
getHasCreateJob()
java.lang.Boolean
getHasJobs()
java.lang.Boolean
getHasOptionalJob()
java.lang.Boolean
getHasReplication()
java.lang.Boolean
getHasReplicationGroups()
java.lang.Boolean
getHasRepositories()
java.lang.Boolean
getHasRetentionCount()
java.lang.Boolean
getHasSchedule()
java.lang.Boolean
getHasServers()
java.lang.Boolean
getHasSites()
java.lang.Boolean
getHasStreamToStore()
MorpheusContext
getMorpheus()
Returns the Morpheus Context for interacting with data stored in the Main Morpheus ApplicationPlugin
getPlugin()
Returns the instance of the Plugin class that this provider is loaded fromjava.lang.Boolean
getRestoreExistingEnabled()
java.lang.Boolean
getRestoreNewEnabled()
java.util.Collection<BackupIntegration>
getScopedProviders()
Get the list ofBackupIntegrations
associated with this backup providerjava.lang.String
getViewSet()
Returns a viewset for reference custom inputs when setting up a backup provider during add instance.java.lang.Boolean
hasCancelBackup()
java.lang.Boolean
hasStorageProvider()
ServiceResponse
initializeBackupProvider(BackupProvider backupProviderModel, java.util.Map opts)
ServiceResponse
updateBackupProvider(BackupProvider backupProviderModel, java.util.Map opts)
ServiceResponse
validateBackupJob(BackupJob backupJobModel, java.util.Map config, java.util.Map opts)
ServiceResponse
validateBackupProvider(BackupProvider backupProviderModel, java.util.Map opts)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.morpheusdata.core.backup.BackupProvider
deleteBackupProvider, getBackupJobOptionTypes, getBackupOptionTypes, getIcon, getInstanceReplicationGroupOptionTypes, getOptionTypes, getReplicationGroupOptionTypes, getReplicationOptionTypes, refresh
-
Methods inherited from interface com.morpheusdata.core.PluginProvider
getCode, getName, isPlugin
-
-
-
-
Constructor Detail
-
AbstractBackupProvider
public AbstractBackupProvider(Plugin plugin, MorpheusContext context)
-
-
Method Detail
-
getMorpheus
public MorpheusContext getMorpheus()
Description copied from interface:PluginProvider
Returns the Morpheus Context for interacting with data stored in the Main Morpheus Application- Specified by:
getMorpheus
in interfacePluginProvider
- Returns:
- an implementation of the MorpheusContext for running Future based rxJava queries
-
getPlugin
public Plugin getPlugin()
Description copied from interface:PluginProvider
Returns the instance of the Plugin class that this provider is loaded from- Specified by:
getPlugin
in interfacePluginProvider
- Returns:
- Plugin class contains references to other providers
-
getEnabled
public java.lang.Boolean getEnabled()
Description copied from interface:BackupProvider
Sets the enabled state of the provider for consumer use. NOTE: This may go away as this should be implied by the installation state of the plugin- Specified by:
getEnabled
in interfaceBackupProvider
- Returns:
- if this provider is usable.
-
getCreatable
public java.lang.Boolean getCreatable()
Description copied from interface:BackupProvider
Is this backup provider creatable by the end user. This could be false for providers that may be forced by specific CloudProvider plugins, for example.- Specified by:
getCreatable
in interfaceBackupProvider
- Returns:
- the creatable state
-
getViewSet
public java.lang.String getViewSet()
Description copied from interface:BackupProvider
Returns a viewset for reference custom inputs when setting up a backup provider during add instance. This is the old way and is no longer being used- Specified by:
getViewSet
in interfaceBackupProvider
- Returns:
-
getDownloadEnabled
public java.lang.Boolean getDownloadEnabled()
Description copied from interface:BackupProvider
Does this provider allow the end user to download a backup. Some backup providers can allow the user to download the backup archive file.- Specified by:
getDownloadEnabled
in interfaceBackupProvider
- Returns:
- whether the backup can be downloaded.
-
getHasAddToJob
public java.lang.Boolean getHasAddToJob()
- Specified by:
getHasAddToJob
in interfaceBackupProvider
-
getHasBackups
public java.lang.Boolean getHasBackups()
- Specified by:
getHasBackups
in interfaceBackupProvider
-
hasCancelBackup
public java.lang.Boolean hasCancelBackup()
- Specified by:
hasCancelBackup
in interfaceBackupProvider
-
getHasCloneJob
public java.lang.Boolean getHasCloneJob()
- Specified by:
getHasCloneJob
in interfaceBackupProvider
-
getHasCopyToStore
public java.lang.Boolean getHasCopyToStore()
- Specified by:
getHasCopyToStore
in interfaceBackupProvider
-
getHasCreateJob
public java.lang.Boolean getHasCreateJob()
- Specified by:
getHasCreateJob
in interfaceBackupProvider
-
getHasJobs
public java.lang.Boolean getHasJobs()
- Specified by:
getHasJobs
in interfaceBackupProvider
-
getDefaultJobType
public java.lang.String getDefaultJobType()
- Specified by:
getDefaultJobType
in interfaceBackupProvider
-
getHasOptionalJob
public java.lang.Boolean getHasOptionalJob()
- Specified by:
getHasOptionalJob
in interfaceBackupProvider
-
getHasReplication
public java.lang.Boolean getHasReplication()
- Specified by:
getHasReplication
in interfaceBackupProvider
-
getHasReplicationGroups
public java.lang.Boolean getHasReplicationGroups()
- Specified by:
getHasReplicationGroups
in interfaceBackupProvider
-
getHasRepositories
public java.lang.Boolean getHasRepositories()
- Specified by:
getHasRepositories
in interfaceBackupProvider
-
getHasRetentionCount
public java.lang.Boolean getHasRetentionCount()
- Specified by:
getHasRetentionCount
in interfaceBackupProvider
-
getHasSchedule
public java.lang.Boolean getHasSchedule()
- Specified by:
getHasSchedule
in interfaceBackupProvider
-
getHasServers
public java.lang.Boolean getHasServers()
- Specified by:
getHasServers
in interfaceBackupProvider
-
getHasSites
public java.lang.Boolean getHasSites()
- Specified by:
getHasSites
in interfaceBackupProvider
-
hasStorageProvider
public java.lang.Boolean hasStorageProvider()
- Specified by:
hasStorageProvider
in interfaceBackupProvider
-
getHasStreamToStore
public java.lang.Boolean getHasStreamToStore()
- Specified by:
getHasStreamToStore
in interfaceBackupProvider
-
getRestoreExistingEnabled
public java.lang.Boolean getRestoreExistingEnabled()
- Specified by:
getRestoreExistingEnabled
in interfaceBackupProvider
-
getRestoreNewEnabled
public java.lang.Boolean getRestoreNewEnabled()
- Specified by:
getRestoreNewEnabled
in interfaceBackupProvider
-
addScopedProvider
public void addScopedProvider(BackupIntegration backupIntegration)
Add a scoped backup provider. ABackupIntegration
links the provider to the provision or container type. Morpheus will use this associated to determine * the available providers when executing an operation in the backup services.- Specified by:
addScopedProvider
in interfaceBackupProvider
- Parameters:
backupIntegration
- a backup integration referencing the provider type and the provision and/or container types
-
addScopedProvider
public void addScopedProvider(BackupTypeProvider backupTypeProvider, java.lang.String provisionTypeCode, java.lang.String containerTypeCode)
Add a scoped backup provider. Registers aBackupTypeProvider
and the associated provision and/or container types with morpheus. Morpheus will use this associated to determine the available providers when executing an operation in the backup services.- Specified by:
addScopedProvider
in interfaceBackupProvider
- Parameters:
backupTypeProvider
- the backup type provider to registerprovisionTypeCode
- the provision type code to be associated with the backup type providercontainerTypeCode
- the container type code to be associated with the backup the provider
-
getScopedProviders
public java.util.Collection<BackupIntegration> getScopedProviders()
Get the list ofBackupIntegrations
associated with this backup provider- Specified by:
getScopedProviders
in interfaceBackupProvider
- Returns:
- a list of
BackupIntegrations
-
getBackupProviders
public java.util.Collection<BackupTypeProvider> getBackupProviders()
Get the list ofBackupTypeProviders
associated with this backup provider- Returns:
- a list of
BackupTypeProviders
-
configureBackupProvider
public ServiceResponse configureBackupProvider(BackupProvider backupProviderModel, java.util.Map config, java.util.Map opts)
- Specified by:
configureBackupProvider
in interfaceBackupProvider
-
validateBackupProvider
public ServiceResponse validateBackupProvider(BackupProvider backupProviderModel, java.util.Map opts)
- Specified by:
validateBackupProvider
in interfaceBackupProvider
-
initializeBackupProvider
public ServiceResponse initializeBackupProvider(BackupProvider backupProviderModel, java.util.Map opts)
- Specified by:
initializeBackupProvider
in interfaceBackupProvider
-
updateBackupProvider
public ServiceResponse updateBackupProvider(BackupProvider backupProviderModel, java.util.Map opts)
- Specified by:
updateBackupProvider
in interfaceBackupProvider
-
getBackupJobProvider
public abstract BackupJobProvider getBackupJobProvider()
Get theBackupJobProvider
responsible for all backup job operations in this backup provider TheDefaultBackupJobProvider
can be used if the provider would like morpheus to handle all job operations.- Returns:
- the
BackupJobProvider
for this backup provider
-
configureBackupJob
public ServiceResponse configureBackupJob(BackupJob backupJobModel, java.util.Map config, java.util.Map opts)
- Specified by:
configureBackupJob
in interfaceBackupProvider
-
validateBackupJob
public ServiceResponse validateBackupJob(BackupJob backupJobModel, java.util.Map config, java.util.Map opts)
- Specified by:
validateBackupJob
in interfaceBackupProvider
-
createBackupJob
public ServiceResponse createBackupJob(BackupJob backupJobModel, java.util.Map opts)
- Specified by:
createBackupJob
in interfaceBackupProvider
-
cloneBackupJob
public ServiceResponse cloneBackupJob(BackupJob sourceBackupJobModel, BackupJob backupJobModel, java.util.Map opts)
- Specified by:
cloneBackupJob
in interfaceBackupProvider
-
addToBackupJob
public ServiceResponse addToBackupJob(BackupJob backupJobModel, java.util.Map opts)
- Specified by:
addToBackupJob
in interfaceBackupProvider
-
deleteBackupJob
public ServiceResponse deleteBackupJob(BackupJob backupJobModel, java.util.Map opts)
- Specified by:
deleteBackupJob
in interfaceBackupProvider
-
executeBackupJob
public ServiceResponse executeBackupJob(BackupJob backupJobModel, java.util.Map opts)
- Specified by:
executeBackupJob
in interfaceBackupProvider
-
-