Interface EmgMessage
- All Known Implementing Classes:
BillingNotification, FabricNotification, IbxNotification, ManagedServiceNotification, NetworkNotification, OrderNotification, UnknownNotification
public sealed interface EmgMessage
permits IbxNotification, NetworkNotification, FabricNotification, BillingNotification, OrderNotification, ManagedServiceNotification, UnknownNotification
A parsed Equinix Messaging Gateway notification. The hierarchy is sealed, so a
switch
over it is checked for exhaustiveness by the compiler:
switch (message) {
case IbxNotification m -> ...;
case NetworkNotification m -> ...;
case FabricNotification m -> ...;
case BillingNotification m -> ...;
case OrderNotification m -> ...;
case ManagedServiceNotification m -> ...;
case UnknownNotification m -> ...;
}
Every implementation is an immutable record carrying the common EmgHeader and the
exact JSON text it was parsed from (rawJson()).
-
Method Summary
Modifier and TypeMethodDescriptionheader()The header attributes shared by every notification.default Stringid()Shortcut forheader().id(): EMG delivers at least once, so use this as the key to de-duplicate redelivered notifications.rawJson()The complete envelope exactly as received (UTF-8 decoded, BOM removed), for auditing or for fields this SDK version does not model.
-
Method Details
-
header
EmgHeader header()The header attributes shared by every notification.- Returns:
- the header, never
null
-
rawJson
String rawJson()The complete envelope exactly as received (UTF-8 decoded, BOM removed), for auditing or for fields this SDK version does not model.- Returns:
- the raw JSON text
-
id
Shortcut forheader().id(): EMG delivers at least once, so use this as the key to de-duplicate redelivered notifications.- Returns:
- the message id, or
nullif the notification carried none
-