Incrementing versions by 0.1.0 for post-helium master branch
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / 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.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     private TransportProtocol protocol;
31
32     /**
33      * Creates {@link ConnectionConfigurationImpl}
34      * @param address 
35      * @param port
36      * @param tlsConfig 
37      * @param switchIdleTimeout
38      */
39     public ConnectionConfigurationImpl(InetAddress address, int port, TlsConfiguration tlsConfig, long switchIdleTimeout) {
40         this.address = address;
41         this.port = port;
42         this.tlsConfig = tlsConfig;
43         this.switchIdleTimeout = switchIdleTimeout;
44     }
45
46     @Override
47     public InetAddress getAddress() {
48         return address;
49     }
50
51     @Override
52     public int getPort() {
53         return port;
54     }
55
56     @Override
57     public Object getTransferProtocol() {
58         return transferProtocol;
59     }
60
61     /**
62      * Used for testing - sets transport protocol
63      * @param protocol
64      */
65     public void setTransferProtocol(TransportProtocol protocol) {
66         this.transferProtocol = protocol;
67     }
68
69     @Override
70     public long getSwitchIdleTimeout() {
71         return switchIdleTimeout;
72     }
73
74     @Override
75     public Object getSslContext() {
76         // TODO Auto-generated method stub
77         return null;
78     }
79
80     @Override
81     public TlsConfiguration getTlsConfiguration() {
82         return tlsConfig;
83     }
84
85     @Override
86     public ThreadConfiguration getThreadConfiguration() {
87         return threadConfig;
88     }
89
90     /**
91      * @param threadConfig thread model configuration (configures threads used)
92      */
93     public void setThreadConfiguration(ThreadConfiguration threadConfig) {
94         this.threadConfig = threadConfig;
95     }
96 }