Remove trailing whitespace
[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.ThreadConfiguration;
15 import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol;
17
18 /**
19  * @author michal.polkorab
20  *
21  */
22 public class ConnectionConfigurationImpl implements ConnectionConfiguration {
23
24     private InetAddress address;
25     private int port;
26     private Object transferProtocol;
27     private TlsConfiguration tlsConfig;
28     private long switchIdleTimeout;
29     private ThreadConfiguration threadConfig;
30
31     /**
32      * Creates {@link ConnectionConfigurationImpl}
33      * @param address
34      * @param port
35      * @param tlsConfig
36      * @param switchIdleTimeout
37      */
38     public ConnectionConfigurationImpl(InetAddress address, int port, TlsConfiguration tlsConfig, long switchIdleTimeout) {
39         this.address = address;
40         this.port = port;
41         this.tlsConfig = tlsConfig;
42         this.switchIdleTimeout = switchIdleTimeout;
43     }
44
45     @Override
46     public InetAddress getAddress() {
47         return address;
48     }
49
50     @Override
51     public int getPort() {
52         return port;
53     }
54
55     @Override
56     public Object getTransferProtocol() {
57         return transferProtocol;
58     }
59
60     /**
61      * Used for testing - sets transport protocol
62      * @param protocol
63      */
64     public void setTransferProtocol(TransportProtocol protocol) {
65         this.transferProtocol = protocol;
66     }
67
68     @Override
69     public long getSwitchIdleTimeout() {
70         return switchIdleTimeout;
71     }
72
73     @Override
74     public Object getSslContext() {
75         // TODO Auto-generated method stub
76         return null;
77     }
78
79     @Override
80     public TlsConfiguration getTlsConfiguration() {
81         return tlsConfig;
82     }
83
84     @Override
85     public ThreadConfiguration getThreadConfiguration() {
86         return threadConfig;
87     }
88
89     /**
90      * @param threadConfig thread model configuration (configures threads used)
91      */
92     public void setThreadConfiguration(ThreadConfiguration threadConfig) {
93         this.threadConfig = threadConfig;
94     }
95 }