blob: 743450c26deae76becffdf0c6445f3f728ad1e33 [file] [log] [blame]
samanwita palf28207b2015-09-04 10:41:56 -07001/*
2 * Copyright 2014 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 */
16package org.onosproject.dhcp.impl;
17
18import org.onosproject.core.ApplicationId;
19import org.onosproject.net.config.Config;
20import org.onosproject.net.config.basics.BasicElementConfig;
21
22/**
23 * DHCP Store Config class.
24 */
25public class DHCPStoreConfig extends Config<ApplicationId> {
26
27 public static final String TIMER_DELAY = "delay";
28 public static final String DEFAULT_TIMEOUT = "timeout";
29 public static final String START_IP = "startip";
30 public static final String END_IP = "endip";
31
32 /**
33 * Returns the delay after which the dhcp server will purge expired entries.
34 *
35 * @return time delay or null if not set
36 */
37 public String timerDelay() {
38 return get(TIMER_DELAY, null);
39 }
40
41 /**
42 * Sets the delay after which the dhcp server will purge expired entries.
43 *
44 * @param delay new time delay; null to clear
45 * @return self
46 */
47 public BasicElementConfig timerDelay(String delay) {
48 return (BasicElementConfig) setOrClear(TIMER_DELAY, delay);
49 }
50
51 /**
52 * Returns the default timeout for pending assignments.
53 *
54 * @return default timeout or null if not set
55 */
56 public String defaultTimeout() {
57 return get(DEFAULT_TIMEOUT, null);
58 }
59
60 /**
61 * Sets the default timeout for pending assignments.
62 *
63 * @param defaultTimeout new default timeout; null to clear
64 * @return self
65 */
66 public BasicElementConfig defaultTimeout(String defaultTimeout) {
67 return (BasicElementConfig) setOrClear(DEFAULT_TIMEOUT, defaultTimeout);
68 }
69
70 /**
71 * Returns the start IP for the available IP Range.
72 *
73 * @return start IP or null if not set
74 */
75 public String startIP() {
76 return get(START_IP, null);
77 }
78
79 /**
80 * Sets the start IP for the available IP Range.
81 *
82 * @param startIP new start IP; null to clear
83 * @return self
84 */
85 public BasicElementConfig startIP(String startIP) {
86 return (BasicElementConfig) setOrClear(START_IP, startIP);
87 }
88
89 /**
90 * Returns the end IP for the available IP Range.
91 *
92 * @return end IP or null if not set
93 */
94 public String endIP() {
95 return get(END_IP, null);
96 }
97
98 /**
99 * Sets the end IP for the available IP Range.
100 *
101 * @param endIP new end IP; null to clear
102 * @return self
103 */
104 public BasicElementConfig endIP(String endIP) {
105 return (BasicElementConfig) setOrClear(END_IP, endIP);
106 }
107}