Class BackendListenerContext

  • All Implemented Interfaces:

    
    public class BackendListenerContext
    
                        

    BackendListenerContext is used to provide context information to a BackendListenerClient implementation. This currently consists of the initialization parameters which were specified in the GUI.

    All of the methods in this class are currently read-only. If update methods are included in the future, they should be defined so that a single instance of BackendListenerContext can be associated with each thread. Therefore, no synchronization should be needed. The same instance should be used for all calls to setupTest, runTest, and teardownTest.

    Since:

    2.13

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      boolean containsParameter(String name) Determine whether or not a value has been specified for the parameter with this name.
      Iterator<String> getParameterNamesIterator() Get an iterator of the parameter names.
      String getParameter(String name) Get the value of a specific parameter as a String, or null if the value was not specified.
      String getParameter(String name, String defaultValue) Get the value of a specified parameter as a String, or return the specified default value if the value was not specified.
      int getIntParameter(String name) Get the value of a specified parameter as an integer.
      int getIntParameter(String name, int defaultValue) Get the value of a specified parameter as an integer, or return the specified default value if the value was not specified or is not an integer.
      long getLongParameter(String name) Get the value of a specified parameter as a long.
      long getLongParameter(String name, long defaultValue) Get the value of a specified parameter as along, or return the specified default value if the value was not specified or is not a long.
      boolean getBooleanParameter(String name, boolean defaultValue)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BackendListenerContext

        BackendListenerContext(Arguments args)
        Parameters:
        args - the initialization parameters.
      • BackendListenerContext

        BackendListenerContext(Map<String, String> params)
        Parameters:
        params - the initialization parameters.
    • Method Detail

      • containsParameter

         boolean containsParameter(String name)

        Determine whether or not a value has been specified for the parameter with this name.

        Parameters:
        name - the name of the parameter to test
        Returns:

        true if the parameter value has been specified, false otherwise.

      • getParameterNamesIterator

         Iterator<String> getParameterNamesIterator()

        Get an iterator of the parameter names.

        Returns:

        an Iterator of Strings of the names of the parameters which have been specified for this test.

      • getParameter

         String getParameter(String name)

        Get the value of a specific parameter as a String, or null if the value was not specified.

        Parameters:
        name - the name of the parameter whose value should be retrieved
        Returns:

        the value of the parameter, or null if the value was not specified

      • getParameter

         String getParameter(String name, String defaultValue)

        Get the value of a specified parameter as a String, or return the specified default value if the value was not specified.

        Parameters:
        name - the name of the parameter whose value should be retrieved
        defaultValue - the default value to return if the value of this parameter was not specified
        Returns:

        the value of the parameter, or the default value if the parameter was not specified

      • getIntParameter

         int getIntParameter(String name)

        Get the value of a specified parameter as an integer. An exception will be thrown if the parameter is not specified or if it is not an integer.

        Parameters:
        name - the name of the parameter whose value should be retrieved
        Returns:

        the value of the parameter

      • getIntParameter

         int getIntParameter(String name, int defaultValue)

        Get the value of a specified parameter as an integer, or return the specified default value if the value was not specified or is not an integer. A warning will be logged if the value is not an integer.

        Parameters:
        name - the name of the parameter whose value should be retrieved
        defaultValue - the default value to return if the value of this parameter was not specified
        Returns:

        the value of the parameter, or the default value if the parameter was not specified

      • getLongParameter

         long getLongParameter(String name)

        Get the value of a specified parameter as a long. An exception will be thrown if the parameter is not specified or if it is not a long.

        Parameters:
        name - the name of the parameter whose value should be retrieved
        Returns:

        the value of the parameter

      • getLongParameter

         long getLongParameter(String name, long defaultValue)

        Get the value of a specified parameter as along, or return the specified default value if the value was not specified or is not a long. A warning will be logged if the value is not a long. The value may be specified in decimal, hexadecimal, or octal, as defined by Long.decode().

        Parameters:
        name - the name of the parameter whose value should be retrieved
        defaultValue - the default value to return if the value of this parameter was not specified
        Returns:

        the value of the parameter, or the default value if the parameter was not specified

      • getBooleanParameter

         boolean getBooleanParameter(String name, boolean defaultValue)
        Parameters:
        name - Parameter name
        defaultValue - Default value used if name is not in params
        Returns:

        boolean the value of the parameter in the map, or the default value