Package eu.scape_project.planning.repository

Examples of eu.scape_project.planning.repository.SCAPEPlanManagementClient


        // no custom save operation is needed here
    }

    public void deployPlan(String endpoint, String user, String password) throws PlanningException {

        SCAPEPlanManagementClient planManagement = new SCAPEPlanManagementClient(endpoint, user, password);
       
        String planIdentifier;
        try {
            planIdentifier = planManagement.reservePlanIdentifier();
        } catch (Exception e) {
            throw new PlanningException("Could not reserve Identifier.", e);
        } catch (Throwable e) {
            throw new PlanningException("Could not reserve Identifier.", e);
        }
        this.plan.getPlanProperties().setRepositoryIdentifier(planIdentifier);
        saveWithoutModifyingPlanState();
       

        String binarydataTempPath = OS.getTmpPath() + planIdentifier + "/";
        File binarydataTempDir = new File(binarydataTempPath);
        binarydataTempDir.mkdirs();
        File planFile = new File(binarydataTempPath + "plan.xml");
        try {
            try {
                BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(planFile));
                projectExport.exportComplete(plan.getPlanProperties().getId(), out, binarydataTempPath);
                out.flush();
                out.close();
               
                planManagement.deployPlan(planIdentifier, new FileInputStream(planFile));
            } catch (Exception e) {
                throw new PlanningException("Failed to generate plan.", e);
            }
        } finally {
            OS.deleteDirectory(binarydataTempDir);
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.repository.SCAPEPlanManagementClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.