Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  // Copyright 2012 Google Inc. All Rights Reserved.
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //       http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
 package com.google.api.ads.adwords.axis.utility.extension;
 
DelegateLocator allows the developer to find all the Delegates for the AdWords API services.

Implementation is not thread-safe, because AdWordsSession and Apache Axis service objects are not thread-safe.

Author(s):
Julian Toledo
 
 public final class DelegateLocator{
 
   private final AdWordsSession adWordsSession;
 
   private volatile AdGroupAdDelegate adGroupAdDelegate;
   private volatile AdGroupFeedDelegate adGroupFeedDelegate;
   private volatile AdGroupDelegate adGroupDelegate;
   private volatile  AdParamDelegate adParamDelegate;
   private volatile AlertDelegate alertDelegate;
   private volatile BudgetOrderDelegate budgetOrderDelegate;
   private volatile BudgetDelegate budgetDelegate;
   private volatile CampaignFeedDelegate campaignFeedDelegate;
   private volatile CampaignDelegate campaignDelegate;
   private volatile ConstantDataDelegate constantDataDelegate;
   private volatile CustomerSyncDelegate customerSyncDelegate;
   private volatile ExperimentDelegate experimentDelegate;
   private volatile FeedDelegate feedDelegate;
   private volatile FeedItemDelegate feedItemDelegate;
   private volatile FeedMappingDelegate feedMappingDelegate;
   private volatile GeoLocationDelegate geoLocationDelegate;
   private volatile MediaDelegate mediaDelegate;
   private volatile UserListDelegate userListDelegate;

  
Constructor for DelegateLocator with it's own AdWordsSession. Stores a new copy of the AdWordsSession specific for this ManagedCustomer (Account).

Parameters:
adWordsSession the AdWordsSession for the ManagedCustomer
  public DelegateLocator(AdWordsSession adWordsSession) {
    this. = AdWordsSessionUtil.copyWithUtilityUserAgent(adWordsSession);
  }

  
Constructor for DelegateLocator for a ManagedCustomer from clientCustomerId. Stores a new copy of the AdWordsSession specific for this ManagedCustomer (Account).

Parameters:
adWordsSession the AdWordsSession for the ManagedCustomer
clientCustomerId the clientCustomerId as String for the AdWordsSession
  public DelegateLocator(AdWordsSession adWordsSessionString clientCustomerId) {
    this. = AdWordsSessionUtil.copyWithUtilityUserAgent(adWordsSession);
    this..setClientCustomerId(clientCustomerId);
  }

  
Constructor for DelegateLocator for a ManagedCustomer. Stores a new copy of the AdWordsSession specific for this ManagedCustomer (Account).

Parameters:
adWordsSession the AdWordsSession for the ManagedCustomer
managedCustomer the ManagedCustomer for the AdWordsSession
  public DelegateLocator(AdWordsSession adWordsSessionManagedCustomer managedCustomer) {
    String clientCustomerId = null;
    if (managedCustomer.getCustomerId() != null) {
      clientCustomerId = managedCustomer.getCustomerId().toString();
    }
    this. = AdWordsSessionUtil.copyWithUtilityUserAgent(adWordsSession);
    this..setClientCustomerId(clientCustomerId);
  }

  
Constructor for DelegateLocator for a ManagedCustomer. Stores a new copy of the AdWordsSession specific for this ManagedCustomer (Account).

Parameters:
adWordsSession the AdWordsSession for the ManagedCustomer
managedCustomerDelegate
  public DelegateLocator(AdWordsSession adWordsSession,
      ManagedCustomerDelegate managedCustomerDelegate,
      AdExtensionOverrideDelegate adExtensionOverrideDelegate,
      AdGroupAdDelegate adGroupAdDelegate,
      AdGroupBidModifierDelegate adGroupBidModifierDelegate,
      AdGroupCriterionDelegate adGroupCriterionDelegate,
      AdGroupFeedDelegate adGroupFeedDelegate,
      AdGroupDelegate adGroupDelegate,
      AdParamDelegate adParamDelegate,
      AlertDelegate alertDelegate,
      BudgetOrderDelegate budgetOrderDelegate,
      BudgetDelegate budgetDelegate,
      CampaignAdExtensionDelegate campaignAdExtensionDelegate,
      CampaignCriterionDelegate campaignCriterionDelegate,
      CampaignFeedDelegate campaignFeedDelegate,
      CampaignDelegate campaignDelegate,
      ConstantDataDelegate constantDataDelegate,
      ConversionTrackerDelegate conversionTrackerDelegate,
      CustomerSyncDelegate customerSyncDelegate,
      DataAdGroupBidLandscapeDelegate dataAdGroupBidLandscapeDelegate,
      DataCriterionBidLandscapeDelegate dataCriterionBidLandscapeDelegate,
      ExperimentDelegate experimentDelegate,
      FeedDelegate feedDelegate,
      FeedItemDelegate feedItemDelegate,
      FeedMappingDelegate feedMappingDelegate,
      GeoLocationDelegate geoLocationDelegate,
      LocationCriterionDelegate locationCriterionDelegate,
      MediaDelegate mediaDelegate,
      TargetingIdeaDelegate targetingIdeaDelegate,
      TrafficEstimatorDelegate trafficEstimatorDelegate,
      UserListDelegate userListDelegate) {
    this. = AdWordsSessionUtil.copyWithUtilityUserAgent(adWordsSession);
    this. = managedCustomerDelegate;
    this. = adExtensionOverrideDelegate;
    this. = adGroupAdDelegate;
    this. = adGroupBidModifierDelegate;
    this. = adGroupCriterionDelegate;
    this. = adGroupFeedDelegate;
    this. = adGroupDelegate;
    this. = adParamDelegate;
    this. = alertDelegate;
    this. = budgetOrderDelegate;
    this. = budgetDelegate;
    this. = campaignAdExtensionDelegate;
    this. = campaignCriterionDelegate;
    this. = campaignFeedDelegate;
    this. = campaignDelegate;
    this. = constantDataDelegate;
    this. = conversionTrackerDelegate;
    this. = customerSyncDelegate;
    this. = dataAdGroupBidLandscapeDelegate;
    this. = dataCriterionBidLandscapeDelegate;
    this. = experimentDelegate;
    this. = feedDelegate;
    this. = feedItemDelegate;
    this. = feedMappingDelegate;
    this. = geoLocationDelegate;
    this. = locationCriterionDelegate;
    this. = mediaDelegate;
    this. = targetingIdeaDelegate;
    this. = trafficEstimatorDelegate;
    this. = userListDelegate;
  }

  
Gets the AdWordsSession associated with thisDelegateLocator.
    return ;
  }

  
Gets the ClientCustomerId associated with theadWordsSession.
  public String getClientCustomerId() {
  }

  
Gets the ManagedCustomerDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the CampaignFeedDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the CampaignDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new CampaignDelegate();
        }
      }
    }
    return ;
  }

  
Gets the AdGroupBidModifierDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the AdGroupFeedDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the AdGroupDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new AdGroupDelegate();
        }
      }
    }
    return ;
  }

  
Gets the AdGroupAdDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the AdGroupCriterionDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the AdExtensionOverrideDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the CampaignCriterionDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the CampaignAdExtensionDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the AlertDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new AlertDelegate();
        }
      }
    }
    return ;
  }

  
Gets the BudgetOrderDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new BudgetOrderDelegate(false);
        }
      }
    }
    return ;
  }

  
Gets the BudgetDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new BudgetDelegate();
        }
      }
    }
    return ;
  }

  
Gets the ConstantDataDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the DataAdGroupBidLandscapeDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the DataCriterionBidLandscapeDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the AdParamDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new AdParamDelegate();
        }
      }
    }
    return ;
  }

  
Gets the CustomerSyncDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the ExperimentDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the FeedDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new FeedDelegate();
        }
      }
    }
    return ;
  }

  
Gets the FeedMappingDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new FeedItemDelegate();
        }
      }
    }
    return ;
  }

  
Gets the FeedMappingDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the GeoLocationDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the LocationCriterionDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }


  
Gets the ConversionTrackerDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the MediaDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new MediaDelegate();
        }
      }
    }
    return ;
  }

  
Gets the TargetingIdeaDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
    return ;
  }

  
Gets the TrafficEstimatorDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
        }
      }
    }
  }

  
Gets the UserListDelegate associated with theadWordsSession.
    if ( == null) {
      synchronized (this) {
        if ( == null) {
           = new UserListDelegate();
        }
      }
    }
    return ;
  }
New to GrepCode? Check out our FAQ X