Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.app.update
Class ServerUpdateManager

    java.lang.Object
      nextapp.echo2.app.update.ServerUpdateManager

All Implemented Interfaces:
  java.io.Serializable

    public class ServerUpdateManager

extends java.lang.Object
implements java.io.Serializable

Monitors updates to component hierarchy and records deltas between server state of application and client state of application.

See Also:
  Serialized Form

Constructor Summary
`ServerUpdateManager(ApplicationInstance applicationInstance)` Creates a new `ServerUpdateManager`.

Method Summary
`void` | `enqueueCommand(Command command)` Enqueues a `Command` for processing.
`PropertyUpdate` | `getApplicationPropertyUpdate(java.lang.String propertyName)` Returns a `PropertyUpdate` representing the application-level property update with the specified name.
`Command[]` | `getCommands()` Returns the stored `Command`s.
`ServerComponentUpdate[]` | `getComponentUpdates()` Returns the stored `ServerComponentUpdate`s.
`void` | `init(ClientUpdateManager clientUpdateManager)` Initialization life-cycle method.
`boolean` | `isEmpty()` Determines if the manager has no updates.
`boolean` | `isFullRefreshRequired()` Determines if a full refresh of the client state is required.
`void` | `processApplicationPropertyUpdate(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)` Processes an update to a property of the `ApplicationInstance`.
`void` | `processComponentAdd(Component parent, Component child)` Processes the addition of a component to the hierarchy.
`void` | `processComponentLayoutDataUpdate(Component updatedComponent)` Processes an update to the `LayoutData` of a component.
`void` | `processComponentPropertyUpdate(Component updatedComponent, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)` Processes an update to a property of a component (other than the `LayoutData` property).
`void` | `processComponentRemove(Component parent, Component child)` Processes the removal of a component from the hierarchy.
`void` | `processComponentVisibilityUpdate(Component updatedComponent)` Processes an update to the visible state of a component.
`void` | `processFullRefresh()` Processes a full refresh of the application state, in response to a severe change, such as application locale or style sheet.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ServerUpdateManager

    public ServerUpdateManager(ApplicationInstance applicationInstance)

  Creates a new `ServerUpdateManager`. Warning: the `init()` method must be invoked before the `ServerUpdateManager` is used.

  Parameters:
    `applicationInstance` - the relevant `ApplicationInstance`
  See Also:
    `init(nextapp.echo2.app.update.ClientUpdateManager)`

Method Detail

### enqueueCommand

    public void enqueueCommand(Command command)

  Enqueues a `Command` for processing.

  Parameters:
    `command` - the command

### getApplicationPropertyUpdate

    public PropertyUpdate getApplicationPropertyUpdate(java.lang.String propertyName)

  Returns a `PropertyUpdate` representing the application-level property update with the specified name. If the specified property has not been updated, null is returned.

  Parameters:
    `propertyName` - the name of the property
  Returns:
    the `PropertyUpdate`

### getCommands

    public Command[] getCommands()

  Returns the stored `Command`s. The commands are NOT removed or modified by this call.

  Returns:
    the commands

### getComponentUpdates

    public ServerComponentUpdate[] getComponentUpdates()

  Returns the stored `ServerComponentUpdate`s. The updates are NOT removed or modified by this call. The updates will be returned sorted by depth of their parent components within the hierarchy, but in otherwise random order.

  Returns:
    the updates

### init

    public void init(ClientUpdateManager clientUpdateManager)

  Initialization life-cycle method. Must be invoked before using the `ServerUpdateManager`.

  Parameters:
    `clientUpdateManager` - the `ClientUpdateManager` that will be used to process input from the client

### isEmpty

    public boolean isEmpty()

  Determines if the manager has no updates.

  Returns:
    true if the manager has no updates

### isFullRefreshRequired

    public boolean isFullRefreshRequired()

  Determines if a full refresh of the client state is required.

  Returns:
    true if a full refresh is required

### processApplicationPropertyUpdate

    public void processApplicationPropertyUpdate(java.lang.String propertyName,
                                                 java.lang.Object oldValue,
                                                 java.lang.Object newValue)

  Processes an update to a property of the `ApplicationInstance`.

  Parameters:
    `propertyName` - the name of the property
    `oldValue` - the previous value of the property
    `newValue` - the current value of the property

### processComponentAdd

    public void processComponentAdd(Component parent,
                                    Component child)

  Processes the addition of a component to the hierarchy. Creates/updates a `ServerComponentUpdate` if required.

  Parameters:
    `parent` - a component which currently exists in the hierarchy
    `child` - the component which was added to `parent`

### processComponentLayoutDataUpdate

    public void processComponentLayoutDataUpdate(Component updatedComponent)

  Processes an update to the `LayoutData` of a component. Creates/updates a `ServerComponentUpdate` if required.

  Parameters:
    `updatedComponent` - a component which currently exists in the hierarchy whose `LayoutData` has changed

### processComponentPropertyUpdate

    public void processComponentPropertyUpdate(Component updatedComponent,
                                               java.lang.String propertyName,
                                               java.lang.Object oldValue,
                                               java.lang.Object newValue)

  Processes an update to a property of a component (other than the `LayoutData` property). Creates/updates a `ServerComponentUpdate` if required.

  Parameters:
    `updatedComponent` - the component whose property(s) changed.
    `propertyName` - the name of the changed property
    `oldValue` - The previous value of the property
    `newValue` - The new value of the property

### processComponentRemove

    public void processComponentRemove(Component parent,
                                       Component child)

  Processes the removal of a component from the hierarchy. Creates/updates a `ServerComponentUpdate` if required.

  Parameters:
    `parent` - a component which currently exists in the hierarchy
    `child` - the component which was removed from `parent`

### processComponentVisibilityUpdate

    public void processComponentVisibilityUpdate(Component updatedComponent)

  Processes an update to the visible state of a component. Creates/updates a `ServerComponentUpdate` if required.

  Parameters:
    `updatedComponent` - a component which currently exists in the hierarchy whose visible state has changed.

### processFullRefresh

    public void processFullRefresh()

  Processes a full refresh of the application state, in response to a severe change, such as application locale or style sheet.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD