Record Class EmgHeader

java.lang.Object
java.lang.Record
com.eqixiac.equinix.messaging.EmgHeader
Record Components:
id - Task.Id: unique per message; the natural idempotency key
source - Task.Source: identifies the sender; issued when EMG is enabled
verb - Task.Verb
resource - Task.Resource: the Equinix product, e.g. DataCenter.Maintenance
contentType - Task.ContentType, normally application/json
creationTime - Task.CreationTimeUTC, or null if absent or unparseable
version - Task.Version: "1.0" or "2.0" in the spec
signature - the envelope Signature (Base64, trimmed). Equinix does not document a verification algorithm, so the SDK exposes it but does not verify it.

public record EmgHeader(String id, String source, EmgVerb verb, String resource, String contentType, Instant creationTime, String version, String signature) extends Record
The header attributes common to every EMG notification: the Task attributes other than Body, plus the envelope's Signature.

Attribute names are matched case-insensitively (Id and the documented ID are the same), and CreateTimeUTC (the name in the header attribute list of the Notification Types guide) is accepted as an alias of CreationTimeUTC (the name in the AsyncAPI spec and every documented sample).

  • Constructor Details

    • EmgHeader

      public EmgHeader(String id, String source, EmgVerb verb, String resource, String contentType, Instant creationTime, String version, String signature)
      Creates an instance of a EmgHeader record class.
      Parameters:
      id - the value for the id record component
      source - the value for the source record component
      verb - the value for the verb record component
      resource - the value for the resource record component
      contentType - the value for the contentType record component
      creationTime - the value for the creationTime record component
      version - the value for the version record component
      signature - the value for the signature record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • source

      public String source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • verb

      public EmgVerb verb()
      Returns the value of the verb record component.
      Returns:
      the value of the verb record component
    • resource

      public String resource()
      Returns the value of the resource record component.
      Returns:
      the value of the resource record component
    • contentType

      public String contentType()
      Returns the value of the contentType record component.
      Returns:
      the value of the contentType record component
    • creationTime

      public Instant creationTime()
      Returns the value of the creationTime record component.
      Returns:
      the value of the creationTime record component
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • signature

      public String signature()
      Returns the value of the signature record component.
      Returns:
      the value of the signature record component