0e93fb368441a718161c627e131a9274a0ad23a8
[lispflowmapping.git] / mappingservice / implementation / src / main / java / org / opendaylight / lispflowmapping / implementation / config / ConfigIni.java
1 /*
2  * Copyright (c) 2014 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 package org.opendaylight.lispflowmapping.implementation.config;
9
10 public class ConfigIni {
11     private boolean mappingOverwrite;
12     private boolean smr;
13
14     public ConfigIni() {
15         initMappingOverwrite();
16         initSmr();
17     }
18
19     private void initMappingOverwrite() {
20         String str = System.getProperty("lisp.mappingOverwrite");
21         if (str != null) {
22             if (str.trim().equalsIgnoreCase("false")) {
23                 this.mappingOverwrite = false;
24             }
25         }
26         this.mappingOverwrite = true;
27     }
28
29     private void initSmr() {
30         String str = System.getProperty("lisp.smr");
31         if (str != null) {
32             if (str.trim().equalsIgnoreCase("true")) {
33                 this.smr = true;
34             }
35         }
36         this.smr = false;
37     }
38
39     public boolean mappingOverwriteIsSet() {
40         return mappingOverwrite;
41     }
42
43     public boolean smrIsSet() {
44         return smr;
45     }
46 }