Search in sources :

Example 1 with ReleaseStepsGOResponse

use of beans.response.ReleaseStepsGOResponse in project MSEC by Tencent.

the class ReleaseOnlySharedobject method exec.

public ReleaseStepsGOResponse exec(ReleasePlan request) {
    ReleaseStepsGOResponse response = new ReleaseStepsGOResponse();
    String result = checkIdentity();
    if (!result.equals("success")) {
        response.setStatus(99);
        response.setMessage(result);
        return response;
    }
    if (request.getSecond_level_service_name() == null || request.getSecond_level_service_name().length() < 1 || request.getFirst_level_service_name() == null || request.getFirst_level_service_name().length() < 1 || request.getPlan_id() == null || request.getPlan_id().length() < 1) {
        response.setMessage("input is invalid");
        response.setStatus(100);
        return response;
    }
    return doRelease(request);
}
Also used : ReleaseStepsGOResponse(beans.response.ReleaseStepsGOResponse)

Example 2 with ReleaseStepsGOResponse

use of beans.response.ReleaseStepsGOResponse in project MSEC by Tencent.

the class ReleaseOnlySharedobject 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());
    if (request.getSharedobject_tag() == null || request.getSharedobject_tag().length() < 1) {
        response.setMessage("idl tag is empty!");
        response.setStatus(100);
        return response;
    }
    plan.setSharedobject_tag(request.getSharedobject_tag());
    plan.setMemo(request.getMemo());
    //check if saved
    ReleasePlan plan2 = (ReleasePlan) session.getAttribute("plan");
    //System.out.println("so tag:"+plan2.getSharedobject_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 3 with ReleaseStepsGOResponse

use of beans.response.ReleaseStepsGOResponse in project MSEC by Tencent.

the class ReleaseStepsGO method doStep5.

private ReleaseStepsGOResponse doStep5(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());
    if (request.getSharedobject_tag() == null || request.getSharedobject_tag().length() < 1) {
        response.setMessage("idl tag is empty!");
        response.setStatus(100);
        return response;
    }
    plan.setSharedobject_tag(request.getSharedobject_tag());
    plan.setMemo(request.getMemo());
    //跳过第三步:选择IDL文件版本,所以在这里设置一下
    plan.setIdl_tag("");
    //check if saved
    ReleasePlan plan2 = (ReleasePlan) session.getAttribute("plan");
    //System.out.println("so tag:"+plan2.getSharedobject_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 4 with ReleaseStepsGOResponse

use of beans.response.ReleaseStepsGOResponse in project MSEC by Tencent.

the class ReleaseStepsGO method doStep3.

private ReleaseStepsGOResponse doStep3(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());
    if (request.getIdl_tag() == null || request.getIdl_tag().length() < 1) {
        response.setMessage("idl tag is empty!");
        response.setStatus(100);
        return response;
    }
    plan.setIdl_tag(request.getIdl_tag());
    //check if saved
    ReleasePlan plan2 = (ReleasePlan) session.getAttribute("plan");
    //System.out.println("idl tag:" + plan2.getIdl_tag());
    response.setMessage("success");
    response.setStatus(0);
    return response;
}
Also used : HttpSession(javax.servlet.http.HttpSession) ReleaseStepsGOResponse(beans.response.ReleaseStepsGOResponse) ReleasePlan(beans.request.ReleasePlan)

Example 5 with ReleaseStepsGOResponse

use of beans.response.ReleaseStepsGOResponse in project MSEC by Tencent.

the class ReleaseOnlyConfig method exec.

public ReleaseStepsGOResponse exec(ReleasePlan request) {
    ReleaseStepsGOResponse response = new ReleaseStepsGOResponse();
    String result = checkIdentity();
    if (!result.equals("success")) {
        response.setStatus(99);
        response.setMessage(result);
        return response;
    }
    if (request.getSecond_level_service_name() == null || request.getSecond_level_service_name().length() < 1 || request.getFirst_level_service_name() == null || request.getFirst_level_service_name().length() < 1 || request.getPlan_id() == null || request.getPlan_id().length() < 1) {
        response.setMessage("input is invalid");
        response.setStatus(100);
        return response;
    }
    return doRelease(request);
}
Also used : ReleaseStepsGOResponse(beans.response.ReleaseStepsGOResponse)

Aggregations

ReleaseStepsGOResponse (beans.response.ReleaseStepsGOResponse)11 HttpSession (javax.servlet.http.HttpSession)7 ReleasePlan (beans.request.ReleasePlan)6 ArrayList (java.util.ArrayList)1 DBUtil (ngse.org.DBUtil)1