/** * 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.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.PrepareTemplateCmd; import com.cloud.api.commands.RegisterIsoCmd; import com.cloud.api.commands.RegisterTemplateCmd; import com.cloud.exception.InternalErrorException; 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 copyTemplate(CopyTemplateCmd cmd) throws StorageUnavailableException, ResourceAllocationException; VirtualMachineTemplate prepareTemplate(PrepareTemplateCmd cmd) ; 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 */ boolean deleteIso(DeleteIsoCmd cmd); /** * Extracts an ISO * * @param cmd * - the command specifying the mode and id of the ISO * @return extractId. */ Long extract(ExtractIsoCmd cmd) throws InternalErrorException; /** * Extracts a Template * * @param cmd * - the command specifying the mode and id of the template * @return extractId */ Long extract(ExtractTemplateCmd cmd) throws InternalErrorException; VirtualMachineTemplate getTemplate(long templateId); }