nvazquez commented on a change in pull request #3553: [WIP] [DO NOT MERGE] CloudStack Backup & Recovery Framework URL: https://github.com/apache/cloudstack/pull/3553#discussion_r363161806
########## File path: plugins/backup/dummy/src/main/java/org/apache/cloudstack/backup/DummyBackupProvider.java ########## @@ -0,0 +1,136 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.backup; + +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.inject.Inject; + +import org.apache.cloudstack.backup.dao.BackupDao; +import org.apache.log4j.Logger; + +import com.cloud.utils.Pair; +import com.cloud.utils.component.AdapterBase; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.vm.VirtualMachine; + +public class DummyBackupProvider extends AdapterBase implements BackupProvider { + + private static final Logger s_logger = Logger.getLogger(DummyBackupProvider.class); + + @Inject + private BackupDao backupDao; + + @Override + public String getName() { + return "dummy"; + } + + @Override + public String getDescription() { + return "Dummy Backup Plugin"; + } + + @Override + public List<BackupOffering> listBackupOfferings(Long zoneId) { + s_logger.debug("Listing backup policies on Dummy B&R Plugin"); + BackupOffering policy1 = new BackupOfferingVO(1, "gold-policy", "dummy", "Golden Policy", "Gold description", true); + BackupOffering policy2 = new BackupOfferingVO(1, "silver-policy", "dummy", "Silver Policy", "Silver description", true); + return Arrays.asList(policy1, policy2); + } + + @Override + public boolean isBackupOffering(Long zoneId, String uuid) { + s_logger.debug("Checking if backup offering exists on the Dummy Backup Provider"); Review comment: No problem ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
