org.jvoicexml.documentserver.schemestrategy
Class FileSchemeStrategy

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

public final class FileSchemeStrategy
extends Object
implements SchemeStrategy

SchemeStrategy to read VoiceXML document from the file system. The files are retrieved by their URI which has to be hierarchical.

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

Field Summary
static String SCHEME_NAME
          Scheme for which this scheme strategy is responsible.
 
Constructor Summary
FileSchemeStrategy()
          Construct a new object.
 
Method Summary
 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.
 
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

FileSchemeStrategy

public FileSchemeStrategy()
Construct a new object.

Method Detail

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.

getInputStream

public InputStream getInputStream(String sessionId,
                                  URI uri,
                                  RequestMethod method,
                                  long timeout,
                                  Map<String,Object> parameters)
                           throws BadFetchError
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

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.