DatacenterBroker (cloudsim 3.1-SNAPSHOT API)

org.cloudbus.cloudsim

## Class DatacenterBroker

- java.lang.Object
- - org.cloudbus.cloudsim.core.SimEntity
  - - org.cloudbus.cloudsim.DatacenterBroker

- All Implemented Interfaces:
    Cloneable
  Direct Known Subclasses:
    NetworkDatacenterBrokerExtends, PowerDatacenterBroker

      public class DatacenterBroker
      extends SimEntity

  DatacentreBroker represents a broker acting on behalf of a user. It hides VM management, as vm creation, sumbission of cloudlets to this VMs and destruction of VMs.
  Since:
    CloudSim Toolkit 1.0
  Author:
    Rodrigo N. Calheiros, Anton Beloglazov

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<? extends Cloudlet>` | `cloudletList` The cloudlet list.
    `protected List<? extends Cloudlet>` | `cloudletReceivedList` The cloudlet received list.
    `protected int` | `cloudletsSubmitted` The cloudlets submitted.
    `protected List<? extends Cloudlet>` | `cloudletSubmittedList` The cloudlet submitted list.
    `protected Map<Integer,DatacenterCharacteristics>` | `datacenterCharacteristicsList` The datacenter characteristics list.
    `protected List<Integer>` | `datacenterIdsList` The datacenter ids list.
    `protected List<Integer>` | `datacenterRequestedIdsList` The datacenter requested ids list.
    `protected EventPostBroker` | `Postevt`
    `protected List<? extends Vm>` | `vmList` The vm list.
    `protected int` | `vmsAcks` The vms acks.
    `protected List<? extends Vm>` | `vmsCreatedList` The vms created list.
    `protected int` | `vmsDestroyed` The vms destroyed.
    `protected int` | `vmsRequested` The vms requested.
    `protected Map<Integer,Integer>` | `vmsToDatacentersMap` The vms to datacenters map.

    - ### Fields inherited from class org.cloudbus.cloudsim.core.SimEntity

      `FINISHED, HOLDING, RUNNABLE, WAITING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatacenterBroker(String name)` Created a new DatacenterBroker object.
    `DatacenterBroker(String name, EventPostBroker evt_)` Constructor like Datacenterbroker(name) + POST EVENT This constructor is used when a broker need to launch another broker at the end of its execution.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `bindCloudletToVm(int cloudletId, int vmId)` Specifies that a given cloudlet must run in a specific virtual machine.
    `protected void` | `clearDatacenters()` Destroy the virtual machines running in datacenters.
    `protected void` | `createVmsInDatacenter(int datacenterId)` Create the virtual machines in a datacenter.
    `protected void` | `finishExecution()` Send an internal event communicating the end of the simulation.
    `<T extends Cloudlet> List<T>` | `getCloudletList()` Gets the cloudlet list.
    `<T extends Cloudlet> List<T>` | `getCloudletReceivedList()` Gets the cloudlet received list.
    `<T extends Cloudlet> List<T>` | `getCloudletSubmittedList()` Gets the cloudlet submitted list.
    `protected Map<Integer,DatacenterCharacteristics>` | `getDatacenterCharacteristicsList()` Gets the datacenter characteristics list.
    `protected List<Integer>` | `getDatacenterIdsList()` Gets the datacenter ids list.
    `protected List<Integer>` | `getDatacenterRequestedIdsList()` Gets the datacenter requested ids list.
    `EventPostBroker` | `getPostevt()`
    `<T extends Vm> List<T>` | `getVmList()` Gets the vm list.
    `protected int` | `getVmsAcks()` Gets the vms acks.
    `<T extends Vm> List<T>` | `getVmsCreatedList()` Gets the vm list.
    `protected int` | `getVmsDestroyed()` Gets the vms destroyed.
    `protected int` | `getVmsRequested()` Gets the vms requested.
    `protected Map<Integer,Integer>` | `getVmsToDatacentersMap()` Gets the vms to datacenters map.
    `protected void` | `incrementVmsAcks()` Increment vms acks.
    `protected void` | `processCloudletReturn(SimEvent ev)` Process a cloudlet return event.
    `void` | `processEvent(SimEvent ev)` Processes events available for this Broker.
    `protected void` | `processOtherEvent(SimEvent ev)` Overrides this method when making a new and different type of Broker.
    `protected void` | `processPostEvent()` Schedule the PostEvent of a broker.
    `protected void` | `processResourceCharacteristics(SimEvent ev)` Process the return of a request for the characteristics of a PowerDatacenter.
    `protected void` | `processResourceCharacteristicsRequest(SimEvent ev)` Process a request for the characteristics of a PowerDatacenter.
    `protected void` | `processVmCreate(SimEvent ev)` Process the ack received due to a request for VM creation.
    `protected <T extends Cloudlet> void` | `setCloudletList(List<T> cloudletList)` Sets the cloudlet list.
    `protected <T extends Cloudlet> void` | `setCloudletReceivedList(List<T> cloudletReceivedList)` Sets the cloudlet received list.
    `protected <T extends Cloudlet> void` | `setCloudletSubmittedList(List<T> cloudletSubmittedList)` Sets the cloudlet submitted list.
    `protected void` | `setDatacenterCharacteristicsList(Map<Integer,DatacenterCharacteristics> datacenterCharacteristicsList)` Sets the datacenter characteristics list.
    `protected void` | `setDatacenterIdsList(List<Integer> datacenterIdsList)` Sets the datacenter ids list.
    `protected void` | `setDatacenterRequestedIdsList(List<Integer> datacenterRequestedIdsList)` Sets the datacenter requested ids list.
    `void` | `setPostevt(EventPostBroker Postevt)`
    `protected <T extends Vm> void` | `setVmList(List<T> vmList)` Sets the vm list.
    `protected void` | `setVmsAcks(int vmsAcks)` Sets the vms acks.
    `protected <T extends Vm> void` | `setVmsCreatedList(List<T> vmsCreatedList)` Sets the vm list.
    `protected void` | `setVmsDestroyed(int vmsDestroyed)` Sets the vms destroyed.
    `protected void` | `setVmsRequested(int vmsRequested)` Sets the vms requested.
    `protected void` | `setVmsToDatacentersMap(Map<Integer,Integer> vmsToDatacentersMap)` Sets the vms to datacenters map.
    `void` | `shutdownEntity()` This method is invoked by the `Simulation` before the simulation finishes.
    `void` | `startEntity()` This method is invoked by the `Simulation` class when the simulation is started.
    `void` | `submitCloudletList(List<? extends Cloudlet> list)` This method is used to send to the broker the list of cloudlets.
    `protected void` | `submitCloudlets()` Submit cloudlets to the created VMs.
    `void` | `submitVmList(List<? extends Vm> list)` This method is used to send to the broker the list with virtual machines that must be created.

    - ### Methods inherited from class org.cloudbus.cloudsim.core.SimEntity

      `cancelEvent, clone, getEventBuffer, getId, getName, getNextEvent, getNextEvent, getState, numEventsWaiting, numEventsWaiting, pause, run, schedule, schedule, schedule, schedule, scheduleFirst, scheduleFirst, scheduleFirst, scheduleFirst, scheduleFirstNow, scheduleFirstNow, scheduleFirstNow, scheduleFirstNow, scheduleNow, scheduleNow, scheduleNow, scheduleNow, selectEvent, send, send, send, send, sendNow, sendNow, sendNow, sendNow, setEventBuffer, setId, setState, waitForEvent`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### vmList

          protected List<? extends Vm> vmList

      The vm list.

    - #### vmsCreatedList

          protected List<? extends Vm> vmsCreatedList

      The vms created list.

    - #### cloudletList

          protected List<? extends Cloudlet> cloudletList

      The cloudlet list.

    - #### cloudletSubmittedList

          protected List<? extends Cloudlet> cloudletSubmittedList

      The cloudlet submitted list.

    - #### cloudletReceivedList

          protected List<? extends Cloudlet> cloudletReceivedList

      The cloudlet received list.

    - #### cloudletsSubmitted

          protected int cloudletsSubmitted

      The cloudlets submitted.

    - #### vmsRequested

          protected int vmsRequested

      The vms requested.

    - #### vmsAcks

          protected int vmsAcks

      The vms acks.

    - #### vmsDestroyed

          protected int vmsDestroyed

      The vms destroyed.

    - #### datacenterIdsList

          protected List<Integer> datacenterIdsList

      The datacenter ids list.

    - #### datacenterRequestedIdsList

          protected List<Integer> datacenterRequestedIdsList

      The datacenter requested ids list.

    - #### vmsToDatacentersMap

          protected Map<Integer,Integer> vmsToDatacentersMap

      The vms to datacenters map.

    - #### datacenterCharacteristicsList

          protected Map<Integer,DatacenterCharacteristics> datacenterCharacteristicsList

      The datacenter characteristics list.

    - #### Postevt

          protected EventPostBroker Postevt

  - ### Constructor Detail

    - #### DatacenterBroker

          public DatacenterBroker(String name)
                           throws Exception

      Created a new DatacenterBroker object.
      Parameters:
        `name` - name to be associated with this entity (as required by Sim_entity class from simjava package)
      Throws:
        `Exception` - the exception

    - #### DatacenterBroker

          public DatacenterBroker(String name,
                          EventPostBroker evt_)
                           throws Exception

      Constructor like Datacenterbroker(name) + POST EVENT This constructor is used when a broker need to launch another broker at the end of its execution. In the case where low frequency CPU is used (due to DVFS), an execution delay can appear in some broker, This constructor allow to keep the right execution order of a broker.
      Parameters:
        `name` -
        `evt_` -
      Throws:
        `Exception`

  - ### Method Detail

    - #### submitVmList

          public void submitVmList(List<? extends Vm> list)

      This method is used to send to the broker the list with virtual machines that must be created.
      Parameters:
        `list` - the list

    - #### submitCloudletList

          public void submitCloudletList(List<? extends Cloudlet> list)

      This method is used to send to the broker the list of cloudlets.
      Parameters:
        `list` - the list

    - #### bindCloudletToVm

          public void bindCloudletToVm(int cloudletId,
                              int vmId)

      Specifies that a given cloudlet must run in a specific virtual machine.
      Parameters:
        `cloudletId` - ID of the cloudlet being bount to a vm
        `vmId` - the vm id

    - #### processEvent

          public void processEvent(SimEvent ev)

      Processes events available for this Broker.
      Specified by:
        `processEvent` in class `SimEntity`
      Parameters:
        `ev` - a SimEvent object

    - #### processResourceCharacteristics

          protected void processResourceCharacteristics(SimEvent ev)

      Process the return of a request for the characteristics of a PowerDatacenter.
      Parameters:
        `ev` - a SimEvent object

    - #### processResourceCharacteristicsRequest

          protected void processResourceCharacteristicsRequest(SimEvent ev)

      Process a request for the characteristics of a PowerDatacenter.
      Parameters:
        `ev` - a SimEvent object

    - #### processVmCreate

          protected void processVmCreate(SimEvent ev)

      Process the ack received due to a request for VM creation.
      Parameters:
        `ev` - a SimEvent object

    - #### processCloudletReturn

          protected void processCloudletReturn(SimEvent ev)

      Process a cloudlet return event.
      Parameters:
        `ev` - a SimEvent object

    - #### processPostEvent

          protected void processPostEvent()

      Schedule the PostEvent of a broker. This method is called by "processCloudletReturn" when all Cloudlet of a Broker are ended

    - #### processOtherEvent

          protected void processOtherEvent(SimEvent ev)

      Overrides this method when making a new and different type of Broker. This method is called by `#body()` for incoming unknown tags.
      Parameters:
        `ev` - a SimEvent object

    - #### createVmsInDatacenter

          protected void createVmsInDatacenter(int datacenterId)

      Create the virtual machines in a datacenter.
      Parameters:
        `datacenterId` - Id of the chosen PowerDatacenter

    - #### submitCloudlets

          protected void submitCloudlets()

      Submit cloudlets to the created VMs.

    - #### clearDatacenters

          protected void clearDatacenters()

      Destroy the virtual machines running in datacenters.

    - #### finishExecution

          protected void finishExecution()

      Send an internal event communicating the end of the simulation.

    - #### shutdownEntity

          public void shutdownEntity()

      Description copied from class: `SimEntity`
      This method is invoked by the `Simulation` before the simulation finishes. If you want to save data in log files this is the method in which the corresponding code would be placed.
      Specified by:
        `shutdownEntity` in class `SimEntity`

    - #### startEntity

          public void startEntity()

      Description copied from class: `SimEntity`
      This method is invoked by the `Simulation` class when the simulation is started. This method should be responsible for starting the entity up.
      Specified by:
        `startEntity` in class `SimEntity`

    - #### getVmList

          public <T extends Vm> List<T> getVmList()

      Gets the vm list.
      Type Parameters:
        `T` - the generic type
      Returns:
        the vm list

    - #### setVmList

          protected <T extends Vm> void setVmList(List<T> vmList)

      Sets the vm list.
      Type Parameters:
        `T` - the generic type
      Parameters:
        `vmList` - the new vm list

    - #### getCloudletList

          public <T extends Cloudlet> List<T> getCloudletList()

      Gets the cloudlet list.
      Type Parameters:
        `T` - the generic type
      Returns:
        the cloudlet list

    - #### setCloudletList

          protected <T extends Cloudlet> void setCloudletList(List<T> cloudletList)

      Sets the cloudlet list.
      Type Parameters:
        `T` - the generic type
      Parameters:
        `cloudletList` - the new cloudlet list

    - #### getCloudletSubmittedList

          public <T extends Cloudlet> List<T> getCloudletSubmittedList()

      Gets the cloudlet submitted list.
      Type Parameters:
        `T` - the generic type
      Returns:
        the cloudlet submitted list

    - #### setCloudletSubmittedList

          protected <T extends Cloudlet> void setCloudletSubmittedList(List<T> cloudletSubmittedList)

      Sets the cloudlet submitted list.
      Type Parameters:
        `T` - the generic type
      Parameters:
        `cloudletSubmittedList` - the new cloudlet submitted list

    - #### getCloudletReceivedList

          public <T extends Cloudlet> List<T> getCloudletReceivedList()

      Gets the cloudlet received list.
      Type Parameters:
        `T` - the generic type
      Returns:
        the cloudlet received list

    - #### setCloudletReceivedList

          protected <T extends Cloudlet> void setCloudletReceivedList(List<T> cloudletReceivedList)

      Sets the cloudlet received list.
      Type Parameters:
        `T` - the generic type
      Parameters:
        `cloudletReceivedList` - the new cloudlet received list

    - #### getVmsCreatedList

          public <T extends Vm> List<T> getVmsCreatedList()

      Gets the vm list.
      Type Parameters:
        `T` - the generic type
      Returns:
        the vm list

    - #### setVmsCreatedList

          protected <T extends Vm> void setVmsCreatedList(List<T> vmsCreatedList)

      Sets the vm list.
      Type Parameters:
        `T` - the generic type
      Parameters:
        `vmsCreatedList` - the vms created list

    - #### getVmsRequested

          protected int getVmsRequested()

      Gets the vms requested.
      Returns:
        the vms requested

    - #### setVmsRequested

          protected void setVmsRequested(int vmsRequested)

      Sets the vms requested.
      Parameters:
        `vmsRequested` - the new vms requested

    - #### getVmsAcks

          protected int getVmsAcks()

      Gets the vms acks.
      Returns:
        the vms acks

    - #### setVmsAcks

          protected void setVmsAcks(int vmsAcks)

      Sets the vms acks.
      Parameters:
        `vmsAcks` - the new vms acks

    - #### incrementVmsAcks

          protected void incrementVmsAcks()

      Increment vms acks.

    - #### getVmsDestroyed

          protected int getVmsDestroyed()

      Gets the vms destroyed.
      Returns:
        the vms destroyed

    - #### setVmsDestroyed

          protected void setVmsDestroyed(int vmsDestroyed)

      Sets the vms destroyed.
      Parameters:
        `vmsDestroyed` - the new vms destroyed

    - #### getDatacenterIdsList

          protected List<Integer> getDatacenterIdsList()

      Gets the datacenter ids list.
      Returns:
        the datacenter ids list

    - #### setDatacenterIdsList

          protected void setDatacenterIdsList(List<Integer> datacenterIdsList)

      Sets the datacenter ids list.
      Parameters:
        `datacenterIdsList` - the new datacenter ids list

    - #### getVmsToDatacentersMap

          protected Map<Integer,Integer> getVmsToDatacentersMap()

      Gets the vms to datacenters map.
      Returns:
        the vms to datacenters map

    - #### setVmsToDatacentersMap

          protected void setVmsToDatacentersMap(Map<Integer,Integer> vmsToDatacentersMap)

      Sets the vms to datacenters map.
      Parameters:
        `vmsToDatacentersMap` - the vms to datacenters map

    - #### getDatacenterCharacteristicsList

          protected Map<Integer,DatacenterCharacteristics> getDatacenterCharacteristicsList()

      Gets the datacenter characteristics list.
      Returns:
        the datacenter characteristics list

    - #### setDatacenterCharacteristicsList

          protected void setDatacenterCharacteristicsList(Map<Integer,DatacenterCharacteristics> datacenterCharacteristicsList)

      Sets the datacenter characteristics list.
      Parameters:
        `datacenterCharacteristicsList` - the datacenter characteristics list

    - #### getDatacenterRequestedIdsList

          protected List<Integer> getDatacenterRequestedIdsList()

      Gets the datacenter requested ids list.
      Returns:
        the datacenter requested ids list

    - #### setDatacenterRequestedIdsList

          protected void setDatacenterRequestedIdsList(List<Integer> datacenterRequestedIdsList)

      Sets the datacenter requested ids list.
      Parameters:
        `datacenterRequestedIdsList` - the new datacenter requested ids list

    - #### getPostevt

          public EventPostBroker getPostevt()

    - #### setPostevt

          public void setPostevt(EventPostBroker Postevt)

Copyright © 2013 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.