main
Class QueryDescription

java.lang.Object
  extended by main.QueryDescription

public class QueryDescription
extends java.lang.Object

The QueryDescription class parses the input file query given to it by the InputFileParser and provides methods for extracting the query sections of the file.


Field Summary
private  int DEFAULT_TIMEOUT
           
private  java.lang.String query
           
private  java.util.ArrayList<QueryVariable> querySpecifications
           
private  int queryTimeout
           
 
Constructor Summary
QueryDescription(java.lang.String inputFileQuery)
          Creates a new QueryDescription given an input file query from the InputFileParser.
 
Method Summary
 java.lang.String getQuery()
          Returns a new query generated from the specifications or null if none was specified.
 QueryVariable[] getQueryVariables()
          Returns the QueryVariables for the query or null if none were specified.
 int getTimeout()
          Returns the timeout value for the query, or null if none was specified.
private  void parseInput(java.lang.String inputFileQuery)
           
(package private)  QueryVariable parseVariableSpecification(java.lang.String line)
           
 void setTimeout(int timeout)
          Sets the query timeout.
 void setVariable(java.lang.String variableName, java.lang.String variableValue)
          Sets a query variable to a new value.
 java.lang.String toString()
          Returns a string representation of this QueryDescription.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

query

private java.lang.String query

queryTimeout

private int queryTimeout

querySpecifications

private java.util.ArrayList<QueryVariable> querySpecifications

DEFAULT_TIMEOUT

private final int DEFAULT_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

QueryDescription

public QueryDescription(java.lang.String inputFileQuery)
                 throws java.text.ParseException
Creates a new QueryDescription given an input file query from the InputFileParser.

Parameters:
inputFileQuery - a String
Throws:
java.text.ParseException - if a parse error occurs
Method Detail

parseInput

private void parseInput(java.lang.String inputFileQuery)
                 throws java.text.ParseException
Throws:
java.text.ParseException

parseVariableSpecification

QueryVariable parseVariableSpecification(java.lang.String line)
                                   throws java.text.ParseException
Throws:
java.text.ParseException

getQuery

public java.lang.String getQuery()
Returns a new query generated from the specifications or null if none was specified.

Returns:
the query

getTimeout

public int getTimeout()
Returns the timeout value for the query, or null if none was specified.

Returns:
the timeout value

setTimeout

public void setTimeout(int timeout)
Sets the query timeout.

Parameters:
timeout - an int

setVariable

public void setVariable(java.lang.String variableName,
                        java.lang.String variableValue)
                 throws javax.naming.directory.InvalidAttributeIdentifierException
Sets a query variable to a new value.

Parameters:
variableName - a String
variableValue - a String
Throws:
javax.naming.directory.InvalidAttributeIdentifierException - if the attribute with the given name does not exist

getQueryVariables

public QueryVariable[] getQueryVariables()
Returns the QueryVariables for the query or null if none were specified.

Returns:
the query variables

toString

public java.lang.String toString()
Returns a string representation of this QueryDescription. This is for debugging purposes only.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this QueryDescroption