blob: 1dc4749f24a36cc77c64a7c3b501def34228a027 [file] [log] [blame]
sanghoshin46297d22015-11-03 17:51:24 +09001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
sanghoshin46297d22015-11-03 17:51:24 +09003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
sangho93447f12016-02-24 00:33:22 +090016package org.onosproject.openstackinterface;
sanghoshin46297d22015-11-03 17:51:24 +090017
18import org.onosproject.core.ApplicationId;
19import org.onosproject.net.config.Config;
20import org.onosproject.net.config.basics.BasicElementConfig;
21
22/**
sangho48907542016-03-28 16:07:07 +090023 * Handles configuration for OpenstackInterface app.
sanghoshin46297d22015-11-03 17:51:24 +090024 */
sangho48907542016-03-28 16:07:07 +090025public class OpenstackInterfaceConfig extends Config<ApplicationId> {
26 public static final String NEUTRON_SERVER = "neutronServer";
27 public static final String KEYSTONE_SERVER = "keystoneServer";
28 public static final String USER_NAME = "userName";
sanghoshinf25d2e02015-11-11 23:07:17 +090029 public static final String PASSWORD = "password";
Daniel Park3a06c522016-01-28 20:51:12 +090030 public static final String PHYSICAL_ROUTER_MAC = "physicalRouterMac";
sanghoshin46297d22015-11-03 17:51:24 +090031
32 /**
sanghoshinf25d2e02015-11-11 23:07:17 +090033 * Returns the Neutron server IP address.
34 *
35 * @return Neutron server IP
36 */
37 public String neutronServer() {
38 return get(NEUTRON_SERVER, "");
39 }
40
41 /**
42 * Returns the Keystone server IP address.
43 *
44 * @return Keystone server IP
45 */
46 public String keystoneServer() {
47 return get(KEYSTONE_SERVER, "");
48 }
49
50 /**
51 * Returns the username for openstack.
52 *
53 * @return username for openstack
54 */
55 public String userName() {
56 return get(USER_NAME, "");
57 }
58
59 /**
60 * Returns the password for openstack.
61 *
62 * @return password for openstack
63 */
64 public String password() {
65 return get(PASSWORD, "");
66 }
67
68 /**
Daniel Park3a06c522016-01-28 20:51:12 +090069 * Returns the MacAddress for physical router.
70 *
71 * @return physical router mac
72 */
73 public String physicalRouterMac() {
74 return get(PHYSICAL_ROUTER_MAC, "");
75 }
sanghoshinf25d2e02015-11-11 23:07:17 +090076
77 /**
78 * Sets the neutron server IP address.
79 *
80 * @param url neutron server IP address
81 * @return itself
82 */
83 public BasicElementConfig neutronServer(String url) {
84 return (BasicElementConfig) setOrClear(NEUTRON_SERVER, url);
85 }
86
87 /**
88 * Sets the keystone server IP address.
89 *
90 * @param url keystone server IP address
91 * @return itself
92 */
93 public BasicElementConfig keystoneServer(String url) {
94 return (BasicElementConfig) setOrClear(KEYSTONE_SERVER, url);
95 }
96
97 /**
98 * Sets the username for openstack.
99 *
100 * @param username user name for openstack
101 * @return itself
102 */
103 public BasicElementConfig userName(String username) {
104 return (BasicElementConfig) setOrClear(USER_NAME, username);
105 }
106
107 /**
108 * Sets the password for openstack.
109 *
110 * @param password password for openstack
111 * @return itself
112 */
113 public BasicElementConfig password(String password) {
114 return (BasicElementConfig) setOrClear(PASSWORD, password);
115 }
sanghoshin46297d22015-11-03 17:51:24 +0900116}