Record Class RedundancySignature
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.gateway.redundancy.types.RedundancySignature
- Record Components:
id
- An id that is unique to an object in the gateway, such as a UUID or a full path. Implements Comparable since the ids have to be sorted in a consistent way to generate a digest of object signatures. Also, the id's equals() and hashcode() methods may need to be overridden, to ensure that ids can be properly compared to whatever makes them unique.digest
- An ImmutableBytes value that is derived by calculating an object's signature using the SHA-256 algorithm. Use DigestBuilder.sha256() to add message properties to a DigestBuilder, then use DigestBuilder.build() to encode the digest into bytes for comparison. IMPORTANT When adding items to a DigestBuilder, they absolutely must be added in a repeatable order. Failure to do so can result in the digest calculation being different for objects with the same properties.
A RedundancySignature is used to compare an object between gateways. If the calculated digests are the same, the
underlying objects are the same as well. If they are different, then a BasicRedundancyDiff needs to be created, and
the more up-to-date object needs to be added to the diff so that it can be applied to the other gateway.
-
Constructor Summary
ConstructorsConstructorDescriptionRedundancySignature
(Comparable<?> id, ImmutableBytes digest) Creates an instance of aRedundancySignature
record class. -
Method Summary
Modifier and TypeMethodDescriptiondigest()
Returns the value of thedigest
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Comparable<?>
id()
Returns the value of theid
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
digest
Returns the value of thedigest
record component.- Returns:
- the value of the
digest
record component
-