/** * 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(); }
/** * 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(); }
/** * Loads an InterMineBag from the UserProfile database. * * @param os the production ObjectStore * @param savedBagId the ID of the bag in the userprofile database * @param uosw the ObjectStoreWriter of the userprofile database * @param classDescriptor if true the classDescriptor will be set * @throws UnknownBagTypeException if the type bag is unknown * @throws ObjectStoreException if something goes wrong */ public InterMineBag(ObjectStore os, Integer savedBagId, ObjectStoreWriter uosw, boolean classDescriptor) throws UnknownBagTypeException, ObjectStoreException { this.os = os; this.uosw = uosw; this.savedBagId = savedBagId; ObjectStore uos = uosw.getObjectStore(); SavedBag savedBag = (SavedBag) uos.getObjectById(savedBagId, SavedBag.class); checkAndSetName(savedBag.getName()); this.type = TypeUtil.unqualifiedName(savedBag.getType()); this.description = savedBag.getDescription(); this.dateCreated = savedBag.getDateCreated(); this.profileId = savedBag.proxGetUserProfile().getId(); setState(savedBag.getState()); this.osb = new ObjectStoreBag(savedBag.getOsbId()); if (classDescriptor) { setClassDescriptors(); } }
/** * Loads an InterMineBag from the UserProfile database. * * @param os the production ObjectStore * @param savedBagId the ID of the bag in the userprofile database * @param uosw the ObjectStoreWriter of the userprofile database * @param classDescriptor if true the classDescriptor will be set * @throws UnknownBagTypeException if the type bag is unknown * @throws ObjectStoreException if something goes wrong */ public InterMineBag(ObjectStore os, Integer savedBagId, ObjectStoreWriter uosw, boolean classDescriptor) throws UnknownBagTypeException, ObjectStoreException { this.os = os; this.uosw = uosw; this.savedBagId = savedBagId; ObjectStore uos = uosw.getObjectStore(); SavedBag savedBag = (SavedBag) uos.getObjectById(savedBagId, SavedBag.class); checkAndSetName(savedBag.getName()); this.type = TypeUtil.unqualifiedName(savedBag.getType()); this.description = savedBag.getDescription(); this.dateCreated = savedBag.getDateCreated(); this.profileId = savedBag.proxGetUserProfile().getId(); setState(savedBag.getState()); this.osb = new ObjectStoreBag(savedBag.getOsbId()); if (classDescriptor) { setClassDescriptors(); } }