SMSLib 3.5.3

org.smslib.routing
Class Router

java.lang.Object
  extended by org.smslib.routing.Router

public class Router
extends java.lang.Object

Base message routing class. Service owns instance of Router (or its subclass), and uses its member functions to designate gateway(s) to send particular outgoing message. It is allowed that router designates more than modem to send message. It is responsibility of Router to decide which gateway will send the message. Custom routing rules are possible by creating subclass.

Author:
Tomek Cejner

Constructor Summary
Router()
           
 
Method Summary
 void customRouting(OutboundMessage msg)
          Place for custom routing performed by specialized subclass.
 java.util.Collection<AGateway> route(OutboundMessage msg, java.util.Collection<AGateway> gateways)
          Heart of routing & load balancing mechanism
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Router

public Router()
Method Detail

route

public java.util.Collection<AGateway> route(OutboundMessage msg,
                                            java.util.Collection<AGateway> gateways)
Heart of routing & load balancing mechanism

Parameters:
msg -

customRouting

public void customRouting(OutboundMessage msg)
Place for custom routing performed by specialized subclass. A "positive" approach is taken. Method has to copy references to gateways from candidates list to allowed. So, default behavior is to copy all references. Another possibility is to take "negative" approach, where method should delete unwanted gateways from list. This approach was found difficult to use at this time.

Parameters:
msg - Message to be routed

SMSLib 3.5.3

(c) 2002-2011, http://smslib.org