org.apache.tapestry5.alerts

## Class AlertStorage

- java.lang.Object
- - org.apache.tapestry5.ioc.internal.util.LockSupport
  - - org.apache.tapestry5.alerts.AlertStorage

- All Implemented Interfaces:
    Serializable, OptimizedSessionPersistedObject

      public class AlertStorage
      extends LockSupport
      implements Serializable, OptimizedSessionPersistedObject

  A stateless session object used to store Alerts between requests.
  Since:
    5.3
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AlertStorage()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(Alert alert)`
    `boolean` | `checkAndResetDirtyMarker()`
    `void` | `dismiss(long alertId)` Dismisses a single Alert, if present.
    `void` | `dismissAll()` Dismisses all Alerts.
    `void` | `dismissNonPersistent()` Dismisses non-persistent Alerts; this is useful after rendering the `Alerts` component.
    `List<Alert>` | `getAlerts()` Returns all stored alerts.

    - ### Methods inherited from class org.apache.tapestry5.ioc.internal.util.LockSupport

      `acquireReadLock, downgradeWriteLockToReadLock, releaseReadLock, releaseWriteLock, takeWriteLock, upgradeReadLockToWriteLock`

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

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

- - ### Constructor Detail

    - #### AlertStorage

          public AlertStorage()

  - ### Method Detail

    - #### checkAndResetDirtyMarker

          public boolean checkAndResetDirtyMarker()

      Specified by:
        `checkAndResetDirtyMarker` in interface `OptimizedSessionPersistedObject`
      Returns:
        true if the object has in-memory changes since the last time this method was called.

    - #### add

          public void add(Alert alert)

    - #### dismissAll

          public void dismissAll()

      Dismisses all Alerts.

    - #### dismissNonPersistent

          public void dismissNonPersistent()

      Dismisses non-persistent Alerts; this is useful after rendering the `Alerts` component.

    - #### dismiss

          public void dismiss(long alertId)

      Dismisses a single Alert, if present.

    - #### getAlerts

          public List<Alert> getAlerts()

      Returns all stored alerts.
      Returns:
        list of alerts (possibly empty)

${project.version} - Copyright © 2003-2014 The Apache Software Foundation.