org.appng.api.messaging

## Class Event

- java.lang.Object
- - org.appng.api.messaging.Event

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    HeartBeat.HeartBeatEvent, NodeEvent, ReloadSiteEvent, ReloadTemplateEvent, RequestNodeState, SiteDeletedEvent, SiteStateEvent, StopSiteEvent

      public abstract class Event
      extends Object
      implements Serializable

  An event can be send by a `Sender` to multiple `Receiver`s.
  Author:
    Matthias Müller
  See Also:
    `Sender`, `Receiver`, `Site.sendEvent(Event)`, Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Event()`
    `protected` | `Event(String siteName)` Creates a new event

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getNodeId()` Returns the node id of this event, i.e.
    `String` | `getSiteName()` Returns the name of the origin `Site` this event was created for
    `abstract void` | `perform(Environment environment, Site site)` Performs the event
    `protected void` | `setNodeId(String nodeId)`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### Event

          protected Event()

    - #### Event

          protected Event(String siteName)

      Creates a new event
      Parameters:
        `siteName` - the name of the `Site` this event is for

  - ### Method Detail

    - #### getNodeId

          public String getNodeId()

      Returns the node id of this event, i.e. the node id of the origin node. The node id is automatically set by the `Serializer` when serializing the event.
      Returns:
        the node id

    - #### setNodeId

          protected void setNodeId(String nodeId)

    - #### getSiteName

          public String getSiteName()

      Returns the name of the origin `Site` this event was created for
      Returns:
        the name of the `Site`

    - #### perform

          public abstract void perform(Environment environment,
                                       Site site)
                                throws InvalidConfigurationException,
                                       BusinessException

      Performs the event
      Parameters:
        `environment` - then `Environment` to use
        `site` - the `Site` where the event occurred
      Throws:
        `InvalidConfigurationException` - if there's a configuration error
        `BusinessException` - if an error occurs while performing the event

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.