Class ModelDatabase
- java.lang.Object
-
- de.unirostock.sems.ModelCrawler.databases.Interface.ModelDatabase
-
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,Callable<Map<String,ChangeSet>>
- Direct Known Subclasses:
BioModelsDb
,PmrDb
public abstract class ModelDatabase extends Object implements Callable<Map<String,ChangeSet>>, Closeable, Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ModelDatabase.DatabaseTypes
-
Field Summary
Fields Modifier and Type Field Description protected boolean
enabled
protected int
limit
protected ModelStorage
modelStorage
protected de.unirostock.sems.morre.client.MorreCrawlerInterface
morreClient
protected File
tempDir
-
Constructor Summary
Constructors Constructor Description ModelDatabase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Map<String,ChangeSet>
call()
Starts the process of crawling for this specific Database.abstract void
close()
Cleans up the working directoryprotected File
createTempDir()
creates a new and empty temporary directory and sets the class variable.int
getLimit()
abstract ChangeSet
getModelChanges(String fileId)
Returns the ChangeSet only for one specific model.ModelStorage
getModelStorage()
de.unirostock.sems.morre.client.MorreCrawlerInterface
getMorreClient()
String
getWorkingDir()
boolean
isEnabled()
abstract Map<String,ChangeSet>
listChanges()
Returns a map with all changes made after the last crawl
the fileId is the map key.abstract List<String>
listModels()
lists all Models in the latest revisionprotected File
obtainWorkingDir()
void
setEnabled(boolean enabled)
void
setLimit(int limit)
void
setModelStorage(ModelStorage modelStorage)
void
setMorreClient(de.unirostock.sems.morre.client.MorreCrawlerInterface morreClient)
void
setWorkingDir(String workingDir)
-
-
-
Field Detail
-
enabled
protected boolean enabled
-
limit
protected int limit
-
tempDir
protected File tempDir
-
morreClient
protected de.unirostock.sems.morre.client.MorreCrawlerInterface morreClient
-
modelStorage
protected ModelStorage modelStorage
-
-
Method Detail
-
createTempDir
protected File createTempDir()
creates a new and empty temporary directory and sets the class variable.- Returns:
- the temporary directory object
-
listModels
public abstract List<String> listModels()
lists all Models in the latest revision- Returns:
- List with all model IDs
-
listChanges
public abstract Map<String,ChangeSet> listChanges()
Returns a map with all changes made after the last crawl
the fileId is the map key.- Returns:
- the list of changes
-
getModelChanges
public abstract ChangeSet getModelChanges(String fileId)
Returns the ChangeSet only for one specific model.- Parameters:
fileId
- the file id- Returns:
- ChangeSet
-
close
public abstract void close()
Cleans up the working directory- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
call
public abstract Map<String,ChangeSet> call()
Starts the process of crawling for this specific Database.
-
getWorkingDir
public String getWorkingDir()
-
obtainWorkingDir
protected File obtainWorkingDir()
-
setWorkingDir
public void setWorkingDir(String workingDir)
-
getLimit
public int getLimit()
-
setLimit
public void setLimit(int limit)
-
isEnabled
public boolean isEnabled()
-
setEnabled
public void setEnabled(boolean enabled)
-
getMorreClient
public de.unirostock.sems.morre.client.MorreCrawlerInterface getMorreClient()
-
setMorreClient
public void setMorreClient(de.unirostock.sems.morre.client.MorreCrawlerInterface morreClient)
-
getModelStorage
public ModelStorage getModelStorage()
-
setModelStorage
public void setModelStorage(ModelStorage modelStorage)
-
-