Package com.google.api.services.plus

Examples of com.google.api.services.plus.Plus


        GoogleTokenResponse tokenData = accessTokenContext.getTokenData();
        // Build credential from stored token data.
        GoogleCredential credential = getGoogleCredential(tokenData);

        // Create a new authorized API client.
        Plus service = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
                .setApplicationName(applicationName)
                .build();
        return service;
    }
View Full Code Here


            // ---------------------------------------------------------
            // ユーザー登録
            // ---------------------------------------------------------

            // Google Plus APIを使ってユーザー情報を取得する
            Plus plus = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
            .setApplicationName(Constants.GOOGLE_APPLICATION_NAME)
            .build();
            Person person = plus.people().get("me").execute();

            userModel = UserService.put(
                tokenInfo.getUserId(),
                tokenInfo.getEmail(),
                person.getUrl(),
View Full Code Here

        // リフレッシュトークンを元にアクセストークンを更新
        credential.refreshToken();

        // Google+ API の設定(デフォルト1回につき20件)
        Plus plus = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
        .setApplicationName(Constants.GOOGLE_APPLICATION_NAME)
        .build();

        Plus.Activities.List listActivities = plus.activities().list("me", "public").setFields(Constants.TARGET_ACTIVITY_FIELDS);

        // 最初のページのリクエストを実行します
        ActivityFeed activityFeed = listActivities.execute();

        // リクエストのラップを解除し、必要な部分を抽出します
View Full Code Here

        // リフレッシュトークンを元にアクセストークンを更新
        credential.refreshToken();

        // Google+ API の設定(デフォルト1回につき20件)
        Plus plus = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
        .setApplicationName(Constants.GOOGLE_APPLICATION_NAME)
        .build();


        Plus.Activities.List listActivities = plus.activities().list("me", "public").setFields(Constants.TARGET_ACTIVITY_FIELDS);

        // 最初のページのリクエストを実行します
        ActivityFeed activityFeed = listActivities.execute();

        // リクエストのラップを解除し、必要な部分を抽出します
View Full Code Here

            // リフレッシュトークンを元にアクセストークンを更新
            credential.refreshToken();

            // Plus Object
            Plus plus = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
            .setApplicationName(Constants.GOOGLE_APPLICATION_NAME)
            .build();

            Person person = null;
            try {
                person = plus.people().get("me").execute();

            } catch (GoogleJsonResponseException e) {
                // When deleted
                if(e.getStatusCode() == 404) {
//                    UserService.delete(userModel);
View Full Code Here

        // リフレッシュトークンを元にアクセストークンを更新
        credential.refreshToken();


        Plus plus = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
        .setApplicationName(Constants.GOOGLE_APPLICATION_NAME)
        .build();
        Person person = plus.people().get("me").execute();

        // 表示名
        if(person.getDisplayName() != null && !person.getDisplayName().isEmpty()) {
            userModel.setDisplayName(person.getDisplayName());
        }
View Full Code Here

            // リフレッシュトークンを元にアクセストークンを更新
            credential.refreshToken();

            // Plus Object
            Plus plus = new Plus.Builder(TRANSPORT, JSON_FACTORY, credential)
            .setApplicationName(Constants.GOOGLE_APPLICATION_NAME)
            .build();

            // Re-acquisition of Activity
            Activity activity = null;
            try {
                activity = plus.activities().get(activityModel.getKey().getName()).execute();

            } catch (GoogleJsonResponseException e) {
                // When deleted
                if(e.getStatusCode() == 404) {
//                    logger.info("Activity Delete");
View Full Code Here

        .setTransport(TRANSPORT)
        .setClientSecrets(Constants.GOOGLE_PROJECT_CLIENT_ID, Constants.GOOGLE_PROJECT_CLIENT_SECRET).build()
        .setAccessToken(userModel.getAccessToken())
        .setRefreshToken(userModel.getRefreshToken());

        Plus plus = new Plus(TRANSPORT, JSON_FACTORY, credential);
        Plus.Activities.List listActivities = plus.activities().list("me", "public").setFields(Constants.TARGET_ACTIVITY_FIELDS);

        // 最初のページのリクエストを実行します
        ActivityFeed activityFeed = listActivities.execute();

        // リクエストのラップを解除し、必要な部分を抽出します
View Full Code Here

        .setClientSecrets(Constants.GOOGLE_PROJECT_CLIENT_ID, Constants.GOOGLE_PROJECT_CLIENT_SECRET).build()
        .setAccessToken(userModel.getAccessToken())
        .setRefreshToken(userModel.getRefreshToken());

        // Google Plus APIを使ってユーザー情報を取得する
        Plus plus = new Plus(TRANSPORT, JSON_FACTORY, credential);
        Person person = plus.people().get("me").execute();

        // 表示名
        if(person.getDisplayName() != null && !person.getDisplayName().isEmpty()) {
            userModel.setDisplayName(person.getDisplayName());
        }
View Full Code Here

        // リフレッシュトークンを元にアクセストークンを更新
        credential.refreshToken();

        System.out.println("new AccessToken:" +  credential.getAccessToken());

        Plus plus = new Plus(TRANSPORT, JSON_FACTORY, credential);
        Plus.Activities.List listActivities = plus.activities().list("me", "public").setFields(Constants.TARGET_ACTIVITY_FIELDS);

        // 最初のページのリクエストを実行します
        ActivityFeed activityFeed = listActivities.execute();

        // リクエストのラップを解除し、必要な部分を抽出します
View Full Code Here

TOP

Related Classes of com.google.api.services.plus.Plus

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.