|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface APIConfig
Interface for internal API configuration implementations.
Implementation of this class hold the configuration for
the smppapi. The API configuration is loaded by the
APIConfigFactory class.
Implementations must supply a no-argument constructor so that APIConfigFactory can instantiate it.
Most applications can probably accept the default settings of the API. If, however, you're trying to eke maximum performance out of your application, tweaking these settings may help.
Supported API properties are:
| Property name | Type | Description |
|---|---|---|
smppapi.default_version |
String | Set the default version that will be used for new Connections |
smppapi.default_alphabet |
String | The class name of the default alphabet encoding to use. Must be an implementation of org.mobicents.smpp.util.AlphabetEncoding |
smppapi.lax_versions |
Boolean | Enable or disable interpreting interface_version values of 0x00 thru 0x32 (inclusive) as SMPP version 3.3. The specification is not entirely clear in its statement on whether this is allowed or not. |
smppapi.net.buffersize_in |
Integer | Sets the size of the buffer, in bytes, used on the incoming stream connection from the SMSC. |
smppapi.net.buffersize_out |
Integer | Sets the size of the buffer, in bytes, used on the outgoing stream connection to the SMSC. |
smppapi.net.autoflush |
Boolean | By default, the SmscLink class automatically
flushes the output stream after every packet written to the output stream. In
high-load environments, it may be better to turn this off and manually flush
the output stream only when required (after a short period of inactivity, for
example). |
smppapi.net.autoclose_snoop |
Boolean | If snoop streams are set on the SMSC link object and this value is true (the default), the snoop streams will be closed when the link is closed. If false, the snoop streams will be flushed and left open when the link is closed. |
smppapi.net.link_timeout |
Long | Sets the timeout in milliseconds for network links. This value affects
how long network reads should block for but its exact interpretation is
link-implementation specific. For TcpLink, this value represents
the SO_TIMEOUT setting on the TCP/IP socket. |
smppapi.connection.bind_timeout |
Long | The length of time, in milliseconds, to wait for a bind response packet after sending a bind request. If a packet is not received within this time period, the network connection is closed. A negative value or zero means wait indefinitely. |
smppapi.connection.rcv_daemon.ioex_count |
Integer | The number of I/O exceptions the receiver daemon will accept occurring before exiting. |
smppapi.event.dispatcher |
String | The name of a class, which implements
EventDispatcher, which will be used as the default
event dispatcher for Connection objects. |
smppapi.event.threaded_dispatcher.pool_size |
Integer | The size of the thread pool used by the
TaskExecutorEventDispatcher class. |
smppapi.message.segment_size |
Integer | The default segment size to use for concatenated short messages using optional parameters. |
APIConfigFactory,
PropertiesAPIConfig| Field Summary | |
|---|---|
static String |
BIND_TIMEOUT
|
static String |
DEFAULT_ALPHABET
|
static String |
DEFAULT_VERSION
|
static String |
EVENT_DISPATCHER_CLASS
|
static String |
EVENT_THREAD_POOL_SIZE
|
static String |
LAX_VERSIONS
|
static String |
LINK_AUTO_FLUSH
|
static String |
LINK_AUTOCLOSE_SNOOP
|
static String |
LINK_BUFFERSIZE_IN
|
static String |
LINK_BUFFERSIZE_OUT
|
static String |
LINK_TIMEOUT
|
static String |
SEGMENT_SIZE
|
static String |
TOO_MANY_IO_EXCEPTIONS
|
| Method Summary | ||
|---|---|---|
boolean |
getBoolean(String property)
Get a property as a boolean value. |
|
boolean |
getBoolean(String property,
boolean defaultValue)
Get a property as a boolean value. |
|
|
getClassInstance(String property,
Class<T> type)
Instantiate a new instance of a class whose class name is specified in property. |
|
|
getClassInstance(String property,
Class<T> type,
T defaultValue)
Instantiate a new instance of a class whose class name is specified in property, returning a default value if the property is not set. |
|
int |
getInt(String property)
Get the value for a property, parsed as a Java int. |
|
int |
getInt(String property,
int defaultValue)
Get the value for a property, parsed as a Java int. |
|
long |
getLong(String property)
Get the value for a property, parsed as a Java long. |
|
long |
getLong(String property,
long defaultValue)
Get the value for a property, parsed as a Java long. |
|
String |
getProperty(String property)
Get the value for a property. |
|
String |
getProperty(String property,
String defaultValue)
Get the value for a property or return a default value if it is not set. |
|
short |
getShort(String property)
Get the value for a property, parsed as a Java short. |
|
short |
getShort(String property,
short defaultValue)
Get the value of a property, parsed as a short. |
|
void |
initialise()
Initialise this properties instance. |
|
boolean |
isSet(String property)
Determine if a property is set in the configuration. |
|
boolean |
reloadAPIConfig()
Cause the API properties to be reloaded. |
|
| Field Detail |
|---|
static final String DEFAULT_VERSION
APIConfig,
Constant Field Valuesstatic final String DEFAULT_ALPHABET
APIConfig,
Constant Field Valuesstatic final String LAX_VERSIONS
APIConfig,
Constant Field Valuesstatic final String LINK_BUFFERSIZE_IN
APIConfig,
Constant Field Valuesstatic final String LINK_BUFFERSIZE_OUT
APIConfig,
Constant Field Valuesstatic final String LINK_AUTO_FLUSH
APIConfig,
Constant Field Valuesstatic final String LINK_AUTOCLOSE_SNOOP
APIConfig,
Constant Field Valuesstatic final String LINK_TIMEOUT
APIConfig,
Constant Field Valuesstatic final String TOO_MANY_IO_EXCEPTIONS
APIConfig,
Constant Field Valuesstatic final String EVENT_DISPATCHER_CLASS
APIConfig,
Constant Field Valuesstatic final String EVENT_THREAD_POOL_SIZE
APIConfig,
Constant Field Valuesstatic final String BIND_TIMEOUT
APIConfig,
Constant Field Valuesstatic final String SEGMENT_SIZE
APIConfig,
Constant Field Values| Method Detail |
|---|
void initialise()
APIConfigFactory
will call this method once after it has instantiated the
configuration implementation so that any implementation-specific
actions can be carried out.
boolean reloadAPIConfig()
false will be returned to the caller.
String getProperty(String property)
throws PropertyNotFoundException
property - The name of the property to retrieve.
property.
PropertyNotFoundException - if property is
not found in the configuration.
String getProperty(String property,
String defaultValue)
property - The name of the property to retrieve.defaultValue - The value to return if property is not
set.
property.
short getShort(String property,
short defaultValue)
throws InvalidConfigurationException
short. If the
property is not set, the default value is returned.
property - The name of the property to retrieve the value for.defaultValue - The default value to return if the property is
not set.
property.
InvalidConfigurationException - If the value cannot be parsed as
a short.
short getShort(String property)
throws InvalidConfigurationException,
PropertyNotFoundException
short.
property - the name of the property to retrive.
PropertyNotFoundException - if property is not
found in the configuration.
InvalidConfigurationException - if the value is not a valid short.
int getInt(String property,
int defaultValue)
throws InvalidConfigurationException
int. If
the property is not found, the default value is returned.
property - the name of the property to retrive.defaultValue - the value to return if the property does not exist.
InvalidConfigurationException - if the value is not a valid
integer.
int getInt(String property)
throws InvalidConfigurationException,
PropertyNotFoundException
int.
property - the name of the property to retrive.
PropertyNotFoundException - if
property is not found in the configuration.
InvalidConfigurationException - if the value is not a valid
integer.
long getLong(String property,
long defaultValue)
throws InvalidConfigurationException
long. If
the property is not found, the default value is returned.
property - the name of the property to retrieve.defaultValue - the value to return if the property does not exist.
InvalidConfigurationException - if the value is not a valid long.
long getLong(String property)
throws InvalidConfigurationException,
PropertyNotFoundException
long.
property - the name of the property to retrive.
PropertyNotFoundException - if property is not
found in the configuration.
InvalidConfigurationException - if the value is not a valid long.
boolean getBoolean(String property,
boolean defaultValue)
throws InvalidConfigurationException
true. Any of 'off',
'no' or 'false' will evaluate to false. Boolean
parameters may also be specified as a number, where zero will equate to
false while non-zero will equate to true.
All other words will result in an InvalidConfigurationException being
thrown.
property - the name of the property to look up.defaultValue - the value to return if the property does not exist.
InvalidConfigurationException - if the property has a
value that cannot be parsed or interpreted as boolean.
boolean getBoolean(String property)
throws InvalidConfigurationException,
PropertyNotFoundException
getBoolean(String, boolean) for details of how a boolean
value can be specified.
property - The name of the property to retrieve.
PropertyNotFoundException - if property is not
found in the configuration.
InvalidConfigurationException - if the property has a value
that cannot be parsed or interpreted as boolean.
<T> T getClassInstance(String property,
Class<T> type)
T - The expected type of the instantiated class.property - The name of a property whose value is the fully
qualified name of a class to instantiate.type - The expected type of the instantiated class. This may
specify a super-class or interface of the actually instantiated
class.
PropertyNotFoundException - If property is not
found in the configuration.
<T> T getClassInstance(String property,
Class<T> type,
T defaultValue)
T - The expected type of the instantiated class.property - The name of a property whose value is the fully
qualified name of a class to instantiate.type - The expected type of the instantiated class. This may
specify a super-class or interface of the actually instantiated
class.
boolean isSet(String property)
property - The name of the property to test.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||