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);
107 public Map<String, String> savePolicies() throws Exception {
109 Map<String, String> successMap = new HashMap<String,String>();
110 if(isPolicyExists()){
111 successMap.put("EXISTS", "This Policy already exist on the PAP");
115 if(!isPreparedToSave()){
116 //Prep and configure the policy for saving
120 // Until here we prepared the data and here calling the method to create xml.
121 Path newPolicyPath = null;
122 newPolicyPath = Paths.get(policyAdapter.getNewFileName());
124 successMap = createPolicy(newPolicyPath,getCorrectPolicyDataObject());
129 //This is the method for preparing the policy for saving. We have broken it out
130 //separately because the fully configured policy is used for multiple things
132 public boolean prepareToSave() throws Exception{
134 if(isPreparedToSave()){
135 //we have already done this
140 String policyID = policyAdapter.getPolicyID();
141 version = policyAdapter.getHighestVersion();
143 // Create the Instance for pojo, PolicyType object is used in marshalling.
144 if (policyAdapter.getPolicyType().equals("Config")) {
145 PolicyType policyConfig = new PolicyType();
147 policyConfig.setVersion(Integer.toString(version));
148 policyConfig.setPolicyId(policyID);
149 policyConfig.setTarget(new TargetType());
150 policyAdapter.setData(policyConfig);
152 policyName = policyAdapter.getNewFileName();
153 if (policyAdapter.getData() != null) {
154 // Save the Configurations file with the policy name with extention based on selection.
155 String jsonBody = policyAdapter.getJsonBody();
156 saveConfigurations(policyName, jsonBody);
158 // Make sure the filename ends with an extension
159 if (policyName.endsWith(".xml") == false) {
160 policyName = policyName + ".xml";
164 PolicyType configPolicy = (PolicyType) policyAdapter.getData();
166 configPolicy.setDescription(policyAdapter.getPolicyDescription());
168 configPolicy.setRuleCombiningAlgId(policyAdapter.getRuleCombiningAlgId());
170 AllOfType allOfOne = new AllOfType();
171 String fileName = policyAdapter.getNewFileName();
172 String name = fileName.substring(fileName.lastIndexOf("\\") + 1, fileName.length());
173 if ((name == null) || (name.equals(""))) {
174 name = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
177 //setup values for pulling out matching attributes
178 ObjectMapper mapper = new ObjectMapper();
179 JsonNode rootNode = mapper.readTree(policyAdapter.getJsonBody());
180 String matching = null;
182 if (policyAdapter.getTtlDate()==null){
183 policyAdapter.setTtlDate("NA");
185 if (policyAdapter.getServiceType().contains("-v")){
186 matching = getValueFromDictionary(policyAdapter.getServiceType());
188 String jsonVersion = StringUtils.replaceEach(rootNode.get("version").toString(), new String[]{"\""}, new String[]{""});
189 matching = getValueFromDictionary(policyAdapter.getServiceType() + "-v" + jsonVersion);
192 matchMap = new HashMap<String,String>();
193 if (matching != null && !matching.isEmpty()){
194 matchMap = Splitter.on(",").withKeyValueSeparator("=").split(matching);
195 if(policyAdapter.getJsonBody() != null){
196 pullMatchValue(rootNode);
200 // Match for policyName
201 allOfOne.getMatch().add(createMatch("PolicyName", name));
203 AllOfType allOf = new AllOfType();
205 // Adding the matches to AllOfType element Match for Ecomp
206 allOf.getMatch().add(createMatch("ECOMPName", policyAdapter.getEcompName()));
207 if (matchMap==null || matchMap.isEmpty()){
208 // Match for ConfigName
209 allOf.getMatch().add(createMatch("ConfigName", policyAdapter.getConfigName()));
211 allOf.getMatch().add(createDynamicMatch("service", policyAdapter.getServiceType()));
213 allOf.getMatch().add(createDynamicMatch("uuid", policyAdapter.getUuid()));
214 // Match for location
215 allOf.getMatch().add(createDynamicMatch("location", policyAdapter.getLocation()));
217 for (Entry<String, String> matchValue : matchMap.entrySet()){
218 String value = matchValue.getValue();
219 String key = matchValue.getKey().trim();
220 if (value.contains("matching-true")){
221 if (mapAttribute.containsKey(key)){
222 allOf.getMatch().add(createDynamicMatch(key, mapAttribute.get(key)));
227 // Match for riskType
228 allOf.getMatch().add(
229 createDynamicMatch("RiskType", policyAdapter.getRiskType()));
230 // Match for riskLevel
231 allOf.getMatch().add(
232 createDynamicMatch("RiskLevel", String.valueOf(policyAdapter.getRiskLevel())));
233 // Match for riskguard
234 allOf.getMatch().add(
235 createDynamicMatch("guard", policyAdapter.getGuard()));
237 allOf.getMatch().add(
238 createDynamicMatch("TTLDate", policyAdapter.getTtlDate()));
240 AnyOfType anyOf = new AnyOfType();
241 anyOf.getAllOf().add(allOfOne);
242 anyOf.getAllOf().add(allOf);
244 TargetType target = new TargetType();
245 ((TargetType) target).getAnyOf().add(anyOf);
247 // Adding the target to the policy element
248 configPolicy.setTarget((TargetType) target);
250 RuleType rule = new RuleType();
251 rule.setRuleId(policyAdapter.getRuleID());
253 rule.setEffect(EffectType.PERMIT);
255 // Create Target in Rule
256 AllOfType allOfInRule = new AllOfType();
258 // Creating match for ACCESS in rule target
259 MatchType accessMatch = new MatchType();
260 AttributeValueType accessAttributeValue = new AttributeValueType();
261 accessAttributeValue.setDataType(STRING_DATATYPE);
262 accessAttributeValue.getContent().add("ACCESS");
263 accessMatch.setAttributeValue(accessAttributeValue);
264 AttributeDesignatorType accessAttributeDesignator = new AttributeDesignatorType();
265 URI accessURI = null;
267 accessURI = new URI(ACTION_ID);
268 } catch (URISyntaxException e) {
269 PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "MicroServiceConfigPolicy", "Exception creating ACCESS URI");
271 accessAttributeDesignator.setCategory(CATEGORY_ACTION);
272 accessAttributeDesignator.setDataType(STRING_DATATYPE);
273 accessAttributeDesignator.setAttributeId(new IdentifierImpl(accessURI).stringValue());
274 accessMatch.setAttributeDesignator(accessAttributeDesignator);
275 accessMatch.setMatchId(FUNCTION_STRING_EQUAL_IGNORE);
277 // Creating Config Match in rule Target
278 MatchType configMatch = new MatchType();
279 AttributeValueType configAttributeValue = new AttributeValueType();
280 configAttributeValue.setDataType(STRING_DATATYPE);
281 configAttributeValue.getContent().add("Config");
282 configMatch.setAttributeValue(configAttributeValue);
283 AttributeDesignatorType configAttributeDesignator = new AttributeDesignatorType();
284 URI configURI = null;
286 configURI = new URI(RESOURCE_ID);
287 } catch (URISyntaxException e) {
288 PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "MicroServiceConfigPolicy", "Exception creating Config URI");
290 configAttributeDesignator.setCategory(CATEGORY_RESOURCE);
291 configAttributeDesignator.setDataType(STRING_DATATYPE);
292 configAttributeDesignator.setAttributeId(new IdentifierImpl(configURI).stringValue());
293 configMatch.setAttributeDesignator(configAttributeDesignator);
294 configMatch.setMatchId(FUNCTION_STRING_EQUAL_IGNORE);
296 allOfInRule.getMatch().add(accessMatch);
297 allOfInRule.getMatch().add(configMatch);
299 AnyOfType anyOfInRule = new AnyOfType();
300 anyOfInRule.getAllOf().add(allOfInRule);
302 TargetType targetInRule = new TargetType();
303 targetInRule.getAnyOf().add(anyOfInRule);
305 rule.setTarget(targetInRule);
306 rule.setAdviceExpressions(getAdviceExpressions(version, policyName));
308 configPolicy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().add(rule);
309 policyAdapter.setPolicyData(configPolicy);
312 PolicyLogger.error("Unsupported data object." + policyAdapter.getData().getClass().getCanonicalName());
314 setPreparedToSave(true);
318 private void pullMatchValue(JsonNode rootNode) {
319 Iterator<Map.Entry<String, JsonNode>> fieldsIterator = rootNode.fields();
320 String newValue = null;
321 while (fieldsIterator.hasNext()) {
322 Map.Entry<String, JsonNode> field = fieldsIterator.next();
323 final String key = field.getKey();
324 final JsonNode value = field.getValue();
325 if (value.isContainerNode() && !value.isArray()) {
326 pullMatchValue(value); // RECURSIVE CALL
328 newValue = StringUtils.replaceEach(value.toString(), new String[]{"[", "]", "\""}, new String[]{"", "", ""});
329 mapAttribute.put(key, newValue);
335 private String getValueFromDictionary(String service){
337 Connection con = null;
341 String modelName = service.split("-v")[0];
342 String modelVersion = service.split("-v")[1];
346 * Retrieve the property values for db access from the xacml.pap.properties
348 papDbDriver = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_DB_DRIVER);
349 papDbUrl = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_DB_URL);
350 papDbUser = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_DB_USER);
351 papDbPassword = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_DB_PASSWORD);
353 String ruleTemplate=null;
357 Class.forName(papDbDriver);
358 con = DriverManager.getConnection(papDbUrl,papDbUser,papDbPassword);
359 st = con.createStatement();
361 String queryString = "Select * from MicroServiceModels where modelName=\"" + modelName
362 + "\" AND version=\"" + modelVersion+"\"";
365 rs = st.executeQuery(queryString);
367 ruleTemplate=rs.getString("annotation");
370 }catch (ClassNotFoundException e) {
371 PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "MicroServiceModels", "Exception querying MicroServiceModels");
372 } catch (SQLException e) {
373 PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "MicroServiceModels", "Exception querying MicroServiceModels");
376 if (con!=null) con.close();
377 if (rs!=null) rs.close();
378 if (st!=null) st.close();
379 } catch (Exception ex){
380 LOGGER.error("Exception Occured While Closing the Database Connection"+ex);
386 // Data required for Advice part is setting here.
387 private AdviceExpressionsType getAdviceExpressions(int version, String fileName) {
388 AdviceExpressionsType advices = new AdviceExpressionsType();
389 AdviceExpressionType advice = new AdviceExpressionType();
390 advice.setAdviceId("MSID");
391 advice.setAppliesTo(EffectType.PERMIT);
393 AttributeAssignmentExpressionType assignment1 = new AttributeAssignmentExpressionType();
394 assignment1.setAttributeId("type");
395 assignment1.setCategory(CATEGORY_RESOURCE);
396 assignment1.setIssuer("");
398 AttributeValueType configNameAttributeValue = new AttributeValueType();
399 configNameAttributeValue.setDataType(STRING_DATATYPE);
400 configNameAttributeValue.getContent().add("Configuration");
401 assignment1.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue));
403 advice.getAttributeAssignmentExpression().add(assignment1);
404 // For Config file Url if configurations are provided.
405 AttributeAssignmentExpressionType assignment2 = new AttributeAssignmentExpressionType();
406 assignment2.setAttributeId("URLID");
407 assignment2.setCategory(CATEGORY_RESOURCE);
408 assignment2.setIssuer("");
410 AttributeValueType AttributeValue = new AttributeValueType();
411 AttributeValue.setDataType(URI_DATATYPE);
413 if(policyName.endsWith(".xml")){
414 configName = policyName.replace(".xml", "");
416 configName = policyName;
418 String content = CONFIG_URL +"/Config/" + configName + ".json";
419 AttributeValue.getContent().add(content);
420 assignment2.setExpression(new ObjectFactory().createAttributeValue(AttributeValue));
422 advice.getAttributeAssignmentExpression().add(assignment2);
423 AttributeAssignmentExpressionType assignment3 = new AttributeAssignmentExpressionType();
424 assignment3.setAttributeId("PolicyName");
425 assignment3.setCategory(CATEGORY_RESOURCE);
426 assignment3.setIssuer("");
428 AttributeValueType attributeValue3 = new AttributeValueType();
429 attributeValue3.setDataType(STRING_DATATYPE);
430 fileName = FilenameUtils.removeExtension(fileName);
431 fileName = fileName + ".xml";
432 String name = fileName.substring(fileName.lastIndexOf("\\") + 1, fileName.length());
433 if ((name == null) || (name.equals(""))) {
434 name = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
436 attributeValue3.getContent().add(name);
437 assignment3.setExpression(new ObjectFactory().createAttributeValue(attributeValue3));
438 advice.getAttributeAssignmentExpression().add(assignment3);
440 AttributeAssignmentExpressionType assignment4 = new AttributeAssignmentExpressionType();
441 assignment4.setAttributeId("VersionNumber");
442 assignment4.setCategory(CATEGORY_RESOURCE);
443 assignment4.setIssuer("");
445 AttributeValueType configNameAttributeValue4 = new AttributeValueType();
446 configNameAttributeValue4.setDataType(STRING_DATATYPE);
447 configNameAttributeValue4.getContent().add(Integer.toString(version));
448 assignment4.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue4));
450 advice.getAttributeAssignmentExpression().add(assignment4);
452 AttributeAssignmentExpressionType assignment5 = new AttributeAssignmentExpressionType();
453 assignment5.setAttributeId("matching:" + ECOMPID);
454 assignment5.setCategory(CATEGORY_RESOURCE);
455 assignment5.setIssuer("");
457 AttributeValueType configNameAttributeValue5 = new AttributeValueType();
458 configNameAttributeValue5.setDataType(STRING_DATATYPE);
459 configNameAttributeValue5.getContent().add(policyAdapter.getEcompName());
460 assignment5.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue5));
462 advice.getAttributeAssignmentExpression().add(assignment5);
464 AttributeAssignmentExpressionType assignment7 = new AttributeAssignmentExpressionType();
465 assignment7.setAttributeId("matching:service");
466 assignment7.setCategory(CATEGORY_RESOURCE);
467 assignment7.setIssuer("");
469 AttributeValueType configNameAttributeValue7 = new AttributeValueType();
470 configNameAttributeValue7.setDataType(STRING_DATATYPE);
471 configNameAttributeValue7.getContent().add(policyAdapter.getServiceType());
472 assignment7.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue7));
474 advice.getAttributeAssignmentExpression().add(assignment7);
476 if (matchMap==null || matchMap.isEmpty()){
477 AttributeAssignmentExpressionType assignment6 = new AttributeAssignmentExpressionType();
478 assignment6.setAttributeId("matching:" + CONFIGID);
479 assignment6.setCategory(CATEGORY_RESOURCE);
480 assignment6.setIssuer("");
482 AttributeValueType configNameAttributeValue6 = new AttributeValueType();
483 configNameAttributeValue6.setDataType(STRING_DATATYPE);
484 configNameAttributeValue6.getContent().add(policyAdapter.getConfigName());
485 assignment6.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue6));
487 advice.getAttributeAssignmentExpression().add(assignment6);
490 AttributeAssignmentExpressionType assignment8 = new AttributeAssignmentExpressionType();
491 assignment8.setAttributeId("matching:uuid");
492 assignment8.setCategory(CATEGORY_RESOURCE);
493 assignment8.setIssuer("");
495 AttributeValueType configNameAttributeValue8 = new AttributeValueType();
496 configNameAttributeValue8.setDataType(STRING_DATATYPE);
497 configNameAttributeValue8.getContent().add(policyAdapter.getUuid());
498 assignment8.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue8));
500 advice.getAttributeAssignmentExpression().add(assignment8);
502 AttributeAssignmentExpressionType assignment9 = new AttributeAssignmentExpressionType();
503 assignment9.setAttributeId("matching:Location");
504 assignment9.setCategory(CATEGORY_RESOURCE);
505 assignment9.setIssuer("");
507 AttributeValueType configNameAttributeValue9 = new AttributeValueType();
508 configNameAttributeValue9.setDataType(STRING_DATATYPE);
509 configNameAttributeValue9.getContent().add(policyAdapter.getLocation());
510 assignment9.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue9));
512 advice.getAttributeAssignmentExpression().add(assignment9);
514 for (Entry<String, String> matchValue : matchMap.entrySet()){
515 String value = matchValue.getValue();
516 String key = matchValue.getKey().trim();
517 if (value.contains("matching-true")){
518 if (mapAttribute.containsKey(key)){
519 AttributeAssignmentExpressionType assignment9 = new AttributeAssignmentExpressionType();
520 assignment9.setAttributeId("matching:" + key);
521 assignment9.setCategory(CATEGORY_RESOURCE);
522 assignment9.setIssuer("");
524 AttributeValueType configNameAttributeValue9 = new AttributeValueType();
525 configNameAttributeValue9.setDataType(STRING_DATATYPE);
526 configNameAttributeValue9.getContent().add(mapAttribute.get(key));
527 assignment9.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue9));
529 advice.getAttributeAssignmentExpression().add(assignment9);
536 AttributeAssignmentExpressionType assignment10 = new AttributeAssignmentExpressionType();
537 assignment10.setAttributeId("Priority");
538 assignment10.setCategory(CATEGORY_RESOURCE);
539 assignment10.setIssuer("");
541 AttributeValueType configNameAttributeValue10 = new AttributeValueType();
542 configNameAttributeValue10.setDataType(STRING_DATATYPE);
543 configNameAttributeValue10.getContent().add(policyAdapter.getPriority());
544 assignment10.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue10));
546 advice.getAttributeAssignmentExpression().add(assignment10);
549 AttributeAssignmentExpressionType assignment11 = new AttributeAssignmentExpressionType();
550 assignment11.setAttributeId("RiskType");
551 assignment11.setCategory(CATEGORY_RESOURCE);
552 assignment11.setIssuer("");
554 AttributeValueType configNameAttributeValue11 = new AttributeValueType();
555 configNameAttributeValue11.setDataType(STRING_DATATYPE);
556 configNameAttributeValue11.getContent().add(policyAdapter.getRiskType());
557 assignment11.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue11));
559 advice.getAttributeAssignmentExpression().add(assignment11);
561 AttributeAssignmentExpressionType assignment12 = new AttributeAssignmentExpressionType();
562 assignment12.setAttributeId("RiskLevel");
563 assignment12.setCategory(CATEGORY_RESOURCE);
564 assignment12.setIssuer("");
566 AttributeValueType configNameAttributeValue12 = new AttributeValueType();
567 configNameAttributeValue12.setDataType(STRING_DATATYPE);
568 configNameAttributeValue12.getContent().add(policyAdapter.getRiskLevel());
569 assignment12.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue12));
571 advice.getAttributeAssignmentExpression().add(assignment12);
573 AttributeAssignmentExpressionType assignment13 = new AttributeAssignmentExpressionType();
574 assignment13.setAttributeId("guard");
575 assignment13.setCategory(CATEGORY_RESOURCE);
576 assignment13.setIssuer("");
578 AttributeValueType configNameAttributeValue13 = new AttributeValueType();
579 configNameAttributeValue13.setDataType(STRING_DATATYPE);
580 configNameAttributeValue13.getContent().add(policyAdapter.getGuard());
581 assignment13.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue13));
583 advice.getAttributeAssignmentExpression().add(assignment13);
585 AttributeAssignmentExpressionType assignment14 = new AttributeAssignmentExpressionType();
586 assignment14.setAttributeId("TTLDate");
587 assignment14.setCategory(CATEGORY_RESOURCE);
588 assignment14.setIssuer("");
590 AttributeValueType configNameAttributeValue14 = new AttributeValueType();
591 configNameAttributeValue14.setDataType(STRING_DATATYPE);
592 configNameAttributeValue14.getContent().add(policyAdapter.getTtlDate());
593 assignment14.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue14));
595 advice.getAttributeAssignmentExpression().add(assignment14);
597 advices.getAdviceExpression().add(advice);
602 public Object getCorrectPolicyDataObject() {
603 return policyAdapter.getPolicyData();