* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.model.PDPGroupContainer;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.model.PDPGroupContainer;
import org.onap.policy.model.Roles;
import org.onap.policy.rest.adapter.AutoPushTabAdapter;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.PolicyEntity;
import org.onap.policy.rest.jpa.PolicyVersion;
import org.onap.policy.model.Roles;
import org.onap.policy.rest.adapter.AutoPushTabAdapter;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.PolicyEntity;
import org.onap.policy.rest.jpa.PolicyVersion;
import org.onap.policy.xacml.api.XACMLErrorConstants;
import org.onap.policy.xacml.api.pap.OnapPDPGroup;
import org.onap.policy.xacml.std.pap.StdPDPGroup;
import org.onap.policy.xacml.api.XACMLErrorConstants;
import org.onap.policy.xacml.api.pap.OnapPDPGroup;
import org.onap.policy.xacml.std.pap.StdPDPGroup;
public class AutoPushController extends RestrictedBaseController{
private static final Logger logger = FlexLogger.getLogger(AutoPushController.class);
public class AutoPushController extends RestrictedBaseController{
private static final Logger logger = FlexLogger.getLogger(AutoPushController.class);
@RequestMapping(value={"/get_AutoPushPoliciesContainerData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
public void getPolicyGroupContainerData(HttpServletRequest request, HttpServletResponse response){
try{
@RequestMapping(value={"/get_AutoPushPoliciesContainerData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
public void getPolicyGroupContainerData(HttpServletRequest request, HttpServletResponse response){
try{
data = new ArrayList<>();
String userId = UserUtils.getUserSession(request).getOrgUserId();
Map<String, Object> model = new HashMap<>();
data = new ArrayList<>();
String userId = UserUtils.getUserSession(request).getOrgUserId();
Map<String, Object> model = new HashMap<>();
// create the id of the target file
// Our standard for file naming is:
// <domain>.<filename>.<version>.xml
// create the id of the target file
// Our standard for file naming is:
// <domain>.<filename>.<version>.xml
updatedGroupObject.setOnapPdps(pdpGroup.getOnapPdps());
updatedGroupObject.setPipConfigs(pdpGroup.getPipConfigs());
updatedGroupObject.setStatus(pdpGroup.getStatus());
updatedGroupObject.setOnapPdps(pdpGroup.getOnapPdps());
updatedGroupObject.setPipConfigs(pdpGroup.getPipConfigs());
updatedGroupObject.setStatus(pdpGroup.getStatus());
// replace the original set of Policies with the set from the
// container (possibly modified by the user)
// replace the original set of Policies with the set from the
// container (possibly modified by the user)
updatedGroupObject.setPolicies(currentPoliciesInGroup);
this.container.updateGroup(updatedGroupObject);
updatedGroupObject.setPolicies(currentPoliciesInGroup);
this.container.updateGroup(updatedGroupObject);
PrintWriter out = response.getWriter();
refreshGroups();
JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups));
JSONObject j = new JSONObject(msg);
out.write(j.toString());
PrintWriter out = response.getWriter();
refreshGroups();
JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups));
JSONObject j = new JSONObject(msg);
out.write(j.toString());
updatedGroupObject.setOnapPdps(group.getOnapPdps());
updatedGroupObject.setPipConfigs(group.getPipConfigs());
updatedGroupObject.setStatus(group.getStatus());
updatedGroupObject.setOnapPdps(group.getOnapPdps());
updatedGroupObject.setPipConfigs(group.getPipConfigs());
updatedGroupObject.setStatus(group.getStatus());