Interface PushController

  • All Known Implementing Classes:
    AbstractPushController, CommentPushController, CronJobsPushController, WorkflowPushController

    public interface PushController
    A push controller is one of the fundamental building blocks of Cockpit's server push mechanism. It is typically executed in its own Thread and allows actions to be performed and components to be updated asynchronously using reverse Ajax.

    The push controller itself contains the logic for testing if an update is required (see isUpdateNeeded() ) and if so notifying the appropriate Cockpit components by the use of CockpitEvents (see update()).

    When used with a PushComponent, it provides the means necessary to update ZK view components asynchronously.

    Normally there is no need to implement a push controller from scratch and extending the abstract class AbstractPushController is usually the right way to go.

    • Method Detail

      • isUpdateNeeded

        boolean isUpdateNeeded()
        Returns whether an update is required or not.
        Returns:
        true if an update is needed, false otherwise
        See Also:
        update()
      • setDone

        void setDone()
        Tells this push controller to stop processing server push events. Typically stops the thread gently within one polling cycle (see getUpdateInterval()).
        See Also:
        startController()
      • setComponent

        void setComponent​(PushComponent component)
        Sets the PushComponent to be used by this push controller to component.
        Parameters:
        component - the push component used by this push controller
        See Also:
        PushComponent
      • getComponent

        PushComponent getComponent()
        Returns this push controller's PushComponent.
        Returns:
        the push component used by this push controller
      • setUpdateInterval

        void setUpdateInterval​(int milliseconds)
        Sets the update interval in milliseconds for this push controller.
        Parameters:
        milliseconds - the delay between updates (or update requests) in milliseconds
      • getUpdateInterval

        int getUpdateInterval()
        Returns the update interval in milliseconds for this push controller.
        Returns:
        the delay between updates (or update requests) in milliseconds
      • startController

        void startController()
        Starts this push controller. Typically starts the push controller thread.
        See Also:
        setDone()
      • setParameters

        void setParameters​(java.util.Map<java.lang.String,​java.lang.Object> params)
      • getParameters

        java.util.Map<java.lang.String,​java.lang.Object> getParameters()