org.jclouds.joyent.cloudapi.v6_5.domain
Class Machine

java.lang.Object
  extended by org.jclouds.joyent.cloudapi.v6_5.domain.Machine
All Implemented Interfaces:
Comparable<Machine>

public class Machine
extends Object
implements Comparable<Machine>

a SmartMachine or traditional Virtual Machine

Author:
Gerald Pereira
See Also:

Nested Class Summary
static class Machine.Builder
           
static class Machine.State
           
static class Machine.Type
           
 
Field Summary
protected  Date created
           
protected  String dataset
           
protected  int diskSizeGb
           
protected  String id
           
protected  Set<String> ips
           
protected  int memorySizeMb
           
protected  String name
           
protected  Machine.State state
           
protected  Machine.Type type
           
protected  Date updated
           
 
Constructor Summary
Machine(String id, String name, Machine.Type type, Machine.State state, String dataset, int memorySizeMb, int diskSizeGb, Set<String> ips, Date created, Date updated, Map<String,org.jclouds.domain.JsonBall> metadata)
           
 
Method Summary
static Machine.Builder builder()
           
 int compareTo(Machine that)
           
 boolean equals(Object object)
           
 Date getCreated()
          When this machine was created
 String getDatasetURN()
          The dataset urn this machine was provisioned with
 int getDiskSizeGb()
          The amount of disk this machine has (Gb)
 String getId()
          The globally unique id for this machine
 Set<String> getIps()
          The IP addresses this machine has
 int getMemorySizeMb()
          The amount of memory this machine has (Mb)
 Map<String,String> getMetadata()
          Any "extra" metadata this machine has
 Map<String,String> getMetadataAsJsonLiterals()
          note
 String getName()
          The "friendly" name for this machine
 Machine.State getState()
          The current state of this machine
 Machine.Type getType()
          Whether this is a smartmachine or virtualmachine
 Date getUpdated()
          When this machine was updated
 int hashCode()
           
 Machine.Builder toBuilder()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected final String id

name

protected final String name

type

protected final Machine.Type type

state

protected final Machine.State state

dataset

protected final String dataset

memorySizeMb

@Named(value="memory")
protected final int memorySizeMb

diskSizeGb

@Named(value="disk")
protected final int diskSizeGb

ips

protected final Set<String> ips

created

protected final Date created

updated

protected final Date updated
Constructor Detail

Machine

@ConstructorProperties(value={"id","name","type","state","dataset","memory","disk","ips","created","updated","metadata"})
public Machine(String id,
                                          String name,
                                          Machine.Type type,
                                          Machine.State state,
                                          String dataset,
                                          int memorySizeMb,
                                          int diskSizeGb,
                                          Set<String> ips,
                                          Date created,
                                          Date updated,
                                          Map<String,org.jclouds.domain.JsonBall> metadata)
Method Detail

builder

public static Machine.Builder builder()

toBuilder

public Machine.Builder toBuilder()

getId

public String getId()
The globally unique id for this machine


getName

public String getName()
The "friendly" name for this machine


getType

public Machine.Type getType()
Whether this is a smartmachine or virtualmachine


getState

public Machine.State getState()
The current state of this machine


getDatasetURN

public String getDatasetURN()
The dataset urn this machine was provisioned with


getMemorySizeMb

public int getMemorySizeMb()
The amount of memory this machine has (Mb)


getDiskSizeGb

public int getDiskSizeGb()
The amount of disk this machine has (Gb)


getIps

public Set<String> getIps()
The IP addresses this machine has


getCreated

public Date getCreated()
When this machine was created


getUpdated

public Date getUpdated()
When this machine was updated


getMetadataAsJsonLiterals

public Map<String,String> getMetadataAsJsonLiterals()

note

If the value is a string, it will be quoted, as that's how json strings are represented.

Returns:
key to a json literal of the value
See Also:
Metadata.valueType, Json.fromJson(java.lang.String, java.lang.reflect.Type)

getMetadata

public Map<String,String> getMetadata()
Any "extra" metadata this machine has

note

metadata can contain arbitrarily complex values. If the value has structure, you should use getMetadataAsJsonLiterals()


equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Machine that)
Specified by:
compareTo in interface Comparable<Machine>


Copyright © 2009-2012 jclouds. All Rights Reserved.