/** * Constructor with the actual objects we are trying to link. * @param bag The SavedBag we are trying to share * @param up The UserProfile we are trying to share this with. */ public UserAlreadyShareBagException(SavedBag bag, UserProfile up) { super(String.format("This bag (%s:%d) is already shared with this user (%s:%d)", bag.getName(), bag.getId(), up.getUsername(), up.getId())); } }
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
private boolean tagExists(List<Tag> tags, String name, String taggedObject, String type, String userName) { for (Tag tag : tags) { if (tag.getTagName().equals(name) && tag.getObjectIdentifier().equals(taggedObject) && tag.getType().equals(type) && tag.getUserProfile().getUsername().equals(userName)) { return true; } } return false; } }
/** * Sets the profileId - moves this bag from one profile to another. * * @param profileId the ID of the new userprofile * @throws ObjectStoreException if something goes wrong */ public void setProfileId(Integer profileId) throws ObjectStoreException { this.profileId = profileId; SavedBag savedBag = storeSavedBag(); this.savedBagId = savedBag.getId(); addBagValues(); }
/** * Get a user's password * A check should be made prior to this call to ensure a Profile exists * @param username the username * @return password the password */ public String getPassword(String username) { UserProfile userProfile = getUserProfile(username); return userProfile.getPassword(); }
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
public void testAddTag() { Tag createdTag = manager.addTag("wowTag", "list1", "bag", "bob"); Tag retrievedTag = manager.getTags("wowTag", "list1", "bag", "bob").get(0); assertEquals(createdTag, retrievedTag); assertEquals(createdTag.getTagName(), "wowTag"); assertEquals(createdTag.getObjectIdentifier(), "list1"); assertEquals(createdTag.getType(), "bag"); assertEquals(createdTag.getUserProfile().getUsername(), "bob"); }
/** * Constructor with the actual objects we are trying to link. * @param bag The SavedBag we are trying to share * @param up The UserProfile we are trying to share this with. */ public UserAlreadyShareBagException(SavedBag bag, UserProfile up) { super(String.format("This bag (%s:%d) is already shared with this user (%s:%d)", bag.getName(), bag.getId(), up.getUsername(), up.getId())); } }
/** * Sets the profileId - moves this bag from one profile to another. * * @param profileId the ID of the new userprofile * @throws ObjectStoreException if something goes wrong */ public void setProfileId(Integer profileId) throws ObjectStoreException { this.profileId = profileId; SavedBag savedBag = storeSavedBag(); this.savedBagId = savedBag.getId(); addBagValues(); }
/** * Get a user's password * A check should be made prior to this call to ensure a Profile exists * @param username the username * @return password the password */ public String getPassword(String username) { UserProfile userProfile = getUserProfile(username); return userProfile.getPassword(); }
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
public void setoBJECT(String notXml, ObjectStore os) { setoBJECT(NotXmlParser.SPLITTER.split(notXml), os); } public void setoBJECT(final String[] notXml, final ObjectStore os) {
public void testAddWithProfile() throws Exception { Tag createdTag = manager.addTag("wowTag", "list1", "bag", bobProfile); Tag retrievedTag = manager.getTags("wowTag", "list1", "bag", "bob").get(0); assertEquals(createdTag, retrievedTag); assertEquals(createdTag.getTagName(), "wowTag"); assertEquals(createdTag.getObjectIdentifier(), "list1"); assertEquals(createdTag.getType(), "bag"); assertEquals(createdTag.getUserProfile().getUsername(), "bob"); }