Package com.google.api.services.adsense

Examples of com.google.api.services.adsense.AdSense$Accounts$List


public class ListTest
{
   public static void main( String args[] )
   {
      List list = new List(); // create the List container

      // insert integers in list
      list.insertAtFront( -1 );
      list.print();
      list.insertAtFront( 0 );
      list.print();
      list.insertAtBack( 1 );
      list.print();
      list.insertAtBack( 5 );
      list.print();

      // remove objects from list; print after each removal
      try
      {
         Object removedObject = list.removeFromFront();
         System.out.printf( "%s removed\n", removedObject );
         list.print();

         removedObject = list.removeFromFront();
         System.out.printf( "%s removed\n", removedObject );
         list.print();

         removedObject = list.removeFromBack();
         System.out.printf( "%s removed\n", removedObject );
         list.print();

         removedObject = list.removeFromBack();
         System.out.printf( "%s removed\n", removedObject );
         list.print();
      } // end try
      catch ( EmptyListException emptyListException )
      {
         emptyListException.printStackTrace();
      } // end catch
View Full Code Here


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

        AdSense adSense = new AdSense(TRANSPORT, JSON_FACTORY, credential);

        // アカウントIDを取得
        System.out.println("Account ID:" + asString("id"));
        // 対象クライアントID
        String adClientId = "ca-" + accountId;

        // AdSense Unit の取得(有効な広告のみ)
        AdUnits adUnits = adSense.adunits().list(adClientId).setIncludeInactive(false).execute();
        if(adUnits.getItems() == null || adUnits.getItems().size() <= 0) {
            return forward("select_ad_unit.jsp");
        }

        List<AdUnit> targetUnits = new ArrayList<AdUnit>();
View Full Code Here

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

        try {
            AdSense adSense = new AdSense(TRANSPORT, JSON_FACTORY, credential);

            // アカウント(複数)を取得
            Accounts accounts = adSense.accounts().list().execute();
            requestScope("accounts", accounts);

        }catch(Exception e) {
            // アカウント存在しない場合はエラーになるが、エラーの表示をJSPで行うので何もしない。
        }
View Full Code Here

TOP

Related Classes of com.google.api.services.adsense.AdSense$Accounts$List

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.