/** * 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 . * */ package com.cloud.template; import java.net.URISyntaxException; import com.cloud.api.commands.AttachIsoCmd; import com.cloud.api.commands.CopyIsoCmd; import com.cloud.api.commands.CopyTemplateCmd; import com.cloud.api.commands.DeleteIsoCmd; import com.cloud.api.commands.DeleteTemplateCmd; import com.cloud.api.commands.DetachIsoCmd; import com.cloud.api.commands.ExtractIsoCmd; import com.cloud.api.commands.ExtractTemplateCmd; import com.cloud.api.commands.RegisterIsoCmd; import com.cloud.api.commands.RegisterTemplateCmd; import com.cloud.exception.InternalErrorException; import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.PermissionDeniedException; import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.StorageUnavailableException; public interface TemplateService { VirtualMachineTemplate registerTemplate(RegisterTemplateCmd cmd) throws URISyntaxException, ResourceAllocationException; VirtualMachineTemplate registerIso(RegisterIsoCmd cmd) throws IllegalArgumentException, ResourceAllocationException; VirtualMachineTemplate copyIso(CopyIsoCmd cmd) throws StorageUnavailableException; VirtualMachineTemplate copyTemplate(CopyTemplateCmd cmd) throws StorageUnavailableException; boolean detachIso(DetachIsoCmd cmd); boolean attachIso(AttachIsoCmd cmd); /** * Deletes a template * @param cmd - the command specifying templateId */ boolean deleteTemplate(DeleteTemplateCmd cmd); /** * Deletes a template * @param cmd - the command specifying isoId * @return true if deletion is successful, false otherwise * @throws InvalidParameterValueException, InternalErrorException, PermissionDeniedException */ boolean deleteIso(DeleteIsoCmd cmd); /** * Extracts an ISO * @param cmd - the command specifying the mode and id of the ISO * @return extractId. * @throws InvalidParameterValueException, InternalErrorException, PermissionDeniedException */ Long extract(ExtractIsoCmd cmd) throws InvalidParameterValueException, PermissionDeniedException, InternalErrorException; /** * Extracts a Template * @param cmd - the command specifying the mode and id of the template * @return extractId. * @throws InvalidParameterValueException, InternalErrorException, PermissionDeniedException */ Long extract(ExtractTemplateCmd cmd) throws InvalidParameterValueException, PermissionDeniedException, InternalErrorException; }