1 package org.openecomp.sdc.webseal.simulator.conf;
3 import com.typesafe.config.Config;
4 import com.typesafe.config.ConfigFactory;
5 import org.openecomp.sdc.webseal.simulator.User;
8 import java.util.HashMap;
14 private static Conf conf= null;
15 private String feHost;
16 Map<String,User> users = new HashMap<String,User>();
22 private void initConf() {
24 String confPath = System.getProperty("config.resource");
25 if (confPath == null){
26 System.out.println("config.resource is empty - goint to get it from config.home");
27 confPath = System.getProperty("config.home") + "/webseal.conf";
29 System.out.println("confPath=" + confPath );
30 Config confFile = ConfigFactory.parseFileAnySyntax(new File(confPath));
31 Config resolve = confFile.resolve();
32 setFeHost(resolve.getString("webseal.fe"));
33 List<? extends Config> list = resolve.getConfigList("webseal.users");
34 for (Config conf : list ){
35 String userId = conf.getString("userId");
36 String password = conf.getString("password");
37 String firstName = conf.getString("firstName");
38 String lastName = conf.getString("lastName");
39 String email = conf.getString("email");
40 String role = conf.getString("role");
41 users.put(userId,new User(firstName,lastName,email,userId,role,password));
49 public static Conf getInstance(){
56 public String getFeHost() {
60 public void setFeHost(String feHost) {
64 public Map<String,User> getUsers() {