blob: cfe719d2bdcbb929363368de5ae2e231e9d4cab9 [file] [log] [blame]
Jonathan Hart6344f572015-12-15 08:26:25 -08001/*
2 * Copyright 2016 Open Networking Laboratory
3 *
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 */
16
17package org.onosproject.routing.config;
18
19import org.onosproject.core.ApplicationId;
20import org.onosproject.net.ConnectPoint;
21import org.onosproject.net.config.Config;
22
23/**
24 * Routing configuration.
25 */
26public class RouterConfig extends Config<ApplicationId> {
27
Jonathan Hartea492382016-01-13 09:33:13 -080028 private static final String CP_CONNECT_POINT = "controlPlaneConnectPoint";
29 private static final String OSPF_ENABLED = "ospfEnabled";
30 private static final String PIM_ENABLED = "pimEnabled";
Jonathan Hart6344f572015-12-15 08:26:25 -080031
32 /**
33 * Returns the routing control plane connect point.
34 *
35 * @return control plane connect point
36 */
37 public ConnectPoint getControlPlaneConnectPoint() {
38 return ConnectPoint.deviceConnectPoint(object.path(CP_CONNECT_POINT).asText());
39 }
Jonathan Hartea492382016-01-13 09:33:13 -080040
41 /**
42 * Returns whether OSPF is enabled on this router.
43 *
44 * @return true if OSPF is enabled, otherwise false
45 */
46 public boolean getOspfEnabled() {
47 return object.path(OSPF_ENABLED).asBoolean(false);
48 }
49
50 /**
51 * Returns whether PIM is enabled on this router.
52 *
53 * @return true if PIM is enabled, otherwise false
54 */
55 public boolean pimEnabled() {
56 return object.path(PIM_ENABLED).asBoolean(false);
57 }
Jonathan Hart6344f572015-12-15 08:26:25 -080058}