Class VAPIDEnvelope

java.lang.Object
org.deltava.mail.VAPIDEnvelope
All Implemented Interfaces:
Serializable, Cloneable, Comparable<NotificationEnvelope<?>>, NotificationEnvelope<PushEndpoint>

public class VAPIDEnvelope extends Object implements NotificationEnvelope<PushEndpoint>
An envelope for VAPID messages.
Since:
10.0
Version:
10.6
Author:
Luke
See Also:
  • Constructor Details

    • VAPIDEnvelope

      public VAPIDEnvelope(PushEndpoint ep)
      Creates the envelope.
      Parameters:
      ep - the PushEndpoint to send to
  • Method Details

    • getAudience

      public String getAudience()
      Returns the audience used to generate the JWT for this message.
      Returns:
      the procotol/domain
    • getBody

      public String getBody()
      Returns the message body.
      Returns:
      the body
    • getCreatedOn

      public Instant getCreatedOn()
      Description copied from interface: NotificationEnvelope
      Returns the envelope creation date.
      Specified by:
      getCreatedOn in interface NotificationEnvelope<PushEndpoint>
      Returns:
      the creation date/time
    • getEndpoint

      public PushEndpoint getEndpoint()
      Description copied from interface: NotificationEnvelope
      Returns the destination address.
      Specified by:
      getEndpoint in interface NotificationEnvelope<PushEndpoint>
      Returns:
      the address
    • getProtocol

      public NotificationEnvelope.Protocol getProtocol()
      Description copied from interface: NotificationEnvelope
      Returns this envelope's notification protocol.
      Specified by:
      getProtocol in interface NotificationEnvelope<PushEndpoint>
      Returns:
      the Protocol
    • getExpiryTime

      public Instant getExpiryTime()
      Returns the expiration time of this Envelope within the VAPID service.
      Returns:
      the expiration date/time
    • getToken

      public String getToken()
      Returns the JWT token.
      Returns:
      the JWT token, or null if not generated
    • setBody

      public void setBody(String body)
      Updates the message body.
      Parameters:
      body - the body text
    • setToken

      public void setToken(String jwt)
      Updates the JWT token used to authenticate this message.
      Parameters:
      jwt - the JWT token
    • setExpirationTime

      public void setExpirationTime(Instant dt)
      Updates the expiration time of this Envelope within the VAPID service. The expiration time must be non-null and after the creation time.
      Parameters:
      dt - the expiration date/time