2 * Copyright (c) 2013 Cisco Systems, Inc. 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.protocol.pcep.spi.pojo;
10 import javax.annotation.concurrent.ThreadSafe;
12 import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry;
13 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
14 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
15 import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
16 import org.opendaylight.protocol.pcep.spi.LabelParser;
17 import org.opendaylight.protocol.pcep.spi.LabelSerializer;
18 import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
19 import org.opendaylight.protocol.pcep.spi.MessageParser;
20 import org.opendaylight.protocol.pcep.spi.MessageSerializer;
21 import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
22 import org.opendaylight.protocol.pcep.spi.ObjectParser;
23 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
24 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
25 import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
26 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
27 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
28 import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
29 import org.opendaylight.protocol.pcep.spi.TlvParser;
30 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
31 import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
32 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
33 import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.SubobjectType;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.LabelType;
44 public class SimplePCEPExtensionProviderContext implements PCEPExtensionProviderContext {
45 private final SimpleLabelHandlerRegistry labelReg = new SimpleLabelHandlerRegistry();
46 private final SimpleMessageHandlerRegistry msgReg = new SimpleMessageHandlerRegistry();
47 private final SimpleObjectHandlerRegistry objReg = new SimpleObjectHandlerRegistry();
48 private final SimpleEROSubobjectHandlerRegistry eroSubReg = new SimpleEROSubobjectHandlerRegistry();
49 private final SimpleRROSubobjectHandlerRegistry rroSubReg = new SimpleRROSubobjectHandlerRegistry();
50 private final SimpleXROSubobjectHandlerRegistry xroSubReg = new SimpleXROSubobjectHandlerRegistry();
51 private final SimpleTlvHandlerRegistry tlvReg = new SimpleTlvHandlerRegistry();
54 public final LabelHandlerRegistry getLabelHandlerRegistry() {
59 public final MessageHandlerRegistry getMessageHandlerRegistry() {
64 public final ObjectHandlerRegistry getObjectHandlerRegistry() {
69 public final EROSubobjectHandlerRegistry getEROSubobjectHandlerRegistry() {
70 return this.eroSubReg;
74 public final RROSubobjectHandlerRegistry getRROSubobjectHandlerRegistry() {
75 return this.rroSubReg;
79 public final XROSubobjectHandlerRegistry getXROSubobjectHandlerRegistry() {
80 return this.xroSubReg;
84 public final TlvHandlerRegistry getTlvHandlerRegistry() {
89 public final AutoCloseable registerLabelSerializer(final Class<? extends LabelType> labelClass, final LabelSerializer serializer) {
90 return this.labelReg.registerLabelSerializer(labelClass, serializer);
94 public final AutoCloseable registerLabelParser(final int cType, final LabelParser parser) {
95 return this.labelReg.registerLabelParser(cType, parser);
99 public final AutoCloseable registerEROSubobjectParser(final int subobjectType, final EROSubobjectParser parser) {
100 return this.eroSubReg.registerSubobjectParser(subobjectType, parser);
104 public final AutoCloseable registerEROSubobjectSerializer(final Class<? extends SubobjectType> subobjectClass,
105 final EROSubobjectSerializer serializer) {
106 return this.eroSubReg.registerSubobjectSerializer(subobjectClass, serializer);
110 public final AutoCloseable registerMessageParser(final int messageType, final MessageParser parser) {
111 return this.msgReg.registerMessageParser(messageType, parser);
115 public final AutoCloseable registerMessageSerializer(final Class<? extends Message> msgClass, final MessageSerializer serializer) {
116 return this.msgReg.registerMessageSerializer(msgClass, serializer);
120 public final AutoCloseable registerObjectParser(final int objectClass, final int objectType, final ObjectParser parser) {
121 return this.objReg.registerObjectParser(objectClass, objectType, parser);
125 public final AutoCloseable registerObjectSerializer(final Class<? extends Object> objClass, final ObjectSerializer serializer) {
126 return this.objReg.registerObjectSerializer(objClass, serializer);
130 public final AutoCloseable registerRROSubobjectParser(final int subobjectType, final RROSubobjectParser parser) {
131 return this.rroSubReg.registerSubobjectParser(subobjectType, parser);
135 public final AutoCloseable registerRROSubobjectSerializer(
136 final Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.SubobjectType> subobjectClass,
137 final RROSubobjectSerializer serializer) {
138 return this.rroSubReg.registerSubobjectSerializer(subobjectClass, serializer);
142 public AutoCloseable registerTlvParser(final int tlvType, final TlvParser parser) {
143 return this.tlvReg.registerTlvParser(tlvType, parser);
147 public final AutoCloseable registerTlvSerializer(final Class<? extends Tlv> tlvClass, final TlvSerializer serializer) {
148 return this.tlvReg.registerTlvSerializer(tlvClass, serializer);
152 public final AutoCloseable registerXROSubobjectParser(final int subobjectType, final XROSubobjectParser parser) {
153 return this.xroSubReg.registerSubobjectParser(subobjectType, parser);
157 public final AutoCloseable registerXROSubobjectSerializer(final Class<? extends SubobjectType> subobjectClass,
158 final XROSubobjectSerializer serializer) {
159 return this.xroSubReg.registerSubobjectSerializer(subobjectClass, serializer);