public abstract class
PartnershipSenderextends HttpSender implements PartnershipOp¶
PartnershipSenderis abstract base class for sending HTTP remote request to H2O for executing partnership maintenance operation.
Author: Twinsen Tsang
public abstract Map
Get the mapping of the partnership data key to HTTP form parameter name. For example, if there are 3 data (with keys) in your partnership data and they are named as “dataKey0”, “dataKey1” and “dataKey2”, and you want the HTTP request going to execute containing multi-part parameters “formParam0”, “formParam1” and “formParam2” with the value equal to the data value from “dataKey0”, “dataKey1”, “dataKey2” respectively, Then you should return the Map listed below:
Map m = new HashMap(); // Or LinkedHashMap() if you want to preserve the order. m.put("dataKey0", "fromParam0"); m.put("dataKey1", "fromParam1"); m.put("dataKey2", "fromParam2"); return m;
Returns: The mapping of the partnership data key to HTTP form parameter name.
public abstract Map
Get the mapping of the partnership operation from integer to words. By default, it is recommended to return a HashMap(Integer, String) with 3 mappings. HashMap.get(0) = A word representing the add partnership action. HashMap.get(1) = A word representing the delete partnership action. HashMap.get(2) = A word representing the update partnership action.
Returns: The mapping of the partnership operation from integer to words.
[@EVENT] This method is invoked when the sender is required to create a HTTP Request from configuration. It generates a multi-part content embedded in the HTTP POST request. The multi-part content contains all partnership data with the parameter name retrieved from the partnership mapping.
getPartnershipMapping(). Also the type of partnership operation is appended at the end of multi-part with parameter name equal to ‘request_action’ and it’s value is extracted thru
[@EVENT] This method is invoked when receivedas2 the reply HTTP response from the server. Verify the HTTP response (expected a HTML content) by PartnershipOpVerifer to check whether the partnership operation execute successfully or not.
- SAXException – When fail to verify by PartnershipOpVerifer.