org.jvoicexml.documentserver.schemestrategy
Class DocumentMap

java.lang.Object
  extended by org.jvoicexml.documentserver.schemestrategy.DocumentMap
All Implemented Interfaces:
MappedDocumentRepository

public final class DocumentMap
extends Object
implements MappedDocumentRepository

Implementation of the MappedDocumentRepository.

Version:
$Revision: 148 $

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

Author:
Dirk Schnelle

Method Summary
 void addDocument(URI uri, String document)
          Adds the given document to this repository.
 void addDocument(URI uri, VoiceXmlDocument document)
          Adds the given document to this repository.
 String getDocument(URI uri)
          Gets the document with the given URI.
static DocumentMap getInstance()
          Gets the singleton.
 URI getUri(String ssp)
          Gets an URI that can be evaluated by this scheme strategy for the given ssp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DocumentMap getInstance()
Gets the singleton.

Returns:
The only mapped document repository.

getUri

public URI getUri(String ssp)
Gets an URI that can be evaluated by this scheme strategy for the given ssp.

Specified by:
getUri in interface MappedDocumentRepository
Parameters:
ssp - Scheme specific part
Returns:
Valid URI for this strategy, null in case of an error.

addDocument

public void addDocument(URI uri,
                        String document)
Adds the given document to this repository.

Specified by:
addDocument in interface MappedDocumentRepository
Parameters:
uri - URI as a key for later retrieval.
document - Document to be added.

addDocument

public void addDocument(URI uri,
                        VoiceXmlDocument document)
Adds the given document to this repository.

Specified by:
addDocument in interface MappedDocumentRepository
Parameters:
uri - URI as a key for later retrieval.
document - Document to be added.

getDocument

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

Parameters:
uri - URI of the document.
Returns:
Document with the given URI, null if there is no such document or in case of an error.
Throws:
BadFetchError - There is no such document.


Copyright © 2005-2007 JVoiceXML group.