public class DocumentStorage
extends java.lang.Object
| Constructor and Description |
|---|
DocumentStorage()
Creates a new object.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.URI |
addGrammarDocument(java.lang.String sessionId,
GrammarDocument document)
Adds the given grammar document to the documents store and retrieves the
URI to access it from external.
|
void |
clear(java.lang.String sessionId)
Clears all documents associated with the given session.
|
GrammarDocument |
getDocument(java.net.URI uri)
Retrieves the content of the document.
|
java.net.URI |
resolveBuiltinUri(java.net.URI uri)
Resolves the given URI of a builtin grammar to an URI that can be handled
by this document server.
|
void |
setGrammarCreators(java.util.Collection<GrammarCreator> col)
Adds the specified grammar creators to the list of known grammar
creators.
|
void |
setStoragePort(int port)
Sets the storage port.
|
void |
start()
Starts the document storage.
|
void |
stop()
Stops the storage.
|
public void setStoragePort(int port)
port - port number for the integrated web serverpublic void setGrammarCreators(java.util.Collection<GrammarCreator> col)
col - the creators to addpublic void start()
throws java.lang.Exception
java.lang.Exception - error starting the web serverpublic java.net.URI resolveBuiltinUri(java.net.URI uri)
uri - the builtin URIpublic java.net.URI addGrammarDocument(java.lang.String sessionId,
GrammarDocument document)
throws java.net.URISyntaxException
sessionId - the id of the initiating sessiondocument - the document to addjava.net.URISyntaxException - if the URI could not be createdpublic GrammarDocument getDocument(java.net.URI uri) throws java.net.URISyntaxException
uri - URI of the document to retrieve, null if there is no
such documentjava.net.URISyntaxException - if the URI does not feature a valid pathpublic void clear(java.lang.String sessionId)
throws java.net.URISyntaxException
sessionId - the id of the sessionjava.net.URISyntaxException - if the URI does not feature a valid pathpublic void stop()
throws java.lang.Exception
java.lang.Exception - error closing the storage