java.lang.Object
com.aoindustries.aoserv.cluster.Cluster
All Implemented Interfaces:
Serializable, Comparable<Cluster>

public class Cluster extends Object implements Comparable<Cluster>, Serializable
A cluster contains all of the definitions for virtual and physical resources required and available, but nothing about the current mapping between them. ClusterConfiguration keeps track of the current mappings.

A cluster is immutable. All setters return a new instance of a cluster.

Author:
AO Industries, Inc.
See Also:
  • Constructor Details

    • Cluster

      public Cluster(String name)
      Creates a new, empty cluster.
  • Method Details

    • getName

      public String getName()
    • compareTo

      public int compareTo(Cluster other)
      Sorted ascending. By:
      1. name
      Specified by:
      compareTo in interface Comparable<Cluster>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDom0s

      public Map<String,Dom0> getDom0s()
      Gets an unmodifiable set of Dom0s.
    • getDom0

      public Dom0 getDom0(String hostname)
      Gets a specific Dom0 by name or null if not found.
    • addDom0

      public Cluster addDom0(String hostname, int ram, ProcessorType processorType, ProcessorArchitecture processorArchitecture, int processorSpeed, int processorCores, boolean supportsHvm)
      Adds a Dom0 to the cluster returning the reference to the new cluster object.
    • getDomUs

      public Map<String,DomU> getDomUs()
      Gets an unmodifiable set of DomUs.
    • getDomU

      public DomU getDomU(String hostname)
      Gets a specific DomU by name or null if not found.
    • addDomU

      public Cluster addDomU(String hostname, int primaryRam, int secondaryRam, ProcessorType minimumProcessorType, ProcessorArchitecture minimumProcessorArchitecture, int minimumProcessorSpeed, short processorCores, short processorWeight, boolean requiresHvm, boolean primaryDom0Locked, boolean secondaryDom0Locked)
      Adds a DomU to the cluster returning the reference to new cluster.
    • addDom0Disk

      public Cluster addDom0Disk(String hostname, String device, int diskSpeed)
      Adds a disk to the server with the provided hostname, returns the new cluster.
    • addPhysicalVolume

      public Cluster addPhysicalVolume(String hostname, String device, short partition, long extents)
      Adds a physical volume to this disk, returns the new cluster.
    • addDomUDisk

      public Cluster addDomUDisk(String hostname, String device, int minimumDiskSpeed, int extents, short weight)
      Adds a disk to this virtual server, returns the new cluster.