DeploymentContext dc = (DeploymentContext) event.hook();
final DeployCommandParameters deployParams = dc.getCommandParameters(DeployCommandParameters.class);
processResources(dc, deployParams);
}else if(event.is(Deployment.UNDEPLOYMENT_VALIDATION)){
DeploymentContext dc = (DeploymentContext) event.hook();
final UndeployCommandParameters undeployCommandParameters =
dc.getCommandParameters(UndeployCommandParameters.class);
preserveResources(dc, undeployCommandParameters);
}else if(Deployment.UNDEPLOYMENT_FAILURE.equals(event.type())){
DeploymentContext dc = (DeploymentContext) event.hook();
cleanupPreservedResources(dc, event);