2 * ============LICENSE_START=======================================================
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
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.openecomp.policy.pap.xacml.rest.components;
24 import java.io.PrintWriter;
26 import java.net.URISyntaxException;
27 import java.nio.file.Path;
28 import java.nio.file.Paths;
29 import java.sql.Connection;
30 import java.sql.DriverManager;
31 import java.sql.ResultSet;
32 import java.sql.SQLException;
33 import java.sql.Statement;
34 import java.util.HashMap;
35 import java.util.Iterator;
37 import java.util.Map.Entry;
39 import org.apache.commons.io.FilenameUtils;
40 import org.apache.commons.lang.StringUtils;
41 import org.openecomp.policy.common.logging.eelf.MessageCodes;
42 import org.openecomp.policy.common.logging.eelf.PolicyLogger;
43 import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
44 import org.openecomp.policy.common.logging.flexlogger.Logger;
45 import org.openecomp.policy.rest.XACMLRestProperties;
46 import org.openecomp.policy.rest.adapter.PolicyRestAdapter;
48 import com.att.research.xacml.std.IdentifierImpl;
49 import com.att.research.xacml.util.XACMLProperties;
50 import com.fasterxml.jackson.databind.JsonNode;
51 import com.fasterxml.jackson.databind.ObjectMapper;
52 import com.google.common.base.Splitter;
54 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType;
55 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionsType;
56 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType;
57 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType;
58 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeAssignmentExpressionType;
59 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType;
60 import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType;
61 import oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType;
62 import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType;
63 import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObjectFactory;
64 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
65 import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType;
66 import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType;
68 public class MicroServiceConfigPolicy extends Policy {
70 private static final Logger LOGGER = FlexLogger.getLogger(MicroServiceConfigPolicy.class);
73 * These are the parameters needed for DB access from the PAP
75 private static String papDbDriver = null;
76 private static String papDbUrl = null;
77 private static String papDbUser = null;
78 private static String papDbPassword = null;
79 private static Map<String, String> mapAttribute = new HashMap<String,String>();
80 private static Map<String, String> matchMap = new HashMap<String,String>();
82 public MicroServiceConfigPolicy() {
86 public MicroServiceConfigPolicy(PolicyRestAdapter policyAdapter){
87 this.policyAdapter = policyAdapter;
90 //save configuration of the policy based on the policyname
91 private void saveConfigurations(String policyName, String jsonBody) {
93 if(policyName.endsWith(".xml")){
94 policyName = policyName.replace(".xml", "");
96 PrintWriter out = new PrintWriter(CONFIG_HOME + File.separator + policyName +".json");
97 out.println(jsonBody);
99 } catch (Exception e) {
100 LOGGER.error("Exception Occured While writing Configuration data"+e);
106 public Map<String, String> savePolicies() throws Exception {
108 Map<String, String> successMap = new HashMap<String,String>();
109 if(isPolicyExists()){
110 successMap.put("EXISTS", "This Policy already exist on the PAP");
114 if(!isPreparedToSave()){
115 //Prep and configure the policy for saving
119 // Until here we prepared the data and here calling the method to create xml.
120 Path newPolicyPath = null;
121 newPolicyPath = Paths.get(policyAdapter.getNewFileName());
123 successMap = createPolicy(newPolicyPath,getCorrectPolicyDataObject());
128 //This is the method for preparing the policy for saving. We have broken it out
129 //separately because the fully configured policy is used for multiple things
131 public boolean prepareToSave() throws Exception{
133 if(isPreparedToSave()){
134 //we have already done this
139 String policyID = policyAdapter.getPolicyID();
140 version = policyAdapter.getHighestVersion();
142 // Create the Instance for pojo, PolicyType object is used in marshalling.
143 if (policyAdapter.getPolicyType().equals("Config")) {
144 PolicyType policyConfig = new PolicyType();
146 policyConfig.setVersion(Integer.toString(version));
147 policyConfig.setPolicyId(policyID);
148 policyConfig.setTarget(new TargetType());
149 policyAdapter.setData(policyConfig);
151 policyName = policyAdapter.getNewFileName();
152 if (policyAdapter.getData() != null) {
153 // Save the Configurations file with the policy name with extention based on selection.
154 String jsonBody = policyAdapter.getJsonBody();
155 saveConfigurations(policyName, jsonBody);
157 // Make sure the filename ends with an extension
158 if (policyName.endsWith(".xml") == false) {
159 policyName = policyName + ".xml";
163 PolicyType configPolicy = (PolicyType) policyAdapter.getData();
165 configPolicy.setDescription(policyAdapter.getPolicyDescription());
167 configPolicy.setRuleCombiningAlgId(policyAdapter.getRuleCombiningAlgId());
169 AllOfType allOfOne = new AllOfType();
170 String fileName = policyAdapter.getNewFileName();
171 String name = fileName.substring(fileName.lastIndexOf("\\") + 1, fileName.length());
172 if ((name == null) || (name.equals(""))) {
173 name = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
176 //setup values for pulling out matching attributes
177 ObjectMapper mapper = new ObjectMapper();
178 JsonNode rootNode = mapper.readTree(policyAdapter.getJsonBody());
179 String matching = null;
181 if (policyAdapter.getTtlDate()==null){
182 policyAdapter.setTtlDate("NA");
184 if (policyAdapter.getServiceType().contains("-v")){
185 matching = getValueFromDictionary(policyAdapter.getServiceType());
187 String jsonVersion = StringUtils.replaceEach(rootNode.get("version").toString(), new String[]{"\""}, new String[]{""});
188 matching = getValueFromDictionary(policyAdapter.getServiceType() + "-v" + jsonVersion);
191 matchMap = new HashMap<String,String>();
192 if (matching != null && !matching.isEmpty()){
193 matchMap = Splitter.on(",").withKeyValueSeparator("=").split(matching);
194 if(policyAdapter.getJsonBody() != null){
195 pullMatchValue(rootNode);
199 // Match for policyName
200 allOfOne.getMatch().add(createMatch("PolicyName", name));
202 AllOfType allOf = new AllOfType();
204 // Adding the matches to AllOfType element Match for Ecomp
205 allOf.getMatch().add(createMatch("ECOMPName", policyAdapter.getEcompName()));
206 if (matchMap==null || matchMap.isEmpty()){
207 // Match for ConfigName
208 allOf.getMatch().add(createMatch("ConfigName", policyAdapter.getConfigName()));
210 allOf.getMatch().add(createDynamicMatch("service", policyAdapter.getServiceType()));
212 allOf.getMatch().add(createDynamicMatch("uuid", policyAdapter.getUuid()));
213 // Match for location
214 allOf.getMatch().add(createDynamicMatch("location", policyAdapter.getLocation()));
216 for (Entry<String, String> matchValue : matchMap.entrySet()){
217 String value = matchValue.getValue();
218 String key = matchValue.getKey().trim();
219 if (value.contains("matching-true")){
220 if (mapAttribute.containsKey(key)){
221 allOf.getMatch().add(createDynamicMatch(key, mapAttribute.get(key)));
226 // Match for riskType
227 allOf.getMatch().add(
228 createDynamicMatch("RiskType", policyAdapter.getRiskType()));
229 // Match for riskLevel
230 allOf.getMatch().add(
231 createDynamicMatch("RiskLevel", String.valueOf(policyAdapter.getRiskLevel())));
232 // Match for riskguard
233 allOf.getMatch().add(
234 createDynamicMatch("guard", policyAdapter.getGuard()));
236 allOf.getMatch().add(
237 createDynamicMatch("TTLDate", policyAdapter.getTtlDate()));
239 AnyOfType anyOf = new AnyOfType();
240 anyOf.getAllOf().add(allOfOne);
241 anyOf.getAllOf().add(allOf);
243 TargetType target = new TargetType();
244 ((TargetType) target).getAnyOf().add(anyOf);
246 // Adding the target to the policy element
247 configPolicy.setTarget((TargetType) target);
249 RuleType rule = new RuleType();
250 rule.setRuleId(policyAdapter.getRuleID());
252 rule.setEffect(EffectType.PERMIT);
254 // Create Target in Rule
255 AllOfType allOfInRule = new AllOfType();
257 // Creating match for ACCESS in rule target
258 MatchType accessMatch = new MatchType();
259 AttributeValueType accessAttributeValue = new AttributeValueType();
260 accessAttributeValue.setDataType(STRING_DATATYPE);
261 accessAttributeValue.getContent().add("ACCESS");
262 accessMatch.setAttributeValue(accessAttributeValue);
263 AttributeDesignatorType accessAttributeDesignator = new AttributeDesignatorType();
264 URI accessURI = null;
266 accessURI = new URI(ACTION_ID);
267 } catch (URISyntaxException e) {
268 PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "MicroServiceConfigPolicy", "Exception creating ACCESS URI");
270 accessAttributeDesignator.setCategory(CATEGORY_ACTION);
271 accessAttributeDesignator.setDataType(STRING_DATATYPE);
272 accessAttributeDesignator.setAttributeId(new IdentifierImpl(accessURI).stringValue());
273 accessMatch.setAttributeDesignator(accessAttributeDesignator);
274 accessMatch.setMatchId(FUNCTION_STRING_EQUAL_IGNORE);
276 // Creating Config Match in rule Target
277 MatchType configMatch = new MatchType();
278 AttributeValueType configAttributeValue = new AttributeValueType();
279 configAttributeValue.setDataType(STRING_DATATYPE);
280 configAttributeValue.getContent().add("Config");
281 configMatch.setAttributeValue(configAttributeValue);
282 AttributeDesignatorType configAttributeDesignator = new AttributeDesignatorType();
283 URI configURI = null;
285 configURI = new URI(RESOURCE_ID);
286 } catch (URISyntaxException e) {
287 PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "MicroServiceConfigPolicy", "Exception creating Config URI");
289 configAttributeDesignator.setCategory(CATEGORY_RESOURCE);
290 configAttributeDesignator.setDataType(STRING_DATATYPE);
291 configAttributeDesignator.setAttributeId(new IdentifierImpl(configURI).stringValue());
292 configMatch.setAttributeDesignator(configAttributeDesignator);
293 configMatch.setMatchId(FUNCTION_STRING_EQUAL_IGNORE);
295 allOfInRule.getMatch().add(accessMatch);
296 allOfInRule.getMatch().add(configMatch);
298 AnyOfType anyOfInRule = new AnyOfType();
299 anyOfInRule.getAllOf().add(allOfInRule);
301 TargetType targetInRule = new TargetType();
302 targetInRule.getAnyOf().add(anyOfInRule);
304 rule.setTarget(targetInRule);
305 rule.setAdviceExpressions(getAdviceExpressions(version, policyName));
307 configPolicy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().add(rule);
308 policyAdapter.setPolicyData(configPolicy);
311 PolicyLogger.error("Unsupported data object." + policyAdapter.getData().getClass().getCanonicalName());
313 setPreparedToSave(true);
317 private void pullMatchValue(JsonNode rootNode) {
318 Iterator<Map.Entry<String, JsonNode>> fieldsIterator = rootNode.fields();
319 String newValue = null;
320 while (fieldsIterator.hasNext()) {
321 Map.Entry<String, JsonNode> field = fieldsIterator.next();
322 final String key = field.getKey();
323 final JsonNode value = field.getValue();
324 if (value.isContainerNode() && !value.isArray()) {
325 pullMatchValue(value); // RECURSIVE CALL
327 newValue = StringUtils.replaceEach(value.toString(), new String[]{"[", "]", "\""}, new String[]{"", "", ""});
328 mapAttribute.put(key, newValue);
334 private String getValueFromDictionary(String service){
336 Connection con = null;
340 String modelName = service.split("-v")[0];
341 String modelVersion = service.split("-v")[1];
345 * Retrieve the property values for db access from the xacml.pap.properties
347 papDbDriver = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_DB_DRIVER);
348 papDbUrl = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_DB_URL);
349 papDbUser = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_DB_USER);
350 papDbPassword = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_DB_PASSWORD);
352 String ruleTemplate=null;
356 Class.forName(papDbDriver);
357 con = DriverManager.getConnection(papDbUrl,papDbUser,papDbPassword);
358 st = con.createStatement();
360 String queryString = "Select * from MicroServiceModels where modelName=\"" + modelName
361 + "\" AND version=\"" + modelVersion+"\"";
364 rs = st.executeQuery(queryString);
366 ruleTemplate=rs.getString("annotation");
369 }catch (ClassNotFoundException e) {
370 PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "MicroServiceModels", "Exception querying MicroServiceModels");
371 } catch (SQLException e) {
372 PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "MicroServiceModels", "Exception querying MicroServiceModels");
375 if (con!=null) con.close();
376 if (rs!=null) rs.close();
377 if (st!=null) st.close();
378 } catch (Exception ex){
379 LOGGER.error("Exception Occured While Closing the Database Connection"+ex);
385 // Data required for Advice part is setting here.
386 private AdviceExpressionsType getAdviceExpressions(int version, String fileName) {
387 AdviceExpressionsType advices = new AdviceExpressionsType();
388 AdviceExpressionType advice = new AdviceExpressionType();
389 advice.setAdviceId("MSID");
390 advice.setAppliesTo(EffectType.PERMIT);
392 AttributeAssignmentExpressionType assignment1 = new AttributeAssignmentExpressionType();
393 assignment1.setAttributeId("type");
394 assignment1.setCategory(CATEGORY_RESOURCE);
395 assignment1.setIssuer("");
397 AttributeValueType configNameAttributeValue = new AttributeValueType();
398 configNameAttributeValue.setDataType(STRING_DATATYPE);
399 configNameAttributeValue.getContent().add("Configuration");
400 assignment1.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue));
402 advice.getAttributeAssignmentExpression().add(assignment1);
403 // For Config file Url if configurations are provided.
404 AttributeAssignmentExpressionType assignment2 = new AttributeAssignmentExpressionType();
405 assignment2.setAttributeId("URLID");
406 assignment2.setCategory(CATEGORY_RESOURCE);
407 assignment2.setIssuer("");
409 AttributeValueType AttributeValue = new AttributeValueType();
410 AttributeValue.setDataType(URI_DATATYPE);
412 if(policyName.endsWith(".xml")){
413 configName = policyName.replace(".xml", "");
415 configName = policyName;
417 String content = CONFIG_URL +"/Config/" + configName + ".json";
418 AttributeValue.getContent().add(content);
419 assignment2.setExpression(new ObjectFactory().createAttributeValue(AttributeValue));
421 advice.getAttributeAssignmentExpression().add(assignment2);
422 AttributeAssignmentExpressionType assignment3 = new AttributeAssignmentExpressionType();
423 assignment3.setAttributeId("PolicyName");
424 assignment3.setCategory(CATEGORY_RESOURCE);
425 assignment3.setIssuer("");
427 AttributeValueType attributeValue3 = new AttributeValueType();
428 attributeValue3.setDataType(STRING_DATATYPE);
429 fileName = FilenameUtils.removeExtension(fileName);
430 fileName = fileName + ".xml";
431 String name = fileName.substring(fileName.lastIndexOf("\\") + 1, fileName.length());
432 if ((name == null) || (name.equals(""))) {
433 name = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
435 attributeValue3.getContent().add(name);
436 assignment3.setExpression(new ObjectFactory().createAttributeValue(attributeValue3));
437 advice.getAttributeAssignmentExpression().add(assignment3);
439 AttributeAssignmentExpressionType assignment4 = new AttributeAssignmentExpressionType();
440 assignment4.setAttributeId("VersionNumber");
441 assignment4.setCategory(CATEGORY_RESOURCE);
442 assignment4.setIssuer("");
444 AttributeValueType configNameAttributeValue4 = new AttributeValueType();
445 configNameAttributeValue4.setDataType(STRING_DATATYPE);
446 configNameAttributeValue4.getContent().add(Integer.toString(version));
447 assignment4.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue4));
449 advice.getAttributeAssignmentExpression().add(assignment4);
451 AttributeAssignmentExpressionType assignment5 = new AttributeAssignmentExpressionType();
452 assignment5.setAttributeId("matching:" + ECOMPID);
453 assignment5.setCategory(CATEGORY_RESOURCE);
454 assignment5.setIssuer("");
456 AttributeValueType configNameAttributeValue5 = new AttributeValueType();
457 configNameAttributeValue5.setDataType(STRING_DATATYPE);
458 configNameAttributeValue5.getContent().add(policyAdapter.getEcompName());
459 assignment5.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue5));
461 advice.getAttributeAssignmentExpression().add(assignment5);
463 AttributeAssignmentExpressionType assignment7 = new AttributeAssignmentExpressionType();
464 assignment7.setAttributeId("matching:service");
465 assignment7.setCategory(CATEGORY_RESOURCE);
466 assignment7.setIssuer("");
468 AttributeValueType configNameAttributeValue7 = new AttributeValueType();
469 configNameAttributeValue7.setDataType(STRING_DATATYPE);
470 configNameAttributeValue7.getContent().add(policyAdapter.getServiceType());
471 assignment7.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue7));
473 advice.getAttributeAssignmentExpression().add(assignment7);
475 if (matchMap==null || matchMap.isEmpty()){
476 AttributeAssignmentExpressionType assignment6 = new AttributeAssignmentExpressionType();
477 assignment6.setAttributeId("matching:" + CONFIGID);
478 assignment6.setCategory(CATEGORY_RESOURCE);
479 assignment6.setIssuer("");
481 AttributeValueType configNameAttributeValue6 = new AttributeValueType();
482 configNameAttributeValue6.setDataType(STRING_DATATYPE);
483 configNameAttributeValue6.getContent().add(policyAdapter.getConfigName());
484 assignment6.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue6));
486 advice.getAttributeAssignmentExpression().add(assignment6);
489 AttributeAssignmentExpressionType assignment8 = new AttributeAssignmentExpressionType();
490 assignment8.setAttributeId("matching:uuid");
491 assignment8.setCategory(CATEGORY_RESOURCE);
492 assignment8.setIssuer("");
494 AttributeValueType configNameAttributeValue8 = new AttributeValueType();
495 configNameAttributeValue8.setDataType(STRING_DATATYPE);
496 configNameAttributeValue8.getContent().add(policyAdapter.getUuid());
497 assignment8.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue8));
499 advice.getAttributeAssignmentExpression().add(assignment8);
501 AttributeAssignmentExpressionType assignment9 = new AttributeAssignmentExpressionType();
502 assignment9.setAttributeId("matching:Location");
503 assignment9.setCategory(CATEGORY_RESOURCE);
504 assignment9.setIssuer("");
506 AttributeValueType configNameAttributeValue9 = new AttributeValueType();
507 configNameAttributeValue9.setDataType(STRING_DATATYPE);
508 configNameAttributeValue9.getContent().add(policyAdapter.getLocation());
509 assignment9.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue9));
511 advice.getAttributeAssignmentExpression().add(assignment9);
513 for (Entry<String, String> matchValue : matchMap.entrySet()){
514 String value = matchValue.getValue();
515 String key = matchValue.getKey().trim();
516 if (value.contains("matching-true")){
517 if (mapAttribute.containsKey(key)){
518 AttributeAssignmentExpressionType assignment9 = new AttributeAssignmentExpressionType();
519 assignment9.setAttributeId("matching:" + key);
520 assignment9.setCategory(CATEGORY_RESOURCE);
521 assignment9.setIssuer("");
523 AttributeValueType configNameAttributeValue9 = new AttributeValueType();
524 configNameAttributeValue9.setDataType(STRING_DATATYPE);
525 configNameAttributeValue9.getContent().add(mapAttribute.get(key));
526 assignment9.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue9));
528 advice.getAttributeAssignmentExpression().add(assignment9);
535 AttributeAssignmentExpressionType assignment10 = new AttributeAssignmentExpressionType();
536 assignment10.setAttributeId("Priority");
537 assignment10.setCategory(CATEGORY_RESOURCE);
538 assignment10.setIssuer("");
540 AttributeValueType configNameAttributeValue10 = new AttributeValueType();
541 configNameAttributeValue10.setDataType(STRING_DATATYPE);
542 configNameAttributeValue10.getContent().add(policyAdapter.getPriority());
543 assignment10.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue10));
545 advice.getAttributeAssignmentExpression().add(assignment10);
548 AttributeAssignmentExpressionType assignment11 = new AttributeAssignmentExpressionType();
549 assignment11.setAttributeId("RiskType");
550 assignment11.setCategory(CATEGORY_RESOURCE);
551 assignment11.setIssuer("");
553 AttributeValueType configNameAttributeValue11 = new AttributeValueType();
554 configNameAttributeValue11.setDataType(STRING_DATATYPE);
555 configNameAttributeValue11.getContent().add(policyAdapter.getRiskType());
556 assignment11.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue11));
558 advice.getAttributeAssignmentExpression().add(assignment11);
560 AttributeAssignmentExpressionType assignment12 = new AttributeAssignmentExpressionType();
561 assignment12.setAttributeId("RiskLevel");
562 assignment12.setCategory(CATEGORY_RESOURCE);
563 assignment12.setIssuer("");
565 AttributeValueType configNameAttributeValue12 = new AttributeValueType();
566 configNameAttributeValue12.setDataType(STRING_DATATYPE);
567 configNameAttributeValue12.getContent().add(policyAdapter.getRiskLevel());
568 assignment12.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue12));
570 advice.getAttributeAssignmentExpression().add(assignment12);
572 AttributeAssignmentExpressionType assignment13 = new AttributeAssignmentExpressionType();
573 assignment13.setAttributeId("guard");
574 assignment13.setCategory(CATEGORY_RESOURCE);
575 assignment13.setIssuer("");
577 AttributeValueType configNameAttributeValue13 = new AttributeValueType();
578 configNameAttributeValue13.setDataType(STRING_DATATYPE);
579 configNameAttributeValue13.getContent().add(policyAdapter.getGuard());
580 assignment13.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue13));
582 advice.getAttributeAssignmentExpression().add(assignment13);
584 AttributeAssignmentExpressionType assignment14 = new AttributeAssignmentExpressionType();
585 assignment14.setAttributeId("TTLDate");
586 assignment14.setCategory(CATEGORY_RESOURCE);
587 assignment14.setIssuer("");
589 AttributeValueType configNameAttributeValue14 = new AttributeValueType();
590 configNameAttributeValue14.setDataType(STRING_DATATYPE);
591 configNameAttributeValue14.getContent().add(policyAdapter.getTtlDate());
592 assignment14.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue14));
594 advice.getAttributeAssignmentExpression().add(assignment14);
596 advices.getAdviceExpression().add(advice);
601 public Object getCorrectPolicyDataObject() {
602 return policyAdapter.getPolicyData();