Package org.fluxtream.core.domain

Examples of org.fluxtream.core.domain.ApiKey$PermanentFailReason


        final File f = File.createTempFile(randomFilename, ".unknown");

        IOUtils.copy(mpf.getInputStream(), new FileOutputStream(f));

        final long guestId = AuthHelper.getGuestId();
        final ApiKey apiKey = guestService.getApiKey(apiKeyId);
        if (apiKey.getGuestId()!=guestId)
            throw new RuntimeException("Attempt to upload file associated to another user's " +
                                       "ApiKey! apiKeyId=" + apiKeyId +
                                       ", guestId="  + AuthHelper.getGuestId());


        final Connector connector = apiKey.getConnector();
        executor.execute( new Runnable() {

            @Override
            public void run() {
                final AbstractUpdater bean = beanFactory.getBean(connector.getUpdaterClass());
View Full Code Here


      return new ModelAndView("connectors/openpath/enterCredentials");
    }
    long guestId = AuthHelper.getGuestId();

        final Connector connector = Connector.getConnector("instagram");
        final ApiKey apiKey = guestService.createApiKey(guestId, connector);

        guestService.setApiKeyAttribute(apiKey, "accessKey", accessKey);
        guestService.setApiKeyAttribute(apiKey, "secretKey", secretKey);

        ModelAndView mav = new ModelAndView("connectors/openpath/success");
View Full Code Here

            String accessToken = jsonToken.getString("access_token");
            String account = jsonToken.getString("account");

            final Connector connector = Connector.getConnector("github");
            final ApiKey apiKey = guestService.createApiKey(guest.getId(), connector);

            guestService.setApiKeyAttribute(apiKey, "accessToken", accessToken);
            guestService.setApiKeyAttribute(apiKey, "account", account);

            getUserLogin(apiKey, accessToken);
View Full Code Here

   
    JSONObject token = JSONObject.fromObject(fetched);
    Connector scopedApi = Connector.getConnector("foursquare");
    Guest guest = AuthHelper.getGuest();

        final ApiKey apiKey = guestService.createApiKey(guest.getId(), scopedApi);

    guestService.setApiKeyAttribute(apiKey,
        "accessToken", token.getString("access_token"));
   
    return "redirect:/app/from/"+scopedApi.getName();
View Full Code Here

    String verifier = request.getParameter("oauth_verifier");
    provider.retrieveAccessToken(consumer, verifier);
    Guest guest = AuthHelper.getGuest();

        final Connector connector = Connector.getConnector("freshbooks");
        final ApiKey apiKey = guestService.createApiKey(guest.getId(), connector);

    guestService.setApiKeyAttribute(apiKey, "accessToken", consumer.getToken());
    guestService.setApiKeyAttribute(apiKey, "tokenSecret", consumer.getTokenSecret());

    return "redirect:/app/from/"+connector.getName();
View Full Code Here

   
//    String scope = (String) request.getSession().getAttribute("oauth2Scope");
    Guest guest = AuthHelper.getGuest();

        final Connector connector = Connector.getConnector("instagram");
        final ApiKey apiKey = guestService.createApiKey(guest.getId(), connector);

    guestService.setApiKeyAttribute(apiKey,
        "accessToken", token.getString("access_token"));
   
    JSONObject userObject = token.getJSONObject("user");
View Full Code Here

      token = guestService.getApiKeyAttribute(updateInfo.apiKey, "sessionToken");
    return token;
  }

  public boolean checkAuthorization(GuestService guestService, long guestId) {
    ApiKey apiKey = guestService.getApiKey(guestId,
        Connector.getConnector("toodledo"));
    return apiKey != null;
  }
View Full Code Here

        return getChannelMaxTime(srcInfo, channelName);
    }


    public Double getUpdateStartTime(final UpdateInfo updateInfo, final long uid, final String deviceName, final String channelName) throws Exception {
        ApiKey apiKey = updateInfo.apiKey;

        // The updateStartDate for a given object type is stored in the apiKeyAttributes
        // as FluxtreamCapture.<channelName>.updateStartDate.  In the case of a failure the updater will store the date
        // that failed and start there next time.  In the case of a successfully completed update it will store
        // the timestamp of the last datapoint from the datastore on that channel.
View Full Code Here

      mav.setViewName("connectors/toodledo/error");
      return mav;
    }

        final Connector connector = Connector.getConnector("toodledo");
        final ApiKey apiKey = guestService.createApiKey(guestId, connector);

    guestService.setApiKeyAttribute(apiKey, "email", email);
    guestService.setApiKeyAttribute(apiKey, "password", password);
    guestService.setApiKeyAttribute(apiKey, "userid", userid);
   
View Full Code Here

        }
    }

    // Update the start time where we will begin during the next update cycle.
    public void updateStartTime(final UpdateInfo updateInfo, final String channelName, final Double nextUpdateStartTime) throws Exception {
        ApiKey apiKey = updateInfo.apiKey;

        // The updateStartDate for a given object type is stored in the apiKeyAttributes
        // as FluxtreamCapture.<channelName>.updateStartDate.  In the case of a failure the updater will store the date
        // that failed and start there next time.  In the case of a successfully completed update it will store
        // the timestamp of the last datapoint from the datastore on that channel.
View Full Code Here

TOP

Related Classes of org.fluxtream.core.domain.ApiKey$PermanentFailReason

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.