org.marre.sms.transport.ucp
Class UcpTransport

java.lang.Object
  extended byorg.marre.sms.transport.ucp.UcpTransport
All Implemented Interfaces:
SmsTransport

public class UcpTransport
extends java.lang.Object
implements SmsTransport

An SmsTransport that sends the SMS through an UCP SMSC

Version:
$Id: UcpTransport.java,v 1.16 2005/11/26 16:37:14 c95men Exp $
Author:
Markus Eriksson

Constructor Summary
UcpTransport()
           
 
Method Summary
 byte[] buildLogin(java.lang.String userid, java.lang.String pwd)
          Building the Login Stream
 byte[] buildSubmit(SmsPdu pdu, boolean moreToSend, SmsAddress dest, SmsAddress sender)
           
 void connect()
          Connects to the SMS server.
 void disconnect()
          Closing Socket and Streams
 void init(java.util.Properties props)
          Initializes the class with the properties specified
 void ping()
          Pings the SMS sender.
 java.lang.String send(SmsMessage msg, SmsAddress theDest, SmsAddress sender)
          Sends an SmsMessage to the given destination.
 java.lang.String sendUcp(byte[] data)
          This method is sending the Data to over the existing Connection and recives the answer, the Answer is returned as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UcpTransport

public UcpTransport()
Method Detail

init

public void init(java.util.Properties props)
          throws SmsException
Initializes the class with the properties specified

Specified by:
init in interface SmsTransport
Parameters:
props - smsj.ucp.ip.host : the ip address or dns name of the UCP server
smsj.ucp.ip.port : the ip port of the UCP server
smsj.ucp.ucp60.uid : the UCP60 user id
smsj.ucp.ucp60.password : the UCP60 password
Throws:
SmsException

connect

public void connect()
             throws SmsException,
                    java.io.IOException
Description copied from interface: SmsTransport
Connects to the SMS server.

Specified by:
connect in interface SmsTransport
Throws:
java.io.IOException - Inidicates a failure to communicate with the SMS server.
SmsException - Indicates a sms related problem.

send

public java.lang.String send(SmsMessage msg,
                             SmsAddress theDest,
                             SmsAddress sender)
                      throws SmsException,
                             java.io.IOException
Description copied from interface: SmsTransport
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.

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

buildLogin

public byte[] buildLogin(java.lang.String userid,
                         java.lang.String pwd)
                  throws SmsException
Building the Login Stream

Parameters:
userid -
pwd -
Throws:
SmsException

buildSubmit

public byte[] buildSubmit(SmsPdu pdu,
                          boolean moreToSend,
                          SmsAddress dest,
                          SmsAddress sender)
                   throws SmsException
Throws:
SmsException

ping

public void ping()
          throws SmsException
Description copied from interface: SmsTransport
Pings the SMS sender. Should be used to keep the connection alive.

Specified by:
ping in interface SmsTransport
Throws:
SmsException - Indicates a sms related problem.

disconnect

public void disconnect()
                throws SmsException,
                       java.io.IOException
Closing Socket and Streams

Specified by:
disconnect in interface SmsTransport
Throws:
SmsException
java.io.IOException - Inidicates a failure to communicate with the SMS server.

sendUcp

public java.lang.String sendUcp(byte[] data)
                         throws SmsException,
                                java.io.IOException
This method is sending the Data to over the existing Connection and recives the answer, the Answer is returned as a String.

Parameters:
data -
Throws:
SmsException
java.io.IOException


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