@RequiresEnterpriseLicense(allowEval=true) @Connector(name="google-ad-manager-premium", friendlyName="Google Ad Manager (Premium)", minMuleVersion="3.6") @RequiresEntitlement(name="google-ad-manager-premium", provider="Ricston-Ltd") public class GoogleAdManagerConnector extends Object
All processors can throw a AdManagerApiException when there is a problem with the request submitted to the API or a AdManagerCommunicationException if there is a communication problem with the API (such as timeouts etc.).
Constructor and Description |
---|
GoogleAdManagerConnector() |
Modifier and Type | Method and Description |
---|---|
Object |
create(CreateSelector selector,
Object objects)
Create Objects on a service.
|
com.google.api.ads.dfp.axis.v201805.ReportJob |
createReport(DownloadReportMethod createReportMethod,
String dimensions,
String columns,
String dimensionAttributes,
Date startDate,
Date endDate)
Creates a Report with the given parameters.
|
InputStream |
downloadReport(com.google.api.ads.dfp.axis.v201805.ReportJob reportJob,
ExportFormat exportFormat)
Download a Report from the Google Ad Manager service.
|
Object |
get(GetSelector selector)
Gets a object(s) depending on the service chosen.
|
com.google.api.ads.dfp.axis.v201805.AvailabilityForecast |
getAvailabilityForecast(com.google.api.ads.dfp.axis.v201805.ProspectiveLineItem prospectiveLineItem,
Boolean includeTargetingCriteriaBreakdown,
Boolean includeContendingLineItems)
Retrieve the Availability Forecast for the given prospective Line Item
|
com.google.api.ads.dfp.axis.v201805.AvailabilityForecast |
getAvailabilityForecastById(long lineItemId,
Boolean includeTargetingCriteriaBreakdown,
Boolean includeContendingLineItems)
Retrieve the Availability Forecast for the given prospective Line Item ID
|
Object |
getByStatement(GetByStatementSelector selector,
String queryString,
Map<String,Object> queryParams,
String queryOrder,
Integer queryOffset)
Retrieve object(s) that match the query.
|
AbstractConfig |
getConnectionStrategy() |
com.google.api.ads.dfp.axis.v201805.CustomFieldOption |
getCustomFieldOption(long customFieldOptionId)
Gets a Custom Field with the given Custom field Option ID
|
com.google.api.ads.dfp.axis.v201805.DeliveryForecast |
getDeliveryForecast(List<com.google.api.ads.dfp.axis.v201805.ProspectiveLineItem> prospectiveLineItems,
String ignoredLineItems)
Retrieve the Delivery Forecast for the given prospective Line Items
|
com.google.api.ads.dfp.axis.v201805.DeliveryForecast |
getDeliveryForecastByIds(String lineItemIds,
String ignoredLineItems)
Retrieve the Delivery Forecast for the given prospective Line Item IDs
|
String |
getReportDownloadUrl(long reportJobId,
com.google.api.ads.dfp.axis.v201805.ReportDownloadOptions reportDownloadOptions)
Gets the URL containing the Report generated.
|
com.google.api.ads.dfp.axis.v201805.ReportJobStatus |
getReportJobStatus(long reportJobId)
Gets the status of a created Report Job (usually used in conjunction with
Create Report with
DownloadReportMethod
set as Async) |
Integer |
perform(String selector,
String queryString,
Map<String,Object> queryParams)
Perform action onto objects.
|
List<String[]> |
selectPql(String selectCols,
String fromTable,
String queryString,
Map<String,Object> queryParams,
String queryOrder,
Integer queryOffset)
Method for executing a PQL (Publisher-Query-Language) select statement to
retrieve data from Google Ad Manager.
|
void |
setConnectionStrategy(AbstractConfig connectionStrategy) |
Object |
update(UpdateSelector selector,
Object items)
Update a list of Objects.
|
public AbstractConfig getConnectionStrategy()
public void setConnectionStrategy(AbstractConfig connectionStrategy)
connectionStrategy
- Google Ad Manager connection strategy@Processor(friendlyName="Download Report") @MetaDataScope(value=DownloadReportDataSense.class) public InputStream downloadReport(@Default(value="#[payload]") @RefOnly com.google.api.ads.dfp.axis.v201805.ReportJob reportJob, @MetaDataKeyParam(affects=OUTPUT) @Default(value="XML") ExportFormat exportFormat) throws AdManagerException
reportJob
- The Report Job for which the download needs to be generatedexportFormat
- The format in which the document should be producedAdManagerException
- AdManagerApiExceptionif there is a problem with the request made to the
API. AdManagerCommunicationException if there is a communication
problem with the API (such as timeouts etc.)@Processor(friendlyName="Get Report Download URL") public String getReportDownloadUrl(long reportJobId, com.google.api.ads.dfp.axis.v201805.ReportDownloadOptions reportDownloadOptions) throws AdManagerCommunicationException
reportJobId
- The Report Job ID (refer to Create
Report)reportDownloadOptions
- Report
Download Options a POJO containing the report download optionsAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)@Processor(friendlyName="Select PQL") public List<String[]> selectPql(@Default(value="*") String selectCols, String fromTable, String queryString, Map<String,Object> queryParams, @Default(value="ASC") String queryOrder, @Default(value="0") Integer queryOffset) throws AdManagerCommunicationException
selectCols
- A comma-delimited list of columns to be selected, if it's left
blank or an asterisk ('*') is used every column will be returnedfromTable
- The name of the table from which the data will be obtainedqueryString
- The query string to filter the objects The query string is written
as id=:id, in turns the queryParams must contain
the parameter specified (e.g. :id)queryParams
- The query parameters to filter the objects, these parameters
should match the promised parameters specified in the queryString
parameterqueryOrder
- The order in which the results will be retrievedqueryOffset
- The query limit for the statementEach element of the List is a row of the table which contains an array with the values of every columns, with the first element of the list containing the names of every column for which data have been obtained.
AdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)@MetaDataScope(value=GetByStatementSelectorDataSense.class) @Processor(friendlyName="Get by Statement") public Object getByStatement(@MetaDataKeyParam(affects=OUTPUT) @Placement(order=0,group="Service") @FriendlyName(value="Service") GetByStatementSelector selector, String queryString, Map<String,Object> queryParams, @Default(value="ASC") String queryOrder, @Default(value="0") Integer queryOffset) throws AdManagerException, SelectorException
selector
- The object that will be retrievedqueryString
- The query string to filter the objects The query string is written
as id=:id, in turns the queryParams
must contain the parameter specified (e.g. :id)queryParams
- The query parameters to filter the objects, these parameters
should match the promised parameters specified in the
queryString
parameterqueryOrder
- The order in which the results will be retrievedqueryOffset
- The query offset for the statementAdManagerException
- when : a) Exception is raised by the API, in this case a specific
AdManagerApiException
is thrown b) Exception is raised because
of a communication problem with the API
AdManagerCommunicationException
c) Exception is raised because
of an incorrect action AdManagerException
SelectorException
- if service chosen is not supported@Processor @MetaDataScope(value=GetSelectorDataSense.class) public Object get(@MetaDataKeyParam(affects=OUTPUT) @Placement(order=0,group="Service") @FriendlyName(value="Service") GetSelector selector) throws SelectorException, AdManagerApiException, AdManagerCommunicationException
selector
- The object that will be retrievedUser
or List
of
Role
SelectorException
- if selector provided does not match a serviceAdManagerCommunicationException
- If there are exceptions related to communication with the Google
Ad Manager ServiceAdManagerApiException
- if there is a problem with the request made to the API.@Processor @MetaDataScope(value=PerformSelectorDataSense.class) public Integer perform(@MetaDataKeyParam(labels={"Service","Action"}) String selector, String queryString, Map<String,Object> queryParams) throws AdManagerException, SelectorException
queryString
- The query string to filter the objects
The query string is written as id=:id, in turns
the queryParams must contain the parameter specified (e.g. :id)queryParams
- The query parameters to filter the objects, these parameters
should match the promised parameters specified in the queryString
parameterselector
- The service that an action should be performed on, and the action
to be perform.
The string should take form of object||action such as Ad Units||Activate Ad Units.
Supported objects can be found in the
PerformSelector
enum, the actions supported match the ones in the Google
Ad Manager documentation
AdManagerException
- when :
AdManagerApiException
is thrown
AdManagerCommunicationException
AdManagerException
SelectorException
- if service chosen is not supported@Processor @MetaDataScope(value=CreateSelectorDataSense.class) public Object create(@MetaDataKeyParam(affects=BOTH) @Placement(order=0,group="Service") @FriendlyName(value="Service") CreateSelector selector, @Default(value="#[payload]") @RefOnly Object objects) throws AdManagerApiException, AdManagerCommunicationException, SelectorException
objects
- List<Object>
Objects to be created (different depending on
the service chosen)selector
- The type of object being created (see CreateSelector
)AdManagerApiException
- if there is a problem with the request made to the API.AdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)SelectorException
- if service chosen is not supported@MetaDataScope(value=UpdateSelectorDataSense.class) @Processor public Object update(@MetaDataKeyParam(affects=BOTH) @Placement(order=0,group="Service") @FriendlyName(value="Service") UpdateSelector selector, @Default(value="#[payload]") @RefOnly Object items) throws SelectorException, AdManagerCommunicationException, AdManagerApiException
selector
- The update operation to be performeditems
- The items to be updatedSelectorException
- if service chosen is not supportedAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Create Report") public com.google.api.ads.dfp.axis.v201805.ReportJob createReport(DownloadReportMethod createReportMethod, String dimensions, String columns, @Optional String dimensionAttributes, Date startDate, Date endDate) throws AdManagerException
createReportMethod
- Whether sync (wait for report to be created) or async (refer to
Get Report Job Status)dimensions
- comma-delimited dimensions listcolumns
- comma-delimited columns listdimensionAttributes
- comma-delimited dimension attributes liststartDate
- the start of the Report dateendDate
- the end of the report dateAdManagerException
- when : a) Exception is raised by the API, in this case a specific
AdManagerApiException
is thrown b) Exception is raised because
of a communication problem with the API
AdManagerCommunicationException
c) Exception is raised because
of an incorrect action AdManagerException
@Processor(friendlyName="Get Custom Field Option") public com.google.api.ads.dfp.axis.v201805.CustomFieldOption getCustomFieldOption(long customFieldOptionId) throws AdManagerApiException, AdManagerCommunicationException
customFieldOptionId
- the ID of the Custom field OptionAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Get Report Job Status") public com.google.api.ads.dfp.axis.v201805.ReportJobStatus getReportJobStatus(long reportJobId) throws AdManagerApiException
DownloadReportMethod
set as Async)reportJobId
- the ID of the Report JobAdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Get Availability Forecast") public com.google.api.ads.dfp.axis.v201805.AvailabilityForecast getAvailabilityForecast(@RefOnly @Default(value="#[payload]") com.google.api.ads.dfp.axis.v201805.ProspectiveLineItem prospectiveLineItem, @Optional Boolean includeTargetingCriteriaBreakdown, @Optional Boolean includeContendingLineItems) throws AdManagerApiException, AdManagerCommunicationException
prospectiveLineItem
- the prospective Line Item to retrieve the Availability Forecast
forincludeTargetingCriteriaBreakdown
- boolean to include or not targeting criteria breakdownincludeContendingLineItems
- boolean to include or not contending Line ItemsAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Get Availability Forecast by ID") public com.google.api.ads.dfp.axis.v201805.AvailabilityForecast getAvailabilityForecastById(long lineItemId, @Optional Boolean includeTargetingCriteriaBreakdown, @Optional Boolean includeContendingLineItems) throws AdManagerApiException, AdManagerCommunicationException
lineItemId
- the prospective Line Item ID for retrieve the Availability
ForecastincludeTargetingCriteriaBreakdown
- boolean for include or not targeting criteria breakdownincludeContendingLineItems
- boolean for include or not contending Line ItemsAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Get Delivery Forecast by IDs") public com.google.api.ads.dfp.axis.v201805.DeliveryForecast getDeliveryForecastByIds(@Optional String lineItemIds, @Optional String ignoredLineItems) throws AdManagerApiException, AdManagerCommunicationException, AdManagerUserException
lineItemIds
- comma-delimited list of IDs for the Line Items to includeignoredLineItems
- comma-delimited list of IDs for the Line Items to ignoreAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.AdManagerUserException
- if there is a user error when using the operation.@Processor(friendlyName="Get Delivery Forecast") public com.google.api.ads.dfp.axis.v201805.DeliveryForecast getDeliveryForecast(@RefOnly @Default(value="#[payload]") List<com.google.api.ads.dfp.axis.v201805.ProspectiveLineItem> prospectiveLineItems, @Optional String ignoredLineItems) throws AdManagerApiException, AdManagerCommunicationException
prospectiveLineItems
- list of prospective Line Items for the Delivery ForecastignoredLineItems
- comma-delimited list of IDs for the Line Items to ignoreAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.Copyright © 2010–2019. All rights reserved.