2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.pap.xacml.rest.controller;
23 import com.fasterxml.jackson.databind.DeserializationFeature;
24 import com.fasterxml.jackson.databind.JsonNode;
25 import com.fasterxml.jackson.databind.ObjectMapper;
27 import java.io.IOException;
28 import java.io.PrintWriter;
29 import java.net.UnknownHostException;
30 import java.util.Date;
31 import java.util.List;
33 import javax.servlet.http.HttpServletRequest;
34 import javax.servlet.http.HttpServletResponse;
36 import org.jboss.netty.handler.ipfilter.CIDR;
37 import org.json.JSONObject;
38 import org.onap.policy.common.logging.flexlogger.FlexLogger;
39 import org.onap.policy.common.logging.flexlogger.Logger;
40 import org.onap.policy.pap.xacml.rest.adapters.GridData;
41 import org.onap.policy.pap.xacml.rest.util.DictionaryUtils;
42 import org.onap.policy.rest.dao.CommonClassDao;
43 import org.onap.policy.rest.jpa.ActionList;
44 import org.onap.policy.rest.jpa.AddressGroup;
45 import org.onap.policy.rest.jpa.FWTag;
46 import org.onap.policy.rest.jpa.FWTagPicker;
47 import org.onap.policy.rest.jpa.FirewallDictionaryList;
48 import org.onap.policy.rest.jpa.GroupServiceList;
49 import org.onap.policy.rest.jpa.PortList;
50 import org.onap.policy.rest.jpa.PrefixList;
51 import org.onap.policy.rest.jpa.ProtocolList;
52 import org.onap.policy.rest.jpa.SecurityZone;
53 import org.onap.policy.rest.jpa.ServiceList;
54 import org.onap.policy.rest.jpa.TermList;
55 import org.onap.policy.rest.jpa.UserInfo;
56 import org.onap.policy.rest.jpa.Zone;
57 import org.springframework.beans.factory.annotation.Autowired;
58 import org.springframework.http.MediaType;
59 import org.springframework.stereotype.Controller;
60 import org.springframework.web.bind.annotation.RequestMapping;
61 import org.springframework.web.bind.annotation.RequestMethod;
62 import org.springframework.web.servlet.ModelAndView;
65 public class FirewallDictionaryController {
67 private static final Logger LOGGER = FlexLogger.getLogger(FirewallDictionaryController.class);
69 private static CommonClassDao commonClassDao;
70 private static String prefixListName = "prefixListName";
71 private static String successMessage = "success";
72 private static String operation = "operation";
73 private static String errorMsg = "error";
74 private static String dictionaryFields = "dictionaryFields";
75 private static String duplicateResponseString = "Duplicate";
76 private static String utf8 = "UTF-8";
77 private static String applicationJsonContentType = "application / json";
78 private static String protocolName = "protocolName";
79 private static String groupNameStart = "Group_";
80 private static String option = "option";
81 private static String zoneName = "zoneName";
82 private static String serviceName = "serviceName";
83 private static String termName = "termName";
84 private static String userid = "userid";
85 private static String tagPickerName = "tagPickerName";
86 private static String pfListDatas = "prefixListDictionaryDatas";
87 private static String portListDatas = "portListDictionaryDatas";
88 private static String protocolListDatas = "protocolListDictionaryDatas";
89 private static String addressGroupDatas = "addressGroupDictionaryDatas";
90 private static String actionListDatas = "actionListDictionaryDatas";
91 private static String serviceGroupDatas = "serviceGroupDictionaryDatas";
92 private static String securityZoneDatas = "securityZoneDictionaryDatas";
93 private static String serviceListDatas = "serviceListDictionaryDatas";
94 private static String zoneDatas = "zoneDictionaryDatas";
95 private static String termListDictDatas = "termListDictionaryDatas";
96 private static String fwDictListDatas = "fwDictListDictionaryDatas";
97 private static String fwTagPickerDatas = "fwTagPickerDictionaryDatas";
98 private static String fwTagDatas = "fwTagDictionaryDatas";
101 public FirewallDictionaryController(CommonClassDao commonClassDao) {
102 FirewallDictionaryController.commonClassDao = commonClassDao;
105 public static void setCommonClassDao(CommonClassDao clDao) {
106 commonClassDao = clDao;
109 public FirewallDictionaryController() {
113 private DictionaryUtils getDictionaryUtilsInstance() {
114 return DictionaryUtils.getDictionaryUtils();
118 value = {"/get_PrefixListDataByName"},
119 method = {RequestMethod.GET},
120 produces = MediaType.APPLICATION_JSON_VALUE)
121 public void getPrefixListDictionaryEntityDataByName(HttpServletResponse response) {
122 DictionaryUtils utils = getDictionaryUtilsInstance();
123 utils.getDataByEntity(response, pfListDatas, prefixListName, PrefixList.class);
127 value = {"/get_PrefixListData"},
128 method = {RequestMethod.GET},
129 produces = MediaType.APPLICATION_JSON_VALUE)
130 public void getPrefixListDictionaryEntityData(HttpServletResponse response) {
131 DictionaryUtils utils = getDictionaryUtilsInstance();
132 utils.getData(response, pfListDatas, PrefixList.class);
135 @RequestMapping(value = {"/fw_dictionary/save_prefixList"}, method = {RequestMethod.POST})
136 public ModelAndView savePrefixListDictionary(HttpServletRequest request, HttpServletResponse response)
138 DictionaryUtils utils = getDictionaryUtilsInstance();
140 boolean fromAPI = utils.isRequestFromAPI(request);
141 ObjectMapper mapper = new ObjectMapper();
142 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
143 JsonNode root = mapper.readTree(request.getReader());
144 PrefixList prefixList;
146 prefixList = mapper.readValue(root.get(dictionaryFields).toString(), PrefixList.class);
148 prefixList = mapper.readValue(root.get("prefixListDictionaryData").toString(), PrefixList.class);
151 List<Object> duplicateData = commonClassDao.checkDuplicateEntry(prefixList.getPrefixListName(),
152 prefixListName, PrefixList.class);
153 boolean duplicateflag = false;
154 if (!duplicateData.isEmpty()) {
155 PrefixList data = (PrefixList) duplicateData.get(0);
156 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
157 prefixList.setId(data.getId());
158 } else if ((request.getParameter(operation) != null
159 && !"update".equals(request.getParameter(operation)))
160 || (request.getParameter(operation) == null && (data.getId() != prefixList.getId()))) {
161 duplicateflag = true;
164 String responseString = null;
165 if (!duplicateflag) {
166 if (prefixList.getId() == 0) {
167 commonClassDao.save(prefixList);
169 commonClassDao.update(prefixList);
171 responseString = mapper.writeValueAsString(commonClassDao.getData(PrefixList.class));
173 responseString = duplicateResponseString;
176 return utils.getResultForApi(responseString);
178 utils.setResponseData(response, pfListDatas, responseString);
180 } catch (Exception e) {
181 utils.setErrorResponseData(response, e);
186 @RequestMapping(value = {"/fw_dictionary/remove_PrefixList"}, method = {RequestMethod.POST})
187 public void removePrefixListDictionary(HttpServletRequest request, HttpServletResponse response)
189 DictionaryUtils utils = getDictionaryUtilsInstance();
190 utils.removeData(request, response, pfListDatas, PrefixList.class);
193 @RequestMapping(value = {"/fw_dictionary/validate_prefixList"}, method = {RequestMethod.POST})
194 public void validatePrefixListDictionary(HttpServletRequest request, HttpServletResponse response)
196 DictionaryUtils utils = getDictionaryUtilsInstance();
198 ObjectMapper mapper = new ObjectMapper();
199 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
200 JsonNode root = mapper.readTree(request.getReader());
201 PrefixList prefixList = mapper.readValue(root.get("prefixListDictionaryData").toString(), PrefixList.class);
202 String responseValidation = successMessage;
204 CIDR.newCIDR(prefixList.getPrefixListValue());
205 } catch (UnknownHostException e) {
207 responseValidation = errorMsg;
209 response.setCharacterEncoding(utf8);
210 response.setContentType(applicationJsonContentType);
211 request.setCharacterEncoding(utf8);
213 PrintWriter out = response.getWriter();
214 JSONObject j = new JSONObject("{result: " + responseValidation + "}");
215 out.write(j.toString());
216 } catch (Exception e) {
217 utils.setErrorResponseData(response, e);
222 value = {"/get_PortListData"},
223 method = {RequestMethod.GET},
224 produces = MediaType.APPLICATION_JSON_VALUE)
225 public void getPortListDictionaryEntityData(HttpServletResponse response) {
226 DictionaryUtils utils = getDictionaryUtilsInstance();
227 utils.getData(response, portListDatas, PortList.class);
230 @RequestMapping(value = {"/fw_dictionary/save_portName"}, method = {RequestMethod.POST})
231 public ModelAndView savePortListDictionary(HttpServletRequest request, HttpServletResponse response)
233 DictionaryUtils utils = getDictionaryUtilsInstance();
235 boolean fromAPI = utils.isRequestFromAPI(request);
236 ObjectMapper mapper = new ObjectMapper();
237 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
238 JsonNode root = mapper.readTree(request.getReader());
241 portList = mapper.readValue(root.get(dictionaryFields).toString(), PortList.class);
243 portList = mapper.readValue(root.get("portListDictionaryData").toString(), PortList.class);
245 List<Object> duplicateData =
246 commonClassDao.checkDuplicateEntry(portList.getPortName(), "portName", PortList.class);
247 boolean duplicateflag = false;
248 if (!duplicateData.isEmpty()) {
249 PortList data = (PortList) duplicateData.get(0);
250 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
251 portList.setId(data.getId());
252 } else if ((request.getParameter(operation) != null
253 && !"update".equals(request.getParameter(operation)))
254 || (request.getParameter(operation) == null && (data.getId() != portList.getId()))) {
255 duplicateflag = true;
258 String responseString = null;
259 if (!duplicateflag) {
260 if (portList.getId() == 0) {
261 commonClassDao.save(portList);
263 commonClassDao.update(portList);
265 responseString = mapper.writeValueAsString(commonClassDao.getData(PortList.class));
267 responseString = duplicateResponseString;
270 return utils.getResultForApi(responseString);
272 utils.setResponseData(response, portListDatas, responseString);
274 } catch (Exception e) {
275 utils.setErrorResponseData(response, e);
280 @RequestMapping(value = {"/fw_dictionary/remove_PortList"}, method = {RequestMethod.POST})
281 public void removePortListDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
282 DictionaryUtils utils = getDictionaryUtilsInstance();
283 utils.removeData(request, response, portListDatas, PortList.class);
287 value = {"/get_ProtocolListData"},
288 method = {RequestMethod.GET},
289 produces = MediaType.APPLICATION_JSON_VALUE)
290 public void getProtocolListDictionaryEntityData(HttpServletResponse response) {
291 DictionaryUtils utils = getDictionaryUtilsInstance();
292 utils.getData(response, protocolListDatas, ProtocolList.class);
296 value = {"/get_ProtocolListDataByName"},
297 method = {RequestMethod.GET},
298 produces = MediaType.APPLICATION_JSON_VALUE)
299 public void getProtocolListDictionaryEntityDataByName(HttpServletResponse response) {
300 DictionaryUtils utils = getDictionaryUtilsInstance();
301 utils.getDataByEntity(response, protocolListDatas, protocolName, ProtocolList.class);
304 @RequestMapping(value = {"/fw_dictionary/save_protocolList"}, method = {RequestMethod.POST})
305 public ModelAndView saveProtocolListDictionary(HttpServletRequest request, HttpServletResponse response)
307 DictionaryUtils utils = getDictionaryUtilsInstance();
309 boolean fromAPI = utils.isRequestFromAPI(request);
310 ObjectMapper mapper = new ObjectMapper();
311 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
312 JsonNode root = mapper.readTree(request.getReader());
313 ProtocolList protocolList;
315 protocolList = mapper.readValue(root.get(dictionaryFields).toString(), ProtocolList.class);
317 protocolList = mapper.readValue(root.get("protocolListDictionaryData").toString(), ProtocolList.class);
319 List<Object> duplicateData = commonClassDao.checkDuplicateEntry(protocolList.getProtocolName(),
320 protocolName, ProtocolList.class);
321 boolean duplicateflag = false;
322 if (!duplicateData.isEmpty()) {
323 ProtocolList data = (ProtocolList) duplicateData.get(0);
324 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
325 protocolList.setId(data.getId());
326 } else if ((request.getParameter(operation) != null
327 && !"update".equals(request.getParameter(operation)))
328 || (request.getParameter(operation) == null && (data.getId() != protocolList.getId()))) {
329 duplicateflag = true;
332 String responseString = null;
333 if (!duplicateflag) {
334 if (protocolList.getId() == 0) {
335 commonClassDao.save(protocolList);
337 commonClassDao.update(protocolList);
339 responseString = mapper.writeValueAsString(commonClassDao.getData(ProtocolList.class));
341 responseString = duplicateResponseString;
344 return utils.getResultForApi(responseString);
346 utils.setResponseData(response, protocolListDatas, responseString);
348 } catch (Exception e) {
349 utils.setErrorResponseData(response, e);
354 @RequestMapping(value = {"/fw_dictionary/remove_protocol"}, method = {RequestMethod.POST})
355 public void removeProtocolListDictionary(HttpServletRequest request, HttpServletResponse response)
357 DictionaryUtils utils = getDictionaryUtilsInstance();
358 utils.removeData(request, response, protocolListDatas, ProtocolList.class);
362 value = {"/get_AddressGroupDictionaryDataByName"},
363 method = {RequestMethod.GET},
364 produces = MediaType.APPLICATION_JSON_VALUE)
365 public void getAddressGroupDictionaryEntityDataByName(HttpServletResponse response) {
366 DictionaryUtils utils = getDictionaryUtilsInstance();
367 utils.getDataByEntity(response, addressGroupDatas, "name", AddressGroup.class);
371 value = {"/get_AddressGroupData"},
372 method = {RequestMethod.GET},
373 produces = MediaType.APPLICATION_JSON_VALUE)
374 public void getAddressGroupDictionaryEntityData(HttpServletResponse response) {
375 DictionaryUtils utils = getDictionaryUtilsInstance();
376 utils.getData(response, addressGroupDatas, AddressGroup.class);
379 @RequestMapping(value = {"/fw_dictionary/save_addressGroup"}, method = {RequestMethod.POST})
380 public ModelAndView saveAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response)
382 DictionaryUtils utils = getDictionaryUtilsInstance();
384 boolean fromAPI = utils.isRequestFromAPI(request);
385 ObjectMapper mapper = new ObjectMapper();
386 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
387 JsonNode root = mapper.readTree(request.getReader());
388 AddressGroup addressGroup;
391 addressGroup = mapper.readValue(root.get(dictionaryFields).toString(), AddressGroup.class);
392 gridData = mapper.readValue(root.get(dictionaryFields).toString(), GridData.class);
394 addressGroup = mapper.readValue(root.get("addressGroupDictionaryData").toString(), AddressGroup.class);
395 gridData = mapper.readValue(root.get("addressGroupDictionaryData").toString(), GridData.class);
397 if (!addressGroup.getGroupName().startsWith(groupNameStart)) {
398 String groupName = groupNameStart + addressGroup.getGroupName();
399 addressGroup.setGroupName(groupName);
401 addressGroup.setServiceList(utils.appendKey(gridData.getAttributes(), option, ","));
402 List<Object> duplicateData =
403 commonClassDao.checkDuplicateEntry(addressGroup.getGroupName(), "name", AddressGroup.class);
404 boolean duplicateflag = false;
405 if (!duplicateData.isEmpty()) {
406 AddressGroup data = (AddressGroup) duplicateData.get(0);
407 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
408 addressGroup.setId(data.getId());
409 } else if ((request.getParameter(operation) != null
410 && !"update".equals(request.getParameter(operation)))
411 || (request.getParameter(operation) == null && (data.getId() != addressGroup.getId()))) {
412 duplicateflag = true;
415 String responseString = null;
416 if (!duplicateflag) {
417 if (addressGroup.getId() == 0) {
418 commonClassDao.save(addressGroup);
420 commonClassDao.update(addressGroup);
422 responseString = mapper.writeValueAsString(commonClassDao.getData(AddressGroup.class));
424 responseString = duplicateResponseString;
427 return utils.getResultForApi(responseString);
429 utils.setResponseData(response, addressGroupDatas, responseString);
431 } catch (Exception e) {
432 utils.setErrorResponseData(response, e);
437 @RequestMapping(value = {"/fw_dictionary/remove_AddressGroup"}, method = {RequestMethod.POST})
438 public void removeAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response)
440 DictionaryUtils utils = getDictionaryUtilsInstance();
441 utils.removeData(request, response, addressGroupDatas, AddressGroup.class);
445 value = {"/get_ActionListDictionaryDataByName"},
446 method = {RequestMethod.GET},
447 produces = MediaType.APPLICATION_JSON_VALUE)
448 public void getActionListDictionaryEntityDataByName(HttpServletResponse response) {
449 DictionaryUtils utils = getDictionaryUtilsInstance();
450 utils.getDataByEntity(response, actionListDatas, "actionName", ActionList.class);
454 value = {"/get_ActionListData"},
455 method = {RequestMethod.GET},
456 produces = MediaType.APPLICATION_JSON_VALUE)
457 public void getActionListDictionaryEntityData(HttpServletResponse response) {
458 DictionaryUtils utils = getDictionaryUtilsInstance();
459 utils.getData(response, actionListDatas, ActionList.class);
462 @RequestMapping(value = {"/fw_dictionary/save_ActionList"}, method = {RequestMethod.POST})
463 public ModelAndView saveActionListDictionary(HttpServletRequest request, HttpServletResponse response)
465 DictionaryUtils utils = getDictionaryUtilsInstance();
467 boolean fromAPI = utils.isRequestFromAPI(request);
468 ObjectMapper mapper = new ObjectMapper();
469 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
470 JsonNode root = mapper.readTree(request.getReader());
471 ActionList actionList;
473 actionList = mapper.readValue(root.get(dictionaryFields).toString(), ActionList.class);
475 actionList = mapper.readValue(root.get("actionListDictionaryData").toString(), ActionList.class);
477 List<Object> duplicateData =
478 commonClassDao.checkDuplicateEntry(actionList.getActionName(), "actionName", ActionList.class);
479 boolean duplicateflag = false;
480 if (!duplicateData.isEmpty()) {
481 ActionList data = (ActionList) duplicateData.get(0);
482 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
483 actionList.setId(data.getId());
484 } else if ((request.getParameter(operation) != null
485 && !"update".equals(request.getParameter(operation)))
486 || (request.getParameter(operation) == null && (data.getId() != actionList.getId()))) {
487 duplicateflag = true;
490 String responseString = null;
491 if (!duplicateflag) {
492 if (actionList.getId() == 0) {
493 commonClassDao.save(actionList);
495 commonClassDao.update(actionList);
497 responseString = mapper.writeValueAsString(commonClassDao.getData(ActionList.class));
499 responseString = duplicateResponseString;
502 return utils.getResultForApi(responseString);
504 utils.setResponseData(response, actionListDatas, responseString);
506 } catch (Exception e) {
507 utils.setErrorResponseData(response, e);
512 @RequestMapping(value = {"/fw_dictionary/remove_ActionList"}, method = {RequestMethod.POST})
513 public void removeActionListDictionary(HttpServletRequest request, HttpServletResponse response)
515 DictionaryUtils utils = getDictionaryUtilsInstance();
516 utils.removeData(request, response, actionListDatas, ActionList.class);
520 value = {"/get_ServiceGroupData"},
521 method = {RequestMethod.GET},
522 produces = MediaType.APPLICATION_JSON_VALUE)
523 public void getServiceGroupDictionaryEntityData(HttpServletResponse response) {
524 DictionaryUtils utils = getDictionaryUtilsInstance();
525 utils.getData(response, serviceGroupDatas, GroupServiceList.class);
529 value = {"/get_ServiceGroupDictionaryDataByName"},
530 method = {RequestMethod.GET},
531 produces = MediaType.APPLICATION_JSON_VALUE)
532 public void getServiceGroupDictionaryEntityDataByName(HttpServletResponse response) {
533 DictionaryUtils utils = getDictionaryUtilsInstance();
534 utils.getDataByEntity(response, serviceGroupDatas, "name", GroupServiceList.class);
537 @RequestMapping(value = {"/fw_dictionary/save_serviceGroup"}, method = {RequestMethod.POST})
538 public ModelAndView saveServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response)
540 DictionaryUtils utils = getDictionaryUtilsInstance();
542 boolean fromAPI = utils.isRequestFromAPI(request);
543 ObjectMapper mapper = new ObjectMapper();
544 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
545 JsonNode root = mapper.readTree(request.getReader());
546 GroupServiceList groupServiceList;
549 groupServiceList = mapper.readValue(root.get(dictionaryFields).toString(), GroupServiceList.class);
550 gridData = mapper.readValue(root.get(dictionaryFields).toString(), GridData.class);
553 mapper.readValue(root.get("serviceGroupDictionaryData").toString(), GroupServiceList.class);
554 gridData = mapper.readValue(root.get("serviceGroupDictionaryData").toString(), GridData.class);
556 if (!groupServiceList.getGroupName().startsWith(groupNameStart)) {
557 String groupName = groupNameStart + groupServiceList.getGroupName();
558 groupServiceList.setGroupName(groupName);
560 groupServiceList.setServiceList(utils.appendKey(gridData.getAttributes(), option, ","));
561 List<Object> duplicateData =
562 commonClassDao.checkDuplicateEntry(groupServiceList.getGroupName(), "name", GroupServiceList.class);
563 boolean duplicateflag = false;
564 if (!duplicateData.isEmpty()) {
565 GroupServiceList data = (GroupServiceList) duplicateData.get(0);
566 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
567 groupServiceList.setId(data.getId());
568 } else if ((request.getParameter(operation) != null
569 && !"update".equals(request.getParameter(operation)))
570 || (request.getParameter(operation) == null && (data.getId() != groupServiceList.getId()))) {
571 duplicateflag = true;
574 String responseString = null;
575 if (!duplicateflag) {
576 if (groupServiceList.getId() == 0) {
577 commonClassDao.save(groupServiceList);
579 commonClassDao.update(groupServiceList);
581 responseString = mapper.writeValueAsString(commonClassDao.getData(GroupServiceList.class));
583 responseString = duplicateResponseString;
586 return utils.getResultForApi(responseString);
588 utils.setResponseData(response, serviceGroupDatas, responseString);
590 } catch (Exception e) {
591 utils.setErrorResponseData(response, e);
596 @RequestMapping(value = {"/fw_dictionary/remove_serviceGroup"}, method = {RequestMethod.POST})
597 public void removeServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response)
599 DictionaryUtils utils = getDictionaryUtilsInstance();
600 utils.removeData(request, response, serviceGroupDatas, GroupServiceList.class);
604 value = {"/get_SecurityZoneDataByName"},
605 method = {RequestMethod.GET},
606 produces = MediaType.APPLICATION_JSON_VALUE)
607 public void getSecurityZoneDictionaryEntityDataByName(HttpServletResponse response) {
608 DictionaryUtils utils = getDictionaryUtilsInstance();
609 utils.getDataByEntity(response, securityZoneDatas, zoneName, SecurityZone.class);
613 value = {"/get_SecurityZoneData"},
614 method = {RequestMethod.GET},
615 produces = MediaType.APPLICATION_JSON_VALUE)
616 public void getSecurityZoneDictionaryEntityData(HttpServletResponse response) {
617 DictionaryUtils utils = getDictionaryUtilsInstance();
618 utils.getData(response, securityZoneDatas, SecurityZone.class);
621 @RequestMapping(value = {"/fw_dictionary/save_securityZone"}, method = {RequestMethod.POST})
622 public ModelAndView saveSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response)
624 DictionaryUtils utils = getDictionaryUtilsInstance();
626 boolean fromAPI = utils.isRequestFromAPI(request);
627 ObjectMapper mapper = new ObjectMapper();
628 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
629 JsonNode root = mapper.readTree(request.getReader());
630 SecurityZone securityZone;
632 securityZone = mapper.readValue(root.get(dictionaryFields).toString(), SecurityZone.class);
634 securityZone = mapper.readValue(root.get("securityZoneDictionaryData").toString(), SecurityZone.class);
636 List<Object> duplicateData =
637 commonClassDao.checkDuplicateEntry(securityZone.getZoneName(), zoneName, SecurityZone.class);
638 boolean duplicateflag = false;
639 if (!duplicateData.isEmpty()) {
640 SecurityZone data = (SecurityZone) duplicateData.get(0);
641 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
642 securityZone.setId(data.getId());
643 } else if ((request.getParameter(operation) != null
644 && !"update".equals(request.getParameter(operation)))
645 || (request.getParameter(operation) == null && (data.getId() != securityZone.getId()))) {
646 duplicateflag = true;
649 String responseString = null;
650 if (!duplicateflag) {
651 if (securityZone.getId() == 0) {
652 commonClassDao.save(securityZone);
654 commonClassDao.update(securityZone);
656 responseString = mapper.writeValueAsString(commonClassDao.getData(SecurityZone.class));
658 responseString = duplicateResponseString;
661 return utils.getResultForApi(responseString);
663 utils.setResponseData(response, securityZoneDatas, responseString);
665 } catch (Exception e) {
666 utils.setErrorResponseData(response, e);
671 @RequestMapping(value = {"/fw_dictionary/remove_securityZone"}, method = {RequestMethod.POST})
672 public void removeSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response)
674 DictionaryUtils utils = getDictionaryUtilsInstance();
675 utils.removeData(request, response, securityZoneDatas, SecurityZone.class);
679 value = {"/get_ServiceListData"},
680 method = {RequestMethod.GET},
681 produces = MediaType.APPLICATION_JSON_VALUE)
682 public void getServiceListDictionaryEntityData(HttpServletResponse response) {
683 DictionaryUtils utils = getDictionaryUtilsInstance();
684 utils.getData(response, serviceListDatas, ServiceList.class);
688 value = {"/get_ServiceListDictionaryDataByName"},
689 method = {RequestMethod.GET},
690 produces = MediaType.APPLICATION_JSON_VALUE)
691 public void getServiceListDictionaryEntityDataByName(HttpServletResponse response) {
692 DictionaryUtils utils = getDictionaryUtilsInstance();
693 utils.getDataByEntity(response, serviceListDatas, serviceName, ServiceList.class);
696 @RequestMapping(value = {"/fw_dictionary/save_serviceList"}, method = {RequestMethod.POST})
697 public ModelAndView saveServiceListDictionary(HttpServletRequest request, HttpServletResponse response)
699 DictionaryUtils utils = getDictionaryUtilsInstance();
701 boolean fromAPI = utils.isRequestFromAPI(request);
702 ObjectMapper mapper = new ObjectMapper();
703 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
704 JsonNode root = mapper.readTree(request.getReader());
705 ServiceList serviceList;
706 GridData serviceListGridData;
708 serviceList = mapper.readValue(root.get(dictionaryFields).toString(), ServiceList.class);
709 serviceListGridData = mapper.readValue(root.get(dictionaryFields).toString(), GridData.class);
711 serviceList = mapper.readValue(root.get("serviceListDictionaryData").toString(), ServiceList.class);
712 serviceListGridData =
713 mapper.readValue(root.get("serviceListDictionaryData").toString(), GridData.class);
716 .setServiceTransProtocol(utils.appendKey(serviceListGridData.getTransportProtocols(), option, ","));
717 serviceList.setServiceAppProtocol(utils.appendKey(serviceListGridData.getAppProtocols(), option, ","));
718 serviceList.setServiceType("SERVICE");
719 List<Object> duplicateData =
720 commonClassDao.checkDuplicateEntry(serviceList.getServiceName(), serviceName, ServiceList.class);
721 boolean duplicateflag = false;
722 if (!duplicateData.isEmpty()) {
723 ServiceList data = (ServiceList) duplicateData.get(0);
724 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
725 serviceList.setId(data.getId());
726 } else if ((request.getParameter(operation) != null
727 && !"update".equals(request.getParameter(operation)))
728 || (request.getParameter(operation) == null && (data.getId() != serviceList.getId()))) {
729 duplicateflag = true;
732 String responseString = null;
733 if (!duplicateflag) {
734 if (serviceList.getId() == 0) {
735 commonClassDao.save(serviceList);
737 commonClassDao.update(serviceList);
739 responseString = mapper.writeValueAsString(commonClassDao.getData(ServiceList.class));
741 responseString = duplicateResponseString;
744 return utils.getResultForApi(responseString);
746 utils.setResponseData(response, serviceListDatas, responseString);
748 } catch (Exception e) {
749 utils.setErrorResponseData(response, e);
754 @RequestMapping(value = {"/fw_dictionary/remove_serviceList"}, method = {RequestMethod.POST})
755 public void removeServiceListDictionary(HttpServletRequest request, HttpServletResponse response)
757 DictionaryUtils utils = getDictionaryUtilsInstance();
758 utils.removeData(request, response, serviceListDatas, ServiceList.class);
762 value = {"/get_ZoneData"},
763 method = {RequestMethod.GET},
764 produces = MediaType.APPLICATION_JSON_VALUE)
765 public void getZoneDictionaryEntityData(HttpServletResponse response) {
766 DictionaryUtils utils = getDictionaryUtilsInstance();
767 utils.getData(response, zoneDatas, Zone.class);
771 value = {"/get_ZoneDictionaryDataByName"},
772 method = {RequestMethod.GET},
773 produces = MediaType.APPLICATION_JSON_VALUE)
774 public void getZoneDictionaryEntityDataByName(HttpServletResponse response) {
775 DictionaryUtils utils = getDictionaryUtilsInstance();
776 utils.getDataByEntity(response, zoneDatas, zoneName, Zone.class);
779 @RequestMapping(value = {"/fw_dictionary/save_zoneName"}, method = {RequestMethod.POST})
780 public ModelAndView saveZoneDictionary(HttpServletRequest request, HttpServletResponse response)
782 DictionaryUtils utils = getDictionaryUtilsInstance();
784 boolean fromAPI = utils.isRequestFromAPI(request);
785 ObjectMapper mapper = new ObjectMapper();
786 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
787 JsonNode root = mapper.readTree(request.getReader());
790 zone = mapper.readValue(root.get(dictionaryFields).toString(), Zone.class);
792 zone = mapper.readValue(root.get("zoneDictionaryData").toString(), Zone.class);
794 List<Object> duplicateData = commonClassDao.checkDuplicateEntry(zone.getZoneName(), zoneName, Zone.class);
795 boolean duplicateflag = false;
796 if (!duplicateData.isEmpty()) {
797 Zone data = (Zone) duplicateData.get(0);
798 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
799 zone.setId(data.getId());
800 } else if ((request.getParameter(operation) != null
801 && !"update".equals(request.getParameter(operation)))
802 || (request.getParameter(operation) == null && (data.getId() != zone.getId()))) {
803 duplicateflag = true;
806 String responseString = null;
807 if (!duplicateflag) {
808 if (zone.getId() == 0) {
809 commonClassDao.save(zone);
811 commonClassDao.update(zone);
813 responseString = mapper.writeValueAsString(commonClassDao.getData(Zone.class));
815 responseString = duplicateResponseString;
818 return utils.getResultForApi(responseString);
820 utils.setResponseData(response, zoneDatas, responseString);
822 } catch (Exception e) {
823 utils.setErrorResponseData(response, e);
828 @RequestMapping(value = {"/fw_dictionary/remove_zone"}, method = {RequestMethod.POST})
829 public void removeZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
830 DictionaryUtils utils = getDictionaryUtilsInstance();
831 utils.removeData(request, response, zoneDatas, Zone.class);
835 value = {"/get_TermListDataByName"},
836 method = {RequestMethod.GET},
837 produces = MediaType.APPLICATION_JSON_VALUE)
838 public void getTermListDictionaryEntityDataByName(HttpServletResponse response) {
839 DictionaryUtils utils = getDictionaryUtilsInstance();
840 utils.getDataByEntity(response, termListDictDatas, termName, TermList.class);
844 value = {"/get_TermListData"},
845 method = {RequestMethod.GET},
846 produces = MediaType.APPLICATION_JSON_VALUE)
847 public void getTermListDictionaryEntityData(HttpServletResponse response) {
848 DictionaryUtils utils = getDictionaryUtilsInstance();
849 utils.getData(response, termListDictDatas, TermList.class);
852 @RequestMapping(value = {"/fw_dictionary/save_termList"}, method = {RequestMethod.POST})
853 public ModelAndView saveTermListDictionary(HttpServletRequest request, HttpServletResponse response)
855 DictionaryUtils utils = getDictionaryUtilsInstance();
857 boolean fromAPI = utils.isRequestFromAPI(request);
858 ObjectMapper mapper = new ObjectMapper();
859 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
860 JsonNode root = mapper.readTree(request.getReader());
862 TermListData termListDatas;
863 String userId = null;
865 termList = mapper.readValue(root.get(dictionaryFields).toString(), TermList.class);
866 termListDatas = mapper.readValue(root.get(dictionaryFields).toString(), TermListData.class);
869 termList = mapper.readValue(root.get("termListDictionaryData").toString(), TermList.class);
870 termListDatas = mapper.readValue(root.get("termListDictionaryData").toString(), TermListData.class);
871 userId = root.get(userid).textValue();
874 termList.setFromZones(utils.appendKey(termListDatas.getFromZoneDatas(), option, ","));
875 termList.setToZones(utils.appendKey(termListDatas.getToZoneDatas(), option, ","));
876 termList.setSrcIPList(utils.appendKey(termListDatas.getSourceListDatas(), option, ","));
877 termList.setDestIPList(utils.appendKey(termListDatas.getDestinationListDatas(), option, ","));
878 termList.setSrcPortList(utils.appendKey(termListDatas.getSourceServiceDatas(), option, ","));
879 termList.setDestPortList(utils.appendKey(termListDatas.getDestinationServiceDatas(), option, ","));
880 termList.setAction(utils.appendKey(termListDatas.getActionListDatas(), option, ","));
882 UserInfo userInfo = utils.getUserInfo(userId);
883 List<Object> duplicateData =
884 commonClassDao.checkDuplicateEntry(termList.getTermName(), termName, TermList.class);
885 boolean duplicateflag = false;
886 if (!duplicateData.isEmpty()) {
887 TermList data = (TermList) duplicateData.get(0);
888 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
889 termList.setId(data.getId());
890 } else if ((request.getParameter(operation) != null
891 && !"update".equals(request.getParameter(operation)))
892 || (request.getParameter(operation) == null && (data.getId() != termList.getId()))) {
893 duplicateflag = true;
896 String responseString = null;
897 if (!duplicateflag) {
898 termList.setUserModifiedBy(userInfo);
899 if (termList.getId() == 0) {
900 termList.setUserCreatedBy(userInfo);
901 commonClassDao.save(termList);
903 termList.setModifiedDate(new Date());
904 commonClassDao.update(termList);
906 responseString = mapper.writeValueAsString(commonClassDao.getData(TermList.class));
908 responseString = duplicateResponseString;
911 return utils.getResultForApi(responseString);
913 utils.setResponseData(response, termListDictDatas, responseString);
915 } catch (Exception e) {
916 utils.setErrorResponseData(response, e);
921 @RequestMapping(value = {"/fw_dictionary/remove_termList"}, method = {RequestMethod.POST})
922 public void removeTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException {
923 DictionaryUtils utils = getDictionaryUtilsInstance();
924 utils.removeData(request, response, termListDictDatas, TermList.class);
927 // ParentList Dictionary Data
929 value = {"/get_FWDictionaryListDataByName"},
930 method = {RequestMethod.GET},
931 produces = MediaType.APPLICATION_JSON_VALUE)
932 public void getFWDictListDictionaryEntityDataByName(HttpServletResponse response) {
933 DictionaryUtils utils = getDictionaryUtilsInstance();
934 utils.getDataByEntity(response, fwDictListDatas, "parentItemName", FirewallDictionaryList.class);
938 value = {"/get_FWDictionaryListData"},
939 method = {RequestMethod.GET},
940 produces = MediaType.APPLICATION_JSON_VALUE)
941 public void getFWDictionaryListEntityData(HttpServletResponse response) {
942 DictionaryUtils utils = getDictionaryUtilsInstance();
943 utils.getData(response, fwDictListDatas, FirewallDictionaryList.class);
946 @RequestMapping(value = {"/fw_dictionary/save_FWDictionaryList"}, method = {RequestMethod.POST})
947 public ModelAndView saveFWDictionaryList(HttpServletRequest request, HttpServletResponse response)
949 DictionaryUtils utils = getDictionaryUtilsInstance();
951 boolean fromAPI = utils.isRequestFromAPI(request);
952 ObjectMapper mapper = new ObjectMapper();
953 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
954 JsonNode root = mapper.readTree(request.getReader());
955 FirewallDictionaryList fwDictList;
958 fwDictList = mapper.readValue(root.get(dictionaryFields).toString(), FirewallDictionaryList.class);
959 gridData = mapper.readValue(root.get(dictionaryFields).toString(), GridData.class);
962 mapper.readValue(root.get("fwDictListDictionaryData").toString(), FirewallDictionaryList.class);
963 gridData = mapper.readValue(root.get("fwDictListDictionaryData").toString(), GridData.class);
966 fwDictList.setServiceList(utils.appendKey(gridData.getAttributes(), option, ","));
967 fwDictList.setAddressList(utils.appendKey(gridData.getAlAttributes(), option, ","));
969 List<Object> duplicateData = commonClassDao.checkDuplicateEntry(fwDictList.getParentItemName(),
970 "parentItemName", FirewallDictionaryList.class);
971 boolean duplicateflag = false;
972 if (!duplicateData.isEmpty()) {
973 FirewallDictionaryList data = (FirewallDictionaryList) duplicateData.get(0);
974 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
975 fwDictList.setId(data.getId());
976 } else if ((request.getParameter(operation) != null
977 && !"update".equals(request.getParameter(operation)))
978 || (request.getParameter(operation) == null && (data.getId() != fwDictList.getId()))) {
979 duplicateflag = true;
982 String responseString = null;
983 if (!duplicateflag) {
984 if (fwDictList.getId() == 0) {
985 commonClassDao.save(fwDictList);
987 commonClassDao.update(fwDictList);
989 responseString = mapper.writeValueAsString(commonClassDao.getData(FirewallDictionaryList.class));
991 responseString = duplicateResponseString;
994 return utils.getResultForApi(responseString);
996 utils.setResponseData(response, fwDictListDatas, responseString);
998 } catch (Exception e) {
999 utils.setErrorResponseData(response, e);
1004 @RequestMapping(value = {"/fw_dictionary/remove_FWDictionaryList"}, method = {RequestMethod.POST})
1005 public void removeFWDictionaryList(HttpServletRequest request, HttpServletResponse response) throws IOException {
1006 DictionaryUtils utils = getDictionaryUtilsInstance();
1007 utils.removeData(request, response, fwDictListDatas, FirewallDictionaryList.class);
1011 value = {"/get_TagPickerNameByName"},
1012 method = {RequestMethod.GET},
1013 produces = MediaType.APPLICATION_JSON_VALUE)
1014 public void getTagPickerNameEntityDataByName(HttpServletResponse response) {
1015 DictionaryUtils utils = getDictionaryUtilsInstance();
1016 utils.getDataByEntity(response, fwTagPickerDatas, tagPickerName, FWTagPicker.class);
1020 value = {"/get_TagPickerListData"},
1021 method = {RequestMethod.GET},
1022 produces = MediaType.APPLICATION_JSON_VALUE)
1023 public void getTagPickerDictionaryEntityData(HttpServletResponse response) {
1024 DictionaryUtils utils = getDictionaryUtilsInstance();
1025 utils.getData(response, fwTagPickerDatas, FWTagPicker.class);
1028 @RequestMapping(value = {"/fw_dictionary/save_fwTagPicker"}, method = {RequestMethod.POST})
1029 public ModelAndView saveFirewallTagPickerDictionary(HttpServletRequest request, HttpServletResponse response)
1030 throws IOException {
1031 DictionaryUtils utils = getDictionaryUtilsInstance();
1033 boolean fromAPI = utils.isRequestFromAPI(request);
1034 ObjectMapper mapper = new ObjectMapper();
1035 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
1036 JsonNode root = mapper.readTree(request.getReader());
1037 FWTagPicker fwTagPicker;
1041 fwTagPicker = mapper.readValue(root.get(dictionaryFields).toString(), FWTagPicker.class);
1042 data = mapper.readValue(root.get(dictionaryFields).toString(), TagGridValues.class);
1045 fwTagPicker = mapper.readValue(root.get("fwTagPickerDictionaryData").toString(), FWTagPicker.class);
1046 data = mapper.readValue(root.get("fwTagPickerDictionaryData").toString(), TagGridValues.class);
1047 userId = root.get(userid).textValue();
1049 fwTagPicker.setTagValues(utils.appendKeyValue(data.getTags(), "#", ":"));
1051 UserInfo userInfo = utils.getUserInfo(userId);
1053 List<Object> duplicateData = commonClassDao.checkDuplicateEntry(fwTagPicker.getTagPickerName(),
1054 tagPickerName, FWTagPicker.class);
1055 boolean duplicateflag = false;
1056 if (!duplicateData.isEmpty()) {
1057 FWTagPicker data1 = (FWTagPicker) duplicateData.get(0);
1058 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
1059 fwTagPicker.setId(data1.getId());
1060 } else if ((request.getParameter(operation) != null
1061 && !"update".equals(request.getParameter(operation)))
1062 || (request.getParameter(operation) == null && (data1.getId() != fwTagPicker.getId()))) {
1063 duplicateflag = true;
1066 String responseString = null;
1067 if (!duplicateflag) {
1068 fwTagPicker.setUserModifiedBy(userInfo);
1069 if (fwTagPicker.getId() == 0) {
1070 fwTagPicker.setUserCreatedBy(userInfo);
1071 commonClassDao.save(fwTagPicker);
1073 fwTagPicker.setModifiedDate(new Date());
1074 commonClassDao.update(fwTagPicker);
1076 responseString = mapper.writeValueAsString(commonClassDao.getData(FWTagPicker.class));
1078 responseString = duplicateResponseString;
1081 return utils.getResultForApi(responseString);
1083 utils.setResponseData(response, fwTagPickerDatas, responseString);
1085 } catch (Exception e) {
1086 utils.setErrorResponseData(response, e);
1091 @RequestMapping(value = {"/fw_dictionary/remove_tagPicker"}, method = {RequestMethod.POST})
1092 public void removeFirewallTagPickerDictionary(HttpServletRequest request, HttpServletResponse response)
1093 throws IOException {
1094 DictionaryUtils utils = getDictionaryUtilsInstance();
1095 utils.removeData(request, response, fwTagPickerDatas, FWTagPicker.class);
1099 value = {"/get_TagListData"},
1100 method = {RequestMethod.GET},
1101 produces = MediaType.APPLICATION_JSON_VALUE)
1102 public void getTagDictionaryEntityData(HttpServletResponse response) {
1103 DictionaryUtils utils = getDictionaryUtilsInstance();
1104 utils.getData(response, fwTagDatas, FWTag.class);
1108 value = {"/get_TagNameByName"},
1109 method = {RequestMethod.GET},
1110 produces = MediaType.APPLICATION_JSON_VALUE)
1111 public void getTagNameEntityDataByName(HttpServletResponse response) {
1112 DictionaryUtils utils = getDictionaryUtilsInstance();
1113 utils.getDataByEntity(response, fwTagDatas, "fwTagName", FWTag.class);
1116 @RequestMapping(value = {"/fw_dictionary/save_fwTag"}, method = {RequestMethod.POST})
1117 public ModelAndView saveFirewallTagDictionary(HttpServletRequest request, HttpServletResponse response)
1118 throws IOException {
1119 DictionaryUtils utils = getDictionaryUtilsInstance();
1121 boolean fromAPI = utils.isRequestFromAPI(request);
1122 ObjectMapper mapper = new ObjectMapper();
1123 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
1124 JsonNode root = mapper.readTree(request.getReader());
1126 TagGridValues tagGridValues;
1129 fwTag = mapper.readValue(root.get(dictionaryFields).toString(), FWTag.class);
1130 tagGridValues = mapper.readValue(root.get(dictionaryFields).toString(), TagGridValues.class);
1133 fwTag = mapper.readValue(root.get("fwTagDictionaryData").toString(), FWTag.class);
1134 tagGridValues = mapper.readValue(root.get("fwTagDictionaryData").toString(), TagGridValues.class);
1135 userId = root.get(userid).textValue();
1137 fwTag.setTagValues(utils.appendKey(tagGridValues.getTags(), "tags", ","));
1139 UserInfo userInfo = utils.getUserInfo(userId);
1140 List<Object> duplicateData =
1141 commonClassDao.checkDuplicateEntry(fwTag.getFwTagName(), "fwTagName", FWTag.class);
1142 boolean duplicateflag = false;
1143 if (!duplicateData.isEmpty()) {
1144 FWTag data = (FWTag) duplicateData.get(0);
1145 if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) {
1146 fwTag.setId(data.getId());
1147 } else if ((request.getParameter(operation) != null
1148 && !"update".equals(request.getParameter(operation)))
1149 || (request.getParameter(operation) == null && (data.getId() != fwTag.getId()))) {
1150 duplicateflag = true;
1153 String responseString = null;
1154 if (!duplicateflag) {
1155 fwTag.setUserModifiedBy(userInfo);
1156 if (fwTag.getId() == 0) {
1157 fwTag.setUserCreatedBy(userInfo);
1158 commonClassDao.save(fwTag);
1160 fwTag.setModifiedDate(new Date());
1161 commonClassDao.update(fwTag);
1163 responseString = mapper.writeValueAsString(commonClassDao.getData(FWTag.class));
1165 responseString = duplicateResponseString;
1168 return utils.getResultForApi(responseString);
1170 utils.setResponseData(response, fwTagDatas, responseString);
1172 } catch (Exception e) {
1173 utils.setErrorResponseData(response, e);
1178 @RequestMapping(value = {"/fw_dictionary/remove_tagList"}, method = {RequestMethod.POST})
1179 public void removeFirewallTagDictionary(HttpServletRequest request, HttpServletResponse response)
1180 throws IOException {
1181 DictionaryUtils utils = getDictionaryUtilsInstance();
1182 utils.removeData(request, response, fwTagDatas, FWTag.class);
1187 class TagGridValues {
1188 private List<Object> tags;
1190 public List<Object> getTags() {
1194 public void setTags(List<Object> tags) {
1201 private List<Object> attributes;
1203 public List<Object> getAttributes() {
1207 public void setAttributes(List<Object> attributes) {
1208 this.attributes = attributes;
1213 class TermListData {
1214 private List<Object> fromZoneDatas;
1215 private List<Object> toZoneDatas;
1216 private List<Object> sourceListDatas;
1217 private List<Object> destinationListDatas;
1218 private List<Object> sourceServiceDatas;
1219 private List<Object> destinationServiceDatas;
1220 private List<Object> actionListDatas;
1222 public List<Object> getFromZoneDatas() {
1223 return fromZoneDatas;
1226 public void setFromZoneDatas(List<Object> fromZoneDatas) {
1227 this.fromZoneDatas = fromZoneDatas;
1230 public List<Object> getToZoneDatas() {
1234 public void setToZoneDatas(List<Object> toZoneDatas) {
1235 this.toZoneDatas = toZoneDatas;
1238 public List<Object> getSourceListDatas() {
1239 return sourceListDatas;
1242 public void setSourceListDatas(List<Object> sourceListDatas) {
1243 this.sourceListDatas = sourceListDatas;
1246 public List<Object> getDestinationListDatas() {
1247 return destinationListDatas;
1250 public void setDestinationListDatas(List<Object> destinationListDatas) {
1251 this.destinationListDatas = destinationListDatas;
1254 public List<Object> getSourceServiceDatas() {
1255 return sourceServiceDatas;
1258 public void setSourceServiceDatas(List<Object> sourceServiceDatas) {
1259 this.sourceServiceDatas = sourceServiceDatas;
1262 public List<Object> getDestinationServiceDatas() {
1263 return destinationServiceDatas;
1266 public void setDestinationServiceDatas(List<Object> destinationServiceDatas) {
1267 this.destinationServiceDatas = destinationServiceDatas;
1270 public List<Object> getActionListDatas() {
1271 return actionListDatas;
1274 public void setActionListDatas(List<Object> actionListDatas) {
1275 this.actionListDatas = actionListDatas;