org.jclouds.cloudstack.domain
Class Template

java.lang.Object
  extended by org.jclouds.cloudstack.domain.Template
All Implemented Interfaces:
Comparable<Template>

public class Template
extends Object
implements Comparable<Template>

Author:
Adrian Cole

Nested Class Summary
static class Template.Builder<T extends Template.Builder<T>>
           
static class Template.Format
           
static class Template.Status
           
static class Template.Type
           
 
Constructor Summary
protected Template(String id, String displayText, String domain, String domainId, String account, String accountId, String zone, String zoneId, String OSType, String OSTypeId, String name, Template.Type type, Template.Status status, Template.Format format, String hypervisor, Long size, Date created, Date removed, boolean crossZones, boolean bootable, boolean extractable, boolean featured, boolean ispublic, boolean ready, boolean passwordEnabled, String jobId, String jobStatus, String checksum, String hostId, String hostName, String sourceTemplateId, String templateTag)
           
 
Method Summary
static Template.Builder<?> builder()
           
 int compareTo(Template o)
           
 boolean equals(Object obj)
           
 String getAccount()
           
 String getAccountId()
           
 String getChecksum()
           
 Date getCreated()
           
 String getDisplayText()
           
 String getDomain()
           
 String getDomainId()
           
 Template.Format getFormat()
           
 String getHostId()
           
 String getHostName()
           
 String getHypervisor()
           
 String getId()
           
 String getJobId()
           
 String getJobStatus()
           
 String getName()
           
 String getOSType()
           
 String getOSTypeId()
           
 Date getRemoved()
           
 Long getSize()
           
 String getSourceTemplateId()
           
 Template.Status getStatus()
          Retrieve the status of the template.
 String getTemplateTag()
           
 Template.Type getType()
           
 String getZone()
           
 String getZoneId()
           
 int hashCode()
           
 boolean isBootable()
           
 boolean isCrossZones()
           
 boolean isExtractable()
           
 boolean isFeatured()
           
 boolean isPasswordEnabled()
           
 boolean ispublic()
           
 boolean isReady()
           
protected  com.google.common.base.Objects.ToStringHelper string()
           
 Template.Builder<?> toBuilder()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Template

@ConstructorProperties(value={"id","displaytext","domain","domainid","account","accountid","zonename","zoneid","ostypename","ostypeid","name","templatetype","status","format","hypervisor","size","created","removed","crossZones","bootable","isextractable","isfeatured","ispublic","isready","passwordenabled","jobid","jobstatus","checksum","hostId","hostname","sourcetemplateid","templatetag"})
protected Template(String id,
                                              @Nullable
                                              String displayText,
                                              @Nullable
                                              String domain,
                                              @Nullable
                                              String domainId,
                                              @Nullable
                                              String account,
                                              @Nullable
                                              String accountId,
                                              @Nullable
                                              String zone,
                                              @Nullable
                                              String zoneId,
                                              @Nullable
                                              String OSType,
                                              @Nullable
                                              String OSTypeId,
                                              @Nullable
                                              String name,
                                              @Nullable
                                              Template.Type type,
                                              @Nullable
                                              Template.Status status,
                                              @Nullable
                                              Template.Format format,
                                              @Nullable
                                              String hypervisor,
                                              @Nullable
                                              Long size,
                                              @Nullable
                                              Date created,
                                              @Nullable
                                              Date removed,
                                              boolean crossZones,
                                              boolean bootable,
                                              boolean extractable,
                                              boolean featured,
                                              boolean ispublic,
                                              boolean ready,
                                              boolean passwordEnabled,
                                              @Nullable
                                              String jobId,
                                              @Nullable
                                              String jobStatus,
                                              @Nullable
                                              String checksum,
                                              @Nullable
                                              String hostId,
                                              @Nullable
                                              String hostName,
                                              @Nullable
                                              String sourceTemplateId,
                                              @Nullable
                                              String templateTag)
Method Detail

builder

public static Template.Builder<?> builder()

toBuilder

public Template.Builder<?> toBuilder()

getId

public String getId()
Returns:
Template id

getDisplayText

@Nullable
public String getDisplayText()
Returns:
the display text of the template

getDomain

@Nullable
public String getDomain()
Returns:
the name of the domain to which the template beLongs

getDomainId

@Nullable
public String getDomainId()
Returns:
the ID of the domain to which the template beLongs

getAccount

@Nullable
public String getAccount()
Returns:
the name of the account to which the template beLongs

getAccountId

@Nullable
public String getAccountId()
Returns:
the ID of the account to which the template beLongs

getZone

@Nullable
public String getZone()
Returns:
the name of the zone to which the template beLongs

getZoneId

@Nullable
public String getZoneId()
Returns:
the ID of the zone to which the template beLongs

getOSType

@Nullable
public String getOSType()
Returns:
the name of the OS type to which the template beLongs

getOSTypeId

@Nullable
public String getOSTypeId()
Returns:
the ID of the OS type to which the template beLongs

getName

@Nullable
public String getName()
Returns:
Template name

getType

@Nullable
public Template.Type getType()
Returns:
the type of the template

getStatus

@Nullable
public Template.Status getStatus()
Retrieve the status of the template.

Note that in CloudStack 2.2.x through to at least 3.0.4, the possible status values are not well defined by CloudStack. CloudStack returns a plain-text English string for UI display, which jclouds attempts to parse into an enumeration, but the mapping is incomplete. This method should be reliable for the common cases, but it is possible (particularly for error statuses) that this method will return UNRECOGNIZED.

Returns:
status of the template

getFormat

@Nullable
public Template.Format getFormat()
Returns:
the format of the template.

getHypervisor

@Nullable
public String getHypervisor()
Returns:
the hypervisor on which the template runs

getSize

@Nullable
public Long getSize()
Returns:
the size of the template in kilobytes

getCreated

@Nullable
public Date getCreated()
Returns:
the date this template was created

getRemoved

@Nullable
public Date getRemoved()
Returns:
the date this template was removed

isCrossZones

public boolean isCrossZones()
Returns:
true if the template is managed across all Zones, false otherwise

isBootable

public boolean isBootable()
Returns:
true if the ISO is bootable, false otherwise

isExtractable

public boolean isExtractable()
Returns:
true if the template is extractable, false otherwise

isFeatured

public boolean isFeatured()
Returns:
true if this template is a featured template, false otherwise

ispublic

public boolean ispublic()

isReady

public boolean isReady()
Returns:
true if the template is ready to be deployed from, false otherwise

isPasswordEnabled

public boolean isPasswordEnabled()
Returns:
true if the reset password feature is enabled, false otherwise

getJobId

@Nullable
public String getJobId()
Returns:
shows the current pending asynchronous job ID, or null if current pending jobs are acting on the template

getJobStatus

@Nullable
public String getJobStatus()
Returns:
shows the current pending asynchronous job status

getChecksum

@Nullable
public String getChecksum()
Returns:
checksum of the template

getHostId

@Nullable
public String getHostId()
Returns:
the ID of the secondary storage host for the template

getHostName

@Nullable
public String getHostName()
Returns:
the name of the secondary storage host for the template

getSourceTemplateId

@Nullable
public String getSourceTemplateId()
Returns:
the template ID of the parent template if present

getTemplateTag

@Nullable
public String getTemplateTag()
Returns:
the tag of this template

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

string

protected com.google.common.base.Objects.ToStringHelper string()

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Template o)
Specified by:
compareTo in interface Comparable<Template>


Copyright © 2009-2013 jclouds. All Rights Reserved.