Search in sources :

Example 6 with ReleasePlan

use of beans.request.ReleasePlan in project MSEC by Tencent.

the class ReleaseOnlyConfig method doRelease.

private ReleaseStepsGOResponse doRelease(ReleasePlan request) {
    ReleaseStepsGOResponse response = new ReleaseStepsGOResponse();
    //把计划保存到session里
    HttpSession session = getHttpRequest().getSession();
    ReleasePlan plan = (ReleasePlan) session.getAttribute("plan");
    //System.out.println("plan id in session:"+plan.getPlan_id());
    if (plan == null) {
        response.setMessage("can NOT find the session, it maybe timeout.");
        response.setStatus(100);
        return response;
    }
    if (request.getConfig_tag() == null || request.getConfig_tag().length() < 1) {
        response.setMessage("config tag is empty!");
        response.setStatus(100);
        return response;
    }
    plan.setConfig_tag(request.getConfig_tag());
    plan.setMemo(request.getMemo());
    //check if saved
    ReleasePlan plan2 = (ReleasePlan) session.getAttribute("plan");
    //System.out.println("config tag:"+plan2.getConfig_tag());
    // Commit Plan
    String commitResult = CommitPlan(plan2);
    if (commitResult == null || !commitResult.equals("success")) {
        response.setMessage("commit failed:" + (commitResult == null ? "" : commitResult));
        response.setStatus(100);
        return response;
    }
    response.setPlanDetail(plan2);
    response.setMessage("success");
    response.setStatus(0);
    return response;
}
Also used : HttpSession(javax.servlet.http.HttpSession) ReleaseStepsGOResponse(beans.response.ReleaseStepsGOResponse) ReleasePlan(beans.request.ReleasePlan)

Example 7 with ReleasePlan

use of beans.request.ReleasePlan in project MSEC by Tencent.

the class ReleaseOnlyLibrary method doRelease.

private ReleaseStepsGOResponse doRelease(ReleasePlan request) {
    ReleaseStepsGOResponse response = new ReleaseStepsGOResponse();
    //把计划保存到session里
    HttpSession session = getHttpRequest().getSession();
    ReleasePlan plan = (ReleasePlan) session.getAttribute("plan");
    if (plan == null) {
        response.setMessage("can NOT find the session, it maybe timeout.");
        response.setStatus(100);
        return response;
    }
    //System.out.println("plan id in session:"+plan.getPlan_id());
    plan.setMemo(request.getMemo());
    // Commit Plan
    String commitResult = CommitPlan(plan);
    if (commitResult == null || !commitResult.equals("success")) {
        response.setMessage("commit failed:" + (commitResult == null ? "" : commitResult));
        response.setStatus(100);
        return response;
    }
    response.setPlanDetail(plan);
    response.setMessage("success");
    response.setStatus(0);
    return response;
}
Also used : HttpSession(javax.servlet.http.HttpSession) ReleaseStepsGOResponse(beans.response.ReleaseStepsGOResponse) ReleasePlan(beans.request.ReleasePlan)

Example 8 with ReleasePlan

use of beans.request.ReleasePlan in project MSEC by Tencent.

the class ReleaseStepsGO method doStep2.

private ReleaseStepsGOResponse doStep2(ReleasePlan request) {
    ReleaseStepsGOResponse response = new ReleaseStepsGOResponse();
    //把计划保存到session里
    HttpSession session = getHttpRequest().getSession();
    ReleasePlan plan = (ReleasePlan) session.getAttribute("plan");
    //System.out.println("plan id in session:"+plan.getPlan_id());
    if (plan == null) {
        response.setMessage("can NOT find the session, it maybe timeout.");
        response.setStatus(100);
        return response;
    }
    if (request.getConfig_tag() == null || request.getConfig_tag().length() < 1) {
        response.setMessage("config tag is empty!");
        response.setStatus(100);
        return response;
    }
    plan.setConfig_tag(request.getConfig_tag());
    //check if saved
    //ReleasePlan plan2 = (ReleasePlan)session.getAttribute("plan");
    //System.out.println("config tag:"+plan2.getConfig_tag());
    response.setMessage("success");
    response.setStatus(0);
    return response;
}
Also used : HttpSession(javax.servlet.http.HttpSession) ReleaseStepsGOResponse(beans.response.ReleaseStepsGOResponse) ReleasePlan(beans.request.ReleasePlan)

Aggregations

ReleasePlan (beans.request.ReleasePlan)8 ReleaseStepsGOResponse (beans.response.ReleaseStepsGOResponse)6 HttpSession (javax.servlet.http.HttpSession)6 ArrayList (java.util.ArrayList)2 DBUtil (ngse.org.DBUtil)2 IPPortPair (beans.request.IPPortPair)1 QueryReleasePlanDetailResponse (beans.response.QueryReleasePlanDetailResponse)1 QueryReleasePlanResponse (beans.response.QueryReleasePlanResponse)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 JSONObject (org.json.JSONObject)1