cd63d91b7378dc584147b926575f22b889e744a8
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / controller / config / yang / pcep / impl / PCEPDispatcherImplModule.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 /**
9  * Generated file
10
11  * Generated from: yang module name: pcep-impl  yang module local name: pcep-dispatcher-impl
12  * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
13  * Generated at: Wed Nov 06 13:16:39 CET 2013
14  *
15  * Do not modify this file unless it is present under src/main directory
16  */
17 package org.opendaylight.controller.config.yang.pcep.impl;
18
19 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
20 import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
21 import org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open;
23
24 /**
25  *
26  */
27 public final class PCEPDispatcherImplModule extends org.opendaylight.controller.config.yang.pcep.impl.AbstractPCEPDispatcherImplModule {
28
29     public PCEPDispatcherImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier name,
30             final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
31         super(name, dependencyResolver);
32     }
33
34     public PCEPDispatcherImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier name,
35             final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final PCEPDispatcherImplModule oldModule,
36             final java.lang.AutoCloseable oldInstance) {
37         super(name, dependencyResolver, oldModule, oldInstance);
38     }
39
40     @Override
41     public void validate() {
42         super.validate();
43         JmxAttributeValidationException.checkNotNull(getMaxUnknownMessages(), "value is not set.", maxUnknownMessagesJmxAttribute);
44         JmxAttributeValidationException.checkCondition(getMaxUnknownMessages() > 0, "Parameter 'maxUnknownMessages' "
45                 + "must be greater than 0", maxUnknownMessagesJmxAttribute);
46     }
47
48     @Override
49     public java.lang.AutoCloseable createInstance() {
50         Open localPrefs = getPcepSessionProposalFactoryDependency().getSessionProposal(null, 0);
51         DefaultPCEPSessionNegotiatorFactory negFactory = new DefaultPCEPSessionNegotiatorFactory(localPrefs, getMaxUnknownMessages());
52
53         return new PCEPDispatcherImpl(getPcepExtensionsDependency().getMessageHandlerRegistry(), negFactory, getBossGroupDependency(), getWorkerGroupDependency(), getMd5ChannelFactoryDependency(), getMd5ServerChannelFactoryDependency());
54     }
55 }