Package edu.wpi.cs.wpisuitetng.exceptions

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


  @Override
  public Defect[] getEntity(Session s, String id) throws NotFoundException {
    final int intId = Integer.parseInt(id);
    if(intId < 1) {
      throw new NotFoundException();
    }
    Defect[] defects = null;
    try {
      defects = db.retrieve(Defect.class, "id", intId, s.getProject()).toArray(new Defect[0]);
    } catch (WPISuiteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if(defects.length < 1 || defects[0] == null) {
      throw new NotFoundException();
    }
    return defects;
  }
View Full Code Here


  public Project[] getEntity(String id) throws NotFoundException, WPISuiteException
  {
    Project[] m = new Project[1];
    if(id.equalsIgnoreCase(""))
    {
      throw new NotFoundException("No (blank) Project id given.");
    }
    else
    {
      m = data.retrieve(project, "idNum", id).toArray(m);
     
      if(m[0] == null)
      {
        throw new NotFoundException("Project with id <" + id + "> not found.");
      }
      else
      {
        return m;
      }
View Full Code Here

  public Project[] getEntityByName(Session s, String projectName) throws NotFoundException, WPISuiteException
  {
    Project[] m = new Project[1];
    if(projectName.equalsIgnoreCase(""))
    {
      throw new NotFoundException("No (blank) Project name given.");
    }
    else
    {
      return data.retrieve(project, "name", projectName).toArray(m);
    }
View Full Code Here

   
    String id = AbstractEntityManager.parseFieldFromJSON(content, "idNum");
   
    if(id.equalsIgnoreCase(""))
    {
      throw new NotFoundException("No (blank) Project id given.");
    }
    else
    {
      p = data.retrieve(project, "idNum", id).toArray(p);
     
      if(p[0] == null)
      {
        throw new NotFoundException("Project with id <" + id + "> not found.");
      }
    }
   
    return update(s, p[0], content);
  }
View Full Code Here

  public User[] getEntity(String id) throws WPISuiteException
  {
    User[] m = new User[1];
    if(id.equalsIgnoreCase(""))
    {
      throw new NotFoundException("No User id given.");
    }
    else
    {
      m = data.retrieve(user, "username", id).toArray(m);
     
      if(m[0] == null)
      {
        throw new NotFoundException("User with id <" + id + "> not found.");
      }
      else
      {
        return m;
      }
View Full Code Here

    {
      p = projects.getEntityByName(current, projectName)[0];
   
      if(p == null)
      {
        throw new NotFoundException("Could not find project with given name to switch to.");
      }
    }
    catch(NotFoundException e)
    {
      logger.log(Level.WARNING, "Project Session switch attempted with nonexistent project");
View Full Code Here

TOP

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

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.