Class 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 void addMeasuringPointRepository​(org.palladiosimulator.edp2.models.measuringpoint.MeasuringPointRepository measuringPointRepository)
      Adds a MeasuringPointRepository to the MeasuringPointRepository list
      protected void addMonitorRepository​(org.palladiosimulator.monitorrepository.MonitorRepository monitorRepository)
      Adds a MonitorRepository to the MonitorRepository list
      protected void addSloRepository​(org.palladiosimulator.servicelevelobjective.ServiceLevelObjectiveRepository sloRepository)
      Adds a ServiceLevelObjectiveRepository to the sloRepository list
      void checkIfRepositoriesExist​(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 Allocations
      List<org.palladiosimulator.edp2.models.measuringpoint.MeasuringPointRepository> getMeasuringPointRepositoryList()
      Returns the list of MeasuringPointRepositorys
      List<org.palladiosimulator.monitorrepository.MonitorRepository> getMonitorRepositoryList()
      Returns the list of MonitorRepositorys
      List<org.palladiosimulator.pcm.repository.Repository> getRepositoryList()
      Returns the list Repositories
      List<org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment> getResourceEnvironmenList()
      Returns the list of ResourceEnvironments
      List<org.palladiosimulator.servicelevelobjective.ServiceLevelObjectiveRepository> getSLORepositoryList()
      Returns the list of SloRepositorys
      List<String> getSLORepositoryNameList()
      Returns the list of SloRepositoryNames
      List<org.palladiosimulator.pcm.subsystem.SubSystem> getSubSystemList()
      Returns the list of SubSystems
      List<org.palladiosimulator.pcm.system.System> getSystemList()
      Returns the list of Systems
      EList<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 UsageModels
      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.
      boolean measuringPointRepositoryExists()
      Checks whether there exists a MonitorRepository
      boolean modelsExist()
      Checks whether any Palladio core models exist
      boolean monitorRepositoryExists()
      Checks whether there exists a MonitorRepository
      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(Predicate t) will be usable from there
      boolean sloRepositoryExists()
      Checks whether there exists a SLO Repository
    • Constructor Detail

      • ModelAccessor

        public ModelAccessor()
        Constructor initiliazes the list for all models
    • 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(Predicate t) 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
      • getSLORepositoryNameList

        public List<String> getSLORepositoryNameList()
        Returns the list of SloRepositoryNames
        Returns:
        list of SloRepositoryNames