|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectesmska.data.Gateways
public class Gateways
Class managing all gateways
| Nested Class Summary | |
|---|---|
static class |
Gateways.Events
|
| Method Summary | |
|---|---|
boolean |
add(Gateway gateway)
Add new gateway |
boolean |
addAll(java.util.Collection<Gateway> gateways)
Add new gateways |
void |
addValuedListener(ValuedListener<Gateways.Events,Gateway> valuedListener)
|
void |
clear()
Remove all gateways |
boolean |
contains(Gateway gateway)
Search for an existing gateway |
static java.lang.String |
convertDelayToHumanString(long delay,
boolean inMilliseconds)
Convert message delay to more human readable string delay. |
Gateway |
get(java.lang.String gatewayName)
Find gateway by name. |
java.util.SortedSet<Gateway> |
getAll()
Get unmodifiable collection of all gateways sorted by name |
java.util.HashSet<DeprecatedGateway> |
getDeprecatedGateways()
Get set of currently deprecated gateways |
java.util.TreeSet<Gateway> |
getFavorites()
Get gateways marked as favorites |
java.util.TreeSet<Gateway> |
getHidden()
Get gateways marked as hidden |
static Gateways |
getInstance()
Get shared instance |
java.util.TreeSet<Gateway> |
getVisible()
Get just the visible (non-hidden) gateways |
boolean |
isEmpty()
Return if there are no gateways |
static boolean |
isFakeGateway(java.lang.String gatewayName)
Returns whether the gateway is a fake one (used just for development purposes). |
static boolean |
isNumberPreferred(Gateway gateway,
java.lang.String number)
Returns whether gateway matches the number with its preferred prefixes. |
static boolean |
isNumberSupported(Gateway gateway,
java.lang.String number)
Returns whether gateway matches the number with its supported prefixes. |
static GatewayInfo |
parseInfo(java.net.URL script)
Parse GatewayInfo implementation from the provided URL. |
boolean |
remove(Gateway gateway)
Remove existing gateway |
boolean |
removeAll(java.util.Collection<Gateway> gateways)
Remove existing gateways |
void |
removeValuedListener(ValuedListener<Gateways.Events,Gateway> valuedListener)
|
void |
setDeprecatedGateways(java.util.Set<DeprecatedGateway> deprecatedGateways)
Set currently deprecated gateways. |
int |
size()
Return number of gateways |
Tuple<java.util.ArrayList<Gateway>,java.lang.Boolean> |
suggestGateway(java.lang.String number)
Guess gateway according to phone number or phone number prefix. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void addValuedListener(ValuedListener<Gateways.Events,Gateway> valuedListener)
public void removeValuedListener(ValuedListener<Gateways.Events,Gateway> valuedListener)
public static Gateways getInstance()
public java.util.SortedSet<Gateway> getAll()
public boolean add(Gateway gateway)
gateway - new gateway, not null
Collection.add(E)public boolean addAll(java.util.Collection<Gateway> gateways)
gateways - collection of gateways, not null, no null element
Collection.addAll(java.util.Collection extends E>)public boolean remove(Gateway gateway)
gateway - gateway to be removed, not null
Collection.remove(java.lang.Object)public boolean removeAll(java.util.Collection<Gateway> gateways)
gateways - collection of gateways to be removed, not null, no null element
Collection.removeAll(java.util.Collection>)public void clear()
public boolean contains(Gateway gateway)
gateway - gateway to be searched, not null
Collection.contains(java.lang.Object)public int size()
Collection.size()public boolean isEmpty()
Collection.isEmpty()public java.util.HashSet<DeprecatedGateway> getDeprecatedGateways()
public void setDeprecatedGateways(java.util.Set<DeprecatedGateway> deprecatedGateways)
public Gateway get(java.lang.String gatewayName)
gatewayName - Name of the gateway. Search is case sensitive. May be null.
public static boolean isFakeGateway(java.lang.String gatewayName)
public Tuple<java.util.ArrayList<Gateway>,java.lang.Boolean> suggestGateway(java.lang.String number)
number - phone number or its prefix. The minimum length is two characters,
for shorter input (or null) the method does nothing.
public static boolean isNumberSupported(Gateway gateway,
java.lang.String number)
gateway - gatewaynumber - phone number
public static boolean isNumberPreferred(Gateway gateway,
java.lang.String number)
gateway - gatewaynumber - phone number
public static java.lang.String convertDelayToHumanString(long delay,
boolean inMilliseconds)
delay - number of seconds (or milliseconds) of the delayinMilliseconds - if true,then delay is specified in
milliseconds, otherwise in seconds
public static GatewayInfo parseInfo(java.net.URL script)
throws java.io.IOException,
javax.script.ScriptException,
java.beans.IntrospectionException
script - URL (file or jar) of gateway script
java.io.IOException - when there is problem accessing the script file
javax.script.ScriptException - when the script is not valid
java.beans.IntrospectionException - when current JRE does not support JavaScript executionpublic java.util.TreeSet<Gateway> getFavorites()
public java.util.TreeSet<Gateway> getHidden()
public java.util.TreeSet<Gateway> getVisible()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||