Hi,
Please find details below.
To use custom SMS provider you would need to implement interface : com.arcot.integrations.frontend.SMSService
Methods in the interface:
1. public void init(Map<String, String> initParams) throws Adapter Exception:
Explanation: This method is called after creating an instance of User specific Class.In this method, user can provide any validation before sending SMS.
For eg: We can provide a check to validate various configuration details provided in the property file like SMS-URL, APP-ID and others.
2. public boolean validatePhoneNumber(String phone Number):
Explanation: This method is used to validate phone number. User can provide his own validations like how many digits phone number should have and any other he want. Return true if we don’t want to validate the number.
3. public void sendSMS(SMS smsData) throws AdapterException:
Explanation: This method is used to send the SMS to the end user.
In this method,User will encode all the details like username,textmessage and other details(details specific to service provider) and send that to the output-stream of the POST-URL/API.In order to validate,we can read the response again from the POST-URL/API and check whether message is sent successfully or not.
Note:
For throwing any exception create an object of AceNoticeCode inside the class and throw the exception.
For eg: Following Code Snippet is used to throw an exception if POSTURL is null.
public final static AceNoticeCode SMS_MISSING_POST_URL
= new AceNoticeCode (Code, Message);
If (postUrl == null) {
throw new AdapterException (
SMS_MISSING_POST_URL, ErrorMessage);
}
Instructions for configuring SMS Service in the properties file:
1. Open arcotafm.properties present in <ARCOT_HOME>/conf/afm.
2. Under SMS Service Gateway Configuration present in arcotafm.properties, provide the following details for SMS Class:
sms.service.impl=com.arcot.integrations.frontend. MySMSService
3. Provide the configuration details related to your Service Provider:
For eg: sms.service.url=SMS_POST_URL
sms.service.api.id=SMS_APP_ID
Note: We can add and remove these parameters depending upon SMS Service Provider.
4. Restart the APP_SERVER.
Regards,
Ujwol