i had not done it before but i knew it is possible.
The application is a web based application hosted by a third party hosting company.
The sms notification to registering clients must
1. send sms notification to clients on successful registration informing them of date of start of service
2. auto send sms reminders to clients some days before start of service
3. auto send sms reminders to clients some days before end/expiry of service
4. send custom sms notification to selected clients
Presentation/Logic:
JSF 2.1
Primefaces 4.0
DAO, Javabeans
Container:
Apache Tomcat 7.0 (production).
Weblogic (development).
Database:
MySQL (production)
Oracle (development)
SMS Gateway:
Clickatell SMS gateway transport
Third party:
Quartz job scheduler (attached to the web servlet listener and register reminder)
Quartz 2.2.1
IDE
Jdeveloper
Netbeans
Code snippets
/*****
*Manage bean exposes the sendsms to client
****/
private final void SendSMS() {
try {
Date d = new Date();
d.setTime(pet.getCurrent_date_of_enrolment().getTime() + globalsettings().getIncubation_period() * 60 * 60 * 24 * 1000);
AlertInfoDetailEntity alertinfo = new AlertInfoDetailEntity();
alertinfo = aldsr.AlertInfoDetail("Registration");
SMSGatewayEntity smsgateway = new SMSGatewayEntity();
smsgateway = smdsr.SMSGateway();
SMSender SendSMS = new SMSender(smsgateway.getSms_gateway_username(), smsgateway.getSms_gateway_password(),
smsgateway.getSms_gateway_apiid(), smsgateway.getSms_gateway_name());
SendSMS.SendSMSText_NoSSL(alertinfo.getAlert_message().replaceAll("<client_name>",
pee.getFirstname() + " " +
pee.getSurname()).replaceAll("<enrolment_uid>",
pee.getEnrolment_uid()).replaceAll("<start_date>",
new SimpleDateFormat("dd/MMM/yyyy").format(d)), "234" + pee.getPhone_number().replaceAll("-", "").trim(), "CHIEASY");
addMessageInfo("SMS Notification Sent Successfully.");
} catch (SmsException cfe) {
addMessageError("Error Sending SMS..." + cfe.getMessage().replaceAll("Clickatell", "SMS Gateway"));
logger.log(logger.getLevel().SEVERE, cfe.getMessage());
cfe.printStackTrace();
} catch (IOException cfe) {
addMessageError("Error Sending SMS..." + cfe.getMessage());
logger.log(logger.getLevel().SEVERE, cfe.getMessage());
} catch (ConfigurationException cfe) {
addMessageError("Error Sending SMS..." + cfe.getMessage());
logger.log(logger.getLevel().SEVERE, cfe.getMessage());
}
}
Thanks for posting this.
ReplyDeleteCan you share SendSMS.SendSMSText_NoSSL(...)?
Thanks for sharing
ReplyDeleteMsgclub have two types of sms api Java; XML and JSON for sending SMS in bulk to your prospects from our gateway.
bulk SMS API