Package org.scribe.builder

Examples of org.scribe.builder.ServiceBuilder


   * @param token Token
   * @param tokenSecret Token secret
   */
  public YelpAPI(String consumerKey, String consumerSecret, String token, String tokenSecret) {
    this.service =
        new ServiceBuilder().provider(TwoStepOAuth.class).apiKey(consumerKey)
            .apiSecret(consumerSecret).build();
    this.accessToken = new Token(token, tokenSecret);
  }
View Full Code Here


    public Facebook(String apiKey, String apiSecret, String callback) {

        this.apiSecret = apiSecret;

        service = new ServiceBuilder()
                .provider(FacebookApi.class)
                .apiKey(apiKey)
                .apiSecret(apiSecret)
                .callback(callback)
                .build();
View Full Code Here

                  oauthho.oAuthVersion = OAuthVersion.OAUTH1;
                    GenericOAuth10aApi oauth10aApi = new GenericOAuth10aApi();
                    oauth10aApi.setAccessTokenEndpoint(providerConfig.getAccess_token_url());
                    oauth10aApi.setAuthorizationUrl(providerConfig.getAuthorization_url());
                    oauth10aApi.setRequestTokenEndpoint(providerConfig.getRequest_token_url());
                    oauthho.oauthService = new ServiceBuilder()
                            .provider(oauth10aApi)
                            .apiKey(oauthho.apiKey)
                            .apiSecret(oauthho.apiSecret)
                            .build();

                } else if (providerConfig.getOAuth_version() == 2.0) {
                 
                    if (providerConfig.getCallback_url() == null) {
                        throw new ScriptException("API configuration not specified");
                    }
                   
                  oauthho.oAuthVersion = OAuthVersion.OAUTH2;
                    GenericOAuth20Api oauth20Api = new GenericOAuth20Api();
                    oauth20Api.setAccessTokenEP(providerConfig.getAccess_token_url());
                    oauth20Api.setAuthorizeUrl(providerConfig.getAuthorization_url());
                    oauthho.oauthService = new ServiceBuilder()
                            .provider(oauth20Api)
                            .apiKey(oauthho.apiKey)
                            .apiSecret(oauthho.apiSecret)
                            .build();
                }
View Full Code Here

        String apiSecret = application.getProperty(String.format("oauth.%s.apiSecret", provider));
        String callback = application.getProperty(String.format("oauth.%s.callback", provider));
        //
        Class<? extends Api> apiClazz = (Class<? extends Api>) ClassUtils.forName(apiClass, getClass().getClassLoader());
        //
        return new ServiceBuilder().provider(apiClazz).apiKey(apiKey).apiSecret(apiSecret).callback(callback).build();
    }
View Full Code Here

    private Token EMPTY_TOKEN = null;
    private OAuthService oAuthService;

    @Before
    public void setup() {
        oAuthService = new ServiceBuilder().provider(SinaApi.class).apiKey("1530323438").apiSecret("5578be7bd2ff290413ab1046cea7e99c").callback("http://www.opensourceforce.org").build();
    }
View Full Code Here

  }

  private void connect() throws ForemanException
  {
    log.trace("Connecting to Tradeking");
    srv = new ServiceBuilder().provider(TradekingAPI.class).apiKey(ForemanConstants.API_KEY.toString()).apiSecret(ForemanConstants.API_SECRET.toString()).build();
    log.trace("\t ... Service built!");
    accessToken = new Token(ForemanConstants.ACCESS_TOKEN.toString(), ForemanConstants.ACCESS_TOKEN_SECRET.toString());
    log.trace("\t ... Access Token built!");
    log.trace("Connection Established");
  }
View Full Code Here

    Token accessToken;



    public Yelp(){
        this.service = new ServiceBuilder().provider(YelpApi2.class).apiKey(CONSUMER_KEY).apiSecret(CONSUMER_SECRET).build();
        this.accessToken = new Token(TOKEN, TOKEN_SECRET);
    }
View Full Code Here

    }

    public YelpSearchResults searchMultiple(String searchTerm, String city) {

        // Execute a signed call to the Yelp service.
        OAuthService service = new ServiceBuilder().provider(YelpApi2.class).apiKey(CONSUMER_KEY).apiSecret(CONSUMER_SECRET).build();
        Token accessToken = new Token(TOKEN, TOKEN_SECRET);
        OAuthRequest request = new OAuthRequest(Verb.GET, "http://api.yelp.com/v2/search");

        request.addQuerystringParameter("location", city);
        //request.addQuerystringParameter("category", "restaurants");
View Full Code Here

  protected final OAuthService service;
  protected final Token token;
 
  public XeroClient(Reader pemReader, String consumerKey, String consumerSecret) {
    service = new ServiceBuilder()
        .provider(new XeroOAuthService(pemReader))
        .apiKey(consumerKey)
        .apiSecret(consumerSecret)
        .build();
    token = new Token(consumerKey, consumerSecret);
View Full Code Here

        super(ProviderType.LinkedIn);
    }

    @Override
    protected OAuthService buildService() {
         return new ServiceBuilder()
            .provider(LinkedInApi.class)
            .apiKey(getConfigString("consumerKey"))
            .apiSecret(getConfigString("consumerSecret"))
            .callback(getCallbackUrl())
            .build();
View Full Code Here

TOP

Related Classes of org.scribe.builder.ServiceBuilder

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.