public final class HttpSchemeStrategy extends java.lang.Object implements SchemeStrategy
SchemeStrategy to read VoiceXML document via the HTTP protocol.
This implementation uses the proxy settings that are delivered via the
environment variables http.proxyHost and
http.proxyPort.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HTTP_SCHEME_NAME
Scheme for which this scheme strategy is responsible.
|
protected static SessionStorage<org.apache.http.impl.client.HttpClientBuilder> |
SESSION_STORAGE
the storage of session identifiers.
|
| Constructor and Description |
|---|
HttpSchemeStrategy()
Construct a new object.
|
| Modifier and Type | Method and Description |
|---|---|
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 |
setFetchTimeout(int timeout)
Sets the default fetch timeout.
|
void |
setScheme(java.lang.String value)
Sets the scheme for this strategy.
|
public static final java.lang.String HTTP_SCHEME_NAME
protected static SessionStorage<org.apache.http.impl.client.HttpClientBuilder> SESSION_STORAGE
public void setScheme(java.lang.String value)
value - the new schemepublic java.lang.String getScheme()
getScheme in interface SchemeStrategypublic void setFetchTimeout(int timeout)
timeout - the default fetch timeout.public 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
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 typepublic void sessionClosed(java.lang.String sessionId)
sessionClosed in interface SchemeStrategysessionId - the Id of the current JVoiceXML session.