Merge "Fix audit log to contain ending timestamp"
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / controller / PolicyController.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP Policy Engine
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.controller;
22
23
24 import java.io.File;
25 import java.io.FileInputStream;
26 import java.io.IOException;
27 import java.io.InputStream;
28 import java.util.ArrayList;
29 import java.util.HashMap;
30 import java.util.List;
31 import java.util.Map;
32 import java.util.Properties;
33
34 import javax.annotation.PostConstruct;
35 import javax.mail.MessagingException;
36 import javax.script.SimpleBindings;
37 import javax.servlet.http.HttpServletRequest;
38 import javax.servlet.http.HttpServletResponse;
39
40 import org.json.JSONObject;
41 import org.onap.policy.admin.PolicyNotificationMail;
42 import org.onap.policy.admin.RESTfulPAPEngine;
43 import org.onap.policy.common.logging.flexlogger.FlexLogger;
44 import org.onap.policy.common.logging.flexlogger.Logger;
45 import org.onap.policy.model.PDPGroupContainer;
46 import org.onap.policy.model.Roles;
47 import org.onap.policy.rest.XACMLRestProperties;
48 import org.onap.policy.rest.XacmlAdminAuthorization;
49 import org.onap.policy.rest.dao.CommonClassDao;
50 import org.onap.policy.rest.jpa.Datatype;
51 import org.onap.policy.rest.jpa.FunctionDefinition;
52 import org.onap.policy.rest.jpa.PolicyEntity;
53 import org.onap.policy.rest.jpa.PolicyVersion;
54 import org.onap.policy.rest.jpa.UserInfo;
55 import org.onap.policy.xacml.api.XACMLErrorConstants;
56 import org.onap.policy.xacml.api.pap.PAPPolicyEngine;
57 import org.onap.portalsdk.core.controller.RestrictedBaseController;
58 import org.onap.portalsdk.core.web.support.JsonMessage;
59 import org.onap.portalsdk.core.web.support.UserUtils;
60 import org.springframework.beans.factory.annotation.Autowired;
61 import org.springframework.http.MediaType;
62 import org.springframework.stereotype.Controller;
63 import org.springframework.web.bind.annotation.RequestMapping;
64 import org.springframework.web.bind.annotation.RequestMethod;
65 import org.springframework.web.servlet.ModelAndView;
66
67 import com.att.research.xacml.util.XACMLProperties;
68 import com.fasterxml.jackson.databind.ObjectMapper;
69
70
71 @Controller
72 @RequestMapping("/")
73 public class PolicyController extends RestrictedBaseController {
74         private static final Logger     policyLogger    = FlexLogger.getLogger(PolicyController.class);
75
76         private static CommonClassDao commonClassDao;
77
78         // Our authorization object
79         //
80         XacmlAdminAuthorization authorizer = new XacmlAdminAuthorization();
81         //
82         // The PAP Engine
83         //
84         private static PAPPolicyEngine papEngine;
85
86         private static String logTableLimit;
87         private static String systemAlertTableLimit;
88         protected static Map<String, String> dropDownMap = new HashMap<>();
89         public static Map<String, String> getDropDownMap() {
90                 return dropDownMap;
91         }
92
93         public static void setDropDownMap(Map<String, String> dropDownMap) {
94                 PolicyController.dropDownMap = dropDownMap;
95         }
96
97         public static String getDomain() {
98                 return XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_DOMAIN, "urn");
99         }
100
101         private static final Object mapAccess = new Object();
102         private static Map<Datatype, List<FunctionDefinition>> mapDatatype2Function = null;
103         private static Map<String, FunctionDefinition> mapID2Function = null;
104
105         //Constant variables used across Policy-sdk
106         private static final String policyData = "policyData";
107         private static final String characterEncoding = "UTF-8";
108         private static final String contentType = "application/json";
109         private static final String file = "file";
110
111         //Smtp Java Mail Properties
112         private static String smtpHost = null;
113         private static String smtpPort = null;
114         private static String smtpUsername = null;
115         private static String smtpPassword = null;
116         private static String smtpApplicationName = null;
117         private static String smtpEmailExtension = null;
118         //log db Properties
119         private static String logdbDriver = null;
120         private static String logdbUrl = null;
121         private static String logdbUserName = null;
122         private static String logdbPassword = null;
123         private static String logdbDialect = null;
124         //Xacml db properties
125         private static String xacmldbUrl = null;
126         private static String xacmldbUserName = null;
127         private static String xacmldbPassword = null;
128
129         //AutoPush feature.
130         private static String autoPushAvailable;
131         private static String autoPushDSClosedLoop;
132         private static String autoPushDSFirewall;
133         private static String autoPushDSMicroservice;
134         private static String autoPushPDPGroup;
135
136         //papURL
137         private static String papUrl;
138
139         //MicroService Model Properties
140         private static String msOnapName;
141         private static String msPolicyName;
142
143         //WebApp directories
144         private static String configHome;
145         private static String actionHome;
146         
147         private static boolean jUnit = false;
148         
149
150         public static boolean isjUnit() {
151                 return jUnit;
152         }
153
154         public static void setjUnit(boolean jUnit) {
155                 PolicyController.jUnit = jUnit;
156         }
157
158         @Autowired
159         private PolicyController(CommonClassDao commonClassDao){
160                 PolicyController.commonClassDao = commonClassDao;
161         }
162
163         public PolicyController() {
164         }
165
166         @PostConstruct
167         public void init(){
168                 Properties prop = new Properties();
169                 InputStream input = null;
170                 try {
171                         if(jUnit){
172                                 File file = new File(new File(".").getCanonicalPath() + File.separator + "src"+ File.separator + "test" + File.separator + "resources" + File.separator + "JSONConfig.json");
173                                 input = new FileInputStream(file);
174                         }else{
175                                 input = new FileInputStream("xacml.admin.properties");
176                         }
177                         // load a properties file
178                         prop.load(input);
179                         //pap url
180                         setPapUrl(prop.getProperty("xacml.rest.pap.url"));
181                         // get the property values
182                         setSmtpHost(prop.getProperty("onap.smtp.host"));
183                         setSmtpPort(prop.getProperty("onap.smtp.port"));
184                         setSmtpUsername(prop.getProperty("onap.smtp.userName"));
185                         setSmtpPassword(prop.getProperty("onap.smtp.password"));
186                         setSmtpApplicationName(prop.getProperty("onap.application.name"));
187                         setSmtpEmailExtension(prop.getProperty("onap.smtp.emailExtension"));
188                         //Log Database Properties
189                         setLogdbDriver(prop.getProperty("xacml.log.db.driver"));
190                         setLogdbUrl(prop.getProperty("xacml.log.db.url"));
191                         setLogdbUserName(prop.getProperty("xacml.log.db.user"));
192                         setLogdbPassword(prop.getProperty("xacml.log.db.password"));
193                         setLogdbDialect(prop.getProperty("onap.dialect"));
194                         //Xacml Database Properties
195                         setXacmldbUrl(prop.getProperty("javax.persistence.jdbc.url"));
196                         setXacmldbUserName(prop.getProperty("javax.persistence.jdbc.user"));
197                         setXacmldbPassword(prop.getProperty("javax.persistence.jdbc.password"));
198                         //AutoPuh
199                         setAutoPushAvailable(prop.getProperty("xacml.automatic.push"));
200                         setAutoPushDSClosedLoop(prop.getProperty("xacml.autopush.closedloop"));
201                         setAutoPushDSFirewall(prop.getProperty("xacml.autopush.firewall"));
202                         setAutoPushDSMicroservice(prop.getProperty("xacml.autopush.microservice"));
203                         setAutoPushPDPGroup(prop.getProperty("xacml.autopush.pdpGroup"));
204                         //Micro Service Properties
205                         setMsOnapName(prop.getProperty("xacml.policy.msOnapName"));
206                         if(getMsOnapName() == null){
207                                 setMsOnapName(prop.getProperty("xacml.policy.msEcompName"));
208                         }
209                         policyLogger.info("getMsOnapName => " + getMsOnapName());
210                         setMsPolicyName(prop.getProperty("xacml.policy.msPolicyName"));
211                         policyLogger.info("setMsPolicyName => " + getMsPolicyName());
212                         //WebApp directories
213                         setConfigHome(prop.getProperty("xacml.rest.config.webapps") + "Config");
214                         setActionHome(prop.getProperty("xacml.rest.config.webapps") + "Action");
215                         //Get the Property Values for Dashboard tab Limit
216                         try{
217                                 setLogTableLimit(prop.getProperty("xacml.onap.dashboard.logTableLimit"));
218                                 setSystemAlertTableLimit(prop.getProperty("xacml.onap.dashboard.systemAlertTableLimit"));
219                         }catch(Exception e){
220                                 policyLogger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Dashboard tab Property fields are missing" +e);
221                                 setLogTableLimit("5000");
222                                 setSystemAlertTableLimit("2000");
223                         }
224                         System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME, "xacml.admin.properties");
225                 } catch (IOException ex) {
226                         policyLogger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Exception Occured while reading the Smtp properties from xacml.admin.properties file" +ex);
227                 } finally {
228                         if (input != null) {
229                                 try {
230                                         input.close();
231                                 } catch (IOException e) {
232                                         policyLogger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Exception Occured while Closing the xacml.admin.properties file" +e);
233                                 }
234                         }
235                 }
236
237                 //Initialize the FunctionDefinition table at Server Start up
238                 Map<Datatype, List<FunctionDefinition>> functionMap = getFunctionDatatypeMap();
239                 for (Datatype id : functionMap.keySet()) {
240                         List<FunctionDefinition> functionDefinations = functionMap.get(id);
241                         for (FunctionDefinition functionDef : functionDefinations) {
242                                 dropDownMap.put(functionDef.getShortname(),functionDef.getXacmlid());
243                         }
244                 }
245
246         }
247
248         public static  Map<Datatype, List<FunctionDefinition>>  getFunctionDatatypeMap() {
249                 synchronized(mapAccess) {
250                         if (mapDatatype2Function == null) {
251                                 buildFunctionMaps();
252                         }
253                 }
254                 return mapDatatype2Function;
255         }
256
257         public static Map<String, FunctionDefinition> getFunctionIDMap() {
258                 synchronized(mapAccess) {
259                         if (mapID2Function == null) {
260                                 buildFunctionMaps();
261                         }
262                 }
263                 return mapID2Function;
264         }
265
266         private static  void buildFunctionMaps() {
267                 mapDatatype2Function = new HashMap<>();
268                 mapID2Function = new  HashMap<>();
269                 List<Object> functiondefinitions = commonClassDao.getData(FunctionDefinition.class);
270                 for (int i = 0; i < functiondefinitions.size(); i ++) {
271                         FunctionDefinition value = (FunctionDefinition) functiondefinitions.get(i);
272                         mapID2Function.put(value.getXacmlid(), value);
273                         if (!mapDatatype2Function.containsKey(value.getDatatypeBean())) {
274                                 mapDatatype2Function.put(value.getDatatypeBean(), new ArrayList<FunctionDefinition>());
275                         }
276                         mapDatatype2Function.get(value.getDatatypeBean()).add(value);
277                 }
278         }
279
280         @RequestMapping(value={"/get_FunctionDefinitionDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
281         public void getFunctionDefinitionData(HttpServletRequest request, HttpServletResponse response){
282                 try{
283                         Map<String, Object> model = new HashMap<>();
284                         ObjectMapper mapper = new ObjectMapper();
285                         model.put("functionDefinitionDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(FunctionDefinition.class, "shortname")));
286                         JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
287                         JSONObject j = new JSONObject(msg);
288                         response.getWriter().write(j.toString());
289                 }
290                 catch (Exception e){
291                         policyLogger.error(XACMLErrorConstants.ERROR_DATA_ISSUE +"Error while retriving the Function Definition data"+e);
292                 }
293         }
294
295         public PolicyEntity getPolicyEntityData(String scope, String policyName){
296                 String key = scope + ":" + policyName;
297                 List<Object> data = commonClassDao.getDataById(PolicyEntity.class, "scope:policyName", key);
298                 return (PolicyEntity) data.get(0);
299         }
300
301         public static Map<String, Roles> getUserRoles(String userId) {
302                 Map<String, Roles> scopes = new HashMap<>();
303                 List<Object> roles = commonClassDao.getDataById(Roles.class, "loginId", userId);
304                 if (roles != null && !roles.isEmpty()) {
305                         for (Object role : roles) {
306                                 scopes.put(((Roles) role).getScope(), (Roles) role);
307                         }
308                 }
309                 return scopes;
310         }
311
312         public List<String> getRolesOfUser(String userId) {
313                 List<String> rolesList = new ArrayList<>();
314                 List<Object> roles = commonClassDao.getDataById(Roles.class, "loginId", userId);
315                 for (Object role: roles) {
316                         rolesList.add(((Roles) role).getRole());
317                 }
318                 return rolesList;
319         }
320
321         public List<Object> getRoles(String userId) {
322                 return commonClassDao.getDataById(Roles.class, "loginId", userId);
323         }
324
325         //Get List of User Roles
326         @RequestMapping(value={"/get_UserRolesData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
327         public void getUserRolesEntityData(HttpServletRequest request, HttpServletResponse response){
328                 try{
329                         String userId = UserUtils.getUserSession(request).getOrgUserId();
330                         Map<String, Object> model = new HashMap<>();
331                         ObjectMapper mapper = new ObjectMapper();
332                         model.put("userRolesDatas", mapper.writeValueAsString(getRolesOfUser(userId)));
333                         JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
334                         JSONObject j = new JSONObject(msg);
335                         response.getWriter().write(j.toString());
336                 }
337                 catch (Exception e){
338                         policyLogger.error("Exception Occured"+e);
339                 }
340         }
341
342         //Policy tabs Model and View
343     @RequestMapping(value= {"/policy", "/policy/Editor" } , method = RequestMethod.GET)
344         public ModelAndView view(HttpServletRequest request){
345                 String myRequestURL = request.getRequestURL().toString();
346                 try {
347                         //
348                         // Set the URL for the RESTful PAP Engine
349                         //
350                         setPapEngine((PAPPolicyEngine) new RESTfulPAPEngine(myRequestURL));
351                         new PDPGroupContainer((PAPPolicyEngine) new RESTfulPAPEngine(myRequestURL));
352                 } catch (Exception e) {
353                         policyLogger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Exception Occured while loading PAP"+e);
354                 }
355                 Map<String, Object> model = new HashMap<>();
356                 return new ModelAndView("policy_Editor","model", model);
357         }
358
359         public PAPPolicyEngine getPapEngine() {
360                 return papEngine;
361         }
362
363         public static void setPapEngine(PAPPolicyEngine papEngine) {
364                 PolicyController.papEngine = papEngine;
365         }
366
367         public String getUserName(String createdBy) {
368                 String loginId = createdBy;
369                 List<Object> data = commonClassDao.getDataById(UserInfo.class, "loginId", loginId);
370                 return data.get(0).toString();
371         }
372
373         public static boolean getActivePolicy(String query) {
374                 if(!commonClassDao.getDataByQuery(query, new SimpleBindings()).isEmpty()){
375                         return true;
376                 }else{
377                         return false;
378                 }
379         }
380
381         public void executeQuery(String query) {
382                 commonClassDao.updateQuery(query);
383         }
384
385         public void saveData(Object cloneEntity) {
386                 commonClassDao.save(cloneEntity);
387         }
388
389         public void updateData(Object entity) {
390                 commonClassDao.update(entity);
391         }
392
393         public void deleteData(Object entity) {
394                 commonClassDao.delete(entity);
395         }
396
397         public List<Object> getData(@SuppressWarnings("rawtypes") Class className){
398                 return commonClassDao.getData(className);
399         }
400
401         public PolicyVersion getPolicyEntityFromPolicyVersion(String query){
402                 return (PolicyVersion) commonClassDao.getEntityItem(PolicyVersion.class, "policyName", query);
403         }
404
405         public List<Object> getDataByQuery(String query, SimpleBindings params){
406                 return commonClassDao.getDataByQuery(query, params);
407         }
408
409
410         @SuppressWarnings("rawtypes")
411         public Object getEntityItem(Class className, String columname, String key){
412                 return commonClassDao.getEntityItem(className, columname, key);
413         }
414
415
416         public void watchPolicyFunction(PolicyVersion entity, String policyName, String mode){
417                 PolicyNotificationMail email = new PolicyNotificationMail();
418                 try {
419                         email.sendMail(entity, policyName, mode, commonClassDao);
420                 } catch (MessagingException e) {
421                         policyLogger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "Excepton Occured while Renaming/Deleting a Policy or Scope" + e);
422                 }
423         }
424
425         //Switch Version
426         public JSONObject switchVersionPolicyContent(String policyName) {
427                 String dbCheckName = policyName.replace("/", ".");
428                 if(dbCheckName.contains("Config_")){
429                         dbCheckName = dbCheckName.replace(".Config_", ":Config_");
430                 }else if(dbCheckName.contains("Action_")){
431                         dbCheckName = dbCheckName.replace(".Action_", ":Action_");
432                 }else if(dbCheckName.contains("Decision_")){
433                         dbCheckName = dbCheckName.replace(".Decision_", ":Decision_");
434                 }
435                 String[] splitDBCheckName = dbCheckName.split(":");
436                 String query =   "FROM PolicyEntity where policyName like :splitDBCheckName1 and scope = :splitDBCheckName0";
437                 SimpleBindings params = new SimpleBindings();
438                 params.put("splitDBCheckName1", splitDBCheckName[1] + "%");
439                 params.put("splitDBCheckName0", splitDBCheckName[0]);
440                 List<Object> policyEntity = commonClassDao.getDataByQuery(query, params);
441                 List<String> av = new ArrayList<>();
442                 for(Object entity : policyEntity){
443                         PolicyEntity pEntity = (PolicyEntity) entity;
444                         String removeExtension = pEntity.getPolicyName().replace(".xml", "");
445                         String version = removeExtension.substring(removeExtension.lastIndexOf(".")+1);
446                         av.add(version);
447                 }
448                 if(policyName.contains("/")){
449                         policyName = policyName.replace("/", File.separator);
450                 }
451                 PolicyVersion entity = (PolicyVersion) commonClassDao.getEntityItem(PolicyVersion.class, "policyName", policyName);
452                 JSONObject el = new JSONObject();
453                 el.put("activeVersion", entity.getActiveVersion());
454                 el.put("availableVersions", av);
455                 el.put("highestVersion", entity.getHigherVersion());
456                 return el;
457         }
458
459         public static String getLogTableLimit() {
460                 return logTableLimit;
461         }
462
463         public static void setLogTableLimit(String logTableLimit) {
464                 PolicyController.logTableLimit = logTableLimit;
465         }
466
467         public static String getSystemAlertTableLimit() {
468                 return systemAlertTableLimit;
469         }
470
471         public static void setSystemAlertTableLimit(String systemAlertTableLimit) {
472                 PolicyController.systemAlertTableLimit = systemAlertTableLimit;
473         }
474
475         public static CommonClassDao getCommonClassDao() {
476                 return commonClassDao;
477         }
478
479         public static void setCommonClassDao(CommonClassDao commonClassDao) {
480                 PolicyController.commonClassDao = commonClassDao;
481         }
482
483         public XacmlAdminAuthorization getAuthorizer() {
484                 return authorizer;
485         }
486
487         public void setAuthorizer(XacmlAdminAuthorization authorizer) {
488                 this.authorizer = authorizer;
489         }
490
491         public static Map<Datatype, List<FunctionDefinition>> getMapDatatype2Function() {
492                 return mapDatatype2Function;
493         }
494
495         public static void setMapDatatype2Function(Map<Datatype, List<FunctionDefinition>> mapDatatype2Function) {
496                 PolicyController.mapDatatype2Function = mapDatatype2Function;
497         }
498
499         public static Map<String, FunctionDefinition> getMapID2Function() {
500                 return mapID2Function;
501         }
502
503         public static void setMapID2Function(Map<String, FunctionDefinition> mapID2Function) {
504                 PolicyController.mapID2Function = mapID2Function;
505         }
506
507         public static String getSmtpHost() {
508                 return smtpHost;
509         }
510
511         public static void setSmtpHost(String smtpHost) {
512                 PolicyController.smtpHost = smtpHost;
513         }
514
515         public static String getSmtpPort() {
516                 return smtpPort;
517         }
518
519         public static void setSmtpPort(String smtpPort) {
520                 PolicyController.smtpPort = smtpPort;
521         }
522
523         public static String getSmtpUsername() {
524                 return smtpUsername;
525         }
526
527         public static void setSmtpUsername(String smtpUsername) {
528                 PolicyController.smtpUsername = smtpUsername;
529         }
530
531         public static String getSmtpPassword() {
532                 return smtpPassword;
533         }
534
535         public static void setSmtpPassword(String smtpPassword) {
536                 PolicyController.smtpPassword = smtpPassword;
537         }
538
539         public static String getSmtpApplicationName() {
540                 return smtpApplicationName;
541         }
542
543         public static void setSmtpApplicationName(String smtpApplicationName) {
544                 PolicyController.smtpApplicationName = smtpApplicationName;
545         }
546
547         public static String getSmtpEmailExtension() {
548                 return smtpEmailExtension;
549         }
550
551         public static void setSmtpEmailExtension(String smtpEmailExtension) {
552                 PolicyController.smtpEmailExtension = smtpEmailExtension;
553         }
554
555         public static String getLogdbDriver() {
556                 return logdbDriver;
557         }
558
559         public static void setLogdbDriver(String logdbDriver) {
560                 PolicyController.logdbDriver = logdbDriver;
561         }
562
563         public static String getLogdbUrl() {
564                 return logdbUrl;
565         }
566
567         public static void setLogdbUrl(String logdbUrl) {
568                 PolicyController.logdbUrl = logdbUrl;
569         }
570
571         public static String getLogdbUserName() {
572                 return logdbUserName;
573         }
574
575         public static void setLogdbUserName(String logdbUserName) {
576                 PolicyController.logdbUserName = logdbUserName;
577         }
578
579         public static String getLogdbPassword() {
580                 return logdbPassword;
581         }
582
583         public static void setLogdbPassword(String logdbPassword) {
584                 PolicyController.logdbPassword = logdbPassword;
585         }
586
587         public static String getLogdbDialect() {
588                 return logdbDialect;
589         }
590
591         public static void setLogdbDialect(String logdbDialect) {
592                 PolicyController.logdbDialect = logdbDialect;
593         }
594
595         public static String getXacmldbUrl() {
596                 return xacmldbUrl;
597         }
598
599         public static void setXacmldbUrl(String xacmldbUrl) {
600                 PolicyController.xacmldbUrl = xacmldbUrl;
601         }
602
603         public static String getXacmldbUserName() {
604                 return xacmldbUserName;
605         }
606
607         public static void setXacmldbUserName(String xacmldbUserName) {
608                 PolicyController.xacmldbUserName = xacmldbUserName;
609         }
610
611         public static String getXacmldbPassword() {
612                 return xacmldbPassword;
613         }
614
615         public static void setXacmldbPassword(String xacmldbPassword) {
616                 PolicyController.xacmldbPassword = xacmldbPassword;
617         }
618
619         public static String getAutoPushAvailable() {
620                 return autoPushAvailable;
621         }
622
623         public static void setAutoPushAvailable(String autoPushAvailable) {
624                 PolicyController.autoPushAvailable = autoPushAvailable;
625         }
626
627         public static String getAutoPushDSClosedLoop() {
628                 return autoPushDSClosedLoop;
629         }
630
631         public static void setAutoPushDSClosedLoop(String autoPushDSClosedLoop) {
632                 PolicyController.autoPushDSClosedLoop = autoPushDSClosedLoop;
633         }
634
635         public static String getAutoPushDSFirewall() {
636                 return autoPushDSFirewall;
637         }
638
639         public static void setAutoPushDSFirewall(String autoPushDSFirewall) {
640                 PolicyController.autoPushDSFirewall = autoPushDSFirewall;
641         }
642
643         public static String getAutoPushDSMicroservice() {
644                 return autoPushDSMicroservice;
645         }
646
647         public static void setAutoPushDSMicroservice(String autoPushDSMicroservice) {
648                 PolicyController.autoPushDSMicroservice = autoPushDSMicroservice;
649         }
650
651         public static String getAutoPushPDPGroup() {
652                 return autoPushPDPGroup;
653         }
654
655         public static void setAutoPushPDPGroup(String autoPushPDPGroup) {
656                 PolicyController.autoPushPDPGroup = autoPushPDPGroup;
657         }
658
659         public static String getPapUrl() {
660                 return papUrl;
661         }
662
663         public static void setPapUrl(String papUrl) {
664                 PolicyController.papUrl = papUrl;
665         }
666
667         public static String getMsOnapName() {
668                 return msOnapName;
669         }
670
671         public static void setMsOnapName(String msOnapName) {
672                 PolicyController.msOnapName = msOnapName;
673         }
674
675         public static String getMsPolicyName() {
676                 return msPolicyName;
677         }
678
679         public static void setMsPolicyName(String msPolicyName) {
680                 PolicyController.msPolicyName = msPolicyName;
681         }
682
683         public static String getConfigHome() {
684                 return configHome;
685         }
686
687         public static void setConfigHome(String configHome) {
688                 PolicyController.configHome = configHome;
689         }
690
691         public static String getActionHome() {
692                 return actionHome;
693         }
694
695         public static void setActionHome(String actionHome) {
696                 PolicyController.actionHome = actionHome;
697         }
698
699         public static Object getMapaccess() {
700                 return mapAccess;
701         }
702
703         public static String getPolicydata() {
704                 return policyData;
705         }
706
707         public static String getCharacterencoding() {
708                 return characterEncoding;
709         }
710
711         public static String getContenttype() {
712                 return contentType;
713         }
714
715         public static String getFile() {
716                 return file;
717         }
718         
719         public String convertDate(String dateTTL) {
720                 String formateDate = null;
721                 if(dateTTL.contains("-")){
722                         formateDate = dateTTL.replace("-", "/");
723                 }
724                 return formateDate;
725         }
726 }