4 * Generated from: yang module name: pcep-impl yang module local name: pcep-session-proposal-factory-impl
5 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
6 * Generated at: Wed Nov 06 13:16:39 CET 2013
8 * Do not modify this file unless it is present under src/main directory
10 package org.opendaylight.controller.config.yang.pcep.impl;
12 import java.net.InetSocketAddress;
14 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
15 import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
16 import org.opendaylight.protocol.pcep.impl.PCEPSessionProposalFactoryImpl;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
24 public final class PCEPSessionProposalFactoryImplModule extends
25 org.opendaylight.controller.config.yang.pcep.impl.AbstractPCEPSessionProposalFactoryImplModule {
27 private static final Logger LOG = LoggerFactory.getLogger(PCEPSessionProposalFactoryImplModule.class);
29 public PCEPSessionProposalFactoryImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier name,
30 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
31 super(name, dependencyResolver);
34 public PCEPSessionProposalFactoryImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier name,
35 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
36 final PCEPSessionProposalFactoryImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
37 super(name, dependencyResolver, oldModule, oldInstance);
41 public void validate() {
43 JmxAttributeValidationException.checkNotNull(getActive(), "value is not set.", this.activeJmxAttribute);
44 JmxAttributeValidationException.checkNotNull(getVersioned(), "value is not set.", this.versionedJmxAttribute);
45 JmxAttributeValidationException.checkNotNull(getInitiated(), "value is not set.", this.initiatedJmxAttribute);
46 JmxAttributeValidationException.checkNotNull(getDeadTimerValue(), "value is not set.", this.deadTimerValueJmxAttribute);
47 JmxAttributeValidationException.checkNotNull(getKeepAliveTimerValue(), "value is not set.", this.keepAliveTimerValueJmxAttribute);
48 if (getKeepAliveTimerValue() != 0) {
49 JmxAttributeValidationException.checkCondition(getKeepAliveTimerValue() >= 1, "minimum value is 1.",
50 this.keepAliveTimerValueJmxAttribute);
51 if (getDeadTimerValue() != 0 && (getDeadTimerValue() / getKeepAliveTimerValue() != 4)) {
52 LOG.warn("DeadTimerValue should be 4 times greater than KeepAliveTimerValue");
55 if ((getActive() || getVersioned()) && !getStateful()) {
58 JmxAttributeValidationException.checkNotNull(getStateful(), "value is not set.", this.statefulJmxAttribute);
62 public java.lang.AutoCloseable createInstance() {
63 final PCEPSessionProposalFactoryImpl inner = new PCEPSessionProposalFactoryImpl(getDeadTimerValue(), getKeepAliveTimerValue(), getStateful(), getActive(), getVersioned(), getInitiated());
64 return new PCEPSessionProposalFactoryCloseable(inner);
67 private static final class PCEPSessionProposalFactoryCloseable implements PCEPSessionProposalFactory, AutoCloseable {
69 private final PCEPSessionProposalFactoryImpl inner;
71 public PCEPSessionProposalFactoryCloseable(final PCEPSessionProposalFactoryImpl inner) {
76 public void close() throws Exception {
80 public Open getSessionProposal(final InetSocketAddress inetSocketAddress, final int i) {
81 return this.inner.getSessionProposal(inetSocketAddress, i);