BUG-542 - adding overall statictics
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / ConnectionConfigurationFactory.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.openflow.md.core;
10
11 import java.net.InetAddress;
12
13 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
14
15 /**
16  * @deprecated use configSubsystem
17  */
18 @Deprecated
19 public abstract class ConnectionConfigurationFactory {
20
21     /** OF default listening port */
22     private static final int DEFAULT_OF_PORT = 6653;
23     /** OF legacy default listening port */
24     private static final int LEGACY_OF_PORT = 6633;
25
26     /**
27      * @return default connection configuration
28      */
29     public static ConnectionConfiguration getDefault() {
30         return new ConnectionConfiguration() {
31
32             @Override
33             public InetAddress getAddress() {
34                 // all interfaces
35                 return null;
36             }
37
38             @Override
39             public int getPort() {
40                 return DEFAULT_OF_PORT;
41             }
42
43             @Override
44             public FEATURE_SUPPORT getTlsSupport() {
45                 return FEATURE_SUPPORT.NOT_SUPPORTED;
46             }
47
48             @Override
49             public Object getTransferProtocol() {
50                 // TODO:: TCP/UDP ...
51                 return null;
52             }
53
54             @Override
55             public long getSwitchIdleTimeout() {
56                 return 15000;
57             }
58
59             @Override
60             public Object getSslContext() {
61                 return null;
62             }
63         };
64     }
65     
66     /**
67      * @return default connection configuration
68      */
69     public static ConnectionConfiguration getLegacy() {
70         return new ConnectionConfiguration() {
71
72             @Override
73             public InetAddress getAddress() {
74                 // all interfaces
75                 return null;
76             }
77
78             @Override
79             public int getPort() {
80                 return LEGACY_OF_PORT;
81             }
82
83             @Override
84             public FEATURE_SUPPORT getTlsSupport() {
85                 return FEATURE_SUPPORT.NOT_SUPPORTED;
86             }
87
88             @Override
89             public Object getTransferProtocol() {
90                 // TODO:: TCP/UDP ...
91                 return null;
92             }
93
94             @Override
95             public long getSwitchIdleTimeout() {
96                 return 15000;
97             }
98
99             @Override
100             public Object getSslContext() {
101                 return null;
102             }
103         };
104     }
105
106 }