com.cosylab.vdct.plugins
Class LinkTypeConfig

java.lang.Object
  extended by com.cosylab.vdct.plugins.LinkTypeConfig
All Implemented Interfaces:
LinkTypeConfigPlugin, Plugin

public class LinkTypeConfig
extends java.lang.Object
implements LinkTypeConfigPlugin

A default LinkTypeConfig plugin. It reads link type configuration from an XML file. The file name is defined by VDCT_LINK_CONFIG_FILE filename located in user home directory (or in VDCT_CONFIG_DIR dir). Use VDCT_LINK_CONFIG_FILE_ENV environment variable to override this default setting. An example of XML file:

Author:
Matej Sekoranja

Field Summary
static java.lang.String VDCT_LINK_CONFIG_FILE
           
static java.lang.String VDCT_LINK_CONFIG_FILE_ENV
           
 
Constructor Summary
LinkTypeConfig()
           
 
Method Summary
 void destroy()
          Insert the method's description here.
 java.lang.String getAuthor()
          Insert the method's description here.
 java.lang.String getDescription()
          Insert the method's description here.
 java.util.Hashtable getLinkTypeConfig()
          This method should return a table of different link type configurations.
 java.lang.String getName()
          Insert the method's description here.
 java.lang.String getVersion()
          Insert the method's description here.
 void init(java.util.Properties properties, PluginContext context)
          Insert the method's description here.
 void start()
          Insert the method's description here.
 void stop()
          Insert the method's description here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VDCT_LINK_CONFIG_FILE

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

VDCT_LINK_CONFIG_FILE_ENV

public static final java.lang.String VDCT_LINK_CONFIG_FILE_ENV
See Also:
Constant Field Values
Constructor Detail

LinkTypeConfig

public LinkTypeConfig()
Method Detail

getLinkTypeConfig

public java.util.Hashtable getLinkTypeConfig()
Description copied from interface: LinkTypeConfigPlugin
This method should return a table of different link type configurations. Each element of the list should have a key identifiying the link type (e.g. VME_IO) and have the value of type Object[3], where array consists of { java.util.regex.Pattern, java.lang.String, java.lang.String }. The array represents { link validation schema, default schema, description }. An example of default implementation:
 
        Hashtable linkTypeConfigTable = new Hashtable();
 
        linkTypeConfigTable.put("CONSTANT", new Object[] { Pattern.compile(".*"), "", "CONSTANT" });
        linkTypeConfigTable.put("PV_LINK", new Object[] { Pattern.compile(".*"), "", "PV_LINK" } );
        linkTypeConfigTable.put("VME_IO", new Object[] { Pattern.compile("#C\\d+ S\\d+ @.*"), "#C0 S0 @", "VME_IO - #Ccard Ssignal @parm" });
        linkTypeConfigTable.put("CAMAC_IO", new Object[] { Pattern.compile("#B\\d+ C\\d+ N\\d+ A\\d+ F\\d+ @.*"), "CAMAC_IO - #B0 C0 N0 A0 F0 @", "#Bbranch Ccrate Nstation Asubaddress Ffunction @parm" });
        linkTypeConfigTable.put("AB_IO", new Object[] { Pattern.compile("#L\\d+ A\\d+ C\\d+ S\\d+ @.*"), "#L0 A0 C0 S0 @", "AB_IO - #Llink Aadapter Ccard Ssignal @parm" });
        linkTypeConfigTable.put("GPIB_IO", new Object[] { Pattern.compile("#L\\d+ A\\d+ @.*"), "#L0 A0 @", "GPIB_IO - #Llink Aaddr @parm" });
        linkTypeConfigTable.put("BITBUS_IO", new Object[] { Pattern.compile("#L\\d+ N\\d+ P\\d+ S\\d+ @.*"), "BITBUS_IO - @L0 N0 P0 S0 @", "#Llink Nnode Pport Ssignal @parm" });
        linkTypeConfigTable.put("INST_IO", new Object[] { Pattern.compile("@.*"), "@", "INST_IO - @" });
        linkTypeConfigTable.put("RF_IO", new Object[] { Pattern.compile("#R\\d+ M\\d+ D\\d+ E\\d+ @.*"), "#R0 M0 D0 E0 @", "RF_IO - #Rcryo Mmicro Ddataset Eelement" });
        linkTypeConfigTable.put("VXI_IO", new Object[] { Pattern.compile("#V\\d+ (C\\d+)?+  S\\d+ @.*"), "#V0 C0 S0 @", "VXI_IO - #Vframe Cslot Ssignal @parm" });
 
If null is returned, VisualDCT interprets this as 'failed to load' / 'no configuration found'. If all LinkTypeConfigPlugin plugins return null, VisualDCT loads default configuration. Plugins are loaded as defined in VisualDCT plugin configuration. Configurations are additive, i.e. if there are two configurations for the same link type, the last overrides the first. Creation date: (8.12.2001 12:45:31)

Specified by:
getLinkTypeConfig in interface LinkTypeConfigPlugin
Returns:
java.util.ArrayList
See Also:
LinkTypeConfigPlugin.getLinkTypeConfig()

destroy

public void destroy()
Description copied from interface: Plugin
Insert the method's description here. Creation date: (6.12.2001 22:04:45)

Specified by:
destroy in interface Plugin
See Also:
Plugin.destroy()

getAuthor

public java.lang.String getAuthor()
Description copied from interface: Plugin
Insert the method's description here. Creation date: (6.12.2001 22:10:35)

Specified by:
getAuthor in interface Plugin
Returns:
java.lang.String
See Also:
Plugin.getAuthor()

getDescription

public java.lang.String getDescription()
Description copied from interface: Plugin
Insert the method's description here. Creation date: (6.12.2001 22:09:48)

Specified by:
getDescription in interface Plugin
Returns:
java.lang.String
See Also:
Plugin.getDescription()

getName

public java.lang.String getName()
Description copied from interface: Plugin
Insert the method's description here. Creation date: (6.12.2001 22:04:45)

Specified by:
getName in interface Plugin
Returns:
See Also:
Plugin.getName()

getVersion

public java.lang.String getVersion()
Description copied from interface: Plugin
Insert the method's description here. Creation date: (6.12.2001 22:10:05)

Specified by:
getVersion in interface Plugin
Returns:
java.lang.String
See Also:
Plugin.getVersion()

init

public void init(java.util.Properties properties,
                 PluginContext context)
Description copied from interface: Plugin
Insert the method's description here. Creation date: (6.12.2001 22:04:45)

Specified by:
init in interface Plugin
See Also:
Plugin.init(Properties, PluginContext)

start

public void start()
Description copied from interface: Plugin
Insert the method's description here. Creation date: (6.12.2001 22:04:45)

Specified by:
start in interface Plugin
See Also:
Plugin.start()

stop

public void stop()
Description copied from interface: Plugin
Insert the method's description here. Creation date: (6.12.2001 22:04:45)

Specified by:
stop in interface Plugin
See Also:
Plugin.stop()