@Extensible @BrokerExtension @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class TelephonyMessagingProvider extends java.lang.Object implements UnboundIDExtension, Configurable, ExampleUsageProvider
In order to configure a Telephony Messaging Provider created using this API, use a command like:
dsconfig create-telephony-messaging-provider \
---provider-name "{name}" \
--type third-party \
--set "extension-class:{class-name}" \
--set "extension-argument:{name=value}"
where "{name}" is the name to use for the Telephony Messaging Provider
instance, "{class-name}" is the fully-qualified name of the Java class
that extends
com.unboundid.directory.sdk.ds.api.TelephonyMessagingProvider,
and "{name=value}" represents name-value pairs for any arguments to
provide to the Telephony Messaging Provider. If multiple arguments should be
provided to the extension, then the
"--set extension-argument:{name=value}" option should be
provided multiple times.| Constructor and Description |
|---|
TelephonyMessagingProvider()
Creates a new instance of this Telephony Messaging Provider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
Updates the provided argument parser to define any configuration arguments
which may be used by this extension.
|
void |
finalizeProvider()
This hook is called when the Telephony Messaging Provider is disabled or
the server shuts down.
|
java.util.Map<java.util.List<java.lang.String>,java.lang.String> |
getExamplesArgumentSets()
Retrieves a map containing examples of configurations that may be used for
this extension.
|
abstract java.lang.String[] |
getExtensionDescription()
Retrieves a human-readable description for this extension.
|
abstract java.lang.String |
getExtensionName()
Retrieves a human-readable name for this extension.
|
void |
initializeProvider(BrokerContext serverContext,
TelephonyMessagingProviderConfig config,
com.unboundid.util.args.ArgumentParser parser)
Initializes this Telephony Messaging Provider.
|
abstract boolean |
isMessageSpoken()
Indicates whether messages are spoken over a voice call.
|
abstract void |
sendMessage(java.lang.String recipientNumber,
java.lang.String message,
java.lang.String language)
Delivers a message to the specified recipient.
|
void |
sendMessage(java.lang.String recipientNumber,
java.lang.String message,
java.lang.String language,
java.lang.String verificationCodeToken,
java.lang.String verificationCode)
Delivers a message to the specified recipient, after substituting a
verification code into the message in a form that may be easily understood
by the recipient.
|
public TelephonyMessagingProvider()
initializeProvider(com.unboundid.directory.sdk.broker.types.BrokerContext, com.unboundid.directory.sdk.ds.config.TelephonyMessagingProviderConfig, com.unboundid.util.args.ArgumentParser) method.public abstract java.lang.String getExtensionName()
getExtensionName in interface UnboundIDExtensionpublic abstract java.lang.String[] getExtensionDescription()
getExtensionDescription in interface UnboundIDExtensionnull
or an empty array if no description should be available.public java.util.Map<java.util.List<java.lang.String>,java.lang.String> getExamplesArgumentSets()
getExamplesArgumentSets in interface ExampleUsageProvidernull or empty if there should
not be any example argument sets.public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser) throws com.unboundid.util.args.ArgumentException
defineConfigArguments in interface Configurableparser - The argument parser to be updated with the configuration
arguments which may be used by this extension.com.unboundid.util.args.ArgumentException - If a problem is encountered while updating the
provided argument parser.public void initializeProvider(BrokerContext serverContext, TelephonyMessagingProviderConfig config, com.unboundid.util.args.ArgumentParser parser) throws java.lang.Exception
BrokerContext in a class member so that it can be used elsewhere
in the implementation.
The default implementation is empty.
serverContext - A handle to the server context for the server in
which this extension is running. Extensions should
typically store this in a class member.config - The general configuration for this object.parser - The argument parser which has been initialized from
the configuration for this Telephony Messaging
Provider.java.lang.Exception - If a problem occurs while initializing this store
adapter.public void finalizeProvider()
The default implementation is empty.
public abstract boolean isMessageSpoken()
true if messages are spoken over a voice call.public abstract void sendMessage(java.lang.String recipientNumber, java.lang.String message, java.lang.String language) throws com.unboundid.ldap.sdk.LDAPException
recipientNumber - The phone number to which the message should
be sent. This must not be null.message - The message to be sent. This must not be
null.language - The language and locale code for the message
(e.g. "en-US").com.unboundid.ldap.sdk.LDAPException - If a problem was encountered while sending the
message.public void sendMessage(java.lang.String recipientNumber, java.lang.String message, java.lang.String language, java.lang.String verificationCodeToken, java.lang.String verificationCode) throws com.unboundid.ldap.sdk.LDAPException
isMessageSpoken method returns
true. This should cause the verification code to be spoken slowly,
one character at a time.recipientNumber - The phone number to which the message should
be sent. This must not be null.message - The message to be sent. This must not be
null.language - The language and locale code for the message
(e.g. "en-US").verificationCodeToken - A token to be replaced with a representation
of the provided verification code, wherever
the token appears in the message.verificationCode - The verification code to be inserted in
place of the token.com.unboundid.ldap.sdk.LDAPException - If a problem was encountered while sending the
message.