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
9 package org.opendaylight.openflowjava.eric;
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.openflowjava.eric.api.EricExtensionCodecRegistrator;
13 import org.opendaylight.openflowjava.eric.codec.match.EricMatchCodecs;
14 import org.opendaylight.openflowjava.eric.codec.match.Icmpv6NDOptionsTypeCodec;
15 import org.opendaylight.openflowjava.eric.codec.match.Icmpv6NDReservedCodec;
17 public class EricExtensionsRegistrator implements AutoCloseable {
18 private final EricExtensionCodecRegistrator registrator;
20 public EricExtensionsRegistrator(EricExtensionCodecRegistrator registrator) {
21 this.registrator = Preconditions.checkNotNull(registrator);
22 registrator.registerMatchEntrySerializer(Icmpv6NDReservedCodec.SERIALIZER_KEY,
23 EricMatchCodecs.ICMPV_6_ND_RESERVED_CODEC);
24 registrator.registerMatchEntrySerializer(Icmpv6NDOptionsTypeCodec.SERIALIZER_KEY,
25 EricMatchCodecs.ICMPV_6_ND_OPTIONS_TYPE_CODEC);
26 registrator.registerMatchEntryDeserializer(Icmpv6NDReservedCodec.DESERIALIZER_KEY,
27 EricMatchCodecs.ICMPV_6_ND_RESERVED_CODEC);
28 registrator.registerMatchEntryDeserializer(Icmpv6NDOptionsTypeCodec.DESERIALIZER_KEY,
29 EricMatchCodecs.ICMPV_6_ND_OPTIONS_TYPE_CODEC);
34 registrator.unregisterMatchEntrySerializer(Icmpv6NDReservedCodec.SERIALIZER_KEY);
35 registrator.unregisterMatchEntrySerializer(Icmpv6NDOptionsTypeCodec.SERIALIZER_KEY);
36 registrator.unregisterMatchEntryDeserializer(Icmpv6NDReservedCodec.DESERIALIZER_KEY);
37 registrator.unregisterMatchEntryDeserializer(Icmpv6NDOptionsTypeCodec.DESERIALIZER_KEY);