org.pfsw.tools.cda.darc.client
Class RemoteControlService

java.lang.Object
  extended by org.pfsw.tools.cda.darc.client.RemoteControlService

public class RemoteControlService
extends java.lang.Object

This is the API to remotely control a Class Dependency Analyzer.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
RemoteControlService(DARCConnection conn)
          Initialize the new instance with default values.
 
Method Summary
 IParameterMap analyzeDependencies()
          Analyzes the dependencies on the currently selected element (if possible).
 IParameterMap analyzeDependencies(java.lang.String displayLevel, java.lang.String dependencyLevel, java.lang.String sortOrder, java.lang.String sortFiled)
          Analyzes the dependencies on the currently selected element (if possible).
 void close()
          Close the underlying connection.
 IParameterMap closeWorkset(java.lang.String worksetName)
          Close the workset with the given name.
 IParameterMap exportToFile(java.lang.String filename, java.lang.String filetype)
          Calls a command to export the current element to the given filename utilizing an exporter identified by the fileType.
 IParameterMap getElementInfo()
          Queries the remote CDA for all information attributes about the currently selected model object.
 ModelElementIdentifier getSelectedElement()
          Queries the remote CDA for the currently selected model object.
 IParameterMap loadWorksetFromFile(java.lang.String filename)
          Select the workset with the given name.
 IParameterMap selectElement(ModelElementIdentifier identifier)
          Select the model element specified by the given identifier.
 IParameterMap selectWorkset(java.lang.String worksetName)
          Select the workset with the given name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteControlService

public RemoteControlService(DARCConnection conn)
Initialize the new instance with default values.

Method Detail

loadWorksetFromFile

public IParameterMap loadWorksetFromFile(java.lang.String filename)
Select the workset with the given name. That is, make it the current object in the remote application.

Parameters:
filename - The relative or absolute filename or a CDA workset file (".ws").
Throws:
java.lang.IllegalArgumentException - if the given filename is null or blank.

closeWorkset

public IParameterMap closeWorkset(java.lang.String worksetName)
Close the workset with the given name.

Parameters:
worksetName - The case-sensitive name of the workset to close.
Throws:
java.lang.IllegalArgumentException - if the given workset name is null or blank.

exportToFile

public IParameterMap exportToFile(java.lang.String filename,
                                  java.lang.String filetype)
Calls a command to export the current element to the given filename utilizing an exporter identified by the fileType. Normally the fileType used is "XML/ODEM".

Parameters:
filename - The name of the file to which to export the data.
filetype - The type of the output file. Identifies the exporter to use.
Throws:
java.lang.IllegalArgumentException - if any of the parameters is null or blank.

selectWorkset

public IParameterMap selectWorkset(java.lang.String worksetName)
Select the workset with the given name. That is, make it the current object in the remote application.

Parameters:
worksetName - The full name (no pattern) of the workset to select.
Throws:
java.lang.IllegalArgumentException - if the given worksetName is null or blank.

selectElement

public IParameterMap selectElement(ModelElementIdentifier identifier)
Select the model element specified by the given identifier. That is, make it the current object in the remote application.

Parameters:
identifier - The identifier of the element to select.
Throws:
java.lang.IllegalArgumentException - if the given worksetName is null.

getSelectedElement

public ModelElementIdentifier getSelectedElement()
Queries the remote CDA for the currently selected model object.


getElementInfo

public IParameterMap getElementInfo()
Queries the remote CDA for all information attributes about the currently selected model object. The attributes in the result depend on the element that is currently selected.
The easiest way to identify the element is to do the following on the result:

new ModelElementIdentifier( result )

and then use the isXXX() methods on the ModelElementIdentifier instance.


analyzeDependencies

public IParameterMap analyzeDependencies(java.lang.String displayLevel,
                                         java.lang.String dependencyLevel,
                                         java.lang.String sortOrder,
                                         java.lang.String sortFiled)
Analyzes the dependencies on the currently selected element (if possible). If successful the result map contains an entry INames.XML_DATA which contains the table of dependencies using HTML table tags.

Parameters:
displayLevel - Defines on which aggregation level to display the result table. This parameter must be one of the following constants:
dependencyLevel - This defines the level of dependency the result must contain. It must be one of the constants:
sortOrder - Defines how the result table must be sorted. This parameter must be one of the following constants:
sortFiled - Defines on which field the result table must be sorted. This parameter must be one of the following constants:

analyzeDependencies

public IParameterMap analyzeDependencies()
Analyzes the dependencies on the currently selected element (if possible). If successful the result map contains an entry INames.XML_DATA which contains the table of dependencies using HTML table tags.

This is a convenience method that simple uses the defaults:


close

public void close()
Close the underlying connection.