com.ibm.openpages.api

## Class Context

- java.lang.Object
- - com.ibm.openpages.api.Context

-     public class Context
      extends java.lang.Object

  Application context used to encapsulate system data to allow it to be shared with other parts of the application. List of valid key values: com.ibm.openpages.sdk.service.factory: specifies the complete path for a service factory implementation (e.g., com.ibm.openpages.sdk.service.local.LocalServiceFactory) com.ibm.openpages.platform.sdk.configuration: for system configuration information

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `SERVICE_APPID`
    `static java.lang.String` | `SERVICE_HOST_NAME`
    `static java.lang.String` | `SERVICE_LOCAL`
    `static java.lang.String` | `SERVICE_PORT`
    `static java.lang.String` | `SERVICE_PROTOCOL`
    `static java.lang.String` | `SERVICE_REMOTE_ADDRESS`
    `static java.lang.String` | `SERVICE_REMOTE_HOST`
    `static java.lang.String` | `SERVICE_SESSION`
    `static java.lang.String` | `SERVICE_USER_NAME`
    `static java.lang.String` | `SERVICE_USER_PASSWORD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Context()` Class constructor.
    `Context(Context context)` Copy constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Removes all of the mappings from this context.
    `java.lang.Object` | `get(java.lang.String key)` Returns the value to which the specified key is mapped, or null if this context contains no mapping for the key.
    `boolean` | `getDisableAllTriggers()` Returns whether all triggers are disabled or not.
    `java.lang.Object` | `put(java.lang.String key, java.lang.Object value)` Associates the specified value with the specified key in this context.
    `void` | `setDisableAllTriggers(boolean value)` Sets whether disables (or enables) all triggers.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SERVICE_HOST_NAME

          public static final java.lang.String SERVICE_HOST_NAME

      See Also:
        Constant Field Values

    - #### SERVICE_USER_NAME

          public static final java.lang.String SERVICE_USER_NAME

      See Also:
        Constant Field Values

    - #### SERVICE_USER_PASSWORD

          public static final java.lang.String SERVICE_USER_PASSWORD

      See Also:
        Constant Field Values

    - #### SERVICE_PORT

          public static final java.lang.String SERVICE_PORT

      See Also:
        Constant Field Values

    - #### SERVICE_SESSION

          public static final java.lang.String SERVICE_SESSION

      See Also:
        Constant Field Values

    - #### SERVICE_APPID

          public static final java.lang.String SERVICE_APPID

      See Also:
        Constant Field Values

    - #### SERVICE_REMOTE_HOST

          public static final java.lang.String SERVICE_REMOTE_HOST

      See Also:
        Constant Field Values

    - #### SERVICE_REMOTE_ADDRESS

          public static final java.lang.String SERVICE_REMOTE_ADDRESS

      See Also:
        Constant Field Values

    - #### SERVICE_LOCAL

          public static final java.lang.String SERVICE_LOCAL

      See Also:
        Constant Field Values

    - #### SERVICE_PROTOCOL

          public static final java.lang.String SERVICE_PROTOCOL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Context

          public Context()

      Class constructor.

    - #### Context

          public Context(Context context)

      Copy constructor.

  - ### Method Detail

    - #### get

          public java.lang.Object get(java.lang.String key)

      Returns the value to which the specified key is mapped, or null if this context contains no mapping for the key.
      Parameters:
        `key` - the key whose associated value is to be returned
      Returns:
        the value to which the specified key is mapped, or null if this context contains no mapping for the key

    - #### put

          public java.lang.Object put(java.lang.String key,
                                      java.lang.Object value)

      Associates the specified value with the specified key in this context. If the context previously contained a mapping for the key, the old value is replaced by the specified value.
      Parameters:
        `key` - the key with which the specified value is to be associated
        `value` - the value to be associated with the specified key
      Returns:
        the previous value associated with key, or null if there was no mapping for key

    - #### clear

          public void clear()

      Removes all of the mappings from this context.

    - #### getDisableAllTriggers

          public boolean getDisableAllTriggers()

      Returns whether all triggers are disabled or not.
      Returns:
        true to all triggers are disabled, otherwise false

    - #### setDisableAllTriggers

          public void setDisableAllTriggers(boolean value)

      Sets whether disables (or enables) all triggers.

      Example:

           // Disable all triggers within a trigger event action
           event.getContext().setDisableAllTriggers(true);
           ...
           // Enable all triggers
           event.getContext().setDisableAllTriggers(false);

      Parameters:
        `value` - true to disable all triggers, otherwise false

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.