gov.llnl.babel.repository

Class WebRepository

Implemented Interfaces:
Repository, SymbolResolver, SymbolWriter

public class WebRepository
extends java.lang.Object
implements Repository

The WebRepository class implements an interface to the Alexandria web repository for sidl symbols in XML. The URI in the class constructor points to the Alexandria database and must use either the HTTP or HTTPS (if supported by the JVM) protocols. The username and password of the account must be passed as arguments in the URI as follows: https://www.machine.org?username=USERNAME&password=PASSWORD.

Constructor Summary

WebRepository(String repository, Context context)
The constructor takes a web repository URI with the username and password specified as arguments.

Method Summary

Symbol
lookupSymbol(String fqn)
Look up a symbol based on the fully qualified name and retrieve the most recent version that matches the symbol name.
Symbol
lookupSymbol(SymbolID id)
Look up the symbol based on the fully qualified name and version in the web repository.
void
writeSymbols(Set symbol_names)
Write the symbols in the Set from the symbol table to the web repository.

Constructor Details

WebRepository

public WebRepository(String repository,
                     Context context)
            throws RepositoryException
The constructor takes a web repository URI with the username and password specified as arguments.

Method Details

lookupSymbol

public Symbol lookupSymbol(String fqn)
Look up a symbol based on the fully qualified name and retrieve the most recent version that matches the symbol name. If the symbol name is not found or the XML file is invalid, then null is returned.
Specified by:
lookupSymbol in interface SymbolResolver

lookupSymbol

public Symbol lookupSymbol(SymbolID id)
Look up the symbol based on the fully qualified name and version in the web repository. If the symbol name is not found, the versions do not match, or there is a problem with the XML format, then null is returned.
Specified by:
lookupSymbol in interface SymbolResolver

writeSymbols

public void writeSymbols(Set symbol_names)
            throws RepositoryException
Write the symbols in the Set from the symbol table to the web repository. Each set entry is a SymbolID of the symbol to be written.
Specified by:
writeSymbols in interface SymbolWriter