com.informatica.powercenter.sdk.mapfwk.core
Class ParameterFile

java.lang.Object
  extended by com.informatica.powercenter.sdk.mapfwk.core.ParameterFile

public class ParameterFile
extends java.lang.Object

Author:
sramamoo

Constructor Summary
ParameterFile()
          Default constructor
ParameterFile(java.lang.String filename)
          This constructor assigns the filename for the parameter file.
 
Method Summary
static java.lang.String createParameterFileName(java.lang.String workflowName)
          Create a unique parameter file name
 java.lang.String getParameterFileName()
          Returns the filename for the parameter file
 java.lang.String getParameterValue(java.lang.String parameterName)
          Returns the value of corresponding to the parameter.
 ParameterFileIterator iterator()
          Returns an iterator to iterate over various parameters and their values.
 void loadFromFile()
          Loads the parameter names and values from a file.
 void save()
          Generates the ParameterFile with the given filename and also creates a properties file at the same location with a ".parameter_properties" appended to the filename of the Parameter File.
 void setParameterFileName(java.lang.String filename)
          Sets the filename for the parameter file
 void setParameterValue(java.lang.String parameterName, java.lang.String parameterValue)
          This sets the value of parameterName with parameterValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterFile

public ParameterFile()
Default constructor


ParameterFile

public ParameterFile(java.lang.String filename)
This constructor assigns the filename for the parameter file.

Parameters:
filename - The filename including complete path for the parameter file
Method Detail

getParameterFileName

public java.lang.String getParameterFileName()
Returns the filename for the parameter file

Returns:
filename

setParameterFileName

public void setParameterFileName(java.lang.String filename)
Sets the filename for the parameter file

Parameters:
filename - the filename to set

getParameterValue

public java.lang.String getParameterValue(java.lang.String parameterName)
Returns the value of corresponding to the parameter. Returns null if parameter doesnot exist.

Parameters:
parameterName - The name of the parameter

setParameterValue

public void setParameterValue(java.lang.String parameterName,
                              java.lang.String parameterValue)
                       throws java.lang.IllegalArgumentException
This sets the value of parameterName with parameterValue. The parameterName is expected to be a valid parameter. See Workflow.getListOfParameters() on how to get the list of all parameters that can be over-ridden

Parameters:
parameterName - Name of the parameter
parameterValue - value of the parameter
Throws:
java.lang.IllegalArgumentException - Thrown if parameterName is null

save

public void save()
          throws java.io.IOException
Generates the ParameterFile with the given filename and also creates a properties file at the same location with a ".parameter_properties" appended to the filename of the Parameter File. This properties file is used for later loading the ParameterFile.

Throws:
java.io.IOException

loadFromFile

public void loadFromFile()
                  throws java.io.IOException,
                         java.io.FileNotFoundException
Loads the parameter names and values from a file. It looks for a file with a ".parameter_properties" appended to the parameterFile name and throws a FileNotFoundException if the properties file is not present. This exception is thrown even if the parameter file is present at the location and the properties file is missing.

Throws:
java.io.IOException
java.io.FileNotFoundException

createParameterFileName

public static java.lang.String createParameterFileName(java.lang.String workflowName)
Create a unique parameter file name

Parameters:
workflowName -
Returns:
String proposed parameter filename derived from the workflow name.

iterator

public ParameterFileIterator iterator()
Returns an iterator to iterate over various parameters and their values. See ParameterFileIterator for details about the functionalities supported by the iterator.

Returns:
ParameterFileIterator