Class AbstractBackupProvider

java.lang.Object
com.morpheusdata.core.backup.BackupProvider
com.morpheusdata.core.backup.AbstractBackupProvider
All Implemented Interfaces:
BackupProviderInterface, PluginProvider
Direct Known Subclasses:
MorpheusBackupProvider

public abstract class AbstractBackupProvider extends BackupProvider
Provides a standard set of methods for a BackupProvider. 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 the BackupTypeProviders implemented within the provider.
Since:
0.13.4
  • Constructor Details

  • Method Details

    • getMorpheus

      public MorpheusContext getMorpheus()
      Description copied from interface: PluginProvider
      Returns the Morpheus Context for interacting with data stored in the Main Morpheus Application
      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
      Returns:
      Plugin class contains references to other providers
    • getEnabled

      public Boolean getEnabled()
      Description copied from interface: BackupProviderInterface
      Sets the enabled state of the provider for consumer use. NOTE: This may go away as it should be implied by the installation state of the plugin
    • getCreatable

      public Boolean getCreatable()
      Description copied from interface: BackupProviderInterface
      The backup provider is creatable by the end user. This could be false for providers that may be forced by specific CloudProvider plugins, for example.
    • getDownloadEnabled

      public Boolean getDownloadEnabled()
      Description copied from interface: BackupProviderInterface
      The backup provider allows the end user to download a backup. Some backup providers can allow the user to download the backup archive file.
    • getHasAddToJob

      public Boolean getHasAddToJob()
      Description copied from interface: BackupProviderInterface
      The backup provider can add a workload backup to an existing job.
    • getHasBackups

      public Boolean getHasBackups()
      Description copied from interface: BackupProviderInterface
      The backup provider supports backups. For example, a backup provider may be intended for disaster recovery failover only and may not directly support backups.
    • hasCancelBackup

      public Boolean hasCancelBackup()
      Description copied from interface: BackupProviderInterface
      The backup provider has the ability to cancel an in-progress backup.
    • getHasCloneJob

      public Boolean getHasCloneJob()
      Description copied from interface: BackupProviderInterface
      The backup provider supports cloning a job from an existing job.
    • getHasCopyToStore

      public Boolean getHasCopyToStore()
      Description copied from interface: BackupProviderInterface
      The backup provider supports copying the backup to a separate datastore (export).
    • getHasCreateJob

      public Boolean getHasCreateJob()
      Description copied from interface: BackupProviderInterface
      The backup provider supports creating new jobs.
    • getHasJobs

      public Boolean getHasJobs()
      Description copied from interface: BackupProviderInterface
      The backup provider supports running multiple workload backups within an encapsulating job.
    • getDefaultJobType

      public String getDefaultJobType()
      Description copied from interface: BackupProviderInterface
      The default job type of the provider. The basic options are: new, clone, addTo, none
    • getHasOptionalJob

      public Boolean getHasOptionalJob()
      Description copied from interface: BackupProviderInterface
      The backup provider supports backups outside an encapsulating job.
    • getHasReplication

      public Boolean getHasReplication()
      Description copied from interface: BackupProviderInterface
      The backup provider supports replication.
    • getHasReplicationGroups

      public Boolean getHasReplicationGroups()
      Description copied from interface: BackupProviderInterface
      The backup provider supports replication groups.
    • getHasRepositories

      public Boolean getHasRepositories()
      Description copied from interface: BackupProviderInterface
      The backup provider supports multiple repositories for storage of backup assets. This is used for the display and selection of repositories during backup configuration steps.
    • getHasRetentionCount

      public Boolean getHasRetentionCount()
      Description copied from interface: BackupProviderInterface
      The backup provider supports retention counts for maintaining the desired number of backups.
    • getHasSchedule

      public Boolean getHasSchedule()
      Description copied from interface: BackupProviderInterface
      The backup provider supports scheduled backups. This is primarily used for display of hte schedules and providing options during the backup configuration steps.
    • getHasServers

      public Boolean getHasServers()
      Description copied from interface: BackupProviderInterface
      The backup provider supports backup servers.
    • getHasSites

      public Boolean getHasSites()
      Description copied from interface: BackupProviderInterface
      The backup provider supports backup sites.
    • hasStorageProvider

      public Boolean hasStorageProvider()
      Description copied from interface: BackupProviderInterface
      The backup provider supports multiple storage providers.
    • getHasStreamToStore

      public Boolean getHasStreamToStore()
      Description copied from interface: BackupProviderInterface
      The backup provider supports streaming directly to the datastore.
    • getRestoreExistingEnabled

      public Boolean getRestoreExistingEnabled()
      Description copied from interface: BackupProviderInterface
      The backup provider supports restoring to an existing workload.
    • getRestoreNewEnabled

      public Boolean getRestoreNewEnabled()
      Description copied from interface: BackupProviderInterface
      The backup provider supports restoring to a new workload.
    • addScopedProvider

      public void addScopedProvider(BackupIntegration backupIntegration)
      Add a scoped backup provider. A BackupIntegration 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.
      Parameters:
      backupIntegration - a backup integration referencing the provider type and the provision and/or container types
    • addScopedProvider

      public void addScopedProvider(BackupTypeProvider backupTypeProvider, String provisionTypeCode, String containerTypeCode)
      Add a scoped backup provider. Registers a BackupTypeProvider 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.
      Parameters:
      backupTypeProvider - the backup type provider to register
      provisionTypeCode - the provision type code to be associated with the backup type provider
      containerTypeCode - the container type code to be associated with the backup the provider
    • getScopedProviders

      public Collection<BackupIntegration> getScopedProviders()
      Get the list of BackupIntegrations associated with this backup provider
      Returns:
      a list of BackupIntegrations
    • getBackupProviders

      public Collection<BackupTypeProvider> getBackupProviders()
      Get the list of BackupTypeProviders associated with this backup provider
      Returns:
      a list of BackupTypeProviders
    • configureBackupProvider

      public ServiceResponse configureBackupProvider(BackupProvider backupProviderModel, Map config, Map opts)
      Description copied from interface: BackupProviderInterface
      Apply provider specific configurations to a BackupProvider. The standard configurations are handled by the core system.
      Parameters:
      backupProviderModel - backup provider to configure
      config - the configuration supplied by external inputs.
      opts - optional parameters used for configuration.
      Returns:
      a ServiceResponse object. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup creation process.
    • validateBackupProvider

      public ServiceResponse validateBackupProvider(BackupProvider backupProviderModel, Map opts)
      Description copied from interface: BackupProviderInterface
      Validate the configuration of the BackupProvider. Morpheus will validate the backup based on the supplied option type configurations such as required fields. Use this to either override the validation results supplied by the default validation or to create additional validations beyond the capabilities of option type validation.
      Parameters:
      backupProviderModel - backup provider to validate
      opts - additional options
      Returns:
      a ServiceResponse object. A ServiceResponse with a false success will indicate a failed validation and will halt the backup provider creation process.
    • initializeBackupProvider

      public ServiceResponse initializeBackupProvider(BackupProvider backupProviderModel, Map opts)
      Description copied from interface: BackupProviderInterface
      Execute operations upon initialization of a new backup provider. This method is executed after a successful save and is used to setup any additional require resources and execute the first full integration sync.
      Parameters:
      backupProviderModel - backup provider initializing
      opts - additional options
      Returns:
      a ServiceResponse object. A ServiceResponse with a false success will indicate a failed initialization and will halt the process.
    • updateBackupProvider

      public ServiceResponse updateBackupProvider(BackupProvider backupProviderModel, Map opts)
      Description copied from interface: BackupProviderInterface
      Update the backup provider
      Parameters:
      backupProviderModel - the backup provider
      opts - additional options
      Returns:
      a ServiceResponse object. A ServiceResponse with a false success will indicate a failed update and will halt the process.
    • getBackupJobProvider

      public abstract BackupJobProvider getBackupJobProvider()
      Get the BackupJobProvider responsible for all backup job operations in this backup provider The DefaultBackupJobProvider 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, Map config, Map opts)
      Description copied from interface: BackupProviderInterface
      Apply provider specific configurations to a BackupJob. The standard configurations are handled by the core system.
      Parameters:
      backupJobModel - the backup job to apply the configuration changes to
      config - the configuration supplied by external inputs.
      opts - optional parameters used for configuration.
      Returns:
      a ServiceResponse object. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup creation process.
    • validateBackupJob

      public ServiceResponse validateBackupJob(BackupJob backupJobModel, Map config, Map opts)
      Description copied from interface: BackupProviderInterface
      Validate the configuration of the BackupJob. Morpheus will validate the backup based on the supplied option type configurations such as required fields. Use this to either override the validation results supplied by the default validation or to create additional validations beyond the capabilities of option type validation.
      Parameters:
      backupJobModel - the backup job to validate
      config - the original configuration supplied by external inputs.
      opts - optional parameters used for
      Returns:
      a ServiceResponse object. The errors field of the ServiceResponse is used to send validation results back to the interface in the format of errors['fieldName'] = 'validation message' . The msg property can be used to send generic validation text that is not related to a specific field on the model. A ServiceResponse with any items in the errors list or a success value of 'false' will halt the backup job creation process.
    • createBackupJob

      public ServiceResponse createBackupJob(BackupJob backupJobModel, Map opts)
      Description copied from interface: BackupProviderInterface
      Create the BackupJob on the external provider system.
      Parameters:
      backupJobModel - the fully configured and validated backup job
      opts - additional options used during backup job creation
      Returns:
      a ServiceResponse object. A ServiceResponse with a success value of 'false' will indicate the creation on the external system failed and will halt any further processing in Morpheus.
    • cloneBackupJob

      public ServiceResponse cloneBackupJob(BackupJob sourceBackupJobModel, BackupJob backupJobModel, Map opts)
      Description copied from interface: BackupProviderInterface
      Clone the BackupJob on the external system.
      Parameters:
      sourceBackupJobModel - the source backup job for cloning
      backupJobModel - the backup job that will be associated to the cloned backup job. The externalId of the backup job should be set with the ID of the cloned job result.
      opts - additional options used during backup job clone
      Returns:
      a ServiceResponse object. A ServiceResponse with a success value of 'false' will indicate the clone on the external system failed and will halt any further processing in Morpheus.
    • addToBackupJob

      public ServiceResponse addToBackupJob(BackupJob backupJobModel, Map opts)
      Description copied from interface: BackupProviderInterface
      Add a backup to an existing backup job in the external system.
      Parameters:
      backupJobModel - the backup job receiving the additional backup
      opts - additional options
      Returns:
      a ServiceResponse object. A ServiceResponse with a success value of 'false' will indicate the operation on the external system failed and will halt any further processing in Morpheus.
    • deleteBackupJob

      public ServiceResponse deleteBackupJob(BackupJob backupJobModel, Map opts)
      Description copied from interface: BackupProviderInterface
      Delete the backup job in the external system.
      Parameters:
      backupJobModel - the backup job to be removed
      opts - additional options
      Returns:
      a ServiceResponse object. A ServiceResponse with a success value of 'false' will indicate the operation on the external system failed and will halt any further processing in Morpheus.
    • executeBackupJob

      public ServiceResponse executeBackupJob(BackupJob backupJobModel, Map opts)
      Description copied from interface: BackupProviderInterface
      Execute the backup job on the external system.
      Parameters:
      backupJobModel - the backup job to be executed
      opts - additional options
      Returns:
      a ServiceResponse object. A ServiceResponse with a success value of 'false' will indicate the operation on the external system failed and will halt any further processing in Morpheus.