Interface CampaignConnector
- All Known Subinterfaces:
GenericCampaignConnector
-
Method Summary
Modifier and TypeMethodDescriptioncallFunction
(String name, Map<String, String> fctParams, CampaignCredentials credentials) Calls a remote function on the campaign instance.getWebserviceConfig
(Resource resource) Determines the webservice config to be used.postFunction
(String name, Map<String, String> data, CampaignCredentials credentials) Posts data to a remote function on the campaign instance.retrieveCredentials
(Configuration config) Retrieves the credentials from the specified webservice config.
-
Method Details
-
getWebserviceConfig
Determines the webservice config to be used. This method respects inheritance.- Parameters:
resource
- The resource to get the webservice config for- Returns:
- The webservice config
- Throws:
ACConnectorException
- if the webservice configuration is not present or invalid
-
retrieveCredentials
Retrieves the credentials from the specified webservice config.
- Parameters:
config
- The webservice config- Returns:
- The credentials
- Throws:
ACConnectorException
- if there are no credentials present or the credentials could not be decrypted
-
callFunction
CallResults callFunction(String name, Map<String, String> fctParams, CampaignCredentials credentials) throws ACConnectorExceptionCalls a remote function on the campaign instance.
Note that the caller is required to use
CallResults.destroy()
after processing the result of the remote function call.The remote function needs to reside in the default namespace (/jssp/nms/). To call remote functions in a generic namespace, use
GenericCampaignConnector.callGeneric(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, com.day.cq.mcm.campaign.CampaignCredentials)
instead.- Parameters:
name
- The name of the function to be called (in /jssp/nms/; the value must not include /jssp/nms/)fctParams
- The parameters of the function call (name/value parameters)credentials
- The credentials to be used for the call- Returns:
- The result of the function call
- Throws:
ACConnectorException
- If the remote function could not be called or returned an unexpected status
-
postFunction
CallResults postFunction(String name, Map<String, String> data, CampaignCredentials credentials) throws ACConnectorExceptionPosts data to a remote function on the campaign instance.
Note that the caller is required to use
CallResults.destroy()
after processing the result of the remote function call.The remote function needs to reside in the default namespace (/jssp/nms/). To call remote functions in a generic namespace, use
GenericCampaignConnector.postGeneric(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, com.day.cq.mcm.campaign.CampaignCredentials)
instead.- Parameters:
name
- The name of the function to be called (in /jssp/nms/; the value must not include /jssp/nms/)data
- The data to post (name/value)credentials
- The credentials to be used for the call- Returns:
- The result of the function call
- Throws:
ACConnectorException
- If the remote function could not be called or returned an unexpected status
-