Merge "Add copyright header to ConfigIni.java" into develop
[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                 return;
25             }
26         }
27         this.mappingOverwrite = true;
28     }
29
30     private void initSmr() {
31         String str = System.getProperty("lisp.smr");
32         if (str != null) {
33             if (str.trim().equalsIgnoreCase("true")) {
34                 this.smr = true;
35                 return;
36             }
37         }
38         this.smr = false;
39     }
40
41     public boolean mappingOverwriteIsSet() {
42         return mappingOverwrite;
43     }
44
45     public boolean smrIsSet() {
46         return smr;
47     }
48 }