Class ModelAccessor
- java.lang.Object
-
- org.palladiosimulator.measurementsui.fileaccess.ModelAccessor
-
public class ModelAccessor extends Object
Class for accessing all Palladio models of a Modelling Project (.aird file available) Offers access to each model.
-
-
Constructor Summary
Constructors Constructor Description ModelAccessor()Constructor initiliazes the list for all models
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddMeasuringPointRepository(org.palladiosimulator.edp2.models.measuringpoint.MeasuringPointRepository measuringPointRepository)Adds a MeasuringPointRepository to the MeasuringPointRepository listprotected voidaddMonitorRepository(org.palladiosimulator.monitorrepository.MonitorRepository monitorRepository)Adds a MonitorRepository to the MonitorRepository listprotected voidaddSloRepository(org.palladiosimulator.servicelevelobjective.ServiceLevelObjectiveRepository sloRepository)Adds a ServiceLevelObjectiveRepository to the sloRepository listvoidcheckIfRepositoriesExist(IProject project)This method checks if the monitor- and measuringPointRepository exists and if not it creates default versions of them.List<org.palladiosimulator.pcm.allocation.Allocation>getAllocationList()Returns the list of AllocationsList<org.palladiosimulator.edp2.models.measuringpoint.MeasuringPointRepository>getMeasuringPointRepositoryList()Returns the list of MeasuringPointRepositorysList<org.palladiosimulator.monitorrepository.MonitorRepository>getMonitorRepositoryList()Returns the list of MonitorRepositorysList<org.palladiosimulator.pcm.repository.Repository>getRepositoryList()Returns the list RepositoriesList<org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment>getResourceEnvironmenList()Returns the list of ResourceEnvironmentsList<org.palladiosimulator.servicelevelobjective.ServiceLevelObjectiveRepository>getSLORepositoryList()Returns the list of SloRepositorysList<String>getSLORepositoryNameList()Returns the list of SloRepositoryNamesList<org.palladiosimulator.pcm.subsystem.SubSystem>getSubSystemList()Returns the list of SubSystemsList<org.palladiosimulator.pcm.system.System>getSystemList()Returns the list of SystemsEList<org.palladiosimulator.edp2.models.measuringpoint.MeasuringPoint>getUnassignedMeasuringPoints()This method returns a list of all MeasuringPoints which are not assigned to any Monitor.List<org.palladiosimulator.pcm.usagemodel.UsageModel>getUsageModelList()Returns the list of UsageModelsvoidinitializeModels(org.eclipse.sirius.business.api.session.Session session)Given a sirius session this Method initializes all five palladio component models(+SubSystems), monitor- and measuringPoint-Repositories that are found in this session.booleanmeasuringPointRepositoryExists()Checks whether there exists a MonitorRepositorybooleanmodelsExist()Checks whether any Palladio core models existbooleanmonitorRepositoryExists()Checks whether there exists a MonitorRepositorystatic <T> Predicate<T>not(Predicate<T> t)Method to negate a given predicate NOTE: with java 11 this will be implemented in the java.util.function package so Predicate.not(Predicatet) will be usable from there booleansloRepositoryExists()Checks whether there exists a SLO Repository
-
-
-
Method Detail
-
not
public static <T> Predicate<T> not(Predicate<T> t)
Method to negate a given predicate NOTE: with java 11 this will be implemented in the java.util.function package so Predicate.not(Predicatet) will be usable from there - Type Parameters:
T-- Parameters:
t- predicate to negate- Returns:
- negated Predicate
-
getUnassignedMeasuringPoints
public EList<org.palladiosimulator.edp2.models.measuringpoint.MeasuringPoint> getUnassignedMeasuringPoints()
This method returns a list of all MeasuringPoints which are not assigned to any Monitor.- Returns:
- EList of unassigned MeasuringPoints
-
initializeModels
public void initializeModels(org.eclipse.sirius.business.api.session.Session session)
Given a sirius session this Method initializes all five palladio component models(+SubSystems), monitor- and measuringPoint-Repositories that are found in this session.- Parameters:
session- the session to which all models should be loaded
-
checkIfRepositoriesExist
public void checkIfRepositoriesExist(IProject project)
This method checks if the monitor- and measuringPointRepository exists and if not it creates default versions of them.- Parameters:
project- current Project
-
modelsExist
public boolean modelsExist()
Checks whether any Palladio core models exist- Returns:
- boolean whether models exist or not
-
monitorRepositoryExists
public boolean monitorRepositoryExists()
Checks whether there exists a MonitorRepository- Returns:
- boolean whether a monitorRepository exists
-
measuringPointRepositoryExists
public boolean measuringPointRepositoryExists()
Checks whether there exists a MonitorRepository- Returns:
- boolean whether a monitorRepository exists
-
sloRepositoryExists
public boolean sloRepositoryExists()
Checks whether there exists a SLO Repository- Returns:
-
addMonitorRepository
protected void addMonitorRepository(org.palladiosimulator.monitorrepository.MonitorRepository monitorRepository)
Adds a MonitorRepository to the MonitorRepository list- Parameters:
monitorRepository- to add
-
addMeasuringPointRepository
protected void addMeasuringPointRepository(org.palladiosimulator.edp2.models.measuringpoint.MeasuringPointRepository measuringPointRepository)
Adds a MeasuringPointRepository to the MeasuringPointRepository list- Parameters:
measuringPointRepository- to add
-
addSloRepository
protected void addSloRepository(org.palladiosimulator.servicelevelobjective.ServiceLevelObjectiveRepository sloRepository)
Adds a ServiceLevelObjectiveRepository to the sloRepository list- Parameters:
sloRepository-
-
getResourceEnvironmenList
public List<org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment> getResourceEnvironmenList()
Returns the list of ResourceEnvironments- Returns:
- list of ResourceEnvironments
-
getSystemList
public List<org.palladiosimulator.pcm.system.System> getSystemList()
Returns the list of Systems- Returns:
- list of Systems
-
getAllocationList
public List<org.palladiosimulator.pcm.allocation.Allocation> getAllocationList()
Returns the list of Allocations- Returns:
- list of Allocations
-
getRepositoryList
public List<org.palladiosimulator.pcm.repository.Repository> getRepositoryList()
Returns the list Repositories- Returns:
- list of Repositories
-
getUsageModelList
public List<org.palladiosimulator.pcm.usagemodel.UsageModel> getUsageModelList()
Returns the list of UsageModels- Returns:
- list of UsageModels
-
getSubSystemList
public List<org.palladiosimulator.pcm.subsystem.SubSystem> getSubSystemList()
Returns the list of SubSystems- Returns:
- list of SubSystems
-
getMeasuringPointRepositoryList
public List<org.palladiosimulator.edp2.models.measuringpoint.MeasuringPointRepository> getMeasuringPointRepositoryList()
Returns the list of MeasuringPointRepositorys- Returns:
- list of MeasuringPointRepositorys
-
getMonitorRepositoryList
public List<org.palladiosimulator.monitorrepository.MonitorRepository> getMonitorRepositoryList()
Returns the list of MonitorRepositorys- Returns:
- list of MonitorRepositorys
-
getSLORepositoryList
public List<org.palladiosimulator.servicelevelobjective.ServiceLevelObjectiveRepository> getSLORepositoryList()
Returns the list of SloRepositorys- Returns:
- list of SloRepositorys
-
-