Package org.cloudsimplus.builders
Class BrokerBuilderDecorator
java.lang.Object
org.cloudsimplus.builders.BrokerBuilderDecorator
- All Implemented Interfaces:
BrokerBuilderInterface
,Builder
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
ConstructorDescriptionBrokerBuilderDecorator
(BrokerBuilder builder, DatacenterBrokerSimple broker) -
Method Summary
Modifier and TypeMethodDescriptioncreate()
create
(Consumer<DatacenterBroker> brokerConsumer) Creates a brokerfindBroker
(int id) get
(int index) 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
-
create
Description copied from interface:BrokerBuilderInterface
Creates a broker- Specified by:
create
in interfaceBrokerBuilderInterface
- Parameters:
brokerConsumer
- aConsumer
that will perform some configuration with the just created broker- Returns:
-
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
-