public interface Mapping extends Cloneable
ElementBuilder.newVM()
and ElementBuilder.newNode()
Modifier and Type | Method and Description |
---|---|
boolean |
addOfflineNode(Node node)
Set a node offline.
|
boolean |
addOnlineNode(Node node)
Set a node online.
|
boolean |
addReadyVM(VM vm)
Set a VM ready for being running.
|
boolean |
addRunningVM(VM vm,
Node node)
Set a VM running on a node.
|
boolean |
addSleepingVM(VM vm,
Node node)
Set a VM sleeping on a node.
|
void |
clear()
Remove all the nodes and the VMs in the mapping.
|
void |
clearAllVMs()
Remove all the VMs in the mapping
|
void |
clearNode(Node u)
Remove all the VMs remove on a given node
|
Mapping |
clone()
Copy a mapping.
|
boolean |
contains(Node node)
Check if a node is in the mapping.
|
boolean |
contains(VM vm)
Check if a VM is in the mapping.
|
Set<Node> |
getAllNodes()
Get all the nodes involved in the mapping.
|
Set<VM> |
getAllVMs()
Get all the VMs involved in the mapping.
|
int |
getNbNodes()
Get the number of nodes in the mapping
|
int |
getNbVMs()
Get the number of VMs in the mapping.
|
Set<Node> |
getOfflineNodes()
Get the offline nodes..
|
Set<Node> |
getOnlineNodes()
Get the online nodes.
|
Set<VM> |
getReadyVMs()
Get the VMs that are ready.
|
Set<VM> |
getRunningVMs()
Get the VMs that are running.
|
Set<VM> |
getRunningVMs(Collection<Node> ns)
Get all the VMs running on a collection of nodes.
|
Set<VM> |
getRunningVMs(Node n)
Get the VMs that are running on a node.
|
Set<VM> |
getSleepingVMs()
Get the VMs that are sleeping.
|
Set<VM> |
getSleepingVMs(Collection<Node> ns)
Get all the VMs sleeping on a collection of nodes.
|
Set<VM> |
getSleepingVMs(Node n)
Get the VMs that are sleeping on a node.
|
NodeState |
getState(Node n)
Get the state of a node
|
VMState |
getState(VM v)
Get the state of a VM
|
Node |
getVMLocation(VM vm)
Get the location of a running or a sleeping VM.
|
boolean |
isOffline(Node n)
Check if a node is in the offline state.
|
boolean |
isOnline(Node n)
Check if a node is in the online state.
|
boolean |
isReady(VM v)
Check if a VM is in the ready state.
|
boolean |
isRunning(VM v)
Check if a VM is in the running state.
|
boolean |
isSleeping(VM v)
Check if a VM is in the sleeping state.
|
boolean |
remove(Node n)
Remove a node.
|
boolean |
remove(VM vm)
Remove a VM.
|
boolean addRunningVM(VM vm, Node node)
vm
- the VMnode
- the node that will host the VM. The node must already be considered as online.true
iff the VM is assigned on the node.boolean addSleepingVM(VM vm, Node node)
vm
- the VMnode
- the node that will host the VM. The node must already be considered as online.false
iff the hosting node is offline or unknownboolean addReadyVM(VM vm)
vm
- the VMtrue
iff the VM is now in the ready stateboolean remove(VM vm)
vm
- the VM to remove.true
iff the VM was in the mapping and has been removedboolean remove(Node n)
n
- the node.true
if the node was in the mapping and is removed. false
otherwiseSet<Node> getOnlineNodes()
boolean addOnlineNode(Node node)
node
- the node.true
iff the node is now in the online stateboolean addOfflineNode(Node node)
node
- the nodetrue
if the node is offline. false
otherwiseSet<Node> getOfflineNodes()
Set<VM> getRunningVMs()
boolean isRunning(VM v)
v
- the VM to checktrue
iff the VM is running on a nodeboolean isSleeping(VM v)
v
- the VM to checktrue
iff the VM is sleeping on a nodeboolean isReady(VM v)
v
- the VM to checktrue
iff the VM is readyboolean isOnline(Node n)
n
- the node to checktrue
iff the node is onlineboolean isOffline(Node n)
n
- the node to checktrue
iff the node is offlineSet<VM> getSleepingVMs()
Set<VM> getSleepingVMs(Node n)
n
- the node.Set<VM> getRunningVMs(Node n)
n
- the node.Set<VM> getAllVMs()
Set<Node> getAllNodes()
Node getVMLocation(VM vm)
vm
- the VM.null
is the VM
is not in the sleeping state nor the running stateSet<VM> getRunningVMs(Collection<Node> ns)
ns
- a set of nodesSet<VM> getSleepingVMs(Collection<Node> ns)
ns
- a set of nodesMapping clone()
boolean contains(VM vm)
vm
- the VM.true
if the VM is in.boolean contains(Node node)
node
- the node identifier.true
if the node is in.void clear()
void clearNode(Node u)
u
- the node identifier.void clearAllVMs()
int getNbNodes()
int getNbVMs()
VMState getState(VM v)
v
- the VMnull
otherwiseCopyright © 2015 University of Nice-Sophia Antipolis. All Rights Reserved.