Package com.appspot.piment.model

Examples of com.appspot.piment.model.AuthToken


    if (commentUserId.equals(this.tqqWeiboApi.getUsetId())) {
      tqqApi = this.tqqWeiboApi;
    } else {
      UserMap userMap = this.userMapDao.getUserMap(commentUserId);
      if (userMap != null && StringUtils.isNotBlank(userMap.getTqqUserId())) {
      AuthToken tempAuthToken = this.authTokenDao.getByUserId(userMap.getTqqUserId(), WeiboSource.Tqq);
      this.tqqTempWeiboApi.setAuthToken(tempAuthToken);
      tqqApi = this.tqqTempWeiboApi;
      } else {
      tqqApi = this.tqqRobotWeiboApi;
      commentMsg = "Sina @" + comment.getUser().getScreenName() + "//" + commentMsg;
View Full Code Here


  log.info("Token:" + requestToken.getToken());
  log.info("TokenSecret:" + requestToken.getTokenSecret());
  log.info(requestToken.getAuthenticationURL());

  AuthToken authToken = new AuthToken(WeiboSource.Sina, requestToken.getToken(), requestToken.getTokenSecret());

  return authToken;
  }
View Full Code Here

  ConfigItemDao configItemDao = new ConfigItemDao();
  this.configMap = configItemDao.getValues();

  // tqqロボットユーザIDを元にAccessTokenを取り出す
  AuthToken tqqRobotAuthToken = authTokenDao.getByUserId(this.configMap.get("qq.piment.robot.id"), WeiboSource.Tqq);

  // sinaロボットユーザIDを元にAccessTokenを取り出す
  AuthToken sinaRobotAuthToken = authTokenDao.getByUserId(this.configMap.get("sina.piment.robot.id"), WeiboSource.Sina);

  this.sinaMessageSync = new SinaMessageSync(this.configMap);
  this.sinaMessageSync.setTqqRobotToken(tqqRobotAuthToken);

  this.tqqMessageSync = new TqqMessageSync(configMap);
View Full Code Here

  // ユーザ毎に同期化処理を行う
  for (UserMap user : uerMaps) {

    try {
    // sinaのユーザIDを元にAccessTokenを取り出す
    AuthToken sinaAuthToken = authTokenDao.getByUserId(user.getSinaUserId(), WeiboSource.Sina);
    // tqqのユーザIDを元にAccessTokenを取り出す
    AuthToken tqqAuthToken = authTokenDao.getByUserId(user.getTqqUserId(), WeiboSource.Tqq);

    // トークン情報渡す
    this.sinaMessageSync.setSinaToken(sinaAuthToken);
    this.sinaMessageSync.setTqqToken(tqqAuthToken);
    this.tqqMessageSync.setSinaToken(sinaAuthToken);
View Full Code Here

  String oauth_token_secret = responseParams.get("oauth_token_secret");

  log.info("oauth_token ---> " + oauth_token);
  log.info("oauth_token_secret ---> " + oauth_token_secret);

  AuthToken authToken = new AuthToken(WeiboSource.Tqq, oauth_token, oauth_token_secret);

  return authToken;
  }
View Full Code Here

  try {

    log.fine("-- processing requestToken  --");

    String source = req.getParameter("weibo_source");
    AuthToken authToken = null;
    String authURL = null;
    switch (WeiboSource.valueOf(source)) {
    case Tqq:

    TqqAuthApi tqqOAuth = new TqqAuthApi();
    authToken = tqqOAuth.requestToken();
    authURL = configItemDao.getValue("qq.authorize.url") + "?oauth_token=" + authToken.getToken();
    break;
    case Sina:
    SinaAuthApi sinaOAuth = new SinaAuthApi();
    authToken = sinaOAuth.requestToken();
    authURL = configItemDao.getValue("sina.authorize.url") + "?oauth_token=" + authToken.getToken();
    break;
    default:
    break;
    }
View Full Code Here

    WeiboSource source = WeiboSource.valueOf(req.getParameter("weibo_source"));
    String oauth_token = req.getParameter("oauth_token");
    String oauth_verifier = req.getParameter("oauth_verifier");

    AuthToken authToken = this.authTokenDao.getByToken(oauth_token);
    switch (source) {
    case Sina:
    SinaAuthApi sinaOAuth = new SinaAuthApi(authToken);
    authToken = sinaOAuth.exchangeToken(oauth_verifier);
    break;
View Full Code Here

TOP

Related Classes of com.appspot.piment.model.AuthToken

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.