Class ProjectDeploymentValidator
- java.lang.Object
-
- ch.ivyteam.ivy.deployment.ProjectDeploymentValidator
-
public class ProjectDeploymentValidator extends Object
This class can be used to validate Projects before deploying them on the server.
Warning: this class works only on the server.- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinishValidation()Call this when the validation is finished to clean up temporary allocated resources.IIvyProjectprepareIvyProject(File projectDirectory, IApplication application, org.eclipse.core.runtime.IProgressMonitor progressMonitor)Uses the project under projectDirectory to mock a project which is not yet deployed.IIvyProjectprepareIvyProject(File projectDirectory, IProcessModel processModel, org.eclipse.core.runtime.IProgressMonitor progressMonitor)Uses the project under projectDirectory to mock a project which is not yet deployed.IIvyProjectprepareIvyProject(File projectDirectory, IProcessModelVersion targetPmv, org.eclipse.core.runtime.IProgressMonitor progressMonitor)Uses the project under projectDirectory to mock a project which is not yet deployed.List<ch.ivyteam.ivy.deployment.restricted.IProjectDeploymentValidationIssue>validate(IIvyProject project, org.eclipse.core.runtime.IProgressMonitor progressMonitor)Validates theIIvyProjectand returns a list containing anIProjectDeploymentValidationIssuefor each issue found.
-
-
-
Method Detail
-
prepareIvyProject
public IIvyProject prepareIvyProject(File projectDirectory, IApplication application, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws Exception
Uses the project under projectDirectory to mock a project which is not yet deployed. Use this method only if you intend to add a new process model to the application. Otherwise useprepareIvyProject(File, IProcessModel, IProgressMonitor)orprepareIvyProject(File, IProcessModelVersion, IProgressMonitor)
Warning: this methods works only on the server.- Parameters:
projectDirectory- it points to a directory, where the extracted ivy project is located on the server (neither *.iar nor *.zip files are supported)application- the application the project will be deployed to.progressMonitor- may be null- Returns:
- the
IIvyProjectto access the mocked Project - Throws:
Exception- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
prepareIvyProject
public IIvyProject prepareIvyProject(File projectDirectory, IProcessModel processModel, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws Exception
Uses the project under projectDirectory to mock a project which is not yet deployed. Use this method only if you intend to add a new process model version to an existing process model. Otherwise useprepareIvyProject(File, IApplication, IProgressMonitor)orprepareIvyProject(File, IProcessModelVersion, IProgressMonitor)
Warning: this methods works only on the server.- Parameters:
projectDirectory- it points to a directory, where the extracted ivy project is located on the server (neither *.iar nor *.zip files are supported)processModel- the process model for which a new process model version is going to be created to deploy the project.progressMonitor- may be null- Returns:
- the
IIvyProjectto access the mocked Project - Throws:
Exception- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
prepareIvyProject
public IIvyProject prepareIvyProject(File projectDirectory, IProcessModelVersion targetPmv, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws Exception
Uses the project under projectDirectory to mock a project which is not yet deployed. Use this method only if you intend to overwrite an existing process model version. Otherwise useprepareIvyProject(File, IApplication, IProgressMonitor)orprepareIvyProject(File, IProcessModel, IProgressMonitor)
Warning: this methods works only on the server.- Parameters:
projectDirectory- it points to a directory, where the extracted ivy project is located on the servertargetPmv- the processModelVersion the project will be deployed to.progressMonitor- may be null- Returns:
- the
IIvyProjectto access the mocked Project - Throws:
Exception- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
validate
public List<ch.ivyteam.ivy.deployment.restricted.IProjectDeploymentValidationIssue> validate(IIvyProject project, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
Validates the
IIvyProjectand returns a list containing anIProjectDeploymentValidationIssuefor each issue found.To get the
IIvyProjectfor a project, which is not deployed yet, use one of theprepareIvyProjectmethods.If there are multiple projects to be validated before deployment, then mock all projects before validating them. Mocking all deployable projects ensures that even those dependent projects become visible for validation, which are not deployed yet. For example:
ProjectDeploymentValidatorvalidator =ProjectDeployment.newDeploymentValidator()IIvyProjectprojectA = validator.prepareIvyProject(dirA, myApp, monitor);IIvyProjectprojectB = validator.prepareIvyProject(dirB, myApp, monitor); List<IProjectDeploymentValidationIssue> issuesA = validator.validate(projectA, monitor); List<IProjectDeploymentValidationIssue> issuesB = validator.validate(projectB, monitor);- Parameters:
project- an ivy project reference (you might get it e.g. invokingprepareIvyProject(File, IApplication, IProgressMonitor))progressMonitor- may be null.- Returns:
- a List of
IProjectDeploymentValidationIssues. Never null. - API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
finishValidation
public void finishValidation()
Call this when the validation is finished to clean up temporary allocated resources. Call this before the actual deployment.
Any ivy projects, that have been mocked with
prepareIvyProject(File, IApplication, IProgressMonitor)must not be used afterfinishValidation()was called.- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
-