From 923a9943a1d59a9d1e87d24490eea78fa9869de7 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 19 Mar 2019 01:16:38 +0000 Subject: Use Assertions class from policy-common Change import line in all classes that use the Assertions class, there are a lot of them. Issue-ID: POLICY-1264 Change-Id: I8480264be4e36348b3fc63acf1bc36e9c9dd250b Signed-off-by: liamfallon --- .../apex/model/policymodel/concepts/AxLogic.java | 13 +++++----- .../model/policymodel/concepts/AxPolicies.java | 29 +++++++++++----------- .../apex/model/policymodel/concepts/AxPolicy.java | 21 ++++++++-------- .../model/policymodel/concepts/AxPolicyModel.java | 25 ++++++++++--------- .../apex/model/policymodel/concepts/AxState.java | 9 ++++--- .../model/policymodel/concepts/AxStateOutput.java | 13 +++++----- .../policymodel/concepts/AxStateTaskReference.java | 13 +++++----- .../model/policymodel/concepts/AxStateTree.java | 11 ++++---- .../apex/model/policymodel/concepts/AxTask.java | 25 ++++++++++--------- .../policymodel/concepts/AxTaskParameter.java | 11 ++++---- .../apex/model/policymodel/concepts/AxTasks.java | 13 +++++----- .../model/policymodel/handling/PolicyAnalyser.java | 9 ++++--- 12 files changed, 102 insertions(+), 90 deletions(-) (limited to 'model/policy-model') diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java index ad86fb42c..2fed326f9 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -44,7 +45,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; import org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner; import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class holds Logic for executing a task or task selection on an Apex policy state. The flavour of the logic @@ -54,7 +55,7 @@ import org.onap.policy.apex.model.utilities.Assertions; * executes it. In the Apex engine, executors are deployed as plugins. Apex also provides the executor with run-time * context, which makes context such as input fields, output fields, and context albums available to the task at * runtime. - * + * *

Validation checks that the logic key is valid, that the logic flavour is defined and is valid when checked against * the {@code LOGIC_FLAVOUR_REGEXP} regular expression, and that the specified logic string is not null or blank. */ @@ -113,7 +114,7 @@ public class AxLogic extends AxConcept { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxLogic(final AxLogic copyConcept) { diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java index 3be3e4a31..493cf79c1 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -48,14 +49,14 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class is a policy container and holds a map of the policies for an entire Apex model. All Apex models that use * policies must have an {@link AxPolicies} field. The {@link AxPolicies} class implements the helper methods of the * {@link AxConceptGetter} interface to allow {@link AxPolicy} instances to be retrieved by calling methods directly on * this class without referencing the contained map. - * + * *

Validation checks that the container key is not null. An error is issued if no policies are defined in the * container. Each policy entry is checked to ensure that its key and value are not null and that the key matches the * key in the map value. Each policy entry is then validated individually. @@ -105,7 +106,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxPolicies(final AxPolicies copyConcept) { @@ -146,7 +147,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /* * (non-Javadoc) - * + * * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getKey() */ @Override @@ -156,7 +157,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /* * (non-Javadoc) - * + * * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getKeys() */ @Override @@ -202,7 +203,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /* * (non-Javadoc) - * + * * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model. * basicmodel.concepts.AxValidationResult) */ @@ -250,7 +251,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /* * (non-Javadoc) - * + * * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#clean() */ @Override @@ -264,7 +265,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /* * (non-Javadoc) - * + * * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#toString() */ @Override @@ -307,7 +308,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /* * (non-Javadoc) - * + * * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#hashCode() */ @Override @@ -321,7 +322,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /* * (non-Javadoc) - * + * * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#equals(java.lang.Object) */ @Override @@ -346,7 +347,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter { /* * (non-Javadoc) - * + * * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java index 3c43c6edd..00db24124 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -48,7 +49,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; @@ -57,7 +58,7 @@ import org.slf4j.ext.XLoggerFactory; * {@link AxState} instance. The states of a policy are held in a map in the policy. The state tree is built up at * policy design time by a policy editor and each state is connected to its next state by an {@link AxStateOutput} * instance. - * + * *

Execution of a policy is triggered by an event. A policy starts execution from its first state so the trigger * event for the first sate is the trigger event for the entire policy. Execution from that first state can continue to * one or more subsequent states and so on down branches of states. The state output of the final state in a branch has @@ -65,10 +66,10 @@ import org.slf4j.ext.XLoggerFactory; * in the policy are the possible set of output events on the policy. A state may only be used once in the state tree of * a policy and recursive execution of states in the same execution branch is not allowed, so the same state may not * execute more than once on a single execution of a policy. - * + * *

The template of a policy is a string that can be used by policy editors to store meta information on the policy * that can be used at design time. The policy template string is not used during policy execution. - * + * *

During validation of a policy, the validation checks listed below are executed:

  1. The policy key must not * be a null key
  2. The policy key must be valid
  3. If the policy template is not set, an observation is issued
  4. At * least one state must be defined
  5. Keys and values must all be defined, that is not null
  6. The key on each entry @@ -122,7 +123,7 @@ public class AxPolicy extends AxConcept { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxPolicy(final AxPolicy copyConcept) { @@ -316,7 +317,7 @@ public class AxPolicy extends AxConcept { /** * Validate a state entry. - * + * * @param stateEntry the state entry to validate * @param result The validation result to append to * @return The result of the validation @@ -363,7 +364,7 @@ public class AxPolicy extends AxConcept { /** * Validate a state tree to ensure there are no circular references in it. - * + * * @param result The validation result to append to * @return The result of the validation */ diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java index 8233a0517..acc2c8e04 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -54,7 +55,7 @@ import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas; import org.onap.policy.apex.model.eventmodel.concepts.AxEvent; import org.onap.policy.apex.model.eventmodel.concepts.AxEvents; import org.onap.policy.apex.model.eventmodel.concepts.AxField; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * A container class for an Apex policy model. This class is a container class that allows an Apex @@ -62,18 +63,18 @@ import org.onap.policy.apex.model.utilities.Assertions; * required to run policies in Apex. The model contains schema definitions, definitions of events * and context albums that use those schemas, definitions of tasks for policies and definitions of * the policies themselves. - * + * *

    An Apex policy model is an important artifact in Apex. At editing time, an Apex editor creates * and edits a policy model and a policy model is loaded into and is executed by an Apex engine. * Therefore, an Apex model and the set of policies that it holds is the way that the policy domain * that an Apex engine or a group of Apex engines executes across is expressed, both at design time * and run time. The Apex deployment system is responsible for deploying Apex models to and the * context they need the appropriate engines for execution. - * + * *

    Model registration is carried out by calling the {@code register()} method, which registers the * policy model and all its constituent containers with the model service. The containers for * context schemas, events, context albums, tasks, policies, and key information are all registered. - * + * *

    Once a policy model is composed, the overall structure of the policy model and all its references * can be validated. During validation of a policy model, the validation checks listed below are * executed: @@ -156,7 +157,7 @@ public class AxPolicyModel extends AxModel { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxPolicyModel(final AxPolicyModel copyConcept) { @@ -421,7 +422,7 @@ public class AxPolicyModel extends AxModel { /** * Validate all fundamental concepts keyed in tasks exist. - * + * * @param task The task to validate the keys of * @param result the validation result to return * @return the result @@ -468,7 +469,7 @@ public class AxPolicyModel extends AxModel { /** * Validate that the references used on a state are valid. - * + * * @param state The state to check * @param result the validation result to append to */ @@ -519,7 +520,7 @@ public class AxPolicyModel extends AxModel { /** * Validate that the fields on tasks and events that trigger them and are output by them are * compatible for all tasks used on a state. - * + * * @param state The state to check * @param result the validation result to append to */ @@ -546,7 +547,7 @@ public class AxPolicyModel extends AxModel { /** * Validate that the fields on a task of a state output and the events that trigger it are * compatible. - * + * * @param state The state to check * @param task The task to check * @param stateOutput The state output to check diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java index f25c22827..cb5331f94 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +58,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class holds the definition of a single state in a policy. A state is a single stage in a policy. A state has a @@ -957,9 +958,9 @@ public class AxState extends AxConcept { /** * Compare the object fields on this state to another state. - * + * * @param the other state to compare with - * @return the result of the comparison + * @return the result of the comparison */ private int compareObjectFields(final AxState other) { if (!key.equals(other.key)) { @@ -986,7 +987,7 @@ public class AxState extends AxConcept { if (!taskReferenceMap.equals(other.taskReferenceMap)) { return (taskReferenceMap.hashCode() - other.taskReferenceMap.hashCode()); } - + return 0; } } diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java index 6f6117027..67ed4f16a 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -43,7 +44,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class defines a single output that a state can have. A state can have many outputs with each @@ -52,7 +53,7 @@ import org.onap.policy.apex.model.utilities.Assertions; * state output is selected. If no next state is defined (the next state is a null * {@link AxReferenceKey} key), then this state output outputs its event to an external system and * is an output state for the full policy. - * + * *

    During validation of a state output, the validation checks listed below are executed: *

      *
    1. The state output key must not be a null key and must be valid, see validation in @@ -106,7 +107,7 @@ public class AxStateOutput extends AxConcept { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxStateOutput(final AxStateOutput copyConcept) { diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java index fdf73149f..13c21b65e 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -44,7 +45,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class defines the type of output handling that will be used when a task in a state completes @@ -59,7 +60,7 @@ import org.onap.policy.apex.model.utilities.Assertions; * case of {@link AxStateTaskOutputType#LOGIC} output selection, the output reference key held in * this {@link AxStateTaskReference} instance to an instance of an {@link AxStateFinalizerLogic} * class. See the explanation in the {@link AxState} class for a full description of this handling. - * + * *

      During validation of a state task reference, the validation checks listed below are executed: *

        *
      1. The state task reference key must not be a null key and must be valid, see validation in @@ -111,7 +112,7 @@ public class AxStateTaskReference extends AxConcept { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxStateTaskReference(final AxStateTaskReference copyConcept) { diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java index 0233aa6bf..e68bf9613 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -27,14 +28,14 @@ import java.util.Set; import java.util.TreeSet; import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * The Class is used to return the tree that represents the state branches or chains in a policy. It * creates a tree that holds the state fan out branches in a policy that starts from the given top * state of the tree. Each branch from a state is held in a set of next states for the top state and * each branch in the state tree is itself a {@link AxStateTree} instance. - * + * *

        Validation checks for recursive state use, in other words validation forbids the use of a given * state more than once in a state tree. */ diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java index cf8f34ce7..bbf749a4a 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -54,21 +55,21 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.Validat import org.onap.policy.apex.model.eventmodel.concepts.AxField; import org.onap.policy.apex.model.eventmodel.concepts.AxInputField; import org.onap.policy.apex.model.eventmodel.concepts.AxOutputField; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class holds the definition of a task in Apex. A task is executed by a state and performs * some domain specific logic to carry out work required to be done by a policy. The Task Logic that * is executed by a task is held in a {@link AxTaskLogic} instance. - * + * *

        A task has a set of input fields and output fields, which are passed to and are emitted from the * task during a task execution cycle. A task may have task parameters {@link AxTaskParameter}, * which are configuration values passed to a task at initialization time. - * + * *

        The Task Logic in a task may use information in context albums to perform their domain specific * work. The context albums that the task uses and that should be made available to the task by Apex * policy distribution are held as a set of references to context albums in the task. - * + * *

        During validation of a task, the validation checks listed below are executed: *

          *
        1. The task key must not be a null key and must be valid, see validation in @@ -138,7 +139,7 @@ public class AxTask extends AxConcept { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxTask(final AxTask copyConcept) { @@ -491,7 +492,7 @@ public class AxTask extends AxConcept { /** * Validate a field. - * + * * @param key the key of the field to validate * @param field the field to validate * @param direction The direction of the field @@ -517,7 +518,7 @@ public class AxTask extends AxConcept { /** * Validate a task parameter entry. - * + * * @param taskParameterEntry the task parameter entry to validate * @param result The validation result to append to * @return The result of the validation @@ -541,7 +542,7 @@ public class AxTask extends AxConcept { /** * Validate a context album reference entry. - * + * * @param taskParameterEntry the context album reference entry to validate * @param result The validation result to append to * @return The result of the validation @@ -647,7 +648,7 @@ public class AxTask extends AxConcept { } copy.setContextAlbumReferences(newContextUsage); - copy.setTaskLogic(new AxTaskLogic((AxLogic) taskLogic)); + copy.setTaskLogic(new AxTaskLogic(taskLogic)); return copy; } diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java index 236956020..4846c59cf 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -38,7 +39,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class is used to specify the configuration parameters that may be passed to a task @@ -77,7 +78,7 @@ public class AxTaskParameter extends AxConcept { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxTaskParameter(final AxTaskParameter copyConcept) { diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java index 75fe632a6..b73b6d32b 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -48,14 +49,14 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class is a task container and holds a map of the tasks for an entire Apex model. All Apex * models that use tasks must have an {@link AxTasks} field. The {@link AxTasks} class implements * the helper methods of the {@link AxConceptGetter} interface to allow {@link AxTask} instances to * be retrieved by calling methods directly on this class without referencing the contained map. - * + * *

          Validation checks that the container key is not null. An error is issued if no tasks are defined * in the container. Each task entry is checked to ensure that its key and value are not null and * that the key matches the key in the map value. Each task entry is then validated individually. @@ -93,7 +94,7 @@ public class AxTasks extends AxConcept implements AxConceptGetter { /** * Copy constructor. - * + * * @param copyConcept the concept to copy from */ public AxTasks(final AxTasks copyConcept) { diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java index 244346c99..d40e66ead 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -35,7 +36,7 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; import org.onap.policy.apex.model.policymodel.concepts.AxState; import org.onap.policy.apex.model.policymodel.concepts.AxStateOutput; import org.onap.policy.apex.model.policymodel.concepts.AxTask; -import org.onap.policy.apex.model.utilities.Assertions; +import org.onap.policy.common.utils.validation.Assertions; /** * This class analyses a policy model and shows what the usage of each context album, context item, data type, and event -- cgit 1.2.3-korg