Examples of EnMeExistPreviousConnectionException


Examples of org.encuestame.core.exception.EnMeExistPreviousConnectionException

                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profileAPI,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
            } else if (socialProvider.equals(SocialProvider.LINKEDIN)) {
                LinkedInAPIOperations apiOperations = new LinkedInAPITemplate(
                        apiKey, consumerSecret, accessToken.getValue(),
                        accessToken.getSecret());
                LinkedInProfile profile = apiOperations.getUserProfile();
                SocialUserProfile profileAPI = apiOperations.getProfile();
                log.debug("linkedin profile "+profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profileAPI,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
            } else if (socialProvider.equals(SocialProvider.TWITTER)) {
                TwitterAPIOperations operations = new TwitterAPITemplate(consumerSecret, apiKey, accessToken.getValue(),
                        accessToken.getSecret());
                SocialUserProfile profile = operations.getProfile();
                log.debug("twitter profile "+profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profile,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
                //FUTURE - Issues with OAuth1 request.
            } else if (socialProvider.equals(SocialProvider.YAHOO)) {
                //FUTURE - Only valid on defined domain.
                log.debug("Yahoo provider is disabled");
               
            } else if (socialProvider.equals(SocialProvider.PLURK)) {
              PlurkAPIOperations  apiOperations = new PlurkAPITemplate(
                        apiKey, consumerSecret, accessToken.getValue(),
                        accessToken.getSecret());
                SocialUserProfile profile = apiOperations.getProfile();
                log.debug("plurk profile " + profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profile,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
            } else if (socialProvider.equals(SocialProvider.TUMBLR)) {
              TumblrAPIOperations apiOperations = new TumblrAPITemplate(
                        apiKey, consumerSecret, accessToken.getValue(),
                        accessToken.getSecret());
                SocialUserProfile profile = apiOperations.getProfile();
                log.debug("linkedin profile "+profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profile,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
            } else if (socialProvider.equals(SocialProvider.PLURK)) {
              //TODO:
            }
            log.info("Saved New Social Account");
View Full Code Here

Examples of org.encuestame.core.exception.EnMeExistPreviousConnectionException

                          accessGrant.getAccessToken(), accessGrant.getRefreshToken(), accessGrant.getExpires(),
                          facebookAPIOperations.getProfile(),
                          socialProvider, getUserAccount());
            } else {
                log.warn("This account already exist");
                throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
            }

        }

        //    else if (socialProvider.equals(SocialProvider.GOOGLE_BUZZ)) {
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.