org.cloudsimplus.brokers.DatacenterBrokerNull Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudsim-plus Show documentation
Show all versions of cloudsim-plus Show documentation
CloudSim Plus: A modern, highly extensible and easier-to-use Java 8+ Framework for Modeling and Simulation of Cloud Computing Infrastructures and Services
The newest version!
/*
* CloudSim Plus: A modern, highly-extensible and easier-to-use Framework for
* Modeling and Simulation of Cloud Computing Infrastructures and Services.
* http://cloudsimplus.org
*
* Copyright (C) 2015-2021 Universidade da Beira Interior (UBI, Portugal) and
* the Instituto Federal de Educação Ciência e Tecnologia do Tocantins (IFTO, Brazil).
*
* This file is part of CloudSim Plus.
*
* CloudSim Plus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CloudSim Plus is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CloudSim Plus. If not, see .
*/
package org.cloudsimplus.brokers;
import org.cloudsimplus.cloudlets.Cloudlet;
import org.cloudsimplus.core.SimEntity;
import org.cloudsimplus.core.SimEntityNullBase;
import org.cloudsimplus.datacenters.Datacenter;
import org.cloudsimplus.listeners.DatacenterBrokerEventInfo;
import org.cloudsimplus.listeners.EventInfo;
import org.cloudsimplus.listeners.EventListener;
import org.cloudsimplus.vms.Vm;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Function;
/**
* A class that implements the Null Object Design Pattern for {@link DatacenterBroker}
* class.
*
* @author Manoel Campos da Silva Filho
* @see DatacenterBroker#NULL
*/
final class DatacenterBrokerNull implements DatacenterBroker, SimEntityNullBase {
@Override public int compareTo(SimEntity entity) { return 0; }
@Override public boolean bindCloudletToVm(Cloudlet cloudlet, Vm vm) {
return false;
}
@Override public List getCloudletWaitingList() {
return Collections.emptyList();
}
@Override public List getCloudletFinishedList() {
return Collections.emptyList();
}
@Override public Vm getWaitingVm(int index) {
return Vm.NULL;
}
@Override public List getVmWaitingList() {
return Collections.emptyList();
}
@Override public List getVmExecList() {
return Collections.emptyList();
}
@Override public int getVmsNumber() { return 0; }
@Override public DatacenterBroker requestIdleVmDestruction(Vm vm) { return this; }
@Override public void requestShutdownWhenIdle() {/**/}
@Override public List destroyVm(Vm vm) { return Collections.emptyList(); }
@Override public List getVmCreatedList() { return Collections.emptyList(); }
@Override public DatacenterBroker setDatacenterMapper(BiFunction datacenterMapper) { return this; }
@Override public DatacenterBroker setVmMapper(Function vmMapper) { return this; }
@Override public DatacenterBroker setSelectClosestDatacenter(boolean select) { return this; }
@Override public boolean isSelectClosestDatacenter() { return false; }
@Override public List getCloudletCreatedList() { return Collections.emptyList(); }
@Override public DatacenterBroker addOnVmsCreatedListener(EventListener listener) { return this; }
@Override public DatacenterBroker removeOnVmsCreatedListener(EventListener extends EventInfo> listener) { return this; }
@Override public DatacenterBroker setVmDestructionDelayFunction(Function function) { return this; }
@Override public DatacenterBroker setVmDestructionDelay(double delay) { return this; }
@Override public List getCloudletSubmittedList() { return Collections.emptyList(); }
@Override public List getVmFailedList() { return Collections.emptyList(); }
@Override public VmCreation getVmCreation() { return VmCreation.ofZero(); }
@Override public DatacenterBroker setLastSelectedDc(Datacenter lastSelectedDc) { return this; }
@Override public Datacenter getLastSelectedDc() { return Datacenter.NULL; }
@Override public boolean isShutdownWhenIdle() { return false; }
@Override public DatacenterBroker setShutdownWhenIdle(boolean shutdownWhenIdle) { return this; }
@Override public DatacenterBroker setVmComparator(Comparator comparator) { return this; }
@Override public DatacenterBroker setCloudletComparator(Comparator comparator) { return this; }
@Override public DatacenterBroker submitCloudlet(Cloudlet cloudlet) { return this; }
@Override public DatacenterBroker submitCloudletList(List extends Cloudlet> list) { return this; }
@Override public DatacenterBroker submitCloudletList(List extends Cloudlet> list, double submissionDelay) { return this; }
@Override public DatacenterBroker submitCloudletList(List extends Cloudlet> list, Vm vm) { return this; }
@Override public DatacenterBroker submitCloudletList(List extends Cloudlet> list, Vm vm, double submissionDelay) { return this; }
@Override public DatacenterBroker submitVm(Vm vm) { return this; }
@Override public DatacenterBroker submitVmList(List extends Vm> list) { return this; }
@Override public DatacenterBroker submitVmList(List extends Vm> list, double submissionDelay) { return this; }
@Override public double getStartTime() { return -1; }
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy