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
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
15 * Do not modify this file unless it is present under src/main directory
17 package org.opendaylight.controller.config.yang.pcep.impl;
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;
27 public final class PCEPDispatcherImplModule extends org.opendaylight.controller.config.yang.pcep.impl.AbstractPCEPDispatcherImplModule {
29 private static final String VALUE_IS_NOT_SET = "value is not set.";
30 private static final String KEYSTORE = "keystore";
31 private static final String TRUSTSTORE = "truststore";
32 private static final String PASSWORD = " password ";
33 private static final String LOCATION = " location ";
34 private static final String TYPE = " type ";
35 private static final String PATH_TYPE = " path" + TYPE;
37 public PCEPDispatcherImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier name,
38 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
39 super(name, dependencyResolver);
42 public PCEPDispatcherImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier name,
43 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final PCEPDispatcherImplModule oldModule,
44 final java.lang.AutoCloseable oldInstance) {
45 super(name, dependencyResolver, oldModule, oldInstance);
49 public void validate() {
51 JmxAttributeValidationException.checkNotNull(getMaxUnknownMessages(), VALUE_IS_NOT_SET, maxUnknownMessagesJmxAttribute);
52 JmxAttributeValidationException.checkCondition(getMaxUnknownMessages() > 0, "Parameter 'maxUnknownMessages' "
53 + "must be greater than 0", maxUnknownMessagesJmxAttribute);
54 if (getTls() != null) {
55 JmxAttributeValidationException.checkNotNull(getTls().getCertificatePassword(), "certificate" + PASSWORD + VALUE_IS_NOT_SET, tlsJmxAttribute);
56 JmxAttributeValidationException.checkNotNull(getTls().getKeystore(), KEYSTORE + LOCATION + VALUE_IS_NOT_SET, tlsJmxAttribute);
57 JmxAttributeValidationException.checkNotNull(getTls().getKeystorePassword(), KEYSTORE + PASSWORD + VALUE_IS_NOT_SET, tlsJmxAttribute);
58 JmxAttributeValidationException.checkNotNull(getTls().getKeystorePathType(), KEYSTORE + PATH_TYPE + VALUE_IS_NOT_SET, tlsJmxAttribute);
59 JmxAttributeValidationException.checkNotNull(getTls().getKeystoreType(), KEYSTORE + TYPE + VALUE_IS_NOT_SET, tlsJmxAttribute);
60 JmxAttributeValidationException.checkNotNull(getTls().getTruststore(), TRUSTSTORE + LOCATION + VALUE_IS_NOT_SET, tlsJmxAttribute);
61 JmxAttributeValidationException.checkNotNull(getTls().getTruststorePassword(), TRUSTSTORE + PASSWORD + VALUE_IS_NOT_SET, tlsJmxAttribute);
62 JmxAttributeValidationException.checkNotNull(getTls().getTruststorePathType(), TRUSTSTORE + PATH_TYPE + VALUE_IS_NOT_SET, tlsJmxAttribute);
63 JmxAttributeValidationException.checkNotNull(getTls().getTruststoreType(), TRUSTSTORE + TYPE + VALUE_IS_NOT_SET, tlsJmxAttribute);
68 public java.lang.AutoCloseable createInstance() {
69 Open localPrefs = getPcepSessionProposalFactoryDependency().getSessionProposal(null, 0);
70 DefaultPCEPSessionNegotiatorFactory negFactory = new DefaultPCEPSessionNegotiatorFactory(localPrefs, getMaxUnknownMessages(), getTls());
72 return new PCEPDispatcherImpl(getPcepExtensionsDependency().getMessageHandlerRegistry(), negFactory, getBossGroupDependency(), getWorkerGroupDependency(), getMd5ChannelFactoryDependency(), getMd5ServerChannelFactoryDependency());