net.xoetrope.optional.service
Class ServiceProxyArgs

java.lang.Object
  extended by net.xoetrope.optional.service.ServiceProxyArgs

public class ServiceProxyArgs
extends java.lang.Object

An object which is passed between the layers of a route. It maintains Hashtables of argument names and values which can be changed, added to or removed by any of the layers. It contains utility functions for retrieving or removing arguments by name.

Copyright (c) Xoetrope Ltd., 2001-2006, see license.txt for details


Constructor Summary
ServiceProxyArgs(int numArgs)
          Creates a new instance of ServiceProxyArgs with the number of specified arguments
ServiceProxyArgs(java.lang.String[] argNames)
          Creates a new instance of ServiceProxyArgs with the passed argument names initialising the names array
ServiceProxyArgs(java.lang.String[] argNames, java.lang.Object[] argValues)
          Creates a new instance of ServiceProxyArgs with the passed argument names and values initialising arrays
 
Method Summary
 void addError(java.lang.String error)
          Add an error String to the errors Vector
 void clearErrors()
          Reset the errors Vector for the next call.
 java.lang.Object getConfigParam(java.lang.String name)
          Retrieves the value of the configuration argument specified by the name parameter
 java.util.Vector getErrors()
          Retrieve the errors Vector
 int getNumPassArgs()
          Retrive the number of arguments currently being stored
 int getNumReturnArgs()
          Retrive the number of arguments currently being stored
 java.util.Hashtable getPassArgs()
          Retrieve the passArgs Hashtable
 java.lang.Object getPassParam(java.lang.String name)
          Retrieves the value of the argument specified by the name parameter
 int getPassParamAsInt(java.lang.String name)
          Retrieves the value of the pass argument specified by the name parameter and converts it to an int
 java.util.Hashtable getReturnArgs()
          Retrieve the return args Hashtable
 java.lang.Object getReturnParam(java.lang.String name)
          Retrieves the value of the return argument specified by the name parameter
 int getReturnParamAsInt(java.lang.String name)
          Retrieves the value of the return argument specified by the name parameter and converts it to an int
 boolean hasErrors()
          If the errors hashtable has any entries then an error has been generated.
 void removePassParam(java.lang.String name)
          Remove the named argument from the passArgs Hashtable
 void removeReturnParam(java.lang.String name)
          Remove the named argument from the returnArgs Hashtable
 void setConfigParam(java.lang.String name, java.lang.Object value)
          Sets the value of the named configuration parameter
 void setPassParam(java.lang.String name, java.lang.Object value)
          Sets the value of the named pass parameter
 void setReturnParam(java.lang.String name, java.lang.Object value)
          Sets the value of the named return parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceProxyArgs

public ServiceProxyArgs(int numArgs)
Creates a new instance of ServiceProxyArgs with the number of specified arguments

Parameters:
numArgs - the number of initial arguments

ServiceProxyArgs

public ServiceProxyArgs(java.lang.String[] argNames)
Creates a new instance of ServiceProxyArgs with the passed argument names initialising the names array

Parameters:
argNames - the initial argument names

ServiceProxyArgs

public ServiceProxyArgs(java.lang.String[] argNames,
                        java.lang.Object[] argValues)
Creates a new instance of ServiceProxyArgs with the passed argument names and values initialising arrays

Parameters:
argNames - the initial argument names
argValues - the initial argument values
Method Detail

getPassParam

public java.lang.Object getPassParam(java.lang.String name)
Retrieves the value of the argument specified by the name parameter

Parameters:
name - the name of the argument to retrieve
Returns:
The named pass parameter value

getConfigParam

public java.lang.Object getConfigParam(java.lang.String name)
Retrieves the value of the configuration argument specified by the name parameter

Parameters:
name - the name of the argument to retrieve
Returns:
The named pass parameter value

getReturnParam

public java.lang.Object getReturnParam(java.lang.String name)
Retrieves the value of the return argument specified by the name parameter

Parameters:
name - the name of the return argument to retrieve
Returns:
The named pass parameter value

getPassParamAsInt

public int getPassParamAsInt(java.lang.String name)
Retrieves the value of the pass argument specified by the name parameter and converts it to an int

Parameters:
name - the name of the argument to retrieve
Returns:
The named pass parameter converted to an int value

getReturnParamAsInt

public int getReturnParamAsInt(java.lang.String name)
Retrieves the value of the return argument specified by the name parameter and converts it to an int

Parameters:
name - the name of the argument to retrieve
Returns:
The named return parameter converted to an int value

hasErrors

public boolean hasErrors()
If the errors hashtable has any entries then an error has been generated.

Returns:
boolean indicating whether or not errors have been generated.

setPassParam

public void setPassParam(java.lang.String name,
                         java.lang.Object value)
Sets the value of the named pass parameter

Parameters:
name - the name of the argument
value - the new value of the argument

setReturnParam

public void setReturnParam(java.lang.String name,
                           java.lang.Object value)
Sets the value of the named return parameter

Parameters:
name - the name of the argument
value - the new value of the argument

setConfigParam

public void setConfigParam(java.lang.String name,
                           java.lang.Object value)
Sets the value of the named configuration parameter

Parameters:
name - the name of the argument
value - the new value of the argument

getNumPassArgs

public int getNumPassArgs()
Retrive the number of arguments currently being stored

Returns:
the length of the names array

getNumReturnArgs

public int getNumReturnArgs()
Retrive the number of arguments currently being stored

Returns:
the length of the names array

removePassParam

public void removePassParam(java.lang.String name)
Remove the named argument from the passArgs Hashtable

Parameters:
name - the name of the argument to be removed

removeReturnParam

public void removeReturnParam(java.lang.String name)
Remove the named argument from the returnArgs Hashtable

Parameters:
name - the name of the argument to be removed

getPassArgs

public java.util.Hashtable getPassArgs()
Retrieve the passArgs Hashtable

Returns:
The passArgs Hashtable

getReturnArgs

public java.util.Hashtable getReturnArgs()
Retrieve the return args Hashtable

Returns:
The returnArgs Hashtable

getErrors

public java.util.Vector getErrors()
Retrieve the errors Vector

Returns:
the error Vector

addError

public void addError(java.lang.String error)
Add an error String to the errors Vector

Parameters:
error - The new error to be added

clearErrors

public void clearErrors()
Reset the errors Vector for the next call.