Package org.agorava.api.oauth

Examples of org.agorava.api.oauth.OAuthSession


    }

    @Override
    public String getVerifier() {
        OAuthSession session = getSession();
        return session.getVerifier();
    }
View Full Code Here


        return session.getVerifier();
    }

    @Override
    public void setVerifier(String verifierStr) {
        OAuthSession session = getSession();
        session.setVerifier(verifierStr);
    }
View Full Code Here

        session.setVerifier(verifierStr);
    }

    @Override
    public Token getAccessToken() {
        OAuthSession session = getSession();
        return session.getAccessToken();
    }
View Full Code Here

        return session.getAccessToken();
    }

    @Override
    public void setAccessToken(Token token) {
        OAuthSession session = getSession();
        session.setAccessToken(token);

    }
View Full Code Here

        return config.getSocialMediaName();
    }

    @Override
    public void setAccessToken(String token, String secret) {
        OAuthSession session = getSession();
        session.setAccessToken(new Token(token, secret));

    }
View Full Code Here

        return OAuthSession.NULL;
    }

    @Override
    public OAuthSession setCurrent(String id) throws IllegalArgumentException {
        OAuthSession res = get(id);
        if (res == null)
            throw new IllegalArgumentException("There is no session with id " + id + " in the repository");
        else
            return res;
    }
View Full Code Here

        return false;
    }

    @Override
    public boolean remove(String id) {
        OAuthSession elt = get(id);
        if (elt != null) {
            return remove(elt);
        }
        return false;
    }
View Full Code Here

        return startDanceFor(providerName, null);
    }

    @Override
    public synchronized void endDance() {
        OAuthSession currentSession = getCurrentSession();
        if (currentSession.getAccessToken() == null) {
            currentSession.setAccessToken(getCurrentService().getAccessToken(currentSession.getRequestToken(),
                    currentSession.getVerifier()));
        }
        if (currentSession.getAccessToken() != null) {
            currentSession.setRequestToken(null);
            currentSession.setUserProfile(getCurrentUserProfileService().getUserProfile());
            currentSession.getRepo().add(currentSession);
            completeEvt.select(currentSession.getServiceQualifier()).fire(new OAuthComplete(SocialEvent.Status.SUCCESS, "",
                    currentSession));

            //TODO: reactivate logger
        } else {
            // FIXME Launch an exception !!
View Full Code Here

        endDance();
    }

    @Override
    public OAuthSession buildSessionFor(String providerName) {
        OAuthSession res;
        Annotation qualifier = getServicesToQualifier().get(providerName);
        if (qualifier == null) {
            throw new AgoravaException("Cannot find configured service provider with name : " + providerName);
        }
        return buildSessionFor(qualifier);
View Full Code Here

        return buildSessionFor(qualifier);
    }

    @Override
    public OAuthSession buildSessionFor(Annotation qualifier) {
        OAuthSession res = new OAuthSession.Builder().qualifier(qualifier).repo(unProxifyRepo(getCurrentRepository())).build();
        getCurrentRepository().setCurrent(res);
        return res;
    }
View Full Code Here

TOP

Related Classes of org.agorava.api.oauth.OAuthSession

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.