Class EASyPersistencer
- java.lang.Object
-
- net.ssehub.easy.producer.eclipse.persistency.EASyPersistencer
-
- All Implemented Interfaces:
PersistenceConstants
public class EASyPersistencer extends java.lang.Object implements PersistenceConstants
Abstraction Layer for saving/reading persistent EASy-Producer information.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private IPersistencerpersistencer-
Fields inherited from interface net.ssehub.easy.producer.core.persistence.standard.PersistenceConstants
CONFIG_FILE, EASY_FILES_DEFAULT, INSTANTIATOR_ENGINE, INSTANTIATOR_FILE, INSTANTIATOR_INHERITED, INSTANTIATOR_PATH_REGEX, INSTANTIATOR_PATHS, INSTANTIATOR_UUID, PLP_LOCATION, PLP_VERSION, PRESUCCESSOR_LOCATION, PRESUCCESSOR_MEMEBERNAME, PRESUCCESSOR_UUID, PRESUCCESSOR_VERSION, PTN_PROJECTNAME, PTN_UUID, REASONER_ATTRIBUTE, REASONER_TIMEOUT, REASONER_VALUE_SEPARATOR, REASONER_VALUES, SETTINGS_DEBUG
-
-
Constructor Summary
Constructors Constructor Description EASyPersistencer(java.io.File projectFolder)Sole constructor for this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcreateReasonerConfiguration(PLPInfo plp, Model model)Creates ReasoningConfiguration.java.lang.StringgetProjectID()Returns the ID of a given pl project.PLPInfoload()Reads the persistent data and transforms them into aProductLineProject.private java.util.List<PLPInfo>model2Relatives(Model model)Creates information related to relative projects..private PLPInfopersistentProject2PLP(PersistentProject project)Translates thePersistentProjectinto aProductLineProject.static java.io.FileprojectPath(PLPInfo plp)Returns the location of the main ivml file for the givenProductLineProject.static voidrefreshModels(PLPInfo plp)(Re-)Loads all variability models of the specifiedProductLineProjectfrom the file system.voidsave(PLPInfo plp)Saves the givenProductLineProjectpersistently.
-
-
-
Field Detail
-
persistencer
private IPersistencer persistencer
-
-
Constructor Detail
-
EASyPersistencer
public EASyPersistencer(java.io.File projectFolder)
Sole constructor for this class.- Parameters:
projectFolder- The location of theProductLineProject.
-
-
Method Detail
-
load
public PLPInfo load() throws PersistenceException
Reads the persistent data and transforms them into aProductLineProject.- Returns:
- A
ProductLineProjectornull. - Throws:
PersistenceException- Will be thrown if the data is invalid or an IOException occur, while reading the persistent data.
-
refreshModels
public static void refreshModels(PLPInfo plp)
(Re-)Loads all variability models of the specifiedProductLineProjectfrom the file system.- Parameters:
plp- AProductLineProjectcontaining saved models which should be (re-) loaded from the file system
-
projectPath
public static java.io.File projectPath(PLPInfo plp)
Returns the location of the main ivml file for the givenProductLineProject.- Parameters:
plp- TheProductLineProjectholding the ivml file for which this method looks for.- Returns:
- The location of the ivml file or null if the location could not be determined.
-
persistentProject2PLP
private PLPInfo persistentProject2PLP(PersistentProject project) throws PersistenceException
Translates thePersistentProjectinto aProductLineProject.- Parameters:
project- ThePersistentProjectwhich should be translated.- Returns:
- A
ProductLineProjectrepresenting the givenPersistentProject. - Throws:
PersistenceException- Will be thrown if thePersistentProjectcontains invalid data.
-
createReasonerConfiguration
private void createReasonerConfiguration(PLPInfo plp, Model model)
Creates ReasoningConfiguration.- Parameters:
model- A model of typeModelType.INSTANTIATORSholding all instantiator information.plp- TheProductLineProjectwhere the instantiators should be saved
-
model2Relatives
private java.util.List<PLPInfo> model2Relatives(Model model)
Creates information related to relative projects..- Parameters:
model- A model of typeModelType.PREDECESSORSorModelType.SUCCESSORSholding all Prede-/Successor information.- Returns:
- The Predecessors/Successor-List
-
save
public void save(PLPInfo plp) throws PersistenceException
Saves the givenProductLineProjectpersistently.- Parameters:
plp- TheProductLineProjectwhich should be saved.- Throws:
PersistenceException- Will be thrown if an exception occurs while accessing the file system.
-
getProjectID
public java.lang.String getProjectID()
Returns the ID of a given pl project.- Returns:
- the id or null if the specified project has no configuration file.
-
-