@@ -47,16 +47,7 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
4747 "backup.framework.provider.plugin" ,
4848 "dummy" ,
4949 "The backup and recovery provider plugin. Valid plugin values: dummy, veeam, networker and nas" ,
50- true , ConfigKey .Scope .Zone , BackupFrameworkEnabled .key (),
51- value -> {
52- if (value != null && ((String )value ).contains ("," ) || ((String )value ).contains (" " )) {
53- throw new IllegalArgumentException ("Multiple backup provider plugins are not supported. Please provide a single plugin value." );
54- }
55- List <String > validPlugins = List .of ("dummy" , "veeam" , "networker" , "nas" );
56- if (!validPlugins .contains (((String ) value ).toLowerCase ())) {
57- throw new IllegalArgumentException ("Invalid backup provider plugin: " + value + ". Valid plugin values are: " + String .join (", " , validPlugins ));
58- }
59- });
50+ true , ConfigKey .Scope .Zone , BackupFrameworkEnabled .key (), value -> validateBackupProviderConfig ((String )value ));
6051
6152 ConfigKey <Long > BackupSyncPollingInterval = new ConfigKey <>("Advanced" , Long .class ,
6253 "backup.framework.sync.interval" ,
@@ -159,4 +150,14 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
159150 boolean deleteBackup (final Long backupId , final Boolean forced );
160151
161152 BackupOffering updateBackupOffering (UpdateBackupOfferingCmd updateBackupOfferingCmd );
153+
154+ static void validateBackupProviderConfig (String value ) {
155+ if (value != null && (value .contains ("," ) || value .contains (" " ))) {
156+ throw new IllegalArgumentException ("Multiple backup provider plugins are not supported. Please provide a single plugin value." );
157+ }
158+ List <String > validPlugins = List .of ("dummy" , "veeam" , "networker" , "nas" );
159+ if (value != null && !validPlugins .contains (value .toLowerCase ())) {
160+ throw new IllegalArgumentException ("Invalid backup provider plugin: " + value + ". Valid plugin values are: " + String .join (", " , validPlugins ));
161+ }
162+ }
162163}
0 commit comments