verinec.adaptation.repository
Interface ITranslationRepository

All Known Implementing Classes:
XSLFileRepository

public interface ITranslationRepository

Interface for access to XSL translation repository.

Each translation consists of a pair of XSLT files. The translator does the actual translation from the configuration definition to the actual configuration file.
The restrictor generates restriction warnings from a configuration definition, that is tells what will be lost when using the translator. Even if the translator will be able to translate everything to the configuration, the restrictor document has to be present. It may produce an empty result in this case.

This interface allows to use any back end to store the XSL stylesheets we need for generating the actual configuration for a specific system.
(XSL translators could be stored in File System, CVS, XML-Database etc.).
The repository is expected to cache the parsed XSL translators for performance reasons.

The creation of repositories is not coverd by this interface. Use the TranslationRepFactory to instantiate XSL repositories.

Version:
$Revision:367 $
Author:
david.buchmann at unifr.ch

Method Summary
 XSLTransformer getRestrictor(String service, String name)
          Get a restriction analyzer.
 String[] getServiceNames()
          Get the names of all defined services.
 XSLTransformer getTranslator(String service, String name)
          Get a translator.
 String[] getTranslatorNames(String service)
          Get all available translators for this service
 

Method Detail

getServiceNames

String[] getServiceNames()
                         throws VerinecException
Get the names of all defined services.

Note that the children of hardware (ethernet, wlan, serial) are treated as a service here.

Returns:
Array of Strings with the names of all existing services
Throws:
VerinecException - if an error prevents the repository from retreiving the available services.

getTranslatorNames

String[] getTranslatorNames(String service)
                            throws VerinecException
Get all available translators for this service

Parameters:
service - Name of the service to retreive translators for
Returns:
Array of Strings with names of all translators for this service
Throws:
VerinecException - if an error prevents the repository from retreiving the available translators.

getTranslator

XSLTransformer getTranslator(String service,
                             String name)
                             throws VerinecException
Get a translator.

The translator transforms a abstract xml configuration into concrete configuration for a target system.

Parameters:
service - Name of the service the desired translator should be for
name - Type of target system for the translation
Returns:
The Jdom XSLTransformer for the requested service.
Throws:
VerinecException - If there is no translator

getRestrictor

XSLTransformer getRestrictor(String service,
                             String name)
                             throws VerinecException
Get a restriction analyzer.

Restriction analyzers are XSLT documents. They produce warnings about what would get lost if a configuration is translated using their corresponding translator.

Parameters:
service - Name of the service this translator is for
name - Name of translation restriction to retreive
Returns:
The Jdom object of the requested xslt document.
Throws:
VerinecException - If there is no translator

Copyright © 2005 Verinec, DIUF