|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.java4less.sms.ucp.SmsSender
This is a high level class for sending SMSs. Example of use:
// create object TcpIpAdapter tcp=new TcpIpAdapter(); tcp.connect(ServerAddress,port); // send the sms now using the tcp/ip adapter SmsSender sender=new SmsSender(tcp); sender.createSMS51("123","456","Hello"); if (!sender.sendMessage()) { System.out.println("Error is "+ ((ResponseMessage) sender.getCurrentResponse()).errorDescription); } else System.out.println("SMS was sent successfully"); tcp.disconnect();
Constructor Summary | |
SmsSender(Adapter adapter)
|
Method Summary | |
void |
createSMS01(java.lang.String from,
java.lang.String destination,
java.lang.String message)
create submit message using operation 01 |
void |
createSMS30(java.lang.String from,
java.lang.String destination,
java.lang.String message)
create submit message using operation 30 |
void |
createSMS51(java.lang.String from,
java.lang.String destination,
java.lang.String message)
create submit message using operation 51 |
void |
createSMS60(java.lang.String from,
java.lang.String password)
create open session message |
UcpMessage |
getCurrentMessage()
get message we have created |
UcpMessage |
getCurrentResponse()
get response message we have received |
boolean |
sendMessage()
send created message, returns true if it was successfull and false if there was a negative response from the server. |
boolean |
sendMessage(UcpMessage currentMessage)
send message, returns true if it was successfull and false if there was a negative response from the server. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SmsSender(Adapter adapter)
Method Detail |
public UcpMessage getCurrentMessage()
public UcpMessage getCurrentResponse()
public void createSMS30(java.lang.String from, java.lang.String destination, java.lang.String message) throws SmsException
SmsException
public void createSMS01(java.lang.String from, java.lang.String destination, java.lang.String message) throws SmsException
SmsException
public void createSMS51(java.lang.String from, java.lang.String destination, java.lang.String message) throws SmsException
SmsException
public void createSMS60(java.lang.String from, java.lang.String password) throws SmsException
SmsException
public boolean sendMessage() throws java.lang.Exception
java.lang.Exception
public boolean sendMessage(UcpMessage currentMessage) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |