* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@RequestMapping(
value = {"/get_PDPGroupData"},
method = {org.springframework.web.bind.annotation.RequestMethod.GET},
produces = MediaType.APPLICATION_JSON_VALUE)
public void getPDPGroupEntityData(HttpServletRequest request, HttpServletResponse response) {
try {
@RequestMapping(
value = {"/get_PDPGroupData"},
method = {org.springframework.web.bind.annotation.RequestMethod.GET},
produces = MediaType.APPLICATION_JSON_VALUE)
public void getPDPGroupEntityData(HttpServletRequest request, HttpServletResponse response) {
try {
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups));
- JSONObject j = new JSONObject(msg);
- response.getWriter().write(j.toString());
+ response.getWriter().write(new JSONObject(new JsonMessage(
+ new ObjectMapper().writeValueAsString(groups))).toString());
@RequestMapping(
value = {"/pdp_Group/save_pdp_group"},
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
@RequestMapping(
value = {"/pdp_Group/save_pdp_group"},
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
StdPDPGroup pdpGroupData = mapper
.readValue(root.get("pdpGroupData").toString().replace("groupName", "name"), StdPDPGroup.class);
StdPDPGroup pdpGroupData = mapper
.readValue(root.get("pdpGroupData").toString().replace("groupName", "name"), StdPDPGroup.class);
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups));
- JSONObject j = new JSONObject(msg);
- out.write(j.toString());
+ response.getWriter().write(new JSONObject(new JsonMessage(mapper.writeValueAsString(groups))).toString());
} catch (Exception e) {
policyLogger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Error Occured while Saving the PDP Group" + e);
response.setCharacterEncoding("UTF-8");
} catch (Exception e) {
policyLogger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Error Occured while Saving the PDP Group" + e);
response.setCharacterEncoding("UTF-8");
@RequestMapping(
value = {"/pdp_Group/remove_pdp_group"},
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
@RequestMapping(
value = {"/pdp_Group/remove_pdp_group"},
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
StdPDPGroup pdpGroupData = mapper.readValue(root.get("pdpGroupData").toString(), StdPDPGroup.class);
if ("Default".equals(pdpGroupData.getName())) {
StdPDPGroup pdpGroupData = mapper.readValue(root.get("pdpGroupData").toString(), StdPDPGroup.class);
if ("Default".equals(pdpGroupData.getName())) {
response.setCharacterEncoding("UTF-8");
response.setContentType("application / json");
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
response.setContentType("application / json");
request.setCharacterEncoding("UTF-8");
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups));
- JSONObject j = new JSONObject(msg);
- out.write(j.toString());
+ response.getWriter().write(new JSONObject(new JsonMessage(mapper.writeValueAsString(groups))).toString());
@RequestMapping(
value = {"/pdp_Group/save_pdpTogroup"},
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
@RequestMapping(
value = {"/pdp_Group/save_pdpTogroup"},
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
policyLogger.info("UserId: " + userId + "PDP Group Data: " + root.get("pdpInGroup").toString()
+ "Active Group Data: " + root.get("activePDP").toString());
policyLogger.info(
policyLogger.info("UserId: " + userId + "PDP Group Data: " + root.get("pdpInGroup").toString()
+ "Active Group Data: " + root.get("activePDP").toString());
policyLogger.info(
response.setCharacterEncoding("UTF-8");
response.setContentType("application / json");
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
response.setContentType("application / json");
request.setCharacterEncoding("UTF-8");
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups));
- JSONObject j = new JSONObject(msg);
- out.write(j.toString());
+ response.getWriter().write(new JSONObject(new JsonMessage(mapper.writeValueAsString(groups))).toString());
@RequestMapping(
value = {"/pdp_Group/remove_pdpFromGroup"},
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
@RequestMapping(
value = {"/pdp_Group/remove_pdpFromGroup"},
method = {org.springframework.web.bind.annotation.RequestMethod.POST})
JsonNode root = mapper.readTree(request.getReader());
PolicyController controller = getPolicyControllerInstance();
this.container = new PDPGroupContainer(controller.getPapEngine());
JsonNode root = mapper.readTree(request.getReader());
PolicyController controller = getPolicyControllerInstance();
this.container = new PDPGroupContainer(controller.getPapEngine());
policyLogger.info("UserId: " + userId + "Delete PDP Group Data: " + root.get("data").toString()
+ "Active Group Data: " + root.get("activePDP").toString());
policyLogger.info(
policyLogger.info("UserId: " + userId + "Delete PDP Group Data: " + root.get("data").toString()
+ "Active Group Data: " + root.get("activePDP").toString());
policyLogger.info(
this.container.removePDP(deletePdp, activeGroupData);
response.setCharacterEncoding("UTF-8");
response.setContentType("application / json");
request.setCharacterEncoding("UTF-8");
this.container.removePDP(deletePdp, activeGroupData);
response.setCharacterEncoding("UTF-8");
response.setContentType("application / json");
request.setCharacterEncoding("UTF-8");
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups));
- JSONObject j = new JSONObject(msg);
- out.write(j.toString());
+ response.getWriter().write(new JSONObject(new JsonMessage(mapper.writeValueAsString(groups))).toString());