public class ProjectHandler extends ProjectReference<EnvironmentManager>
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_ENABLED
Name of the property specifying if a project is enabled
|
CONFIG_FILE_NAME, REPORT_FILE_NAME
Constructor and Description |
---|
ProjectHandler(File projectFolder,
String overrideProjectFile,
String projectId) |
Modifier and Type | Method and Description |
---|---|
void |
activate(EnvironmentManager environments)
Activate the project.
|
void |
deactivate(EnvironmentManager environments)
Deactivate the project.
|
ProjectScavenger.Status |
getStatus()
Get the project status.
|
TransformationEnvironment |
getTransformationEnvironment()
Get the transformation environment if available.
|
protected boolean |
isEnabled()
Specifies if the project is enabled.
|
protected boolean |
isForceClearReports()
States if the report file should be deleted in
ProjectReference.update(Object)
even if the project info is already loaded. |
protected void |
onFailure(EnvironmentManager context,
String projectId)
Called when the project failed to load in
ProjectReference.update(Object) . |
protected void |
onNotAvailable(EnvironmentManager context,
String projectId)
Called when the project file is not available in
ProjectReference.update(Object) . |
protected void |
onSuccess(EnvironmentManager context,
String projectId,
File projectFile,
Project project,
ReportFile reportFile)
Called when the project was successfully loaded in
ProjectReference.update(Object) . |
protected void |
setEnabled(boolean enabled)
Set if the project is enabled.
|
forceUpdate, getConfig, getLoadReportFile, getProject, getProjectFile, getProjectFolder, getProjectInfo, getSupportedExtensions, loadProjectInfo, setProject, update
public static final String PROPERTY_ENABLED
public ProjectHandler(File projectFolder, String overrideProjectFile, String projectId) throws IOException
projectFolder
- the project folderoverrideProjectFile
- the name of the project file if it should
override the configuration, otherwise null
projectId
- the project identifierIOException
- if accessing the project configuration file failedprotected boolean isForceClearReports()
ProjectReference
ProjectReference.update(Object)
even if the project info is already loaded.isForceClearReports
in class ProjectReference<EnvironmentManager>
protected boolean isEnabled()
protected void setEnabled(boolean enabled)
enabled
- if the project is enabledprotected void onSuccess(EnvironmentManager context, String projectId, File projectFile, Project project, ReportFile reportFile)
ProjectReference
ProjectReference.update(Object)
.onSuccess
in class ProjectReference<EnvironmentManager>
context
- the update contextprojectId
- the project identifierprojectFile
- the project fileproject
- the loaded projectreportFile
- the report file to publish any additional reports toprotected void onFailure(EnvironmentManager context, String projectId)
ProjectReference
ProjectReference.update(Object)
.onFailure
in class ProjectReference<EnvironmentManager>
context
- the update contextprojectId
- the project identifierprotected void onNotAvailable(EnvironmentManager context, String projectId)
ProjectReference
ProjectReference.update(Object)
.onNotAvailable
in class ProjectReference<EnvironmentManager>
context
- the update contextprojectId
- the project identifierpublic TransformationEnvironment getTransformationEnvironment()
public ProjectScavenger.Status getStatus()
public void activate(EnvironmentManager environments)
environments
- the environment manager to publish the transformation
environment topublic void deactivate(EnvironmentManager environments)
environments
- the environment manager to remove the transformation
environment from if applicableBuild 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a