Class ForgeVM

java.lang.Object
org.btrplace.plan.event.Action
org.btrplace.plan.event.ForgeVM
All Implemented Interfaces:
Event, VMEvent, VMStateTransition

public class ForgeVM
extends Action
implements VMStateTransition
Prepare a VM for being deployed.
Author:
Fabien Hermenier
  • Constructor Details

    • ForgeVM

      public ForgeVM​(VM vm, int start, int end)
      Make a new action.
      Parameters:
      vm - the VM to forge.
      start - the moment the action starts
      end - the moment the action ends
  • Method Details

    • applyAction

      public boolean applyAction​(Model m)
      Put the VM in the ready state iff it does not already belong to the mapping.
      Specified by:
      applyAction in class Action
      Parameters:
      m - the model to modify
      Returns:
      true iff successful
    • equals

      public boolean equals​(Object o)
      Test if the action is equals to another object.
      Overrides:
      equals in class Action
      Parameters:
      o - the object to compare with
      Returns:
      true if o is an instance of ForgeVM and if both instances involve the same VM
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Action
    • getVM

      public VM getVM()
      Description copied from interface: VMEvent
      Get the VM to involved in the action.
      Specified by:
      getVM in interface VMEvent
      Returns:
      the VM identifier
    • pretty

      public String pretty()
      Description copied from class: Action
      Pretty print of the action.
      Specified by:
      pretty in class Action
      Returns:
      a String
    • getCurrentState

      public VMState getCurrentState()
      Description copied from interface: VMStateTransition
      Get the current state of the VM.
      Specified by:
      getCurrentState in interface VMStateTransition
      Returns:
      a State
    • getNextState

      public VMState getNextState()
      Description copied from interface: VMStateTransition
      Get the next state of the VM.
      Specified by:
      getNextState in interface VMStateTransition
      Returns:
      a State
    • visit

      public Object visit​(ActionVisitor v)
      Description copied from interface: Event
      Notify a visitor to visit the action.
      Specified by:
      visit in interface Event
      Parameters:
      v - the visitor to notify
      Returns:
      the visit result