diff options
author | Krishnajinka <kris.jinka@samsung.com> | 2018-08-20 14:18:14 +0900 |
---|---|---|
committer | Krishnajinka <kris.jinka@samsung.com> | 2018-08-20 14:18:50 +0900 |
commit | c47063d7cf7b6294547c7628630a5b9fca1daedc (patch) | |
tree | a025965d319f5138238d153c32245f86ccf7dbed /ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java | |
parent | 84df4a428ded309f750f52ac1c104ac84e426fc0 (diff) |
Use builder for std pap policy
Modify constructor in stdpappolicy to use builder
this will fix the sonar issue related with more than
7 parameters method parameters
Issue-ID: POLICY-1016
Change-Id: Id736a66e5ea48f0f233cffb640cdce8aaa8f2c0d
Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
Diffstat (limited to 'ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java')
-rw-r--r-- | ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java | 102 |
1 files changed, 11 insertions, 91 deletions
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java index 74ded6d43..185175907 100644 --- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java +++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdPAPPolicy.java @@ -3,7 +3,7 @@ * ONAP-XACML * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * Modified Copyright (C) 2018 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -145,97 +145,17 @@ public class StdPAPPolicy implements OnapPAPPolicy, Serializable { this.brmsController = stdPAPPolicyParams.getBrmsController(); this.brmsDependency = stdPAPPolicyParams.getBrmsDependency(); this.drlRuleAndUIParams = stdPAPPolicyParams.getDrlRuleAndUIParams(); - } - - //Constructor for Creating BRMS Param Policies from the Admin Console - public StdPAPPolicy(String configPolicyType, String policyName, String description, - String configName, Boolean editPolicy, String domain, - Map<String, String> dynamicFieldConfigAttributes, Integer highestVersion, String eCompName, - String configBodyData, Map<String, String> drlRuleAndUIParams, String riskLevel, - String riskType, String guard, String ttlDate, String brmsController, - List<String> brmsDependency) { - - this.configPolicyType = configPolicyType; - this.policyName = policyName; - this.policyDescription = description; - this.configName = configName; - this.editPolicy = editPolicy; - this.domain = domain; - this.dynamicFieldConfigAttributes = dynamicFieldConfigAttributes; - this.highestVersion = highestVersion; - this.onapName = eCompName; - this.configBodyData = configBodyData; - this.drlRuleAndUIParams = drlRuleAndUIParams; - this.riskLevel = riskLevel; - this.riskType = riskType; - this.guard = guard; - this.ttlDate = ttlDate; - this.brmsController = brmsController; - this.brmsDependency = brmsDependency; - } - - //Constructor for Creating CloseLoop_Fault and Performance Metric Policies - public StdPAPPolicy(String configPolicyType, String policyName, String description, String onapName, - String jsonBody, Boolean draft, String oldPolicyFileName, String serviceType, - Boolean editPolicy, - String domain, Integer highestVersion, String riskLevel, String riskType, String guard, - String ttlDate) { + this.serviceType = stdPAPPolicyParams.getServiceType(); + this.oldPolicyFileName = stdPAPPolicyParams.getOldPolicyFileName(); + this.draft = stdPAPPolicyParams.isDraft(); + this.uuid = stdPAPPolicyParams.getUuid(); + this.msLocation = stdPAPPolicyParams.getMsLocation(); + this.priority = stdPAPPolicyParams.getPriority(); + this.deleteCondition = stdPAPPolicyParams.getDeleteCondition(); + this.dictionaryType = stdPAPPolicyParams.getDictionaryType(); + this.dictionary = stdPAPPolicyParams.getDictionary(); + this.dictionaryFields = stdPAPPolicyParams.getDictionaryFields(); - this.configPolicyType = configPolicyType; - this.policyName = policyName; - this.policyDescription = description; - this.onapName = onapName; - this.jsonBody = jsonBody; - this.draft = draft; - this.oldPolicyFileName = oldPolicyFileName; - this.serviceType = serviceType; - this.editPolicy = editPolicy; - this.domain = domain; - this.highestVersion = highestVersion; - this.riskLevel = riskLevel; - this.riskType = riskType; - this.guard = guard; - this.ttlDate = ttlDate; - } - - //Constructor for Micro Service Creating/Updating Policies from the Admin Console - public StdPAPPolicy(String configPolicyType, String policyName, String description, String onapName, - String configName, String serviceType, String uuid, - String msLocation, String jsonBody, String priority, String version, Boolean editPolicy, - String domain, int highestVersion, String riskLevel, - String riskType, String guard, String ttlDate) { - - this.configPolicyType = configPolicyType; - this.policyName = policyName; - this.policyDescription = description; - this.onapName = onapName; - this.configName = configName; - this.serviceType = serviceType; - this.uuid = uuid; - this.msLocation = msLocation; - this.priority = priority; - this.version = version; - this.jsonBody = jsonBody; - this.editPolicy = editPolicy; - this.domain = domain; - this.highestVersion = highestVersion; - this.riskLevel = riskLevel; - this.riskType = riskType; - this.guard = guard; - this.ttlDate = ttlDate; - } - - // Constructor for deleting policies from the API - public StdPAPPolicy(String policyName, String deleteCondition) { - this.policyName = policyName; - this.deleteCondition = deleteCondition; - } - - // Constructor for creating dictionary items from the API> - public StdPAPPolicy(String dictionaryType, String dictionary, String dictionaryFields) { - this.dictionaryType = dictionaryType; - this.dictionary = dictionary; - this.dictionaryFields = dictionaryFields; } @Override |