Experts in SMS and MMS Technology. NCLs Provato is an SMS/MMS Gateway supporting  WAP Push, EMS, MMS, SMS, Nokia Smart Messaging, SMPP, CIMD, UCP, MM7, M20, TC35 NCL Technologies Ltd
Provato - SMS MMS Gateway
Mobile Messaging in J2EE & .NET

SwiftNote - Java SMS Toolkit

ie.ncl.msg
Class Factory

java.lang.Object
  extended by ie.ncl.msg.Factory

public class Factory
extends java.lang.Object

This object is used to load an underlying messaging connection, configure it and instantiate it.

Configuration can be changed at run time without the need to re-write software for different Connection/Sender/Receiver implemenations.

To load and instantiate a connection object, the set of connection properties are specified by the configurationName in the file ie/ncl/msg/Factory.properties file.

The name of each property in propertiesshould be of the form

configurationName.propertyName

This allows multiple configurations to be set in the same properties object such as:-

configurationName1.propertyNameA=...
configurationName1.propertyNameB=...
configurationName2.propertyNameA=...
configurationName2.propertyNameB=...

The actual property names and values are implementation specific but one property that must always be configured is:

configurationName1.class=[full classpath of Connection/Sender/Receiver implementation class]


For a list of implementations of Connection/Sender/Receiver see the Java documentation (top of page of each) or SwiftNote toolkit user manual.

See Also:
Connection, Sender, Receiver

Method Summary
static Connection getConnection(java.lang.String configurationName)
          Load and instantiate a connection object as specified by the configurationName.
static Connection getConnection(java.lang.String configurationName, java.util.Properties properties)
          Load and instantiate a connection object as specified by the configurationName and the properties.
static java.lang.String getPropertiesFile()
          Get the properties file name.
static Receiver getReceiver(java.lang.String configurationName)
          Get a receiver as specified by the configurationName.
static Receiver getReceiver(java.lang.String configurationName, java.util.Properties props)
          Get a receiver as specified by the configurationName.
static Sender getSender(java.lang.String configurationName)
          Get a sender as specified by the configurationName.
static Sender getSender(java.lang.String configurationName, java.util.Properties props)
          Get a sender as specified by the configurationName.
static void setPropertiesFile(java.lang.String dottedFileName)
          Set the properties file name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConnection

public static Connection getConnection(java.lang.String configurationName,
                                       java.util.Properties properties)
                                throws ConnectionException
Load and instantiate a connection object as specified by the configurationName and the properties.

Throws:
ConnectionException
See Also:
Connection, Sender, Receiver

setPropertiesFile

public static void setPropertiesFile(java.lang.String dottedFileName)
Set the properties file name. This should be in dotted class notation and in the class path. The '.properties' is automatically appended to the filename. By default the properties file is 'ie.ncl.msg.Factory', located in 'ie/ncl/msg/Factory.properties'.


getPropertiesFile

public static java.lang.String getPropertiesFile()
Get the properties file name. This should be in dotted class notation and in the class path. The '.properties' is automatically appended to the filename.

See Also:
setPropertiesFile(java.lang.String)

getConnection

public static Connection getConnection(java.lang.String configurationName)
                                throws ConnectionException
Load and instantiate a connection object as specified by the configurationName.

The property are loaded from the properties file - ie.ncl.msg.Factory.properties by default.

The format of this file should be:

configurationName1.propertyNameA=value...
configurationName1.propertyNameB=value...
configurationName1.propertyNameC=value...
configurationName1.propertyNameD=value...
...
configurationName2.propertyNameX=value...
configurationName2.propertyNameY=value...
...

The property names and values are implementation specific but one property that must always be configured is:

configurationName.class=[full classpath of Connection/Sender/Receiver implementation class]


For example configurationName.class=ie.ncl.sms.smpp.SmppConnection. For a list of implementations of Connection/Sender/Receiver see the Java documentation (top of page of each) or SwiftNote toolkit user manual.

Throws:
ConnectionException
See Also:
Connection, Sender, Receiver

getSender

public static Sender getSender(java.lang.String configurationName)
                        throws ConnectionException
Get a sender as specified by the configurationName. A Sender is solely used to transmit messages. See getConnection for more details on configuration.

Throws:
ConnectionException
See Also:
getConnection(String), Sender

getSender

public static Sender getSender(java.lang.String configurationName,
                               java.util.Properties props)
                        throws ConnectionException
Get a sender as specified by the configurationName. A Sender is solely used to transmit messages. See getConnection for more details on configuration.

Throws:
ConnectionException
See Also:
getConnection(String,java.util.Properties), Sender

getReceiver

public static Receiver getReceiver(java.lang.String configurationName)
                            throws ConnectionException
Get a receiver as specified by the configurationName. A Receiver is solely used to receive messages. See getConnection for more details on configuration.

Throws:
ConnectionException
See Also:
getConnection(String), Receiver

getReceiver

public static Receiver getReceiver(java.lang.String configurationName,
                                   java.util.Properties props)
                            throws ConnectionException
Get a receiver as specified by the configurationName. A Receiver is solely used to receive messages. See getConnection for more details on configuration.

Throws:
ConnectionException
See Also:
getConnection(String,java.util.Properties), Receiver

Experts in SMS and MMS Technology. NCLs Provato is an SMS/MMS Gateway supporting  WAP Push, EMS, MMS, SMS, Nokia Smart Messaging, SMPP, CIMD, UCP, MM7, M20, TC35 NCL Technologies Ltd
Provato - SMS MMS Gateway
Mobile Messaging in J2EE & .NET

SwiftNote - Java SMS Toolkit