Package org.btrplace.plan.event
Class Allocate
java.lang.Object
org.btrplace.plan.event.Action
org.btrplace.plan.event.Allocate
public class Allocate extends Action implements VMEvent
An action to indicate the amount of resources of a given type
to allocate to a VM.
- Author:
- Fabien Hermenier
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description boolean
applyAction(Model i)
Apply only the scheduled action.boolean
equals(Object o)
int
getAmount()
Get the amount of resources to allocate to the VM.Node
getHost()
Get the node that is currently hosting the VM.String
getResourceId()
Get the resource identifier.VM
getVM()
Get the VM to involved in the action.int
hashCode()
String
pretty()
Pretty print of the action.Object
visit(ActionVisitor v)
Notify a visitor to visit the action.Methods inherited from class org.btrplace.plan.event.Action
addEvent, apply, applyEvents, getEnd, getEvents, getStart, toString
-
Constructor Details
-
Allocate
Make a new constraint.- Parameters:
vm
- the VMon
- the node hosting the VMrc
- the resource identifieramount
- the minimum amount of resource to allocatestart
- the moment the action startsend
- the moment the action ends
-
-
Method Details
-
getHost
Get the node that is currently hosting the VM.- Returns:
- the node
-
getVM
Description copied from interface:VMEvent
Get the VM to involved in the action. -
getResourceId
Get the resource identifier.- Returns:
- a non-empty string
-
getAmount
public int getAmount()Get the amount of resources to allocate to the VM.- Returns:
- a positive number
-
applyAction
Description copied from class:Action
Apply only the scheduled action.- Specified by:
applyAction
in classAction
- Parameters:
i
- the model to modify- Returns:
true
if the action was applied successfully
-
pretty
Description copied from class:Action
Pretty print of the action. -
equals
-
hashCode
public int hashCode() -
visit
Description copied from interface:Event
Notify a visitor to visit the action.
-