Package com.impetus.client.twitter.entities

Examples of com.impetus.client.twitter.entities.UserHBase


    }

    protected void addAllUserInfo()
    {
        UserHBase user1 = buildUser1();
        UserHBase user2 = buildUser2();

        twitter.createEntityManager();
        twitter.addUser(user1);
        twitter.closeEntityManager();
View Full Code Here


    }

    protected void getUserById()
    {
        twitter.createEntityManager();
        UserHBase user1 = twitter.findUserById(userId1);
        assertUser1(user1);

        UserHBase user2 = twitter.findUserById(userId2);
        assertUser2(user2);

    }
View Full Code Here

    }

    protected void updateUser()
    {
        twitter.createEntityManager();
        UserHBase user1 = twitter.findUserById(userId1);
        assertUser1(user1);

        user1.setPersonalDetail(new PersonalDetailHbase("Vivek", "unknown", "Married"));
        user1.addTweet(new TweetHbase("My Third Tweet", "iPhone"));
        twitter.mergeUser(user1);

        UserHBase user1AfterMerge = twitter.findUserById(userId1);

        assertUpdatedUser1(user1AfterMerge);

        twitter.closeEntityManager();
    }
View Full Code Here

    }

    protected void removeUser()
    {
        twitter.createEntityManager();
        UserHBase user1 = twitter.findUserById(userId1);
        assertUpdatedUser1(user1);

        twitter.removeUser(user1);

        UserHBase user1AfterRemoval = twitter.findUserById(userId1);
        Assert.assertNull(user1AfterRemoval);

        twitter.closeEntityManager();

    }
View Full Code Here

    /**
     * @return
     */
    private UserHBase buildUser1()
    {
        UserHBase user1 = new UserHBase(userId1, "Amresh", "password1", "married");

        user1.setPreference(new PreferenceHBase("P1", "Motif", "2"));

        user1.addExternalLink(new ExternalLinkHBase("L1", "Facebook", "http://facebook.com/coolnerd"));
        user1.addExternalLink(new ExternalLinkHBase("L2", "LinkedIn", "http://linkedin.com/in/devilmate"));

        user1.addTweet(new TweetHbase("Here is my first tweet", "Web"));
        user1.addTweet(new TweetHbase("Second Tweet from me", "Mobile"));
        return user1;
    }
View Full Code Here

    /**
     * @return
     */
    private UserHBase buildUser2()
    {
        UserHBase user2 = new UserHBase(userId2, "Saurabh", "password2", "single");

        user2.setPreference(new PreferenceHBase("P2", "High Contrast", "3"));

        user2.addExternalLink(new ExternalLinkHBase("L3", "GooglePlus", "http://plus.google.com/inviteme"));
        user2.addExternalLink(new ExternalLinkHBase("L4", "Yahoo", "http://yahoo.com/profiles/itsmeamry"));

        user2.addTweet(new TweetHbase("Saurabh tweets for the first time", "Phone"));
        user2.addTweet(new TweetHbase("Another tweet from Saurabh", "text"));
        return user2;
    }
View Full Code Here

    }

    @Override
    public void addUser(String userId, String name, String password, String relationshipStatus)
    {
        UserHBase user = new UserHBase(userId, name, password, relationshipStatus);
        em.persist(user);

    }
View Full Code Here

    @Override
    public void savePreference(String userId, PreferenceHBase preference)
    {

        UserHBase user = em.find(UserHBase.class, userId);
        user.setPreference(preference);
        em.persist(user);
    }
View Full Code Here

    }

    @Override
    public void addExternalLink(String userId, String linkId, String linkType, String linkAddress)
    {
        UserHBase user = em.find(UserHBase.class, userId);
        user.addExternalLink(new ExternalLinkHBase(linkId, linkType, linkAddress));

        em.persist(user);
    }
View Full Code Here

    }

    @Override
    public void addTweet(String userId, String tweetBody, String device)
    {
        UserHBase user = em.find(UserHBase.class, userId);
        user.addTweet(new TweetHbase(tweetBody, device));
        em.persist(user);
    }
View Full Code Here

TOP

Related Classes of com.impetus.client.twitter.entities.UserHBase

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.