Skip to content
This repository was archived by the owner on Jul 18, 2022. It is now read-only.

Plugin validation

fschoeppl edited this page Jun 18, 2012 · 2 revisions

The BackMeUp-Core stores all backup jobs and its access data for each user within a database. The jobs and the access data might get invalid after some time, a user might deny access to a service or a sink reached its maximal quota. Therefore a validation mechanism has been introduced to BackMeUp which can be used to validate access data and backup jobs.

Access Data Validation (Profile-Validation)

When a user registers a source or sink for the first time, the users registration data (access data) will be stored within the database as a profile. The business logic provides the validateProfile method which ensures that a plugin is still able to connect to and use the service with the access data of a certain profile. E. g. a user registers a new dropbox sink profile. The id of the profile will be passed to the validateProfile method which returns all error messages / success messages of the validation.

Job Validation

A backup job will be stored within the database including all needed source profiles, the actions to apply on the backup and the sink profile. The validateBackupJob inspects a backup job and validates all profiles by using the validateProfile method. If possible, the required space of the backup will be calculated by summarizing the quotas of each source profile minus the free space of the sink profile. The method returns all error messages / success messages that occurred during validiation.

Implementation

A plugin can be validated by implementing the interface Validationable. The validation method has to perform following steps:

  1. Connect to the service and authenticate with the users access data.
  2. Call a fast service method to ensure that the service is working.
  3. Add all errors to a ValidationNotes instance and return them.

Note: The validator must be added to the blueprint configuration files found in the META-INF/spring folder (more details can be found within the Implementation section of the [plugins page] (https://github.com/backmeup/backmeup-prototype/wiki/plugin-layer).

Example

Clone this wiki locally