Record Class ScenarioFile.SecurityJson

java.lang.Object
java.lang.Record
org.acemq.workloads.scenario.ScenarioFile.SecurityJson
Record Components:
mode - required to verify, insecure to accept any certificate, disabled for no TLS at all
truststore - a PKCS#12 or JKS keystore holding the CA to trust, and a client certificate when one is needed
truststorePassword - the password for it. Read from the file and never written back to one -- see below
allowDevelopmentCertificates - whether a certificate marked as a development one is acceptable. Brokers that generate their own certificate on first boot mark it; a production run should refuse it, and that is the default.
Enclosing class:
ScenarioFile

public static record ScenarioFile.SecurityJson(String mode, String truststore, String truststorePassword, Boolean allowDevelopmentCertificates) extends Record
How to reach a broker over TLS.

The URL decides whether TLS is used at all -- amqps:// or nothing. What a URL cannot carry is which certificates to believe, and that is what this is for: a private certificate authority, or a client certificate, in a keystore.

  • Constructor Details

    • SecurityJson

      public SecurityJson(String mode, String truststore, String truststorePassword, Boolean allowDevelopmentCertificates)
      Creates an instance of a SecurityJson record class.
      Parameters:
      mode - the value for the mode record component
      truststore - the value for the truststore record component
      truststorePassword - the value for the truststorePassword record component
      allowDevelopmentCertificates - the value for the allowDevelopmentCertificates record component
  • Method Details

    • toSecurity

      public org.acemq.amqp.security.Security toSecurity()
      Returns:
      the client's security policy, or null when this says nothing
      Throws:
      ScenarioReader.ScenarioFormatException - if the mode is not a mode
    • 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.
    • mode

      public String mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • truststore

      public String truststore()
      Returns the value of the truststore record component.
      Returns:
      the value of the truststore record component
    • truststorePassword

      public String truststorePassword()
      Returns the value of the truststorePassword record component.
      Returns:
      the value of the truststorePassword record component
    • allowDevelopmentCertificates

      public Boolean allowDevelopmentCertificates()
      Returns the value of the allowDevelopmentCertificates record component.
      Returns:
      the value of the allowDevelopmentCertificates record component