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<>();
80 private static Map<String, String> matchMap = new HashMap<>();
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<>();
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<>();
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");
384 } catch (Exception ex){
385 LOGGER.error("Exception Occured While Closing the Database Connection"+ex);
391 // Data required for Advice part is setting here.
392 private AdviceExpressionsType getAdviceExpressions(int version, String fileName) {
393 AdviceExpressionsType advices = new AdviceExpressionsType();
394 AdviceExpressionType advice = new AdviceExpressionType();
395 advice.setAdviceId("MSID");
396 advice.setAppliesTo(EffectType.PERMIT);
398 AttributeAssignmentExpressionType assignment1 = new AttributeAssignmentExpressionType();
399 assignment1.setAttributeId("type");
400 assignment1.setCategory(CATEGORY_RESOURCE);
401 assignment1.setIssuer("");
403 AttributeValueType configNameAttributeValue = new AttributeValueType();
404 configNameAttributeValue.setDataType(STRING_DATATYPE);
405 configNameAttributeValue.getContent().add("Configuration");
406 assignment1.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue));
408 advice.getAttributeAssignmentExpression().add(assignment1);
409 // For Config file Url if configurations are provided.
410 AttributeAssignmentExpressionType assignment2 = new AttributeAssignmentExpressionType();
411 assignment2.setAttributeId("URLID");
412 assignment2.setCategory(CATEGORY_RESOURCE);
413 assignment2.setIssuer("");
415 AttributeValueType AttributeValue = new AttributeValueType();
416 AttributeValue.setDataType(URI_DATATYPE);
418 if(policyName.endsWith(".xml")){
419 configName = policyName.replace(".xml", "");
421 configName = policyName;
423 String content = CONFIG_URL +"/Config/" + configName + ".json";
424 AttributeValue.getContent().add(content);
425 assignment2.setExpression(new ObjectFactory().createAttributeValue(AttributeValue));
427 advice.getAttributeAssignmentExpression().add(assignment2);
428 AttributeAssignmentExpressionType assignment3 = new AttributeAssignmentExpressionType();
429 assignment3.setAttributeId("PolicyName");
430 assignment3.setCategory(CATEGORY_RESOURCE);
431 assignment3.setIssuer("");
433 AttributeValueType attributeValue3 = new AttributeValueType();
434 attributeValue3.setDataType(STRING_DATATYPE);
435 fileName = FilenameUtils.removeExtension(fileName);
436 fileName = fileName + ".xml";
437 String name = fileName.substring(fileName.lastIndexOf("\\") + 1, fileName.length());
438 if ((name == null) || (name.equals(""))) {
439 name = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
441 attributeValue3.getContent().add(name);
442 assignment3.setExpression(new ObjectFactory().createAttributeValue(attributeValue3));
443 advice.getAttributeAssignmentExpression().add(assignment3);
445 AttributeAssignmentExpressionType assignment4 = new AttributeAssignmentExpressionType();
446 assignment4.setAttributeId("VersionNumber");
447 assignment4.setCategory(CATEGORY_RESOURCE);
448 assignment4.setIssuer("");
450 AttributeValueType configNameAttributeValue4 = new AttributeValueType();
451 configNameAttributeValue4.setDataType(STRING_DATATYPE);
452 configNameAttributeValue4.getContent().add(Integer.toString(version));
453 assignment4.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue4));
455 advice.getAttributeAssignmentExpression().add(assignment4);
457 AttributeAssignmentExpressionType assignment5 = new AttributeAssignmentExpressionType();
458 assignment5.setAttributeId("matching:" + ECOMPID);
459 assignment5.setCategory(CATEGORY_RESOURCE);
460 assignment5.setIssuer("");
462 AttributeValueType configNameAttributeValue5 = new AttributeValueType();
463 configNameAttributeValue5.setDataType(STRING_DATATYPE);
464 configNameAttributeValue5.getContent().add(policyAdapter.getEcompName());
465 assignment5.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue5));
467 advice.getAttributeAssignmentExpression().add(assignment5);
469 AttributeAssignmentExpressionType assignment7 = new AttributeAssignmentExpressionType();
470 assignment7.setAttributeId("matching:service");
471 assignment7.setCategory(CATEGORY_RESOURCE);
472 assignment7.setIssuer("");
474 AttributeValueType configNameAttributeValue7 = new AttributeValueType();
475 configNameAttributeValue7.setDataType(STRING_DATATYPE);
476 configNameAttributeValue7.getContent().add(policyAdapter.getServiceType());
477 assignment7.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue7));
479 advice.getAttributeAssignmentExpression().add(assignment7);
481 if (matchMap==null || matchMap.isEmpty()){
482 AttributeAssignmentExpressionType assignment6 = new AttributeAssignmentExpressionType();
483 assignment6.setAttributeId("matching:" + CONFIGID);
484 assignment6.setCategory(CATEGORY_RESOURCE);
485 assignment6.setIssuer("");
487 AttributeValueType configNameAttributeValue6 = new AttributeValueType();
488 configNameAttributeValue6.setDataType(STRING_DATATYPE);
489 configNameAttributeValue6.getContent().add(policyAdapter.getConfigName());
490 assignment6.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue6));
492 advice.getAttributeAssignmentExpression().add(assignment6);
495 AttributeAssignmentExpressionType assignment8 = new AttributeAssignmentExpressionType();
496 assignment8.setAttributeId("matching:uuid");
497 assignment8.setCategory(CATEGORY_RESOURCE);
498 assignment8.setIssuer("");
500 AttributeValueType configNameAttributeValue8 = new AttributeValueType();
501 configNameAttributeValue8.setDataType(STRING_DATATYPE);
502 configNameAttributeValue8.getContent().add(policyAdapter.getUuid());
503 assignment8.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue8));
505 advice.getAttributeAssignmentExpression().add(assignment8);
507 AttributeAssignmentExpressionType assignment9 = new AttributeAssignmentExpressionType();
508 assignment9.setAttributeId("matching:Location");
509 assignment9.setCategory(CATEGORY_RESOURCE);
510 assignment9.setIssuer("");
512 AttributeValueType configNameAttributeValue9 = new AttributeValueType();
513 configNameAttributeValue9.setDataType(STRING_DATATYPE);
514 configNameAttributeValue9.getContent().add(policyAdapter.getLocation());
515 assignment9.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue9));
517 advice.getAttributeAssignmentExpression().add(assignment9);
519 for (Entry<String, String> matchValue : matchMap.entrySet()){
520 String value = matchValue.getValue();
521 String key = matchValue.getKey().trim();
522 if (value.contains("matching-true")){
523 if (mapAttribute.containsKey(key)){
524 AttributeAssignmentExpressionType assignment9 = new AttributeAssignmentExpressionType();
525 assignment9.setAttributeId("matching:" + key);
526 assignment9.setCategory(CATEGORY_RESOURCE);
527 assignment9.setIssuer("");
529 AttributeValueType configNameAttributeValue9 = new AttributeValueType();
530 configNameAttributeValue9.setDataType(STRING_DATATYPE);
531 configNameAttributeValue9.getContent().add(mapAttribute.get(key));
532 assignment9.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue9));
534 advice.getAttributeAssignmentExpression().add(assignment9);
541 AttributeAssignmentExpressionType assignment10 = new AttributeAssignmentExpressionType();
542 assignment10.setAttributeId("Priority");
543 assignment10.setCategory(CATEGORY_RESOURCE);
544 assignment10.setIssuer("");
546 AttributeValueType configNameAttributeValue10 = new AttributeValueType();
547 configNameAttributeValue10.setDataType(STRING_DATATYPE);
548 configNameAttributeValue10.getContent().add(policyAdapter.getPriority());
549 assignment10.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue10));
551 advice.getAttributeAssignmentExpression().add(assignment10);
554 AttributeAssignmentExpressionType assignment11 = new AttributeAssignmentExpressionType();
555 assignment11.setAttributeId("RiskType");
556 assignment11.setCategory(CATEGORY_RESOURCE);
557 assignment11.setIssuer("");
559 AttributeValueType configNameAttributeValue11 = new AttributeValueType();
560 configNameAttributeValue11.setDataType(STRING_DATATYPE);
561 configNameAttributeValue11.getContent().add(policyAdapter.getRiskType());
562 assignment11.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue11));
564 advice.getAttributeAssignmentExpression().add(assignment11);
566 AttributeAssignmentExpressionType assignment12 = new AttributeAssignmentExpressionType();
567 assignment12.setAttributeId("RiskLevel");
568 assignment12.setCategory(CATEGORY_RESOURCE);
569 assignment12.setIssuer("");
571 AttributeValueType configNameAttributeValue12 = new AttributeValueType();
572 configNameAttributeValue12.setDataType(STRING_DATATYPE);
573 configNameAttributeValue12.getContent().add(policyAdapter.getRiskLevel());
574 assignment12.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue12));
576 advice.getAttributeAssignmentExpression().add(assignment12);
578 AttributeAssignmentExpressionType assignment13 = new AttributeAssignmentExpressionType();
579 assignment13.setAttributeId("guard");
580 assignment13.setCategory(CATEGORY_RESOURCE);
581 assignment13.setIssuer("");
583 AttributeValueType configNameAttributeValue13 = new AttributeValueType();
584 configNameAttributeValue13.setDataType(STRING_DATATYPE);
585 configNameAttributeValue13.getContent().add(policyAdapter.getGuard());
586 assignment13.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue13));
588 advice.getAttributeAssignmentExpression().add(assignment13);
590 AttributeAssignmentExpressionType assignment14 = new AttributeAssignmentExpressionType();
591 assignment14.setAttributeId("TTLDate");
592 assignment14.setCategory(CATEGORY_RESOURCE);
593 assignment14.setIssuer("");
595 AttributeValueType configNameAttributeValue14 = new AttributeValueType();
596 configNameAttributeValue14.setDataType(STRING_DATATYPE);
597 configNameAttributeValue14.getContent().add(policyAdapter.getTtlDate());
598 assignment14.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue14));
600 advice.getAttributeAssignmentExpression().add(assignment14);
602 advices.getAdviceExpression().add(advice);
607 public Object getCorrectPolicyDataObject() {
608 return policyAdapter.getPolicyData();