Examples of IUserAccess


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

     * @param factory DAOファクトリクラスのインスタンス
     * @throws DAOException
     */
    @Override
    public void createFixtures(PartakeConnection con, IPartakeDAOs daos) throws DAOException {
        IUserAccess dao = daos.getUserAccess();
        dao.truncate(con);

        for (int i = 0; i < DEFAULT_USER_IDS.length; ++i)
            dao.put(con, new User(DEFAULT_USER_IDS[i], DEFAULT_USER_TWITTER_SCREENNAME[i], "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));

        dao.put(con, new User(DEFAULT_USER_ID, DEFAULT_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(DEFAULT_ANOTHER_USER_ID, DEFAULT_ANOTHER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(ADMIN_USER_ID, ADMIN_USER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(USER_WITHOUT_PREF_ID, USER_WITHOUT_PREF_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(USER_WITH_PRIVATE_PREF_ID, USER_WITH_PRIVATE_PREF_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));

        dao.put(con, new User(EVENT_OWNER_ID, EVENT_OWNER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(EVENT_EDITOR_ID, EVENT_EDITOR_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(EVENT_COMMENTOR_ID, EVENT_COMMENTOR_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(EVENT_ENROLLED_USER_ID, EVENT_ENROLLED_USER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));

        dao.put(con, new User(EVENT_RESERVED_USER_ID, EVENT_RESERVED_USER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(EVENT_CANCELLED_USER_ID, EVENT_CANCELLED_USER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(EVENT_UNRELATED_USER_ID, EVENT_UNRELATED_USER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));

        dao.put(con, new User(ATTENDANCE_PRESENT_USER_ID, ATTENDANCE_PRESENT_USER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(ATTENDANCE_ABSENT_USER_ID, ATTENDANCE_ABSENT_USER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(ATTENDANCE_UNKNOWN_USER_ID, ATTENDANCE_UNKNOWN_USER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));

        dao.put(con, new User(DEFAULT_SENDER_ID, DEFAULT_SENDER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(DEFAULT_RECEIVER_ID, DEFAULT_RECEIVER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));

        dao.put(con, new User(IMAGE_OWNER_ID, IMAGE_OWNER_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));

        dao.put(con, new User(USER_NO_TWITTER_LINK_ID, USER_NO_TWITTER_LINK_SCREEN_NAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
        dao.put(con, new User(USER_TWITTER_NOAUTH_ID, USER_TWITTER_NOAUTH_TWITTER_SCREENNAME, "http://www.example.com/", TimeUtil.getCurrentDateTime(), null, false));
    }
View Full Code Here

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

        this.targetUserId = targetUserId;
    }

    @Override
    protected User doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        IUserAccess access = daos.getUserAccess();
        User targetUser = access.find(con, targetUserId);
        if (targetUser == null) {
            Logger.info("No user has specified ID: " + targetUserId);
            return null;
        }
View Full Code Here

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

        this.targetState = state;
    }

    @Override
    protected User doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        IUserAccess access = daos.getUserAccess();
        User targetUser = access.find(con, targetUserId);
        if (targetUser == null) {
            Logger.info("No user has specified ID: " + targetUserId);
            return null;
        } else if (targetState == targetUser.isBanned()) {
            if (targetState) {
                Logger.info(String.format(
                        "No need to ban: specified user (%s) is already banned",
                        targetUser.getId()));
            } else {
                Logger.info(String.format(
                        "No need to recover: specified user (%s) is not banned yet",
                        targetUser.getId()));
            }
            return null;
        }

        targetUser = new User(targetUser);
        targetUser.setBanned(targetState);
        access.put(con, targetUser);
        Logger.info(String.format(
                "Administrator (%s) changed state of user (%s) to %s",
                userId,
                targetUser.getId(),
                targetState ? "BANNED" : "NOT BANNED"));
View Full Code Here

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

            pref = UserPreference.getDefaultPreference(userId);
        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

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

    private Map<String, String> configurationMap;

    @Override
    protected Void doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        IUserAccess userAccess = daos.getUserAccess();
        countUser = userAccess.count(con);

        IEventAccess eventAccess = daos.getEventAccess();
        countEvent = eventAccess.count(con);
        countPublicEvent = eventAccess.count(con, EventFilterCondition.PUBLIC_EVENT_ONLY);
        countPrivateEvent = eventAccess.count(con, EventFilterCondition.PRIVATE_EVENT_ONLY);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.