Class AggregateAdapter
java.lang.Object
com.inductiveautomation.ignition.common.historian.rpc.adapters.AggregateAdapter
- All Implemented Interfaces:
BinaryAdapter<Aggregate>, BinaryDeserializer<Aggregate>, BinarySerializer<Aggregate>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode(byte[] serialized, DeserializationContext context) byte[]encode(Aggregate any, SerializationContext context) static AggregateAdapterResolves which kind of aggregatepbcarries.static voidsetKind(HistoryAggregateProto.AggregatePB.Builder builder, HistoryAggregateProto.AggregateKind kind) Sets both aggregate discriminators onbuilder: thekindread by current gateways and the legacytyperead by 8.3 gateways.
-
Constructor Details
-
AggregateAdapter
public AggregateAdapter()
-
-
Method Details
-
getInstance
-
setKind
public static void setKind(HistoryAggregateProto.AggregatePB.Builder builder, HistoryAggregateProto.AggregateKind kind) Sets both aggregate discriminators onbuilder: thekindread by current gateways and the legacytyperead by 8.3 gateways.- Parameters:
kind- the aggregate kind; must not beAggregateKind#Kind_Unspecified.
-
resolveKind
Resolves which kind of aggregatepbcarries. Preferskind; when it is unset the sender predates it, and when it is a value this gateway does not know the sender is newer, so in both cases the legacytypeis used instead.Legacy type zero doubles as the proto3 default, so it only resolves to an ad hoc python aggregate when the python payload is present.
- Returns:
- the resolved kind, or
AggregateKind#Kind_Unspecifiedwhen neither discriminator identifies a decodable aggregate.
-
decode
public Aggregate decode(byte[] serialized, DeserializationContext context) throws ProtoSerializationException - Specified by:
decodein interfaceBinaryDeserializer<Aggregate>- Throws:
ProtoSerializationException
-
encode
public byte[] encode(Aggregate any, SerializationContext context) throws ProtoSerializationException - Specified by:
encodein interfaceBinarySerializer<Aggregate>- Throws:
ProtoSerializationException
-