import org.onap.policy.rest.adapter.PolicyRestAdapter;
import org.onap.policy.xacml.util.XACMLPolicyWriter;
import org.onap.policy.rest.adapter.PolicyRestAdapter;
import org.onap.policy.xacml.util.XACMLPolicyWriter;
import com.att.research.xacml.std.IdentifierImpl;
import com.att.research.xacml.util.XACMLProperties;
import com.att.research.xacmlatt.pdp.policy.PolicyDef;
import com.att.research.xacml.std.IdentifierImpl;
import com.att.research.xacml.util.XACMLProperties;
import com.att.research.xacmlatt.pdp.policy.PolicyDef;
* @return Either the PolicyAdapter.getData() or PolicyAdapter.getPolicyData()
*/
public abstract Object getCorrectPolicyDataObject();
* @return Either the PolicyAdapter.getData() or PolicyAdapter.getPolicyData()
*/
public abstract Object getCorrectPolicyDataObject();
//This is the method for preparing the policy for saving. We have broken it out
//separately because the fully configured policy is used for multiple things
//This is the method for preparing the policy for saving. We have broken it out
//separately because the fully configured policy is used for multiple things
InputStream stream = new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8));
jsonReader = Json.createReader(stream);
LOGGER.info("Json Value is: " + jsonReader.read().toString() );
InputStream stream = new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8));
jsonReader = Json.createReader(stream);
LOGGER.info("Json Value is: " + jsonReader.read().toString() );
if(actionHome == null || configHome == null){
Path webappsPath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS));
//Sanity Check
if (webappsPath == null) {
PolicyLogger.error("Invalid Webapps Path Location property : " + XACMLRestProperties.PROP_PAP_WEBAPPS);
if(actionHome == null || configHome == null){
Path webappsPath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS));
//Sanity Check
if (webappsPath == null) {
PolicyLogger.error("Invalid Webapps Path Location property : " + XACMLRestProperties.PROP_PAP_WEBAPPS);
webappsPathConfig = Paths.get(webappsPath.toString()+"/Config");
webappsPathAction = Paths.get(webappsPath.toString()+"/Action");
}
webappsPathConfig = Paths.get(webappsPath.toString()+"/Config");
webappsPathAction = Paths.get(webappsPath.toString()+"/Action");
}
try {
Files.createDirectories(webappsPathConfig);
} catch (IOException e) {
PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "Policy", "Failed to create config directory");
}
}
try {
Files.createDirectories(webappsPathConfig);
} catch (IOException e) {
PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "Policy", "Failed to create config directory");
}
}