Package in.partake.base

Examples of in.partake.base.PartakeException


        try {
            Calendar calendar = CalendarUtil.createCalendarSkeleton();
            CalendarDAOFacade.addCalendarByCategoryName(con, daos, categoryName, calendar);
            return CalendarUtil.outputCalendar(calendar);
        } catch (IOException e) {
            throw new PartakeException(ServerErrorCode.CALENDAR_CREATION_FAILURE, e);
        } catch (ValidationException e) {
            throw new PartakeException(ServerErrorCode.CALENDAR_INVALID_FORMAT, e);
        }
    }
View Full Code Here


            UserTwitterLink twitterLinkage = updateTwitterLinkage(con, daos, twitterLinkageEmbryo);
            // 2. 対応するユーザーを生成
            UserEx user = getUserFromTwitterLinkage(con, daos, twitterLinkage);
            return user;
        } catch (TwitterException e) {
            throw new PartakeException(ServerErrorCode.TWITTER_OAUTH_ERROR, e);
        }
    }
View Full Code Here

    @Override
    protected Calendar doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        // CalendarLinkage should have cache.
        UserCalendarLink calendarLinkage = daos.getCalendarAccess().find(con, calendarId);
        if (calendarLinkage == null)
            throw new PartakeException(UserErrorCode.INVALID_NOTFOUND);

        User user = daos.getUserAccess().find(con, calendarLinkage.getUserId());
        if (user == null)
            throw new PartakeException(UserErrorCode.INVALID_NOTFOUND);

        Calendar calendar = CalendarUtil.createCalendarSkeleton();

        // TODO: We only consider the first 1000 entries of enrollments due to memory limit.
        List<UserTicket> enrollments =
View Full Code Here

        String identifier = getParameter("openidIdentifier");

        String sessionId = session().get(Constants.Session.ID_KEY);
        assert sessionId != null;
        if (sessionId == null)
            throw new PartakeException(ServerErrorCode.SESSION_ID_KEY_NOTFOUND);

        IOpenIDService service = PartakeApp.getOpenIDService();
        DiscoveryInformation discoveryInformation = service.discover(identifier);
        OpenIDLoginInformation info = new OpenIDLoginInformation(purpose, discoveryInformation);
        Cache.set(Constants.Cache.OPENID_LOGIN_KEY_PREFIX + sessionId, info, LOGIN_TIMEOUT_SEC);
View Full Code Here

    @Override
    protected UserEx doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        user = UserDAOFacade.getUserEx(con, daos, userId);
        if (user == null)
            throw new PartakeException(UserErrorCode.INVALID_NOTFOUND);
        pref = daos.getUserPreferenceAccess().find(con, userId);
        if (pref == null)
            pref = UserPreference.getDefaultPreference(userId);
        return user;
    }
View Full Code Here

    }

    protected UUID getValidUUIDParameter(String key, UserErrorCode missing, UserErrorCode invalid) throws PartakeException {
        String id = getParameter(key);
        if (id == null)
            throw new PartakeException(missing);
        if (!Util.isUUID(id))
            throw new PartakeException(invalid);

        return UUID.fromString(id);
    }
View Full Code Here

        return id;
    }

    protected void checkIdParameterIsValid(String id, UserErrorCode missing, UserErrorCode invalid) throws PartakeException {
        if (id == null)
            throw new PartakeException(missing);
        if (!Util.isUUID(id))
            throw new PartakeException(invalid);
    }
View Full Code Here

    protected String optValidIdParameter(String key, UserErrorCode invalid, String defaultValue) throws PartakeException {
        String id = getParameter(key);
        if (id == null)
            return defaultValue;
        if (!Util.isUUID(id))
            throw new PartakeException(invalid);

        return id;
    }
View Full Code Here

        return getValidIdParameter("commentId", UserErrorCode.MISSING_COMMENT_ID, UserErrorCode.INVALID_COMMENT_ID);
    }

    protected void ensureValidSessionToken() throws PartakeException {
        if (!checkCSRFToken())
            throw new PartakeException(UserErrorCode.INVALID_SECURITY_CSRF);
    }
View Full Code Here

    }

    protected String[] ensureParameters(String key, UserErrorCode ec) throws PartakeException {
        String[] params = getParameters(key);
        if (params == null)
            throw new PartakeException(ec);

        return params;
    }
View Full Code Here

TOP

Related Classes of in.partake.base.PartakeException

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.