space_token = this.context.getSpace().getSpaceToken(); connection.setRequestProperty(Constants.HTTP_SPACE_HEADER, space_token);
@Override protected void executeTasks() throws Exception { final Space s = this.getGoalContext().getSpace(); final BackendConnector bc = BackendConnector.getInstance(); // Check that space exists if(!bc.isSpaceExisting(this.getGoalContext(), s)) throw new GoalExecutionException("Space with token [" + s.getSpaceToken() + "] does not exist", null); bc.cleanSpace(this.getGoalContext(), s); } }
@Override protected void executeTasks() throws Exception { final Space s = this.getGoalContext().getSpace(); final BackendConnector bc = BackendConnector.getInstance(); // Check that space exists if(!bc.isSpaceExisting(this.getGoalContext(), s)) throw new GoalExecutionException("Space with token [" + s.getSpaceToken() + "] does not exist", null); bc.deleteSpace(this.getGoalContext(), s); } }
final BasicHttpRequest cond_req = new BasicHttpRequest(HttpMethod.OPTIONS, PathBuilder.goalExcecution(null, _ctx.getSpace(), app, _gexe.getId()), null); cond_req.setGoalContext(_ctx); params.put("skipResponseBody", "true"); req_list.addRequest( new ConditionalHttpRequest(HttpMethod.POST, PathBuilder.goalExcecutions(null, _ctx.getSpace(), app), params) .setConditionRequest(cond_req) .addCondition(new StatusCondition(HttpURLConnection.HTTP_NOT_FOUND)) ); req_list.addRequest( new ConditionalHttpRequest(HttpMethod.PUT, PathBuilder.goalExcecution(null, _ctx.getSpace(), app, _gexe.getId()), params) .setConditionRequest(cond_req) .addCondition(new StatusCondition(HttpURLConnection.HTTP_OK))
@Override protected void executeTasks() throws Exception { final Space s = this.getGoalContext().getSpace(); this.updateFromConfig(s); final BackendConnector bc = BackendConnector.getInstance(); // Check that name and description are provided if(!s.hasNameAndDescription()) throw new GoalExecutionException("Space modification requires a name and description, adjust the configuration accordingly", null); // Check that space exists if(!bc.isSpaceExisting(this.getGoalContext(), s)) throw new GoalExecutionException("Space with token [" + s.getSpaceToken() + "] does not exist", null); bc.modifySpace(this.getGoalContext(), s); } }