ucot.core
Interface ControlInterface

All Superinterfaces:
ModulePropertyInterface
All Known Implementing Classes:
Core

public interface ControlInterface
extends ModulePropertyInterface

This interface controls the basics of the UCOT-program (starting, parsing, shutting down etc). UCOT core implements this interface and it is designed in a way that the user interface using the core can control the execution of the program effectively.

Author:
vevijopi, tujupien

Field Summary
static java.lang.String PROPERTY_CURRENT_HEURISTIC
           
static java.lang.String PROPERTY_CURRENT_PARSER
           
 
Method Summary
 void addToAnalyzeModel(java.util.Vector<UseCase> useCases)
          Requests core to parse given use cases, perform heuristic on them and add then them to current analyze model.
 void addToAnalyzeModel(java.util.Vector<UseCase> useCases, ParserInterface parser, HeuristicInterface heuristic)
          Requests core to parse use cases, perform heuristic on them and add them to current analyze model.
 void clearAnalyzeModel()
          Clears the whole current analyze model.
 AnalyzeModel getAnalyzeModel()
          Method for getting a pointer to the current analyze model being handled in the core.
 HeuristicInterface getCurrentHeuristic()
          Returns the current heuristic.
 ParserInterface getCurrentParser()
          Returns the current default parser.
 java.util.Vector<HeuristicInterface> getHeuristics()
          Returns a vector containing all the heuristics currently available to the UCOT core.
 InputCollection getInputs()
          Returns all the input adapters currently available to UCOT core.
 java.util.Vector<OutputInterface> getOutputs()
          Returns a vector containing all the output adapters currently available to the UCOT core.
 java.util.Vector<ParserInterface> getParsers()
          Returns a vector containing all the parsers currently available to the UCOT core.
 java.lang.String getRootDir()
          Returns the UCOT root directory.
 UseCaseCollection getUseCaseCollection()
          Returns all currently loaded use cases in a UseCaseCollection.
 void loadAnalyzeModel(java.net.URL url)
          Loads serialized analyze model from the given file.
 void loadUseCases(java.net.URL url)
          Loads use cases from the given file.
 void output(java.net.URL url, OutputInterface output, AnalyzeModel analyzeModel)
          Exports given analyze model to given URL using given output adapter.
 void reloadUseCases(java.net.URL url)
          Reloads use cases from file.
 void saveAnalyzeModel(java.net.URL url)
          Saves the current analyze model to a java serialization file which location is pointed by the given URL.
 void setCurrentHeuristic(HeuristicInterface heuristic)
          Sets the default heuristic to used in analyzation progresses.
 void setCurrentParser(ParserInterface parser)
          Sets the default parser to be used in parsing progresses.
 void shutdown()
          Shuts down the program.
 
Methods inherited from interface ucot.ModulePropertyInterface
applyProperties, getProperties, loadDefaultProperties, loadProperties, saveProperties, setProperties
 

Field Detail

PROPERTY_CURRENT_PARSER

static final java.lang.String PROPERTY_CURRENT_PARSER
See Also:
Constant Field Values

PROPERTY_CURRENT_HEURISTIC

static final java.lang.String PROPERTY_CURRENT_HEURISTIC
See Also:
Constant Field Values
Method Detail

shutdown

void shutdown()

Shuts down the program. The shutdown routine triggers all possible autosave actions and after that the core gets rid of all its modules and prepares itself for getting automatically junkbusted.


getRootDir

java.lang.String getRootDir()

Returns the UCOT root directory. That is either the system directory where the class files are stored under a hierarchical directory structure based on the package definitions or the system directory where the UCOT JAR distribution package is stored. The result depends solely on the fact which distribution is currently used.

Returns:
The path to the UCOT root directory as a String.

clearAnalyzeModel

void clearAnalyzeModel()

Clears the whole current analyze model. Basically this is similiar to creating a whole new empty analyze model. Notice that the old analyze model is not saved anywhere and the restoration of the old model is impossible without manually backing up the old analyze model before using this function.


loadUseCases

void loadUseCases(java.net.URL url)

Loads use cases from the given file.

Parameters:
url - URL to the use case file.

reloadUseCases

void reloadUseCases(java.net.URL url)

Reloads use cases from file. First core should remove all use cases that are loaded from the given url, and then it should (re)read the use cases from the given file.

Parameters:
url - URL of the file to be reloaded.

loadAnalyzeModel

void loadAnalyzeModel(java.net.URL url)
                      throws java.io.IOException

Loads serialized analyze model from the given file.

Parameters:
url - URL to the file containing a serialized analyze model.
Throws:
java.io.IOException - If something goes wrong while loading the analyze model from given URL.

saveAnalyzeModel

void saveAnalyzeModel(java.net.URL url)

Saves the current analyze model to a java serialization file which location is pointed by the given URL.

Parameters:
url - URL to the file where the current analyze model should be serialized and saved.

getUseCaseCollection

UseCaseCollection getUseCaseCollection()

Returns all currently loaded use cases in a UseCaseCollection.

Returns:
UseCaseColletion containing all currently loaded use cases.

addToAnalyzeModel

void addToAnalyzeModel(java.util.Vector<UseCase> useCases)

Requests core to parse given use cases, perform heuristic on them and add then them to current analyze model.

Default parser and heuristic are used for this operation.

Parameters:
useCases - Use cases to work magic on.

addToAnalyzeModel

void addToAnalyzeModel(java.util.Vector<UseCase> useCases,
                       ParserInterface parser,
                       HeuristicInterface heuristic)

Requests core to parse use cases, perform heuristic on them and add them to current analyze model.

If either the given parser or heuristic is unknown to the UCOT core, then nothing is done.

Parameters:
useCases - Use cases to work magic on.
parser - Parser to use.
heuristic - Heuristic to use.

getAnalyzeModel

AnalyzeModel getAnalyzeModel()

Method for getting a pointer to the current analyze model being handled in the core.

Notice that all editing to the analyze model should be done through the AnalyzeModelEditor which can be easily acquired with the getEditor() method from the AnalyzeModel itself.

Returns:
Current analyze model.

getParsers

java.util.Vector<ParserInterface> getParsers()

Returns a vector containing all the parsers currently available to the UCOT core.

Returns:
Vector containing all known parser adapters as ParserInterfaces.

getHeuristics

java.util.Vector<HeuristicInterface> getHeuristics()

Returns a vector containing all the heuristics currently available to the UCOT core.

Returns:
Vector containing all known heuristic adapters as HeuristicInterfaces.

getOutputs

java.util.Vector<OutputInterface> getOutputs()

Returns a vector containing all the output adapters currently available to the UCOT core.

Returns:
Vector containing all known output adapters as OutputInterfaces.

getInputs

InputCollection getInputs()

Returns all the input adapters currently available to UCOT core.

Returns:
InputCollection which contains all known input adapters as InputInterface.

setCurrentParser

void setCurrentParser(ParserInterface parser)

Sets the default parser to be used in parsing progresses.

Parameters:
parser - Parser to be used by default.

setCurrentHeuristic

void setCurrentHeuristic(HeuristicInterface heuristic)

Sets the default heuristic to used in analyzation progresses.

Parameters:
heuristic - Default heuristic to be used by default.

getCurrentParser

ParserInterface getCurrentParser()

Returns the current default parser.

Returns:
Default parser as a ParserInterface.

getCurrentHeuristic

HeuristicInterface getCurrentHeuristic()

Returns the current heuristic.

Returns:
Current heuristic as a HeuristicInterface.

output

void output(java.net.URL url,
            OutputInterface output,
            AnalyzeModel analyzeModel)
            throws java.lang.Exception

Exports given analyze model to given URL using given output adapter.

Parameters:
url - Destination URL.
output - OutputInterface of the output adapter to be used.
analyzeModel - Analyze model to export.
Throws:
If - something goes wrong with the output operation, then an exception is thrown.
java.lang.Exception