org.marre.sms.transport
Interface SmsTransport

All Known Implementing Classes:
ClickatellTransport, GsmTransport, PsWinXmlTransport, UcpTransport

public interface SmsTransport

Interface for an SMS transport. This interface is used to transfer an smsj message to the sms server.

Version:
$Id: SmsTransport.java,v 1.12 2005/11/26 16:31:59 c95men Exp $
Author:
Markus Eriksson

Method Summary
 void connect()
          Connects to the SMS server.
 void disconnect()
          Disconnects from the SMS server.
 void init(java.util.Properties props)
          Initializes the transport.
 void ping()
          Pings the SMS sender.
 java.lang.String send(SmsMessage msg, SmsAddress dest, SmsAddress sender)
          Sends an SmsMessage to the given destination.
 

Method Detail

init

public void init(java.util.Properties props)
          throws SmsException
Initializes the transport. Please see each transport for information on what properties that are available.

Parameters:
props - Properties used to configure this transport.
Throws:
SmsException - If there was a problem with the configuration.

connect

public void connect()
             throws SmsException,
                    java.io.IOException
Connects to the SMS server.

Throws:
SmsException - Indicates a sms related problem.
java.io.IOException - Inidicates a failure to communicate with the SMS server.

ping

public void ping()
          throws SmsException,
                 java.io.IOException
Pings the SMS sender. Should be used to keep the connection alive.

Throws:
SmsException - Indicates a sms related problem.
java.io.IOException - Inidicates a failure to communicate with the SMS server.

send

public java.lang.String send(SmsMessage msg,
                             SmsAddress dest,
                             SmsAddress sender)
                      throws SmsException,
                             java.io.IOException
Sends an SmsMessage to the given destination. This method returns a local identifier for the message. This messageid can then be used to query the status, cancel or replace the sent SMS. The format of the identifier is specific to the SmsTransport implementation. The SmsTransport implementation may decide how long the message id is valid. Depending on the implementation this method is blocking or non-blocking. It is possible that the returned identifier is null. This indicates that the actual transport doesn't handle message ids.

Parameters:
msg - The Message to send
dest - Destination address
sender - Sender address
Returns:
a local identifier for the message.
Throws:
SmsException - Indicates a sms related problem.
java.io.IOException - Inidicates a failure to communicate with the SMS server.

disconnect

public void disconnect()
                throws SmsException,
                       java.io.IOException
Disconnects from the SMS server.

Throws:
SmsException - Indicates a sms related problem.
java.io.IOException - Inidicates a failure to communicate with the SMS server.


Copyright © 2002-2005 Markus Eriksson. All Rights Reserved.