private Workspace doUpdate(String id, Workspace update) throws BadRequestException, ConflictException, NotFoundException, ServerException { try { return workspaceManager.updateWorkspace(id, update); } catch (ValidationException x) { throw new BadRequestException(x.getMessage()); } }
return asDtoWithLinksAndToken(workspace); } catch (ValidationException x) { throw new BadRequestException(x.getMessage());
workspace = workspaceManager.createWorkspace(config, namespace, attributes); } catch (ValidationException x) { throw new BadRequestException(x.getMessage());
/** * Validate stack object * * @param stack stack to validate * @throws BadRequestException if stack is not valid */ public void check(Stack stack) throws BadRequestException, ServerException, NotFoundException { if (stack == null) { throw new BadRequestException("Required non-null stack"); } if (stack.getName() == null || stack.getName().isEmpty()) { throw new BadRequestException("Required non-null and non-empty stack name"); } if (stack.getScope() == null || !stack.getScope().equals("general") && !stack.getScope().equals("advanced")) { throw new BadRequestException("Required non-null scope value: 'general' or 'advanced'"); } if (stack.getWorkspaceConfig() == null) { throw new BadRequestException("Workspace config required"); } try { wsValidator.validateConfig(stack.getWorkspaceConfig()); } catch (ValidationException x) { throw new BadRequestException(x.getMessage()); } } }