Package in.partake.model.dao.access

Examples of in.partake.model.dao.access.IUserTwitterLinkAccess


        array.add(new UserTwitterLink(new UUID(0, 0), 0, "userId", "screenName", "name", "accessToken", "accessTokenSecret", "profileImageURL1"));
        return array;
    }

    public void createFixtures(PartakeConnection con, IPartakeDAOs daos) throws DAOException {
        IUserTwitterLinkAccess dao = daos.getTwitterLinkageAccess();
        dao.truncate(con);


        for (int i = 0; i < DEFAULT_USER_IDS.length; ++i)
            dao.put(con, new UserTwitterLink(DEFAULT_TWITTER_LINK_IDS[i], DEFAULT_USER_TWITTER_IDS[i], DEFAULT_USER_IDS[i], DEFAULT_USER_TWITTER_SCREENNAME[i], "testUser 1", "accessToken", "accessTokenSecret", "http://www.example.com/"));

        dao.put(con, new UserTwitterLink(DEFAULT_TWITTER_LINK_ID, DEFAULT_TWITTER_ID, DEFAULT_USER_ID, DEFAULT_TWITTER_SCREENNAME, "testUser 1", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(DEFAULT_ANOTHER_TWITTER_LINK_ID, DEFAULT_ANOTHER_TWITTER_ID, DEFAULT_ANOTHER_USER_ID, DEFAULT_ANOTHER_TWITTER_SCREENNAME, "testUser 1", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(ADMIN_USER_TWITTER_LINK_ID, ADMIN_USER_TWITTER_ID, ADMIN_USER_ID, ADMIN_USER_SCREENNAME, "testUser 2", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(USER_WITHOUT_PREF_TWITTER_LINK_ID, USER_WITHOUT_PREF_TWITTER_ID, USER_WITHOUT_PREF_ID, USER_WITHOUT_PREF_SCREENNAME, "testUser 3", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(USER_WITH_PRIVATE_PREF_TWITTER_LINK_ID, USER_WITH_PRIVATE_PREF_TWITTER_ID, USER_WITH_PRIVATE_PREF_ID, USER_WITHOUT_PREF_SCREENNAME, "testUser 3", "accessToken", "accessTokenSecret", "http://www.example.com/"));

        dao.put(con, new UserTwitterLink(EVENT_OWNER_TWITTER_LINK_ID, EVENT_OWNER_TWITTER_ID, EVENT_OWNER_ID, EVENT_OWNER_TWITTER_SCREENNAME, "testUser 3", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(EVENT_EDITOR_TWITTER_LINK_ID, EVENT_EDITOR_TWITTER_ID, EVENT_EDITOR_ID, EVENT_EDITOR_TWITTER_SCREENNAME, "testUser 4", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(EVENT_COMMENTOR_TWITTER_LINK_ID, EVENT_COMMENTOR_TWITTER_ID, EVENT_COMMENTOR_ID, EVENT_COMMENTOR_TWITTER_SCREENNAME, "partakein", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(EVENT_ENROLLED_USER_TWITTER_LINK_ID, EVENT_ENROLLED_USER_TWITTER_ID, EVENT_ENROLLED_USER_ID, EVENT_ENROLLED_USER_TWITTER_SCREENNAME, "testUser 4", "accessToken", "accessTokenSecret", "http://www.example.com/"));

        dao.put(con, new UserTwitterLink(EVENT_RESERVED_USER_TWITTER_LINK_ID, EVENT_RESERVED_USER_TWITTER_ID, EVENT_RESERVED_USER_ID, EVENT_RESERVED_USER_TWITTER_SCREENNAME, "partakein", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(EVENT_CANCELLED_USER_TWITTER_LINK_ID, EVENT_CANCELLED_USER_TWITTER_ID, EVENT_CANCELLED_USER_ID, EVENT_CANCELLED_USER_TWITTER_SCREENNAME, "testUser 4", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(EVENT_UNRELATED_USER_TWITTER_LINK_ID, EVENT_UNRELATED_USER_TWITTER_ID, EVENT_UNRELATED_USER_ID, EVENT_UNRELATED_USER_TWITTER_SCREENNAME, "partakein", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(ATTENDANCE_PRESENT_USER_TWITTER_LINK_ID, ATTENDANCE_PRESENT_USER_TWITTER_ID, ATTENDANCE_PRESENT_USER_ID, ATTENDANCE_PRESENT_USER_TWITTER_SCREENNAME, "partakein", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(ATTENDANCE_ABSENT_USER_TWITTER_LINK_ID, ATTENDANCE_ABSENT_USER_TWITTER_ID, ATTENDANCE_ABSENT_USER_ID, ATTENDANCE_ABSENT_USER_TWITTER_SCREENNAME, "partakein", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(ATTENDANCE_UNKNOWN_USER_TWITTER_LINK_ID, ATTENDANCE_UNKNOWN_USER_TWITTER_ID, ATTENDANCE_UNKNOWN_USER_ID, ATTENDANCE_UNKNOWN_USER_TWITTER_SCREENNAME, "partakein", "accessToken", "accessTokenSecret", "http://www.example.com/"));

        dao.put(con, new UserTwitterLink(DEFAULT_SENDER_TWITTER_LINK_ID, DEFAULT_SENDER_TWITTER_ID, DEFAULT_SENDER_ID, DEFAULT_SENDER_TWITTER_SCREENNAME, "testUser 1", "accessToken", "accessTokenSecret", "http://www.example.com/"));
        dao.put(con, new UserTwitterLink(DEFAULT_RECEIVER_TWITTER_LINK_ID, DEFAULT_RECEIVER_TWITTER_ID, DEFAULT_RECEIVER_ID, DEFAULT_RECEIVER_TWITTER_SCREENNAME, "testUser 1", "accessToken", "accessTokenSecret", "http://www.example.com/"));

        dao.put(con, new UserTwitterLink(IMAGE_OWNER_TWITTER_LINK_ID, IMAGE_OWNER_TWITTER_ID, IMAGE_OWNER_ID, IMAGE_OWNER_TWITTER_SCREENNAME, "testUser 1", "accessToken", "accessTokenSecret", "http://www.example.com/"));

        // accessToken and accessTokenSecret are null for this user.
        dao.put(con, new UserTwitterLink(USER_TWITTER_NOAUTH_TWITTER_LINK_ID, USER_TWITTER_NOAUTH_TWITTER_ID, USER_TWITTER_NOAUTH_ID, USER_TWITTER_NOAUTH_TWITTER_SCREENNAME, "testUser 1", null, null, "http://www.example.com/"));
    }
View Full Code Here


        return pref;
    }

    public static UserEx getUserEx(PartakeConnection con, IPartakeDAOs daos, String userId) throws DAOException {
        IUserAccess userAccess = daos.getUserAccess();
        IUserTwitterLinkAccess twitterDAO = daos.getTwitterLinkageAccess();

        User user = userAccess.find(con, userId);
        if (user == null) { return null; }

        UserTwitterLink linkage = twitterDAO.findByUserId(con, userId);
        return new UserEx(user, linkage);
    }
View Full Code Here

        it.update(newEnvelope);
        return false;
    }

    private void markAsUnauthorizedUser(PartakeConnection con, IPartakeDAOs daos, UserEx user) {
        IUserTwitterLinkAccess access = daos.getTwitterLinkageAccess();
        UserTwitterLink linkage = new UserTwitterLink(user.getTwitterLinkage());
        linkage.markAsUnauthorized();

        try {
            // TODO UserExが参照するTwitterLinkageが更新されたため、UserExのキャッシュを破棄あるいは更新する必要がある
            access.put(con, linkage);
        } catch (DAOException ignore) {
            Logger.warn("DAOException is thrown but it's ignored.", ignore);
        }
    }
View Full Code Here

TOP

Related Classes of in.partake.model.dao.access.IUserTwitterLinkAccess

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.