Package org.encuestame.persistence.exception

Examples of org.encuestame.persistence.exception.EnMeNoResultsFoundException


            final TweetPoll tweetPoll = getTweetPollService().getTweetPollById(tweetPollId);
            if (tweetPoll == null) {
                setError("can not publish your tweetpoll", response);
            } else {
                if (twitterAccountsId.length == 0) {
                    throw new EnMeNoResultsFoundException("social accoutns are required to publish");
                }
                 //build text to tweet.
                 final String tweetText = getTweetPollService().generateTweetPollContent(tweetPoll);
                 log.debug("tweet text "+tweetText);
                 //check real lenght if execed limit required.
View Full Code Here


    public final UserAccount getUserAccount(final String username) throws EnMeNoResultsFoundException {
        log.debug("getUserAccount username:: "+username);
        final UserAccount userAccount =  this.findUserByUserName(username);
        if (userAccount == null) {
            log.info(" user not found {"+username+"}");
            throw new EnMeNoResultsFoundException(" user not found {"+username+"}");
        } else {
            //TODO: we can add others validations, like is disabled, banned or the account is expired.
            return userAccount;
        }
    }
View Full Code Here

     * @throws EnMeNoResultsFoundException
     */
   public final UserAccount getUserAccount(final Long userId) throws EnMeNoResultsFoundException {
        final UserAccount userAccount = getAccountDao().getUserAccountById(userId);
        if(userAccount == null){
            throw new EnMeNoResultsFoundException(" user id not found {"+userId+"}");
        } else {
            //TODO: we can add others validations, like is disabled, banned or the account is expired.
            return userAccount;
        }
    }
View Full Code Here

        try {
            final Map<String, Object> sucess = new HashMap<String, Object>();
            final UserAccountBean user = getUser(userId);
            log.debug("user info "+userId);
            if (user == null) {
                setError(new EnMeNoResultsFoundException("user not found").getMessage(), response);
                log.error("user not found");
            } else {
                sucess.put("user", user);
                setItemResponse(sucess);
            }
View Full Code Here

                        .toLowerCase()));
        log.trace("AService getHashTag - is "+tagName+" on  database ?->"+hashTag);
        if (hashTag == null) {
            //if possible we can't exception to allow create a new with the parameter.
            if (exceptionIfNotFound || exceptionIfNotFound == null) {
                throw new EnMeNoResultsFoundException("hashtag [" + hashTag+ "] not found");
            } else {
                return null;
            }
        } else {
            log.debug("getHashTag "+hashTag);
View Full Code Here

     */
    public UserAccount getUserAccount() throws EnMeNoResultsFoundException{
        final UserAccount account = this.getByUsername(this.getUserPrincipalUsername());
        if (account == null) {
            log.fatal("user session not found ");
            throw new EnMeNoResultsFoundException("user not found");
        }
        return account;
    }
View Full Code Here

            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
            final HashTagStatsBean tagStatsBean = new HashTagStatsBean();
            final TypeSearchResult filterType = TypeSearchResult.getTypeSearchResult(filter);
            final SearchPeriods searchPeriod = SearchPeriods.getPeriodString(period);
            if (filterType == null) {
                throw new EnMeNoResultsFoundException("type not found");
            } else {
                if (filterType.equals(TypeSearchResult.HASHTAGRATED)) {
                    // hits /period
                    tagStatsBean.setTotalHits(getStatisticsService().getHashTagHitsbyName(tagName,
                            filterType, request, searchPeriod));
View Full Code Here

        try {
            final QuestionBean questionBean = new QuestionBean();
            questionBean.setQuestionName(createPollBean.getQuestionName());
            final Question question = createQuestion(questionBean, user, QuestionPattern.CUSTOMIZABLE_SELECTION);
            if (question == null) {
                throw new EnMeNoResultsFoundException("Question not valid");
            } else if (createPollBean.getAnswers().length  == 0 ) {
                  throw new EnMeNoResultsFoundException("answers are required to create Poll");
            }
            else{
            final String hashPoll = MD5Utils.md5(RandomStringUtils.randomAlphanumeric(500));
            final CommentOptions commentOpt = CommentOptions.getCommentOption(createPollBean.getShowComments());
            final ShowResultsOptions showResultsOptions = ShowResultsOptions.getShowResults(createPollBean.getShowComments());
View Full Code Here

                // TODO: Remove Hits and social network publications.
                // Remove Question
                getQuestionDao().delete(question);

            } else {
                throw new EnMeNoResultsFoundException("Question  not found");
            }

        } else {
            throw new EnMeNoResultsFoundException("Poll not found");
        }
    }
View Full Code Here

     */
    public PollBean updateQuestionPoll(final Long pollId, final Question question)
            throws EnMeExpcetion {
          final Poll poll = this.getPollById(pollId, getUserAccount(getUserPrincipalUsername()));
          if (poll == null) {
              throw new EnMeNoResultsFoundException("poll not found");
          }
          else{
              poll.setQuestion(question) ;
              getPollDao().saveOrUpdate(poll);
          }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.exception.EnMeNoResultsFoundException

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.