Eliminate network-pcep-topology-config
[bgpcep.git] / pcep / topology / topology-provider / src / main / java / org / opendaylight / bgpcep / pcep / topology / provider / PCEPDispatcherDependenciesImpl.java
1 /*
2  * Copyright (c) 2017 AT&T Intellectual Property. 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;
9
10 import static java.util.Objects.requireNonNull;
11
12 import java.net.InetSocketAddress;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.protocol.concepts.KeyMapping;
15 import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
16 import org.opendaylight.protocol.pcep.PCEPPeerProposal;
17 import org.opendaylight.protocol.pcep.PCEPSessionListenerFactory;
18
19 final class PCEPDispatcherDependenciesImpl implements PCEPDispatcherDependencies {
20     private final @NonNull PCEPSessionListenerFactory listenerFactory;
21     private final @NonNull PCEPPeerProposal peerProposal;
22
23     private final @NonNull PCEPTopologyConfiguration topologyConfig;
24
25     PCEPDispatcherDependenciesImpl(final PCEPSessionListenerFactory listenerFactory,
26             final PCEPPeerProposal peerProposal, final PCEPTopologyConfiguration topologyConfig) {
27         this.listenerFactory = requireNonNull(listenerFactory);
28         this.peerProposal = requireNonNull(peerProposal);
29         this.topologyConfig = requireNonNull(topologyConfig);
30     }
31
32     @Override
33     public PCEPSessionListenerFactory getListenerFactory() {
34         return listenerFactory;
35     }
36
37     @Override
38     public PCEPPeerProposal getPeerProposal() {
39         return peerProposal;
40     }
41
42     @Override
43     public InetSocketAddress getAddress() {
44         return topologyConfig.getAddress();
45     }
46
47     @Override
48     public KeyMapping getKeys() {
49         return topologyConfig.getKeys();
50     }
51 }