cloudstack/server/src/com/cloud/storage/dao/LaunchPermissionDao.java

63 lines
2.4 KiB
Java

/**
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.cloud.storage.dao;
import java.util.List;
import com.cloud.storage.LaunchPermissionVO;
import com.cloud.storage.VMTemplateVO;
import com.cloud.utils.db.GenericDao;
public interface LaunchPermissionDao extends GenericDao<LaunchPermissionVO, Long> {
/**
* remove the ability to launch vms from the given template for the given account names which are valid in the given domain
* @param templateId id of the template to modify launch permissions
* @param accountIds list of account ids
*/
void removePermissions(long templateId, List<Long> accountIds);
/**
* remove all launch permissions associated with a template
* @param templateId
*/
void removeAllPermissions(long templateId);
/**
* Find a launch permission by templateId, accountName, and domainId
* @param templateId the id of the template to search for
* @param accountId the id of the account for which permission is being searched
* @return launch permission if found, null otherwise
*/
LaunchPermissionVO findByTemplateAndAccount(long templateId, long accountId);
/**
* List all launch permissions for the given template
* @param templateId id of the template for which launch permissions will be queried
* @return list of launch permissions
*/
List<LaunchPermissionVO> findByTemplate(long templateId);
/**
* List all templates for which permission to launch instances has been granted to the given account
* @param accountId
* @return
*/
List<VMTemplateVO> listPermittedTemplates(long accountId);
}