2 * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.protocol.api.extensibility;
14 * Stores and handles serializers
15 * @author michal.polkorab
18 public interface SerializerRegistry {
21 * Serializer registry provisioning
26 * @param msgTypeKey lookup key
27 * @return serializer or NullPointerException if no serializer was found
29 <KEYTYPE, SERIALIZERTYPE extends OFGeneralSerializer> SERIALIZERTYPE
30 getSerializer(MessageTypeKey<KEYTYPE> msgTypeKey);
33 * Registers serializer
34 * Throws IllegalStateException when there is
35 * a serializer already registered under given key.
37 * If the serializer implements {@link SerializerRegistryInjector} interface,
38 * the serializer is injected with SerializerRegistry instance.
40 * @param key used for serializer lookup
41 * @param serializer serializer implementation
43 <KEYTYPE> void registerSerializer(MessageTypeKey<KEYTYPE> key,
44 OFGeneralSerializer serializer);
47 * Unregisters serializer
48 * @param key used for serializer lookup
49 * @param serializer serializer implementation
50 * @return true if serializer was removed,
51 * false if no serializer was found under specified key
53 <KEYTYPE> boolean unregisterSerializer(MessageTypeKey<KEYTYPE> key);