org.smslib.routing
Class Router
java.lang.Object
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
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Router
public Router()
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
(c) 2002-2011, http://smslib.org