C
- the update context typepublic class ProjectReference<C> extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_FILE_NAME
The name of the project configuration file in the project folder.
|
static String |
REPORT_FILE_NAME
The name of the log file in the project folder, containing the reports
from loading the project.
|
Constructor and Description |
---|
ProjectReference(File projectFolder,
String overrideProjectFile,
String projectId,
Properties defaultSettings) |
Modifier and Type | Method and Description |
---|---|
void |
forceUpdate(C context)
Force an update by resetting the loaded project information.
|
protected ProjectProperties |
getConfig() |
File |
getLoadReportFile()
Get the file the reports for loading the project are stored in.
|
protected Project |
getProject()
Get the loaded project if available.
|
File |
getProjectFile()
Get the project file is possible.
|
File |
getProjectFolder() |
ProjectInfo |
getProjectInfo()
Get the project information if available.
|
protected Set<String> |
getSupportedExtensions()
Get the supported file extensions for projects.
|
protected boolean |
isForceClearReports()
States if the report file should be deleted in
update(Object)
even if the project info is already loaded. |
protected Project |
loadProjectInfo(File projectFile,
ReportHandler reportHandler)
Load project information.
|
protected void |
onFailure(C context,
String projectId)
Called when the project failed to load in
update(Object) . |
protected void |
onNotAvailable(C context,
String projectId)
Called when the project file is not available in
update(Object) . |
protected void |
onSuccess(C context,
String projectId,
File projectFile,
Project project,
ReportFile reportFile)
Called when the project was successfully loaded in
update(Object) . |
protected void |
setProject(Project project)
Set the internal project.
|
void |
update(C context)
Updates the project status from the configuration and if needed loads the
project and transformation environment and adds or removes the
transformation environment.
|
public static final String CONFIG_FILE_NAME
public static final String REPORT_FILE_NAME
public ProjectReference(File projectFolder, String overrideProjectFile, String projectId, Properties defaultSettings) throws IOException
projectFolder
- the project folderoverrideProjectFile
- the name of the project file if it should
override the configuration, otherwise null
projectId
- the project identifierdefaultSettings
- the properties with default project settings, may
be null
IOException
- if accessing the project configuration file failedpublic void forceUpdate(C context)
context
- the update contextpublic void update(C context)
context
- the update contextprotected boolean isForceClearReports()
update(Object)
even if the project info is already loaded.protected void onSuccess(C context, String projectId, File projectFile, Project project, ReportFile reportFile)
update(Object)
.context
- the update contextprojectId
- the project identifierprojectFile
- the project fileproject
- the loaded projectreportFile
- the report file to publish any additional reports toprotected void onFailure(C context, String projectId)
update(Object)
.context
- the update contextprojectId
- the project identifierprotected void onNotAvailable(C context, String projectId)
update(Object)
.context
- the update contextprojectId
- the project identifierpublic ProjectInfo getProjectInfo()
protected Project getProject()
protected void setProject(Project project)
project
- the project to setpublic File getLoadReportFile()
protected Project loadProjectInfo(File projectFile, ReportHandler reportHandler)
projectFile
- the project filereportHandler
- the report handlernull
if the project file could
not be loadedpublic File getProjectFile()
null
public File getProjectFolder()
protected ProjectProperties getConfig()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a