Class TagProviderService2VersionAdapter.ParameterVersionJavaSerializationCodec

  • All Implemented Interfaces:
    com.inductiveautomation.metro.api.MessageCodec
    Enclosing class:
    TagProviderService2VersionAdapter

    protected static class TagProviderService2VersionAdapter.ParameterVersionJavaSerializationCodec
    extends java.lang.Object
    implements com.inductiveautomation.metro.api.MessageCodec
    This class does some trickery to avoid sending our new Parameters and ParameterValues to old gateays. It uses a custom serializer to swap those out for objects that are compatible with older version.
    • Field Detail

      • logger

        protected static final org.apache.log4j.Logger logger
    • Constructor Detail

      • ParameterVersionJavaSerializationCodec

        protected ParameterVersionJavaSerializationCodec()
    • Method Detail

      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface com.inductiveautomation.metro.api.MessageCodec
      • serialize

        protected byte[] serialize​(java.io.Serializable object)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • encode

        public java.io.InputStream encode​(java.lang.Object data)
                                   throws java.lang.Exception
        Specified by:
        encode in interface com.inductiveautomation.metro.api.MessageCodec
        Throws:
        java.lang.Exception
      • decode

        public java.lang.Object decode​(java.io.InputStream inputStream)
                                throws java.lang.Exception
        Specified by:
        decode in interface com.inductiveautomation.metro.api.MessageCodec
        Throws:
        java.lang.Exception
      • createObjectInputStream

        protected java.io.ObjectInputStream createObjectInputStream​(java.io.InputStream is)
                                                             throws java.io.IOException
        Note that when Metro is used with Ignition, this method never gets called. Instead, ModuleSerializationCodec.createObjectInputStream gets called.
        Throws:
        java.io.IOException