cdx.scorebot.net
Class ConfigurationTemplate

java.lang.Object
  extended by cdx.scorebot.net.ConfigurationTemplate
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CompetitionConfiguration, TeamConfiguration

public abstract class ConfigurationTemplate
extends java.lang.Object
implements java.io.Serializable

This contains only the IP addresses and ports of the services which are to be tested from a template NetworkTestPackage. It allows for the easy re-use and mass-modification of NetworkTestPackages.

Author:
David Underhill
See Also:
Serialized Form

Field Summary
protected  NetworkTestPackage ntp
          the NetworkTestPackage this holds
protected  java.lang.String pathToNTP
          the complete relative filename to the file which contains the NetworkTestPackage template which this configures
protected  java.util.Vector<TestSuiteSkeleton> suiteInfo
          the names of the suites this provides IPs and Ports for
 
Constructor Summary
  ConfigurationTemplate(java.lang.String fn)
          create a Skeleton NetworkTestPackage from the NetworkTestPackage in the specified file
protected ConfigurationTemplate(java.lang.String fn, java.util.Vector<TestSuiteSkeleton> suiteInfo, NetworkTestPackage ntp)
          Create a Skeleton NetworkTestPackage from the NetworkTestPackage in the specified information.
 
Method Summary
 void addMissingSuites()
          refreshes suite names with any which are missing
 boolean equals(ConfigurationTemplate c)
           
protected  void gentleLoadNTP(java.lang.String fn)
          Loads the NetworkTestPackage from the specified filename and sets its path to the path it was loaded from.
 java.lang.String getPathToNTP()
          gets the path to the NetworkTestPackage this is based on
 java.util.Vector<TestSuiteSkeleton> getSuiteInfo()
          gets the information on the suites this skeleton configures
 NetworkTestPackage getUnconfiguredNTP()
          Returns the template NetworkTestPackage
protected  int indexOfSkel(java.lang.String suiteName)
          gets the index of the skeleton which configures the specified suite name, or -1 if no such skeleton exists
protected  void loadNTP(java.lang.String fn)
          Loads the NetworkTestPackage from the specified filename and sets its path to the path it was loaded from.
 void refreshSuites()
          refreshes whether or not suites are valid
 void setPathToNTP(java.lang.String fn)
          sets the path to the NetworkTestPackage this is based on (and refreshes names based on whether or not they are valid now)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pathToNTP

protected java.lang.String pathToNTP
the complete relative filename to the file which contains the NetworkTestPackage template which this configures


suiteInfo

protected java.util.Vector<TestSuiteSkeleton> suiteInfo
the names of the suites this provides IPs and Ports for


ntp

protected transient NetworkTestPackage ntp
the NetworkTestPackage this holds

Constructor Detail

ConfigurationTemplate

public ConfigurationTemplate(java.lang.String fn)
                      throws com.thoughtworks.xstream.core.BaseException,
                             java.io.FileNotFoundException
create a Skeleton NetworkTestPackage from the NetworkTestPackage in the specified file

Parameters:
fn - where to load the NetworkTestPackage from (best if this is a relative path)
Throws:
com.thoughtworks.xstream.core.BaseException - if the object cannot be deserialized
java.io.FileNotFoundException - occurs if the file is not found

ConfigurationTemplate

protected ConfigurationTemplate(java.lang.String fn,
                                java.util.Vector<TestSuiteSkeleton> suiteInfo,
                                NetworkTestPackage ntp)
Create a Skeleton NetworkTestPackage from the NetworkTestPackage in the specified information. Only for use when creating a ConfigurationTemplate from an existing template which is already loaded.

Parameters:
fn - where to load the NetworkTestPackage from (best if this is a relative path)
suiteInfo - the skeleton suite info
ntp - the configuration to run with
Method Detail

loadNTP

protected final void loadNTP(java.lang.String fn)
                      throws com.thoughtworks.xstream.core.BaseException,
                             java.io.FileNotFoundException
Loads the NetworkTestPackage from the specified filename and sets its path to the path it was loaded from.

Parameters:
fn - the filename to load the NetworkTestPackage from
Throws:
com.thoughtworks.xstream.core.BaseException - if the object cannot be deserialized
java.io.FileNotFoundException - occurs if the file is not found

gentleLoadNTP

protected final void gentleLoadNTP(java.lang.String fn)
Loads the NetworkTestPackage from the specified filename and sets its path to the path it was loaded from. On failure, a dialog box is popped up and an empty network test package is used.

Parameters:
fn - the filename to load the NetworkTestPackage from

equals

public boolean equals(ConfigurationTemplate c)

addMissingSuites

public final void addMissingSuites()
refreshes suite names with any which are missing


getUnconfiguredNTP

public final NetworkTestPackage getUnconfiguredNTP()
Returns the template NetworkTestPackage


refreshSuites

public final void refreshSuites()
refreshes whether or not suites are valid


indexOfSkel

protected int indexOfSkel(java.lang.String suiteName)
gets the index of the skeleton which configures the specified suite name, or -1 if no such skeleton exists


getPathToNTP

public final java.lang.String getPathToNTP()
gets the path to the NetworkTestPackage this is based on


setPathToNTP

public final void setPathToNTP(java.lang.String fn)
                        throws com.thoughtworks.xstream.core.BaseException,
                               java.io.FileNotFoundException
sets the path to the NetworkTestPackage this is based on (and refreshes names based on whether or not they are valid now)

Throws:
com.thoughtworks.xstream.core.BaseException - if the object cannot be deserialized
java.io.FileNotFoundException - occurs if the file is not found

getSuiteInfo

public final java.util.Vector<TestSuiteSkeleton> getSuiteInfo()
gets the information on the suites this skeleton configures