2 * Copyright (c) 2019 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowjava.eric;
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.openflowjava.eric.api.EricExtensionCodecRegistrator;
12 import org.opendaylight.openflowjava.eric.codec.match.Icmpv6NDOptionsTypeCodec;
13 import org.opendaylight.openflowjava.eric.codec.match.Icmpv6NDReservedCodec;
15 public class EricExtensionsRegistrator implements AutoCloseable {
16 private final EricExtensionCodecRegistrator registrator;
18 public EricExtensionsRegistrator(EricExtensionCodecRegistrator registrator) {
19 this.registrator = Preconditions.checkNotNull(registrator);
20 registrator.registerMatchEntrySerializer(Icmpv6NDReservedCodec.SERIALIZER_KEY,
21 Icmpv6NDReservedCodec.INSTANCE);
22 registrator.registerMatchEntrySerializer(Icmpv6NDOptionsTypeCodec.SERIALIZER_KEY,
23 Icmpv6NDOptionsTypeCodec.INSTANCE);
24 registrator.registerMatchEntryDeserializer(Icmpv6NDReservedCodec.DESERIALIZER_KEY,
25 Icmpv6NDReservedCodec.INSTANCE);
26 registrator.registerMatchEntryDeserializer(Icmpv6NDOptionsTypeCodec.DESERIALIZER_KEY,
27 Icmpv6NDOptionsTypeCodec.INSTANCE);
32 registrator.unregisterMatchEntrySerializer(Icmpv6NDReservedCodec.SERIALIZER_KEY);
33 registrator.unregisterMatchEntrySerializer(Icmpv6NDOptionsTypeCodec.SERIALIZER_KEY);
34 registrator.unregisterMatchEntryDeserializer(Icmpv6NDReservedCodec.DESERIALIZER_KEY);
35 registrator.unregisterMatchEntryDeserializer(Icmpv6NDOptionsTypeCodec.DESERIALIZER_KEY);