Package com.gnizr.core.exceptions

Examples of com.gnizr.core.exceptions.MissingIdException


  public boolean deleteForUser(ForUser forUser) throws MissingIdException,
      NullPointerException, IllegalArgumentException {
    if (forUser == null)
      throw new NullPointerException("ForUser is NULL");
    if (forUser.getId() <= 0)
      throw new MissingIdException("forUser is missing a valid ID");

    return forUserDao.deleteForUser(forUser.getId());
  }
View Full Code Here


  public boolean hasForUser(Bookmark bookmark, User user)
      throws MissingIdException, NullPointerException {
    if (user == null)
      throw new NullPointerException("User is NULL");
    if (user.getId() < 0)
      throw new MissingIdException("User is missing valid Id");
    if (bookmark == null)
      throw new NullPointerException("Bookmark is NULL");
    if (bookmark.getId() < 0)
      throw new MissingIdException("Bookmark is missing valid Id");

    return forUserDao.hasForUser(bookmark, user);
  }
View Full Code Here

    GnizrDaoUtil.checkNull(prpt);
    TagProperty obj = new TagProperty(prpt);
    if (GnizrDaoUtil.hasMissingId(obj)) {
      GnizrDaoUtil.fillId(tagPrptDao, obj);
      if (obj.getId() <= 0) {
        throw new MissingIdException("tagProperty missing id");
      }
    }
    return tagPrptDao.deleteTagProperty(obj.getId());
  }
View Full Code Here

    GnizrDaoUtil.checkNull(assertion);
    TagAssertion obj = new TagAssertion(assertion);
    if (GnizrDaoUtil.hasMissingId(obj)) {
      GnizrDaoUtil.fillId(tagAsrtDao, tagPrptDao, tagDao, userDao, obj);
      if (obj.getId() <= 0) {
        throw new MissingIdException("tag assertion missing id");
      }
    }
    return tagAsrtDao.deleteTagAssertion(obj.getId());
  }
View Full Code Here

      if (bmarks.isEmpty() == false) {
        bmark = bmarks.get(0);
      }
      return bmark;
    }
    throw new MissingIdException(
        "either user or link object is missing a valid id");
  }
View Full Code Here

      if (aTags.isEmpty() == false) {
        aTag = aTags.get(0);
      }
      return aTag;
    }
    throw new MissingIdException(
        "either user or tag object is missing a valid id");
  }
View Full Code Here

      if (aTags.isEmpty() == false) {
        aTag = aTags.get(0);
      }
      return aTag;
    }
    throw new MissingIdException(
        "either link or tag object is missing a valid id");
  }
View Full Code Here

  public static TagAssertion getTagAssertion(TagAssertionDao tagAssertionDao,
      User user, UserTag subjTag, TagProperty tagPrpt, UserTag objTag)
      throws MissingIdException {
    if (hasMissingId(user) == true) {
      throw new MissingIdException("user object is missing a valid id");
    }
    if (hasMissingId(subjTag) == true) {
      throw new MissingIdException("subjectTag is missing a valid id");
    }
    if (hasMissingId(objTag) == true) {
      throw new MissingIdException("objectTag is missing a valid id");
    }
    if (hasMissingId(tagPrpt) == true) {
      throw new MissingIdException("tagProperty is missing a valid id");
    }
    TagAssertion asrt = null;
    List<TagAssertion> asrts = tagAssertionDao.findTagAssertion(user,
        subjTag, tagPrpt, objTag);
    if (asrts.isEmpty() == false) {
View Full Code Here

  public static void fillObject(ForUserDao forUserDao,
      BookmarkDao bookmarkDao, UserDao userDao, LinkDao linkDao,
      ForUser forUser) throws MissingIdException, NoSuchUserException,
      NoSuchLinkException, NoSuchBookmarkException {
    if (hasMissingId(forUser) == true) {
      throw new MissingIdException("missing forUser.getId()");
    }
    Bookmark bm = forUser.getBookmark();
    fillObject(bookmarkDao, userDao, linkDao, bm);
    User user = forUser.getForUser();
    fillObject(userDao, user);
View Full Code Here

    checkIsTerminited();

    GnizrDaoUtil.checkNull(bookmark);
    if (GnizrDaoUtil.hasMissingId(bookmark) == true) {
      throw new MissingIdException("bookmark is missing a valid id");
    }
    // make a local copy
    Bookmark delBmark = getBookmark(bookmark.getId());
    List<Tag> tagObjs = getTags(delBmark.getTagList());
    tagDao.subtractTagCountOne(tagObjs.toArray(new Tag[0]), delBmark
View Full Code Here

TOP

Related Classes of com.gnizr.core.exceptions.MissingIdException

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.