public interface DocumentServer
Usually these requests serve to obtain resources like VoiceXML documents, grammar documents and audio files from a repository.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TEXT_PLAIN
Constant for the object type
text/plain to retrieve. |
static java.lang.String |
TEXT_XML
Constant for the object type
text/xml to retrieve. |
| Modifier and Type | Method and Description |
|---|---|
java.net.URI |
addGrammarDocument(java.lang.String sessionId,
GrammarDocument document)
Adds the given grammar document to the documents store and retrieves the
URI to access it.
|
javax.sound.sampled.AudioInputStream |
getAudioInputStream(java.lang.String sessionId,
java.net.URI uri)
Retrieves an
AudioStream to the audio file with the given
URI. |
org.jvoicexml.xml.vxml.VoiceXmlDocument |
getDocument(java.lang.String sessionId,
DocumentDescriptor descriptor)
Gets the document with the given URI.
|
GrammarDocument |
getGrammarDocument(java.lang.String sessionId,
java.net.URI uri,
FetchAttributes attributes)
Returns the external Grammar referenced by
URI. |
java.lang.Object |
getObject(java.lang.String sessionId,
DocumentDescriptor descriptor,
java.lang.String type)
Retrieves an object of the given type from the given URI.
|
java.net.URI |
resolveBuiltinUri(java.net.URI uri)
Resolves the given URI ofg a builtin grammar to an URI that can be
handled by this document server.
|
void |
sessionClosed(java.lang.String sessionId)
Notification that the given session is closed.
|
void |
start()
Starts this document server.
|
void |
stop()
Stops this document server.
|
java.net.URI |
storeAudio(javax.sound.sampled.AudioInputStream in)
Stores the audio from the given stream.
|
static final java.lang.String TEXT_PLAIN
text/plain to retrieve.static final java.lang.String TEXT_XML
text/xml to retrieve.void start()
throws java.lang.Exception
java.lang.Exception - error starting the document server.org.jvoicexml.xml.vxml.VoiceXmlDocument getDocument(java.lang.String sessionId,
DocumentDescriptor descriptor)
throws BadFetchError
sessionId - the Id of the current JVoiceXML sessiondescriptor - descriptor for the document to fetch.BadFetchError - The URI does not reference a document or an error occurred
retrieving the document.java.net.URI resolveBuiltinUri(java.net.URI uri)
uri - the builtin URIjava.net.URI addGrammarDocument(java.lang.String sessionId,
GrammarDocument document)
throws java.net.URISyntaxException
sessionId - the id of the initiating sessiondocument - the document to addjava.net.URISyntaxException - error generating the URI for the documentGrammarDocument getGrammarDocument(java.lang.String sessionId, java.net.URI uri, FetchAttributes attributes) throws BadFetchError
URI.
If more than one grammar is available at the given URI, the grammar with the optional type is preferred. If preferredType is null, the ContentServer does not have to care about the preferredType.
sessionId - the Id of the current JVoiceXML sessionuri - Where to find the grammar.attributes - attributes governing the fetch.BadFetchError - The URI does not reference a document or an error occurred
retrieving the document.javax.sound.sampled.AudioInputStream getAudioInputStream(java.lang.String sessionId,
java.net.URI uri)
throws BadFetchError
AudioStream to the audio file with the given
URI.sessionId - the Id of the current JVoiceXML sessionuri - URI of the audio file.AudioInputStream for the audio file.BadFetchError - Error retrieving the audio file.java.lang.Object getObject(java.lang.String sessionId,
DocumentDescriptor descriptor,
java.lang.String type)
throws BadFetchError
sessionId - the Id of the current JVoiceXML sessiondescriptor - descriptor for the document to fetch.type - the type, e.g. text/plain.BadFetchError - Error retrieving the object.java.net.URI storeAudio(javax.sound.sampled.AudioInputStream in)
throws BadFetchError
in - stream to read the audio data fromBadFetchError - Error writing.void sessionClosed(java.lang.String sessionId)
sessionId - the Id of the current JVoiceXML session.void stop()