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-session-proposal-factory-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 java.net.InetSocketAddress;
21 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
22 import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
23 import org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open;
25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory;
31 public final class PCEPSessionProposalFactoryImplModule extends
32 org.opendaylight.controller.config.yang.pcep.impl.AbstractPCEPSessionProposalFactoryImplModule {
34 private static final Logger LOG = LoggerFactory.getLogger(PCEPSessionProposalFactoryImplModule.class);
36 public PCEPSessionProposalFactoryImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier name,
37 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
38 super(name, dependencyResolver);
41 public PCEPSessionProposalFactoryImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier name,
42 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
43 final PCEPSessionProposalFactoryImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
44 super(name, dependencyResolver, oldModule, oldInstance);
48 public void customValidation() {
49 JmxAttributeValidationException.checkNotNull(getDeadTimerValue(), "value is not set.", deadTimerValueJmxAttribute);
50 JmxAttributeValidationException.checkNotNull(getKeepAliveTimerValue(), "value is not set.", keepAliveTimerValueJmxAttribute);
51 if (getKeepAliveTimerValue() != 0) {
52 JmxAttributeValidationException.checkCondition(getKeepAliveTimerValue() >= 1, "minimum value is 1.",
53 keepAliveTimerValueJmxAttribute);
54 if (getDeadTimerValue() != 0 && (getDeadTimerValue() / getKeepAliveTimerValue() != 4)) {
55 LOG.warn("DeadTimerValue should be 4 times greater than KeepAliveTimerValue");
61 public java.lang.AutoCloseable createInstance() {
62 final BasePCEPSessionProposalFactory inner = new BasePCEPSessionProposalFactory(getDeadTimerValue(), getKeepAliveTimerValue());
63 return new PCEPSessionProposalFactoryCloseable(inner);
66 private static final class PCEPSessionProposalFactoryCloseable implements PCEPSessionProposalFactory, AutoCloseable {
68 private final BasePCEPSessionProposalFactory inner;
70 public PCEPSessionProposalFactoryCloseable(final BasePCEPSessionProposalFactory inner) {
80 public Open getSessionProposal(final InetSocketAddress inetSocketAddress, final int i) {
81 return this.inner.getSessionProposal(inetSocketAddress, i);