|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.documentserver.JVoiceXmlDocumentServer
public final class JVoiceXmlDocumentServer
Basic implementation of a DocumentServer.
This implementation offers an extensible support for multiple schemes. All
known handlers for schemes are held in a list of SchemeStrategys.
| Field Summary |
|---|
| Fields inherited from interface org.jvoicexml.DocumentServer |
|---|
TEXT_PLAIN, TEXT_XML |
| Constructor Summary | |
|---|---|
JVoiceXmlDocumentServer()
Creates a new object. |
|
| Method Summary | |
|---|---|
void |
addSchemeStrategy(SchemeStrategy strategy)
Adds the given scheme strategy. |
AudioInputStream |
getAudioInputStream(String sessionId,
URI uri)
Retrieves an AudioStream to the audio file with the given
URI. |
VoiceXmlDocument |
getDocument(String sessionId,
DocumentDescriptor descriptor)
Gets the document with the given URI. |
GrammarDocument |
getGrammarDocument(String sessionId,
URI uri,
FetchAttributes attrs)
Returns the external Grammar referenced by URI. |
Object |
getObject(String sessionId,
DocumentDescriptor descriptor,
String type)
Retrieves an object of the given type from the given URI. |
void |
sessionClosed(String sessionId)
Notification that the given session is closed. |
void |
setFetchAttributes(FetchAttributes attrs)
Sets the default fetch attributes. |
void |
setSchemeStrategies(List<SchemeStrategy> schemeStrategies)
Adds the given list of strategies for schemes to the supported schemes. |
URI |
storeAudio(AudioInputStream in)
Stores the audio from the given stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JVoiceXmlDocumentServer()
This method should not be called by any application. Use
JVoiceXml.getDocumentServer() to obtain a reference to the
document server.
| Method Detail |
|---|
public void setSchemeStrategies(List<SchemeStrategy> schemeStrategies)
schemeStrategies - List with strategies.public void setFetchAttributes(FetchAttributes attrs)
attrs - default fetch attributes.
public VoiceXmlDocument getDocument(String sessionId,
DocumentDescriptor descriptor)
throws BadFetchError
getDocument in interface DocumentServersessionId - 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.public void addSchemeStrategy(SchemeStrategy strategy)
strategy - Scheme strategy to be added.
public GrammarDocument getGrammarDocument(String sessionId,
URI uri,
FetchAttributes attrs)
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.
getGrammarDocument in interface DocumentServersessionId - the Id of the current JVoiceXML sessionuri - Where to find the grammar.attrs - attributes governing the fetch.
BadFetchError - The URI does not reference a document or an error occurred
retrieving the document.
public AudioInputStream getAudioInputStream(String sessionId,
URI uri)
throws BadFetchError
AudioStream to the audio file with the given
URI.
getAudioInputStream in interface DocumentServersessionId - the Id of the current JVoiceXML sessionuri - URI of the audio file.
AudioInputStream for the audio file.
BadFetchError - Error retrieving the audio file.
public Object getObject(String sessionId,
DocumentDescriptor descriptor,
String type)
throws BadFetchError
text/plain and text/xml are
supported.
getObject in interface DocumentServersessionId - 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.
public URI storeAudio(AudioInputStream in)
throws BadFetchError
storeAudio in interface DocumentServerin - stream to read the audio data from
BadFetchError - Error writing.public void sessionClosed(String sessionId)
sessionClosed in interface DocumentServersessionId - the Id of the current JVoiceXML session.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||