Search in sources :

Example 1 with PlatformDotNetBinaryConfiguration

use of org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration in project ignite by apache.

the class PlatformConfigurationUtils method writeDotNetConfiguration.

/**
     * Write .Net configuration to the stream.
     *
     * @param writer Writer.
     * @param cfg Configuration.
     */
public static void writeDotNetConfiguration(BinaryRawWriterEx writer, PlatformDotNetConfiguration cfg) {
    // 1. Write assemblies.
    PlatformUtils.writeNullableCollection(writer, cfg.getAssemblies());
    PlatformDotNetBinaryConfiguration binaryCfg = cfg.getBinaryConfiguration();
    if (binaryCfg != null) {
        writer.writeBoolean(true);
        PlatformUtils.writeNullableCollection(writer, binaryCfg.getTypesConfiguration(), new PlatformWriterClosure<PlatformDotNetBinaryTypeConfiguration>() {

            @Override
            public void write(BinaryRawWriterEx writer, PlatformDotNetBinaryTypeConfiguration typ) {
                writer.writeString(typ.getTypeName());
                writer.writeString(typ.getNameMapper());
                writer.writeString(typ.getIdMapper());
                writer.writeString(typ.getSerializer());
                writer.writeString(typ.getAffinityKeyFieldName());
                writer.writeObject(typ.getKeepDeserialized());
                writer.writeBoolean(typ.isEnum());
            }
        });
        PlatformUtils.writeNullableCollection(writer, binaryCfg.getTypes());
        writer.writeString(binaryCfg.getDefaultNameMapper());
        writer.writeString(binaryCfg.getDefaultIdMapper());
        writer.writeString(binaryCfg.getDefaultSerializer());
        writer.writeBoolean(binaryCfg.isDefaultKeepDeserialized());
    } else
        writer.writeBoolean(false);
}
Also used : PlatformDotNetBinaryTypeConfiguration(org.apache.ignite.platform.dotnet.PlatformDotNetBinaryTypeConfiguration) PlatformDotNetBinaryConfiguration(org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration) BinaryRawWriterEx(org.apache.ignite.internal.binary.BinaryRawWriterEx)

Aggregations

BinaryRawWriterEx (org.apache.ignite.internal.binary.BinaryRawWriterEx)1 PlatformDotNetBinaryConfiguration (org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration)1 PlatformDotNetBinaryTypeConfiguration (org.apache.ignite.platform.dotnet.PlatformDotNetBinaryTypeConfiguration)1