BUG-9079 Make PCEP session recoverable from exception
[bgpcep.git] / pcep / topology-provider / src / main / java / org / opendaylight / bgpcep / pcep / topology / provider / config / PCEPTopologyConfigDependencies.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. 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 package org.opendaylight.bgpcep.pcep.topology.provider.config;
9
10 import static com.google.common.base.Preconditions.checkNotNull;
11
12 import com.google.common.base.Optional;
13 import java.net.InetSocketAddress;
14 import org.opendaylight.bgpcep.programming.spi.InstructionScheduler;
15 import org.opendaylight.controller.config.yang.pcep.topology.provider.PCEPTopologyProviderRuntimeRegistrator;
16 import org.opendaylight.protocol.concepts.KeyMapping;
17 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
18
19 public final class PCEPTopologyConfigDependencies {
20     private final InetSocketAddress address;
21     private final KeyMapping keys;
22     private final InstructionScheduler scheduler;
23     private final TopologyId topologyId;
24     private final Optional<PCEPTopologyProviderRuntimeRegistrator> runtime;
25     private final short rpcTimeout;
26
27     public PCEPTopologyConfigDependencies(final InetSocketAddress address, final KeyMapping keys,
28         final InstructionScheduler scheduler, final TopologyId topologyId,
29         final Optional<PCEPTopologyProviderRuntimeRegistrator> runtime, final short rpcTimeout) {
30         this.address = checkNotNull(address);
31         this.keys = checkNotNull(keys);
32         this.scheduler = checkNotNull(scheduler);
33         this.topologyId = checkNotNull(topologyId);
34         this.runtime = checkNotNull(runtime);
35         this.rpcTimeout = rpcTimeout;
36     }
37
38     public TopologyId getTopologyId() {
39         return this.topologyId;
40     }
41
42     public InstructionScheduler getSchedulerDependency() {
43         return this.scheduler;
44     }
45
46     public short getRpcTimeout() {
47         return this.rpcTimeout;
48     }
49
50     public Optional<PCEPTopologyProviderRuntimeRegistrator> getRuntimeRootRegistrator() {
51         return this.runtime;
52     }
53
54     public InetSocketAddress getAddress() {
55         return this.address;
56     }
57
58     public KeyMapping getKeys() {
59         return this.keys;
60     }
61 }