@RequiresEnterpriseLicense(allowEval=true) @Connector(name="google-dfp-premium", friendlyName="Google DFP (Premium)", minMuleVersion="3.6") @RequiresEntitlement(name="google-dfp-premium", provider="Ricston-Ltd") public class GoogleDfpConnector extends Object
All processors can throw a DfpApiException when there is a problem with the request submitted to the API or a DfpCommunicationException if there is a communication problem with the API (such as timeouts etc).
Constructor and Description |
---|
GoogleDfpConnector() |
Modifier and Type | Method and Description |
---|---|
Object |
create(CreateSelector selector,
Object objects)
Create Objects on a service
|
com.google.api.ads.dfp.axis.v201711.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.v201711.ReportJob reportJob,
ExportFormat exportFormat)
Download a report from the Google DFP service
|
Object |
get(GetSelector selector)
Gets a object(s) depending on the service chosen
|
com.google.api.ads.dfp.axis.v201711.AvailabilityForecast |
getAvailabilityForecast(com.google.api.ads.dfp.axis.v201711.ProspectiveLineItem prospectiveLineItem,
Boolean includeTargetingCriteriaBreakdown,
Boolean includeContendingLineItems)
Retrieve the availability forecast for the given prospective line item
|
com.google.api.ads.dfp.axis.v201711.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.v201711.CustomFieldOption |
getCustomFieldOption(long customFieldOptionId)
Gets a Custom Field with the given Custom field option ID
|
com.google.api.ads.dfp.axis.v201711.DeliveryForecast |
getDeliveryForecast(List<com.google.api.ads.dfp.axis.v201711.ProspectiveLineItem> prospectiveLineItems,
String ignoredLineItems)
Retrieve the delivery forecast for the given prospective line items
|
com.google.api.ads.dfp.axis.v201711.DeliveryForecast |
getDeliveryForecastByIds(String lineItemIds,
String ignoredLineItems)
Retrieve the delivery forecast for the given prospective line items ids
|
String |
getReportDownloadUrl(long reportJobId,
com.google.api.ads.dfp.axis.v201711.ReportDownloadOptions reportDownloadOptions)
Gets the URL containing the report generated
|
com.google.api.ads.dfp.axis.v201711.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 DFP.
|
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 DFP connection strategy@Processor @MetaDataScope(value=DownloadReportDataSense.class) public InputStream downloadReport(@Default(value="#[payload]") @RefOnly com.google.api.ads.dfp.axis.v201711.ReportJob reportJob, @MetaDataKeyParam(affects=OUTPUT) @Default(value="XML") ExportFormat exportFormat) throws DfpException
reportJob
- The report job for which the download needs to be generatedexportFormat
- The format in which the document should be producedDfpException
- DfpApiExceptionif there is a problem with the request made to the API.
DfpCommunicationException if there is a communication problem with the API (such as timeouts etc)@Processor public String getReportDownloadUrl(long reportJobId, com.google.api.ads.dfp.axis.v201711.ReportDownloadOptions reportDownloadOptions) throws DfpCommunicationException
reportJobId
- The Report Job Id (refer to Create Report)reportDownloadOptions
- Report Download Options a POJO
containing the report download optionsDfpCommunicationException
- if there is a communication problem with the API (such as timeouts etc)@Processor 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 DfpCommunicationException
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.
DfpCommunicationException
- if there is a communication problem with the API (such as timeouts etc)@MetaDataScope(value=GetByStatementSelectorDataSense.class) @Processor 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 DfpException, 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 statementDfpException
- when : a) Exception is raised by the API, in this case a specific DfpApiException
is thrown b) Exception is raised because of a communication problem
with the API DfpCommunicationException
c) Exception is raised because of an incorrect action DfpException
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, DfpApiException, DfpCommunicationException
selector
- The object that will be retrievedUser
or List
of Role
SelectorException
- if selector provided does not match a serviceDfpCommunicationException
- If there are exceptions related to communication with the Google DFP ServiceDfpApiException
- 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 DfpException, 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 DFP documentation
DfpException
- when :
DfpApiException
is thrown
DfpCommunicationException
DfpException
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 DfpApiException, DfpCommunicationException, SelectorException
objects
- List<Object>
Objects to be created (different depending on the service chosen)selector
- The type of object being created (see CreateSelector
)DfpApiException
- if there is a problem with the request made to the API.DfpCommunicationException
- 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, DfpCommunicationException, DfpApiException
selector
- The update operation to be performeditems
- The items to be updatedSelectorException
- if service chosen is not supportedDfpCommunicationException
- if there is a communication problem with the api (such as timeouts etc)DfpApiException
- if there is a problem with the request made to the API.@Processor public com.google.api.ads.dfp.axis.v201711.ReportJob createReport(DownloadReportMethod createReportMethod, String dimensions, String columns, @Optional String dimensionAttributes, Date startDate, Date endDate) throws DfpException
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 dateDfpException
- when : a) Exception is raised by the API, in this case a specific DfpApiException
is thrown b) Exception is raised because of a communication problem
with the API DfpCommunicationException
c) Exception is raised because of an incorrect action DfpException
@Processor public com.google.api.ads.dfp.axis.v201711.CustomFieldOption getCustomFieldOption(long customFieldOptionId) throws DfpApiException, DfpCommunicationException
customFieldOptionId
- the ID of the custom field optionDfpCommunicationException
- if there is a communication problem with the api (such as timeouts etc)DfpApiException
- if there is a problem with the request made to the API.@Processor public com.google.api.ads.dfp.axis.v201711.ReportJobStatus getReportJobStatus(long reportJobId) throws DfpApiException
DownloadReportMethod
set as Async)reportJobId
- the ID of the Report JobDfpApiException
- if there is a problem with the request made to the API.@Processor public com.google.api.ads.dfp.axis.v201711.AvailabilityForecast getAvailabilityForecast(@RefOnly @Default(value="#[payload]") com.google.api.ads.dfp.axis.v201711.ProspectiveLineItem prospectiveLineItem, @Optional Boolean includeTargetingCriteriaBreakdown, @Optional Boolean includeContendingLineItems) throws DfpApiException, DfpCommunicationException
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 itemsDfpCommunicationException
- if there is a communication problem with the api (such as timeouts etc)DfpApiException
- if there is a problem with the request made to the API.@Processor public com.google.api.ads.dfp.axis.v201711.AvailabilityForecast getAvailabilityForecastById(long lineItemId, @Optional Boolean includeTargetingCriteriaBreakdown, @Optional Boolean includeContendingLineItems) throws DfpApiException, DfpCommunicationException
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 itemsDfpCommunicationException
- if there is a communication problem with the api (such as timeouts etc)DfpApiException
- if there is a problem with the request made to the API.@Processor public com.google.api.ads.dfp.axis.v201711.DeliveryForecast getDeliveryForecastByIds(@Optional String lineItemIds, @Optional String ignoredLineItems) throws DfpApiException, DfpCommunicationException
lineItemIds
- comma-delimited list of ids for the line items to includeignoredLineItems
- comma-delimited list of ids for the line items to ignoreDfpCommunicationException
- if there is a communication problem with the api (such as timeouts etc)DfpApiException
- if there is a problem with the request made to the API.@Processor public com.google.api.ads.dfp.axis.v201711.DeliveryForecast getDeliveryForecast(@RefOnly @Default(value="#[payload]") List<com.google.api.ads.dfp.axis.v201711.ProspectiveLineItem> prospectiveLineItems, @Optional String ignoredLineItems) throws DfpApiException, DfpCommunicationException
prospectiveLineItems
- list of prospective line items for the delivery forecastignoredLineItems
- comma-delimited list of ids for the line items to ignoreDfpCommunicationException
- if there is a communication problem with the api (such as timeouts etc)DfpApiException
- if there is a problem with the request made to the API.Copyright © 2010–2018. All rights reserved.