Reduce number of paramaters for PCEP Dispatcher
[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
9 package org.opendaylight.bgpcep.pcep.topology.provider;
10
11 import static java.util.Objects.requireNonNull;
12
13 import java.net.InetSocketAddress;
14 import javax.annotation.Nonnull;
15 import org.opendaylight.bgpcep.pcep.topology.provider.config.PCEPTopologyConfiguration;
16 import org.opendaylight.protocol.concepts.KeyMapping;
17 import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
18 import org.opendaylight.protocol.pcep.PCEPPeerProposal;
19 import org.opendaylight.protocol.pcep.PCEPSessionListenerFactory;
20
21 public final class PCEPDispatcherDependenciesImpl implements PCEPDispatcherDependencies {
22     private final ServerSessionManager manager;
23     private final PCEPTopologyConfiguration topologyConfigDependencies;
24
25     public PCEPDispatcherDependenciesImpl(
26             @Nonnull final ServerSessionManager manager,
27             @Nonnull final PCEPTopologyConfiguration topologyConfigDependencies
28     ) {
29         this.manager = requireNonNull(manager);
30         this.topologyConfigDependencies = requireNonNull(topologyConfigDependencies);
31     }
32
33     @Override
34     public InetSocketAddress getAddress() {
35         return this.topologyConfigDependencies.getAddress();
36     }
37
38     @Override
39     public KeyMapping getKeys() {
40         return this.topologyConfigDependencies.getKeys();
41     }
42
43     @Override
44     public PCEPSessionListenerFactory getListenerFactory() {
45         return this.manager;
46     }
47
48     @Override
49     public PCEPPeerProposal getPeerProposal() {
50         return this.manager;
51     }
52 }