Package org.cloudsimplus.builders
Class BrokerBuilderDecorator
java.lang.Object
org.cloudsimplus.builders.BrokerBuilderDecorator
- All Implemented Interfaces:
BrokerBuilderInterface
,Builder
public class BrokerBuilderDecorator extends Object implements BrokerBuilderInterface
A class that implements the Decorator Design Pattern in order to include features in a existing class. It is used to ensure that specific methods are called only after a given method is called.
For instance, the methodsgetVmBuilder()
and
getCloudletBuilder()
can only be called after
some DatacenterBrokerSimple
was created by calling
the method create()
.By this way, after the method is called, it returns an instance of this decorator that allow chained call to the specific decorator methods as the following example:
- Since:
- CloudSim Plus 1.0
- Author:
- Manoel Campos da Silva Filho
-
Constructor Summary
Constructors Constructor Description BrokerBuilderDecorator(BrokerBuilder builder, DatacenterBrokerSimple broker)
-
Method Summary
Modifier and Type Method Description BrokerBuilderDecorator
create()
DatacenterBroker
findBroker(int id)
DatacenterBroker
get(int index)
DatacenterBroker
getBroker()
List<DatacenterBroker>
getBrokers()
CloudletBuilder
getCloudletBuilder()
VmBuilder
getVmBuilder()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cloudsimplus.builders.Builder
validateAmount
-
Constructor Details
-
BrokerBuilderDecorator
-
-
Method Details
-
create
- Specified by:
create
in interfaceBrokerBuilderInterface
-
getBrokers
- Specified by:
getBrokers
in interfaceBrokerBuilderInterface
-
findBroker
- Specified by:
findBroker
in interfaceBrokerBuilderInterface
-
get
- Specified by:
get
in interfaceBrokerBuilderInterface
-
getVmBuilder
- Returns:
- the VmBuilder in charge of creating VMs to the latest DatacenterBroker created by this BrokerBuilder
-
getCloudletBuilder
- Returns:
- the CloudletBuilder in charge of creating Cloudlets to the latest DatacenterBroker created by this BrokerBuilder
-
getBroker
- Returns:
- the latest created broker
-