public class Gateway extends java.lang.Object implements GatewayInfo, java.lang.Comparable<Gateway>
Modifier and Type | Class and Description |
---|---|
static class |
Gateway.Feature
This enum attributes indicate which various features are supported by a given gateway.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UNKNOWN |
Constructor and Description |
---|
Gateway(java.net.URL script)
Creates new Gateway.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Gateway o) |
boolean |
equals(java.lang.Object obj) |
GatewayConfig |
getConfig() |
int |
getDelayBetweenMessages()
The delay in seconds that must be kept between sending messages.
|
java.lang.String |
getDescription()
Short description of the website (purpose, restrictions, etc).
|
java.lang.String[] |
getFeatures()
The list of all supported features by this gateway.
|
javax.swing.Icon |
getIcon()
Gateway logo icon.
|
java.lang.String |
getMaintainer()
Maintainer of the script.
|
int |
getMaxChars()
Maximum message length the gateway allows to send.
|
int |
getMaxParts()
Number of allowed messages which user can send at once.
|
java.lang.String |
getMinProgramVersion()
Minimal program version required to run this script.
|
java.lang.String |
getName()
Gateway name.
|
java.lang.String[] |
getPreferredPrefixes()
List of telephone prefixes that are preferred by this gateway.
|
java.net.URL |
getScript()
URL of gateway script (file or jar URL).
|
java.lang.String |
getSenderNameSuffix()
Get sender name signature suffix that should be appended to the message
before it is sent.
|
int |
getSignatureExtraLength()
Number of extra characters used to display signature.
|
int |
getSMSLength()
Length of one SMS.
|
java.lang.String[] |
getSupportedLanguages()
Indicates for which website languages the script is working.
|
java.lang.String[] |
getSupportedPrefixes()
List of telephone prefixes that are supported by this gateway.
|
java.lang.String |
getVersion()
Version of the script.
|
java.lang.String |
getWebsite()
The URL of the webpage of this gateway.
|
boolean |
hasFeature(Gateway.Feature feature)
Decide whether this particular gateway supports given feature.
|
int |
hashCode() |
boolean |
isFavorite()
Return whether this gateway has been marked as user favorite
|
boolean |
isHidden()
Return whether this gateway has been marked as hidden from the user interface
|
void |
setConfig(GatewayConfig config) |
void |
setFavorite(boolean favorite)
Set this gateway as user favorite
|
void |
setHidden(boolean hidden)
Set this gateway as hidden from user interface
|
java.lang.String |
toString() |
public Gateway(java.net.URL script) throws java.io.IOException, javax.script.ScriptException, java.security.PrivilegedActionException, java.beans.IntrospectionException
script
- system resource containing gateway scriptjava.io.IOException
- When there are problem accessing the script filejavax.script.ScriptException
- When gateway script is invalidjava.security.PrivilegedActionException
- When gateway script is invalidjava.beans.IntrospectionException
- When current JRE does not support JavaScript executionjava.lang.IllegalArgumentException
- When gateway name is not validpublic java.net.URL getScript()
public javax.swing.Icon getIcon()
public boolean isFavorite()
public void setFavorite(boolean favorite)
public boolean isHidden()
public void setHidden(boolean hidden)
public boolean hasFeature(Gateway.Feature feature)
public GatewayConfig getConfig()
public void setConfig(GatewayConfig config)
public java.lang.String getSenderNameSuffix()
public int compareTo(Gateway o)
compareTo
in interface java.lang.Comparable<Gateway>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
GatewayInfo
getName
in interface GatewayInfo
public java.lang.String getVersion()
GatewayInfo
getVersion
in interface GatewayInfo
public java.lang.String getMaintainer()
GatewayInfo
getMaintainer
in interface GatewayInfo
public java.lang.String getMinProgramVersion()
GatewayInfo
getMinProgramVersion
in interface GatewayInfo
public java.lang.String getWebsite()
GatewayInfo
getWebsite
in interface GatewayInfo
public java.lang.String getDescription()
GatewayInfo
getDescription
in interface GatewayInfo
public java.lang.String[] getSupportedPrefixes()
GatewayInfo
getSupportedPrefixes
in interface GatewayInfo
public java.lang.String[] getPreferredPrefixes()
GatewayInfo
GatewayInfo.getSupportedPrefixes()
) then this will be an empty
array.getPreferredPrefixes
in interface GatewayInfo
public int getSMSLength()
GatewayInfo
getSMSLength
in interface GatewayInfo
public int getMaxParts()
GatewayInfo
getMaxParts
in interface GatewayInfo
public int getMaxChars()
GatewayInfo
getMaxChars
in interface GatewayInfo
public int getSignatureExtraLength()
GatewayInfo
getSignatureExtraLength
in interface GatewayInfo
public int getDelayBetweenMessages()
GatewayInfo
getDelayBetweenMessages
in interface GatewayInfo
public java.lang.String[] getSupportedLanguages()
GatewayInfo
getSupportedLanguages
in interface GatewayInfo
public java.lang.String[] getFeatures()
GatewayInfo
Gateway.Feature
attributes.getFeatures
in interface GatewayInfo