Package edu.wpi.cs.wpisuitetng.exceptions

Examples of edu.wpi.cs.wpisuitetng.exceptions.BadRequestException


    Comment newComment = gson.fromJson(content, Comment.class);
   
    List<ValidationIssue> issues = validator.validate(s, newComment);
    if(issues.size() > 0) {
      // TODO: pass errors to client through exception
      throw new BadRequestException();
    }
   
    Defect defect = validator.getLastExistingDefect();
    defect.getEvents().add(newComment);
    db.save(defect, s.getProject());
View Full Code Here


    if(issues.size() > 0) {
      // TODO: pass errors to client through exception
      for (ValidationIssue issue : issues) {
        System.out.println("Validation issue: " + issue.getMessage());
      }
      throw new BadRequestException();
    }

    if(!db.save(newDefect, s.getProject())) {
      throw new WPISuiteException();
    }
View Full Code Here

    Defect updatedDefect = Defect.fromJSON(content);
   
    List<ValidationIssue> issues = validator.validate(session, updatedDefect, Mode.EDIT);
    if(issues.size() > 0) {
      // TODO: pass errors to client through exception
      throw new BadRequestException();
    }

    /*
     * Because of the disconnected objects problem in db4o, we can't just save updatedDefect.
     * We have to get the original defect from db4o, copy properties from updatedDefect,
View Full Code Here

    Project p;
    try{
      p = Project.fromJSON(content);
    } catch(JsonSyntaxException e){
      logger.log(Level.WARNING, "Invalid Project entity creation string.");
      throw new BadRequestException("The entity creation string had invalid format. Entity String: " + content);
    }
   
    
    logger.log(Level.FINE, "New project: "+ p.getName() +" submitted by: "+ theUser.getName() );
    p.setOwner(theUser);
View Full Code Here

   
    try{
      names = gson.fromJson(content, String[].class);
    }catch(JsonSyntaxException j)
    {
      throw new BadRequestException("Could not parse JSON");
    }
   
    ArrayList<String> success = new ArrayList<String>();
   
    UserManager u = ManagerLayer.getInstance().getUsers();
View Full Code Here

    User p;
    try{
      p = User.fromJSON(content);
    } catch(JsonSyntaxException e){
      logger.log(Level.WARNING, "Invalid User entity creation string.");
      throw new BadRequestException("The entity creation string had invalid format. Entity String: " + content);
    }

    if(getEntity(s,p.getUsername())[0] == null)
    {
      String newPassword = UserDeserializer.parsePassword(content);
View Full Code Here

TOP

Related Classes of edu.wpi.cs.wpisuitetng.exceptions.BadRequestException

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.