public final class BuiltinSchemeStrategy extends java.lang.Object implements SchemeStrategy
This class provides basic support for built grammars as specified at http://www.w3.org/TR/voicexml20#dmlABuiltins.
The URI can be platform dependent. This implementation expects the URIs to be of the following form
builtin:<mode>/<type>[?parameters]where mode is a lower-case presentation of
ModeType and type and parameters as
specified in
http://www.w3.org/TR/voicexml20#dmlABuiltins.
Custom grammar types can be added by
addGrammarCreator(GrammarCreator) or
setGrammarCreators(Collection).
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SCHEME_NAME
Scheme for which this scheme strategy is responsible.
|
| Constructor and Description |
|---|
BuiltinSchemeStrategy()
Constructs a new object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGrammarCreator(GrammarCreator creator)
Adds the specified grammar creator to the list of known grammar creators.
|
java.io.InputStream |
getInputStream(java.lang.String sessionId,
java.net.URI uri,
org.jvoicexml.xml.vxml.RequestMethod method,
long timeout,
java.util.Collection<KeyValuePair> parameters)
Opens the external URI and returns an
InputStream to the
referenced object. |
java.lang.String |
getScheme()
Get the scheme that is handled by this strategy.
|
void |
sessionClosed(java.lang.String sessionId)
Notification that the given session is closed.
|
void |
setGrammarCreators(java.util.Collection<GrammarCreator> col)
Adds the specified grammar creators to the list of known grammar
creators.
|
public static final java.lang.String SCHEME_NAME
public void setGrammarCreators(java.util.Collection<GrammarCreator> col)
col - the creators to addpublic void addGrammarCreator(GrammarCreator creator)
creator - the creator to addpublic java.io.InputStream getInputStream(java.lang.String sessionId,
java.net.URI uri,
org.jvoicexml.xml.vxml.RequestMethod method,
long timeout,
java.util.Collection<KeyValuePair> parameters)
throws BadFetchError,
UnsupportedElementError,
java.io.IOException
InputStream to the
referenced object.getInputStream in interface SchemeStrategysessionId - the Id of the current JVoiceXML session.uri - the URI of the object to open.method - type of the request methodtimeout - fetch timeout in msec to wait for the content to be returned
before throwing an error.badfetch event.parameters - request parametersInputStream to the referenced object.BadFetchError - error opening the document or unsupported method typeUnsupportedElementError - the requested element is not supportedjava.io.IOException - error creating the input streampublic java.lang.String getScheme()
getScheme in interface SchemeStrategypublic void sessionClosed(java.lang.String sessionId)
sessionClosed in interface SchemeStrategysessionId - the Id of the current JVoiceXML session.