org.jvoicexml.documentserver.schemestrategy.builtin
Class BuiltinSchemeStrategy

java.lang.Object
  extended by org.jvoicexml.documentserver.schemestrategy.builtin.BuiltinSchemeStrategy
All Implemented Interfaces:
SchemeStrategy

public final class BuiltinSchemeStrategy
extends Object
implements SchemeStrategy

Schemestrategy for builtin grammars.

This class provides basic support for built grammars as specified at ModeType and type and parameters as specified in addGrammarCreator(GrammarCreator) or setGrammarCreators(Collection).

Since:
0.7.1
Version:
$Revision: 2830 $
Author:
Dirk Schnelle-Walka

Field Summary
static String SCHEME_NAME
          Scheme for which this scheme strategy is responsible.
 
Constructor Summary
BuiltinSchemeStrategy()
          Constructs a new object.
 
Method Summary
 void addGrammarCreator(org.jvoicexml.documentserver.schemestrategy.builtin.GrammarCreator creator)
          Adds the specified grammar creator to the list of known grammar creators.
 InputStream getInputStream(String sessionId, URI uri, RequestMethod method, long timeout, Map<String,Object> parameters)
          Opens the external URI and returns an InputStream to the referenced object.
 String getScheme()
          Get the scheme that is handled by this strategy.
 void sessionClosed(String sessionId)
          Notification that the given session is closed.
 void setGrammarCreators(Collection<org.jvoicexml.documentserver.schemestrategy.builtin.GrammarCreator> col)
          Adds the specified grammar creators to the list of known grammar creators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEME_NAME

public static final String SCHEME_NAME
Scheme for which this scheme strategy is responsible.

See Also:
Constant Field Values
Constructor Detail

BuiltinSchemeStrategy

public BuiltinSchemeStrategy()
Constructs a new object.

Method Detail

setGrammarCreators

public void setGrammarCreators(Collection<org.jvoicexml.documentserver.schemestrategy.builtin.GrammarCreator> col)
Adds the specified grammar creators to the list of known grammar creators.

Parameters:
col - the creators to add
Since:
0.7.5

addGrammarCreator

public void addGrammarCreator(org.jvoicexml.documentserver.schemestrategy.builtin.GrammarCreator creator)
Adds the specified grammar creator to the list of known grammar creators.

Parameters:
creator - the creator to add
Since:
0.7.5

getInputStream

public InputStream getInputStream(String sessionId,
                                  URI uri,
                                  RequestMethod method,
                                  long timeout,
                                  Map<String,Object> parameters)
                           throws BadFetchError,
                                  UnsupportedElementError,
                                  IOException
Opens the external URI and returns an InputStream to the referenced object.

Specified by:
getInputStream in interface SchemeStrategy
Parameters:
sessionId - the Id of the current JVoiceXML session.
uri - the URI of the object to open.
method - type of the request method
timeout - fetch timeout in msec to wait for the content to be returned before throwing an error.badfetch event.
parameters - request parameters
Returns:
InputStream to the referenced object.
Throws:
BadFetchError - error opening the document or unsupported method type
UnsupportedElementError - the requested element is not supported
IOException - error creating the input stream

getScheme

public String getScheme()
Get the scheme that is handled by this strategy.

Specified by:
getScheme in interface SchemeStrategy
Returns:
Scheme that is handled by this strategy.

sessionClosed

public void sessionClosed(String sessionId)
Notification that the given session is closed. Now the strategy may free any resources related to the given session, e.g. a session with a web server.

Specified by:
sessionClosed in interface SchemeStrategy
Parameters:
sessionId - the Id of the current JVoiceXML session.


Copyright © 2005-2010JVoiceXML group.