org.dasein.cloud.vsphere.compute
Class Template

java.lang.Object
  extended by org.dasein.cloud.vsphere.compute.Template
All Implemented Interfaces:
AccessControlledService, MachineImageSupport

public class Template
extends Object
implements MachineImageSupport


Field Summary
 
Fields inherited from interface org.dasein.cloud.compute.MachineImageSupport
ANY, DOWNLOAD_IMAGE, GET_IMAGE, IMAGE_VM, LIST_IMAGE, MAKE_PUBLIC, REGISTER_IMAGE, REMOVE_IMAGE, SHARE_IMAGE, UPLOAD_IMAGE
 
Method Summary
 void downloadImage(String machineImageId, OutputStream toOutput)
           
 MachineImage getMachineImage(String templateId)
           
 String getProviderTermForImage(Locale locale)
           
 boolean hasPublicLibrary()
           
 AsynchronousTask<String> imageVirtualMachine(String vmId, String name, String description)
           
 AsynchronousTask<String> imageVirtualMachineToStorage(String vmId, String name, String description, String directory)
           
 String installImageFromUpload(MachineImageFormat format, InputStream imageStream)
           
 boolean isImageSharedWithPublic(String machineImageId)
           
 boolean isSubscribed()
           
 Collection<MachineImage> listMachineImages()
           
 Iterable<MachineImage> listMachineImagesOwnedBy(String accountId)
           
 Collection<String> listShares(String templateId)
           
 Iterable<MachineImageFormat> listSupportedFormats()
           
 String[] mapServiceAction(ServiceAction action)
           
 String registerMachineImage(String atStorageLocation)
           
 void remove(String templateId)
           
 Iterable<MachineImage> searchMachineImages(String keyword, Platform platform, Architecture architecture)
           
 void shareMachineImage(String templateId, String withAccountId, boolean grant)
           
 boolean supportsCustomImages()
           
 boolean supportsImageSharing()
           
 boolean supportsImageSharingWithPublic()
           
 String transfer(CloudProvider fromCloud, String machineImageId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

remove

public void remove(@Nonnull
                   String templateId)
            throws InternalException,
                   CloudException
Specified by:
remove in interface MachineImageSupport
Throws:
InternalException
CloudException

getMachineImage

@Nullable
public MachineImage getMachineImage(@Nonnull
                                             String templateId)
                             throws InternalException,
                                    CloudException
Specified by:
getMachineImage in interface MachineImageSupport
Throws:
InternalException
CloudException

getProviderTermForImage

@Nonnull
public String getProviderTermForImage(@Nonnull
                                              Locale locale)
Specified by:
getProviderTermForImage in interface MachineImageSupport

listShares

@Nonnull
public Collection<String> listShares(@Nonnull
                                             String templateId)
                              throws CloudException,
                                     InternalException
Specified by:
listShares in interface MachineImageSupport
Throws:
CloudException
InternalException

listMachineImages

@Nonnull
public Collection<MachineImage> listMachineImages()
                                           throws InternalException,
                                                  CloudException
Specified by:
listMachineImages in interface MachineImageSupport
Throws:
InternalException
CloudException

mapServiceAction

@Nonnull
public String[] mapServiceAction(@Nonnull
                                         ServiceAction action)
Specified by:
mapServiceAction in interface AccessControlledService

shareMachineImage

public void shareMachineImage(@Nonnull
                              String templateId,
                              @Nullable
                              String withAccountId,
                              boolean grant)
                       throws InternalException,
                              CloudException
Specified by:
shareMachineImage in interface MachineImageSupport
Throws:
InternalException
CloudException

downloadImage

public void downloadImage(@Nonnull
                          String machineImageId,
                          @Nonnull
                          OutputStream toOutput)
                   throws CloudException,
                          InternalException
Specified by:
downloadImage in interface MachineImageSupport
Throws:
CloudException
InternalException

hasPublicLibrary

public boolean hasPublicLibrary()
Specified by:
hasPublicLibrary in interface MachineImageSupport

imageVirtualMachine

@Nonnull
public AsynchronousTask<String> imageVirtualMachine(@Nonnull
                                                            String vmId,
                                                            @Nonnull
                                                            String name,
                                                            @Nonnull
                                                            String description)
                                             throws CloudException,
                                                    InternalException
Specified by:
imageVirtualMachine in interface MachineImageSupport
Throws:
CloudException
InternalException

imageVirtualMachineToStorage

@Nonnull
public AsynchronousTask<String> imageVirtualMachineToStorage(@Nonnull
                                                                     String vmId,
                                                                     @Nonnull
                                                                     String name,
                                                                     @Nonnull
                                                                     String description,
                                                                     @Nonnull
                                                                     String directory)
                                                      throws CloudException,
                                                             InternalException
Specified by:
imageVirtualMachineToStorage in interface MachineImageSupport
Throws:
CloudException
InternalException

installImageFromUpload

@Nonnull
public String installImageFromUpload(@Nonnull
                                             MachineImageFormat format,
                                             @Nonnull
                                             InputStream imageStream)
                              throws CloudException,
                                     InternalException
Specified by:
installImageFromUpload in interface MachineImageSupport
Throws:
CloudException
InternalException

isImageSharedWithPublic

public boolean isImageSharedWithPublic(@Nonnull
                                       String machineImageId)
                                throws CloudException,
                                       InternalException
Specified by:
isImageSharedWithPublic in interface MachineImageSupport
Throws:
CloudException
InternalException

isSubscribed

public boolean isSubscribed()
                     throws CloudException,
                            InternalException
Specified by:
isSubscribed in interface MachineImageSupport
Throws:
CloudException
InternalException

listMachineImagesOwnedBy

@Nonnull
public Iterable<MachineImage> listMachineImagesOwnedBy(@Nullable
                                                               String accountId)
                                                throws CloudException,
                                                       InternalException
Specified by:
listMachineImagesOwnedBy in interface MachineImageSupport
Throws:
CloudException
InternalException

listSupportedFormats

@Nonnull
public Iterable<MachineImageFormat> listSupportedFormats()
                                                  throws CloudException,
                                                         InternalException
Specified by:
listSupportedFormats in interface MachineImageSupport
Throws:
CloudException
InternalException

registerMachineImage

@Nonnull
public String registerMachineImage(@Nonnull
                                           String atStorageLocation)
                            throws CloudException,
                                   InternalException
Specified by:
registerMachineImage in interface MachineImageSupport
Throws:
CloudException
InternalException

searchMachineImages

@Nonnull
public Iterable<MachineImage> searchMachineImages(@Nullable
                                                          String keyword,
                                                          @Nullable
                                                          Platform platform,
                                                          @Nullable
                                                          Architecture architecture)
                                           throws CloudException,
                                                  InternalException
Specified by:
searchMachineImages in interface MachineImageSupport
Throws:
CloudException
InternalException

supportsCustomImages

public boolean supportsCustomImages()
Specified by:
supportsCustomImages in interface MachineImageSupport

supportsImageSharing

public boolean supportsImageSharing()
Specified by:
supportsImageSharing in interface MachineImageSupport

supportsImageSharingWithPublic

public boolean supportsImageSharingWithPublic()
Specified by:
supportsImageSharingWithPublic in interface MachineImageSupport

transfer

@Nonnull
public String transfer(@Nonnull
                               CloudProvider fromCloud,
                               @Nonnull
                               String machineImageId)
                throws CloudException,
                       InternalException
Specified by:
transfer in interface MachineImageSupport
Throws:
CloudException
InternalException


Copyright © 2012 enStratus Networks Inc. All Rights Reserved.