ec947e9aa5114d426ecc5b8e54ea352616f81045
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / core / connection / ConnectionConfigurationImpl.java
1 /*
2  * Copyright (c) 2013 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
9 package org.opendaylight.openflowjava.protocol.impl.core.connection;
10
11 import java.net.InetAddress;
12
13 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
14 import org.opendaylight.openflowjava.protocol.api.connection.StatisticsConfiguration;
15 import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration;
16 import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.provider.impl.rev140328.modules.module.configuration.openflow._switch.connection.provider.impl.Statistics;
19
20 /**
21  * @author michal.polkorab
22  *
23  */
24 public class ConnectionConfigurationImpl implements ConnectionConfiguration {
25
26     private InetAddress address;
27     private int port;
28     private Object transferProtocol;
29     private TlsConfiguration tlsConfig;
30     private long switchIdleTimeout;
31     private ThreadConfiguration threadConfig;
32     private TransportProtocol protocol;
33     private Statistics statistics;
34
35     /**
36      * Creates {@link ConnectionConfigurationImpl}
37      * @param address 
38      * @param port
39      * @param tlsConfig 
40      * @param switchIdleTimeout
41      */
42     public ConnectionConfigurationImpl(InetAddress address, int port, TlsConfiguration tlsConfig, long switchIdleTimeout) {
43         this.address = address;
44         this.port = port;
45         this.tlsConfig = tlsConfig;
46         this.switchIdleTimeout = switchIdleTimeout;
47     }
48
49     @Override
50     public InetAddress getAddress() {
51         return address;
52     }
53
54     @Override
55     public int getPort() {
56         return port;
57     }
58
59     @Override
60     public Object getTransferProtocol() {
61         return transferProtocol;
62     }
63
64     /**
65      * Used for testing - sets transport protocol
66      * @param protocol
67      */
68     public void setTransferProtocol(TransportProtocol protocol) {
69         this.transferProtocol = protocol;
70     }
71
72     @Override
73     public long getSwitchIdleTimeout() {
74         return switchIdleTimeout;
75     }
76
77     @Override
78     public Object getSslContext() {
79         // TODO Auto-generated method stub
80         return null;
81     }
82
83     @Override
84     public TlsConfiguration getTlsConfiguration() {
85         return tlsConfig;
86     }
87
88     @Override
89     public ThreadConfiguration getThreadConfiguration() {
90         return threadConfig;
91     }
92
93     /**
94      * @param threadConfig thread model configuration (configures threads used)
95      */
96     public void setThreadConfiguration(ThreadConfiguration threadConfig) {
97         this.threadConfig = threadConfig;
98     }
99
100     @Override
101     public StatisticsConfiguration getStatisticsConfiguration() {
102         // TODO Auto-generated method stub
103         return null;
104     }
105 }