Class ParameterSet

java.lang.Object
com.progress.open4gl.dynamicapi.ParameterSet

public class ParameterSet extends Object
The ParameterSet holds the data for parameters for running a procedure, method, or function on an application server.

The ParameterSet is used is two phases: 1) Set ALL the parameters (INPUT, OUTPUT or INPUT_OUTPUT) 2) After the execution of the 4GL procedure - get the output values (don't get them if you don't want to. The object can be reused for another call. When setParameter() is called, the object is cleaned up, so the output from the previous call gets lost. The setParameter() calls are currently set to NOT check the validity of the data type and the input/output mode since the assumption is that our ProWrap tool rather than a user would use this interface. make a setParameter (... false) rather then setParameter (... true) calls if you want to change that. Marshaling and unmarshaling of parameters is done by describing a set of parameters as a relational table. That way, the same code the was implemented to marshal and unmarshal Temp-Tables into and from sql result sets can be used to marshal and unmarshal scalar data. The ParameterMetaData.java class (in this package), describes an input parameter value as the tuple: Unspecified value, int proType, int inOut_mode The data type of "value" is unspecified since unlike "real" relational data, not all the value of a parameter set have the same data type. The ParameterMetaData.java class (in this package), describes an output parameter value as the tuple: {int paramNum, int proType, Unspecified value) Note that output parameters don't need the inOut_mode descriptor but instead require the paramNum descriptor (since only OUTPUT and INPUT-OUTPUT parametrs are sent back), so ParameterMetaData and ParameterMetaData are not identical.

  • Field Details

    • funcIsExtent

      protected boolean funcIsExtent
    • funcHasHolder

      protected boolean funcHasHolder
    • INPUT

      public static final int INPUT
      See Also:
    • OUTPUT

      public static final int OUTPUT
      See Also:
    • INPUT_OUTPUT

      public static final int INPUT_OUTPUT
      See Also:
  • Constructor Details

    • ParameterSet

      public ParameterSet(int numParams)
      Construct a parameter set object for numParams parameters.
      Parameters:
      numParams -
    • ParameterSet

      public ParameterSet(ParameterSet ps)
  • Method Details

    • setInputErrorResetPolicy

      public void setInputErrorResetPolicy(InputErrorResetPolicy policy)
      Assign the policy that controls the reset behavior of the ParameterSet when an error occurs processing the input side of an appserver request.
      Parameters:
      policy -
    • getInputErrorResetPolicy

      public InputErrorResetPolicy getInputErrorResetPolicy()
      Retrieve the current value for the InputErrorResetPolicy setting.
      Returns:
    • setOutputErrorResetPolicy

      public void setOutputErrorResetPolicy(OutputErrorResetPolicy policy)
      Assign the policy that controls the reset behavior of the ParameterSet when an error occurs processing the output side of an appserver request.
      Parameters:
      policy -
    • getOutputErrorResetPolicy

      public OutputErrorResetPolicy getOutputErrorResetPolicy()
      Retrieve the current value of the OutputErrorResetPolicy setting.
      Returns:
    • inOutString

      public static String inOutString(int inOut)
    • IsValueType

      protected static boolean IsValueType(int dtype)
    • setBooleanParameter

      public void setBooleanParameter(int position, boolean b, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setBooleanArrayParameter

      public void setBooleanArrayParameter(int position, boolean[] b, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setIntegerParameter

      public void setIntegerParameter(int position, int n, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setIntegerArrayParameter

      public void setIntegerArrayParameter(int position, int[] n, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setLongParameter

      public void setLongParameter(int position, long l, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setLongArrayParameter

      public void setLongArrayParameter(int position, long[] l, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setInt64Parameter

      public void setInt64Parameter(int position, long l, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setInt64Parameter

      public void setInt64Parameter(int position, Long l, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setInt64ArrayParameter

      public void setInt64ArrayParameter(int position, long[] l, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setInt64ArrayParameter

      public void setInt64ArrayParameter(int position, Long[] l, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setBooleanParameter

      public void setBooleanParameter(int position, Boolean b, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setBooleanArrayParameter

      public void setBooleanArrayParameter(int position, Boolean[] b, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setIntegerParameter

      public void setIntegerParameter(int position, Integer n, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setIntegerArrayParameter

      public void setIntegerArrayParameter(int position, Integer[] n, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setLongParameter

      public void setLongParameter(int position, Long l, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setLongArrayParameter

      public void setLongArrayParameter(int position, Long[] l, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setDecimalParameter

      public void setDecimalParameter(int position, BigDecimal d, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setDecimalArrayParameter

      public void setDecimalArrayParameter(int position, BigDecimal[] d, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setStringParameter

      public void setStringParameter(int position, String s, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setStringArrayParameter

      public void setStringArrayParameter(int position, String[] s, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setLongcharParameter

      public void setLongcharParameter(int position, String s, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setLongcharArrayParameter

      public void setLongcharArrayParameter(int position, String[] s, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setDateParameter

      public void setDateParameter(int position, GregorianCalendar d, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setDateArrayParameter

      public void setDateArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setDateTimeParameter

      public void setDateTimeParameter(int position, GregorianCalendar d, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setDateTimeArrayParameter

      public void setDateTimeArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setDateTimeTzParameter

      public void setDateTimeTzParameter(int position, GregorianCalendar d, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setDateTimeTzArrayParameter

      public void setDateTimeTzArrayParameter(int position, GregorianCalendar[] d, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setByteParameter

      public void setByteParameter(int position, byte[] b, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setByteArrayParameter

      public void setByteArrayParameter(int position, byte[][] b, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setRowidParameter

      public void setRowidParameter(int position, Rowid r, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setRowidArrayParameter

      public void setRowidArrayParameter(int position, Rowid[] r, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setMemptrParameter

      public void setMemptrParameter(int position, Memptr p, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setMemptrArrayParameter

      public void setMemptrArrayParameter(int position, Memptr[] p, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setHandleParameter

      public void setHandleParameter(int position, Handle h, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setHandleArrayParameter

      public void setHandleArrayParameter(int position, Handle[] h, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setCOMHandleParameter

      public void setCOMHandleParameter(int position, COMHandle h, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setCOMHandleArrayParameter

      public void setCOMHandleArrayParameter(int position, COMHandle[] h, int m, int extentValue) throws Open4GLException
      Throws:
      Open4GLException
    • setResultSetParameter

      public void setResultSetParameter(int position, ResultSet r, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setDynResultSetParameter

      public void setDynResultSetParameter(int position, ResultSet r, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setDataGraphParameter

      public void setDataGraphParameter(int position, ProDataGraph r, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setDataGraphParameter

      public void setDataGraphParameter(int position, ProDataGraph r, int m, boolean mappedTT) throws Open4GLException
      Throws:
      Open4GLException
    • setDynDataGraphParameter

      public void setDynDataGraphParameter(int position, ProDataGraph r, int m) throws Open4GLException
      Throws:
      Open4GLException
    • setDynDataGraphParameter

      public void setDynDataGraphParameter(int position, ProDataGraph r, int m, boolean mappedTT) throws Open4GLException
      Throws:
      Open4GLException
    • getOutputParameter

      public Object getOutputParameter(int p) throws Open4GLException
      Throws:
      Open4GLException
    • getNumParams

      public int getNumParams()
    • isOutput

      public boolean isOutput(int position)
    • isResultSet

      public boolean isResultSet(int position)
    • isMappedTable

      public boolean isMappedTable(int position)
    • setIsMappedTable

      public void setIsMappedTable(int position, boolean mappedTT)
    • getMappedTableType

      protected int getMappedTableType(int position)
    • isDataGraph

      public boolean isDataGraph(int position)
      Determine if a parameter is to be represented as a data graph. Only datasets can be represented as data graphs. However, it is also possible for a dataset to be represented as an XML document or JSON string.
      Parameters:
      position - integer indicating which parameter in the list to test.
      Returns:
      a boolean indicating that the parameter is a dataset that is represented as a data graph.
    • getFlags

      public int getFlags(int position)
      Information specific to dataset serialized as XML. Includes flags from Memptr. Memptr.DSET_BI and Memptr.RPC_DSET.
      Parameters:
      position - 1-based parameter positionh.
      Returns:
      integer containing bit flags.
    • getOutputCharToLongChar

      public boolean getOutputCharToLongChar(int position)
    • cleanupOutputErrors

      public void cleanupOutputErrors()
    • cleanupOnInputErrors

      public void cleanupOnInputErrors()
    • cleanUp

      public void cleanUp()
    • setParameter

      public void setParameter(int p, Object v, int m, int proType, boolean isExtent, int extentValue) throws Open4GLException
      Set the attributes of a parameter in the set. This is used by the Open Java Client. This overloading assumes the parameter will not be serialized XML.
      Parameters:
      p - integer identify the 0-based position of the parameter in the parameter list.
      v - Object to be stored in the given parameter object as the parameter value.
      m - integer indicating input, output or input-output mode (INPUT, OUTPUT or INPUT | OUTPUT).
      proType - integer identifying ABL data type for the specified parameter.
      isExtent - boolean indicaring whether this is a scaler value (false) or an extent (true).
      extentValue - integer giving the length of the extent. Only valid if isExtent is true.
      Throws:
      Open4GLException - if m is an invalid value.
    • setParameter

      public void setParameter(int p, Object v, int m, int proType, boolean isExtent, int extentValue, int serializeFormat, boolean isRpcStyleSoapMessage, boolean writeBeforeImage) throws Open4GLException
      Set the attributes of a parameter in the set. This is used by the Open Java Client.
      Parameters:
      p - integer identify the 0-based position of the parameter in the parameter list.
      v - Object to be stored in the given parameter object as the parameter value.
      m - integer indicating input, output or input-output mode (INPUT, OUTPUT or INPUT | OUTPUT).
      proType - integer identifying ABL data type for the specified parameter.
      isExtent - boolean indicating whether this is a scaler value (false) or an extent (true).
      extentValue - integer giving the length of the extent. Only valid if isExtent is true.
      serializeFormat - int indicating that the value stored in the parameter specified by p will be represented as an XML or JSON string.
      isRpcStyleSoapMessage - boolean to be used to inform the AppServer that XML serialization will need to be modified RPC style messages.
      writeBeforeImage - boolean indicating whether a before image should be included when the value is serialized as XML or JSON. This parameter is only meaningful if serializeFormat is 1.
      Throws:
      Open4GLException - if there are invalid parameters:
      • m is an invalid value
      • proType is neither Parameter.PRO_DATASET nor Parameter.PRO_DATASETHANDLE and isSerializedXml is true.
    • setBooleanFunction

      public void setBooleanFunction()
    • setBooleanFunction

      public void setBooleanFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setIntegerFunction

      public void setIntegerFunction()
    • setIntegerFunction

      public void setIntegerFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setLongFunction

      public void setLongFunction()
    • setLongFunction

      public void setLongFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setInt64Function

      public void setInt64Function()
    • setInt64Function

      public void setInt64Function(boolean isArray, boolean hasHolder, int extentValue)
    • setDecimalFunction

      public void setDecimalFunction()
    • setDecimalFunction

      public void setDecimalFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setStringFunction

      public void setStringFunction()
    • setStringFunction

      public void setStringFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setDateFunction

      public void setDateFunction()
    • setDateFunction

      public void setDateFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setDateTimeFunction

      public void setDateTimeFunction()
    • setDateTimeFunction

      public void setDateTimeFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setDateTimeTzFunction

      public void setDateTimeTzFunction()
    • setDateTimeTzFunction

      public void setDateTimeTzFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setByteFunction

      public void setByteFunction()
    • setByteFunction

      public void setByteFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setRowidFunction

      public void setRowidFunction()
    • setRowidFunction

      public void setRowidFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setMemptrFunction

      public void setMemptrFunction() throws Open4GLException
      Throws:
      Open4GLException
    • setLongcharFunction

      public void setLongcharFunction() throws Open4GLException
      Throws:
      Open4GLException
    • setHandleFunction

      public void setHandleFunction()
    • setHandleFunction

      public void setHandleFunction(boolean isArray, boolean hasHolder, int extentValue)
    • setCOMHandleFunction

      public void setCOMHandleFunction()
    • setCOMHandleFunction

      public void setCOMHandleFunction(boolean isArray, boolean hasHolder, int extentValue)
    • getFunctionReturnValue

      public Object getFunctionReturnValue()
    • setIsFuncReturnExtent

      public void setIsFuncReturnExtent(boolean bIsExtent)
    • getIsFunctionReturnExtent

      public boolean getIsFunctionReturnExtent()
    • setIsReturnUnknown

      public void setIsReturnUnknown(boolean bIsUnknown)
    • getProcedureReturnValue

      public Object getProcedureReturnValue()
    • setParamNum

      public void setParamNum(DataGraphMetaData metaData, int position)
    • setInOut

      public void setInOut(DataGraphMetaData metaData, int inOut)
    • validate

      public void validate() throws Open4GLException
      Throws:
      Open4GLException
    • setAllowWidening

      public void setAllowWidening(boolean allow)
    • getAllowWidening

      public boolean getAllowWidening()