org.jvoicexml.documentserver
Class JVoiceXmlDocumentServer

java.lang.Object
  extended by org.jvoicexml.documentserver.JVoiceXmlDocumentServer
All Implemented Interfaces:
DocumentServer

public final class JVoiceXmlDocumentServer
extends Object
implements DocumentServer

Basic implementation of a DocumentServer.

Version:
$Revision: 222 $
Author:
Dirk Schnelle
See Also:

Copyright © 2005-2006 JVoiceXML group - http://jvoicexml.sourceforge.net/


Field Summary
 
Fields inherited from interface org.jvoicexml.DocumentServer
CONFIG_KEY
 
Constructor Summary
JVoiceXmlDocumentServer()
          Creates a new object.
 
Method Summary
 void addSchemeStrategy(SchemeStrategy strategy)
          Adds the given scheme strategy.
 AudioInputStream getAudioInputStream(URI uri)
          Retrieves an AudioStream to the audio file with the given URI.
 VoiceXmlDocument getDocument(URI uri)
          Gets the document with the given URI.
 GrammarDocument getGrammarDocument(URI uri)
          Returns the external Grammar referenced by URI.
 void setSchemeStrategies(List<SchemeStrategy> schemeStrategies)
          Adds the given list of strategies for schemes to the supported schemes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVoiceXmlDocumentServer

public JVoiceXmlDocumentServer()
Creates a new object.

This method should not be called by any application. Use JVoiceXml.getDocumentServer() to obtain a reference to the document server.

Method Detail

setSchemeStrategies

public void setSchemeStrategies(List<SchemeStrategy> schemeStrategies)
Adds the given list of strategies for schemes to the supported schemes.

Parameters:
schemeStrategies - List with strategies.
Since:
0.5

getDocument

public VoiceXmlDocument getDocument(URI uri)
                             throws BadFetchError
Gets the document with the given URI.

Specified by:
getDocument in interface DocumentServer
Parameters:
uri - URI of the document.
Returns:
VoiceXML document with the given URI.
Throws:
BadFetchError - The URI does not reference a document or an error occurred retrieving the document.

addSchemeStrategy

public void addSchemeStrategy(SchemeStrategy strategy)
Adds the given scheme strategy.

Parameters:
strategy - Scheme strategy to be added.

getGrammarDocument

public GrammarDocument getGrammarDocument(URI uri)
                                   throws BadFetchError
Returns the external Grammar referenced by 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.

Specified by:
getGrammarDocument in interface DocumentServer
Parameters:
uri - Where to find the grammar.
Returns:
ExternalGrammar the grammar referenced by the URI.
Throws:
BadFetchError - The URI does not reference a document or an error occurred retrieving the document.

getAudioInputStream

public AudioInputStream getAudioInputStream(URI uri)
                                     throws BadFetchError
Retrieves an AudioStream to the audio file with the given URI.

Specified by:
getAudioInputStream in interface DocumentServer
Parameters:
uri - URI of the audio file.
Returns:
AudioInputStream for the audio file.
Throws:
BadFetchError - Error retrieving the audio file.


Copyright © 2005-2007 JVoiceXML group.