-
Notifications
You must be signed in to change notification settings - Fork 0
Plugin validation
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.
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.
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.
A plugin can be validated by implementing the interface Validationable
.
The validation method has to perform following steps:
- Connect to the service and authenticate with the users access data.
- Call a fast service method to ensure that the service is working.
- 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).