예제 #1
0
  /**
   * Constructor.
   *
   * @param name The name of this bag.
   * @param type The type it is meant to have.
   * @param desc A free text description of the bag.
   * @param createdAt When this list was first created.
   * @param os The production object store.
   * @param profileId The internal DB id of the profile of the user this list belongs to.
   * @param savedBagId The internal DB id of the saved bag this list represents.
   * @param osb The bag that represents the production DB level stored set of object ids.
   * @param userprofileObjectStore The user-profile object store writer.
   * @throws ObjectStoreException If a ObjectStoreBag needs to be created and there is a problem
   *     doing so.
   */
  public InvalidBag(
      String name,
      String type,
      String desc,
      Date createdAt,
      ObjectStore os,
      Integer savedBagId,
      Integer profileId,
      ObjectStoreBag osb,
      ObjectStoreWriter userprofileObjectStore)
      throws ObjectStoreException {

    this.type = TypeUtil.unqualifiedName(type);
    this.name = name;
    this.description = desc;
    this.dateCreated = createdAt;

    checkArguments(os, userprofileObjectStore);
    this.os = os;
    if (osb == null) {
      this.osb = os.createObjectStoreBag();
    } else {
      this.osb = osb;
    }
    this.uosw = userprofileObjectStore;

    this.profileId = profileId;
    this.savedBagId = savedBagId;
  }
예제 #2
0
  /**
   * Constructor callable by the ProfileManager.
   *
   * @param savedBag The saved bag retrieved from the DB.
   * @param profileId The id of the user profile.
   * @param os The production object store.
   * @param userprofileObjectStore The userprofile object store.
   * @throws ObjectStoreException If there is a problem creating an ObjectStoreBag.
   */
  protected InvalidBag(
      SavedBag savedBag,
      Integer profileId,
      ObjectStore os,
      ObjectStoreWriter userprofileObjectStore)
      throws ObjectStoreException {

    this.type = TypeUtil.unqualifiedName(savedBag.getType());
    this.name = savedBag.getName();
    this.description = savedBag.getDescription();
    this.dateCreated = savedBag.getDateCreated();

    checkArguments(os, userprofileObjectStore);
    this.os = os;
    this.osb = os.createObjectStoreBag();
    this.uosw = userprofileObjectStore;

    this.profileId = profileId;
    this.savedBagId = savedBag.getId();
  }