2 * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
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
9 package org.opendaylight.openflowjava.protocol.impl.core.connection;
11 import java.net.InetAddress;
12 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
13 import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration;
14 import org.opendaylight.openflowjava.protocol.api.connection.TlsConfiguration;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol;
18 * @author michal.polkorab
21 public class ConnectionConfigurationImpl implements ConnectionConfiguration {
23 private final InetAddress address;
24 private final int port;
25 private Object transferProtocol;
26 private final TlsConfiguration tlsConfig;
27 private final long switchIdleTimeout;
28 private ThreadConfiguration threadConfig;
29 private final boolean useBarrier;
32 * Creates {@link ConnectionConfigurationImpl}
37 * @param switchIdleTimeout
40 public ConnectionConfigurationImpl(final InetAddress address, final int port, final TlsConfiguration tlsConfig,
41 final long switchIdleTimeout, final boolean useBarrier) {
42 this.address = address;
44 this.tlsConfig = tlsConfig;
45 this.switchIdleTimeout = switchIdleTimeout;
46 this.useBarrier = useBarrier;
50 public InetAddress getAddress() {
55 public int getPort() {
60 public Object getTransferProtocol() {
61 return transferProtocol;
65 * Used for testing - sets transport protocol
68 public void setTransferProtocol(final TransportProtocol protocol) {
69 this.transferProtocol = protocol;
73 public long getSwitchIdleTimeout() {
74 return switchIdleTimeout;
78 public Object getSslContext() {
79 // TODO Auto-generated method stub
84 public TlsConfiguration getTlsConfiguration() {
89 public ThreadConfiguration getThreadConfiguration() {
94 * @param threadConfig thread model configuration (configures threads used)
96 public void setThreadConfiguration(final ThreadConfiguration threadConfig) {
97 this.threadConfig = threadConfig;
101 public boolean useBarrier() {