org.icepush

## Class PushContext

- java.lang.Object
- - org.icepush.PushContext

-     public class PushContext
      extends java.lang.Object

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addGroupMember(java.lang.String groupName, java.lang.String pushID)` Adds the specified `pushID` to the group with the specified `groupName`.
    `void` | `backOff(java.lang.String browserID, long delay)` Instructs the specified browser to back off from ajax push listen for the specified number of milliseconds.
    `java.lang.String` | `createPushId(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Creates a Push ID consisting of the Browser ID and Sub ID.
    `static PushContext` | `getInstance(javax.servlet.ServletContext servletContext)` Gets the PushContext instance associated with the specified `servletContext`.
    `void` | `push(java.lang.String groupName)` Initiate a Server Push to the members of the group specified by the `groupName`.
    `void` | `push(java.lang.String groupName, PushConfiguration pushConfiguration)` Initiate a Server Push to the members of the group specified by the `groupName`.
    `void` | `removeGroupMember(java.lang.String groupName, java.lang.String pushID)` Removes the specified `pushId` from the group with the specified `groupName`.

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

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

- - ### Method Detail

    - #### addGroupMember

          public void addGroupMember(java.lang.String groupName,
                                     java.lang.String pushID)
                              throws java.lang.IllegalArgumentException

      Adds the specified `pushID` to the group with the specified `groupName`.

      Parameters:
        `groupName` - The name of the group the specified `pushID` needs to be added to.
        `pushID` - The Push ID that needs to be added.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified `groupName` and/or the specified `pushID` is `null` or empty.

    - #### backOff

          public void backOff(java.lang.String browserID,
                              long delay)
                       throws java.lang.IllegalArgumentException

      Instructs the specified browser to back off from ajax push listen for the specified number of milliseconds.

      Parameters:
        `browserID` - The ICEpush browser ID as stored in the ice.push.browser cookie.
        `delay` - The delay in milliseconds the browser needs to back off.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified `browserID` is `null` or empty and/or the specified `delay` is less than `0`.

    - #### createPushId

          public java.lang.String createPushId(javax.servlet.http.HttpServletRequest request,
                                               javax.servlet.http.HttpServletResponse response)
                                        throws java.lang.IllegalArgumentException

      Creates a Push ID consisting of the Browser ID and Sub ID. If the specified `request` does not contain a Browser ID already, it will be created and set on the specified `request` and `response`.

      Parameters:
        `request` - The HTTP Servlet request.
        `response` - The HTTP Servlet response.
      Returns:
        The created Push ID.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified `request` and/or `response` is `null`.

    - #### push

          public void push(java.lang.String groupName)
                    throws java.lang.IllegalArgumentException

      Initiate a Server Push to the members of the group specified by the `groupName`.

      Parameters:
        `groupName` - The group name of the group.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified `groupName` is `null` or empty.
      See Also:
        `push(String, PushConfiguration)`

    - #### push

          public void push(java.lang.String groupName,
                           PushConfiguration pushConfiguration)
                    throws java.lang.IllegalArgumentException

      Initiate a Server Push to the members of the group specified by the `groupName`.

      Parameters:
        `groupName` - The group name of the group.
        `pushConfiguration` - The Push configuration.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified `groupName` is `null` or empty.
      See Also:
        `push(String)`

    - #### removeGroupMember

          public void removeGroupMember(java.lang.String groupName,
                                        java.lang.String pushID)
                                 throws java.lang.IllegalArgumentException

      Removes the specified `pushId` from the group with the specified `groupName`.

      Parameters:
        `groupName` - The name of the group the specified `pushId` needs to be removed from.
        `pushID` - The Push ID that needs to be removed.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified `groupName` and/or the specified `pushID` is `null` or empty.

    - #### getInstance

          public static PushContext getInstance(javax.servlet.ServletContext servletContext)
                                         throws java.lang.IllegalArgumentException

      Gets the PushContext instance associated with the specified `servletContext`.

      Parameters:
        `servletContext` - The ServletContext from which to get the PushContext.
      Returns:
        The PushContext.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified `servletContext` is `null`.

Copyright 2025 ICEsoft Technologies Canada Corp., All Rights Reserved.