Use Assertions class from policy-common 72/79372/4
authorliamfallon <liam.fallon@est.tech>
Tue, 19 Mar 2019 01:16:38 +0000 (01:16 +0000)
committerliamfallon <liam.fallon@est.tech>
Tue, 19 Mar 2019 01:16:38 +0000 (01:16 +0000)
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 <liam.fallon@est.tech>
67 files changed:
auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineArgument.java
auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineCommand.java
auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/KeywordNode.java
client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRest.java
client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditor.java
client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRest.java
client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRest.java
context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java
context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java
core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java
core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java
core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java
core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java
core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/impl/ExecutorFactoryImpl.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxArtifactKey.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConcept.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetterImpl.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInfo.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyUse.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxModel.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxValidationMessage.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDaoFactory.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelSaver.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelStringWriter.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelWriter.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbum.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextModel.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java
model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineModel.java
model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvent.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEventModel.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvents.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxField.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java
model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java
model/utilities/src/main/java/org/onap/policy/apex/model/utilities/Assertions.java [deleted file]
model/utilities/src/test/java/org/onap/policy/apex/model/utilities/AssertionsTest.java [deleted file]
plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java
plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java
plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ConfigrationProviderImpl.java

index 6dd2f14..6ce1979 100644 (file)
@@ -1,26 +1,27 @@
 /*-
  * ============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=========================================================
  */
 
 package org.onap.policy.apex.auth.clieditor;
 
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class holds the definition of an argument of a CLI command.
@@ -106,7 +107,7 @@ public class CommandLineArgument implements Comparable<CommandLineArgument> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see java.lang.Object#toString()
      */
     @Override
@@ -117,7 +118,7 @@ public class CommandLineArgument implements Comparable<CommandLineArgument> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
     @Override
@@ -163,15 +164,15 @@ public class CommandLineArgument implements Comparable<CommandLineArgument> {
         if (this == obj) {
             return true;
         }
-        
+
         if (obj == null) {
             return false;
         }
-        
+
         if (getClass() != obj.getClass()) {
             return false;
         }
-        
+
         CommandLineArgument other = (CommandLineArgument) obj;
         if (argumentName == null) {
             if (other.argumentName != null) {
@@ -180,7 +181,7 @@ public class CommandLineArgument implements Comparable<CommandLineArgument> {
         } else if (!argumentName.equals(other.argumentName)) {
             return false;
         }
-        
+
         if (description == null) {
             if (other.description != null) {
                 return false;
@@ -188,7 +189,7 @@ public class CommandLineArgument implements Comparable<CommandLineArgument> {
         } else if (!description.equals(other.description)) {
             return false;
         }
-        
+
         return nullable == other.nullable;
     }
 }
index beba915..564c532 100644 (file)
@@ -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=========================================================
  */
@@ -23,7 +24,7 @@ package org.onap.policy.apex.auth.clieditor;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class represents a single Apex CLI command that is issued to the Apex Editor Java API
@@ -188,7 +189,7 @@ public class CommandLineCommand implements Comparable<CommandLineCommand> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see java.lang.Object#toString()
      */
     @Override
@@ -200,7 +201,7 @@ public class CommandLineCommand implements Comparable<CommandLineCommand> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
     @Override
@@ -218,15 +219,15 @@ public class CommandLineCommand implements Comparable<CommandLineCommand> {
         if (result != 0) {
             return result;
         }
-        
+
         if (!argumentList.equals(otherCommand.argumentList)) {
             return (argumentList.hashCode() - otherCommand.argumentList.hashCode());
         }
-        
+
         if (systemCommand != otherCommand.systemCommand) {
             return (this.hashCode() - otherCommand.hashCode());
         }
-        
+
         return apiMethod.compareTo(otherCommand.apiMethod);
     }
 
@@ -250,7 +251,7 @@ public class CommandLineCommand implements Comparable<CommandLineCommand> {
                 return 1;
             }
         }
-        
+
         return 0;
     }
 
@@ -278,15 +279,15 @@ public class CommandLineCommand implements Comparable<CommandLineCommand> {
         if (this == obj) {
             return true;
         }
-        
+
         if (obj == null) {
             return false;
         }
-        
+
         if (getClass() != obj.getClass()) {
             return false;
         }
-        
+
         return this.compareTo((CommandLineCommand) obj) == 0;
     }
 }
index c16bbf5..f6932e9 100644 (file)
@@ -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,7 +28,7 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * The Class KeywordNode holds the structure of a command keyword for the Apex CLI editor. The
@@ -202,15 +203,15 @@ public class KeywordNode implements Comparable<KeywordNode> {
         if (this == obj) {
             return true;
         }
-        
+
         if (obj == null) {
             return false;
         }
-        
+
         if (getClass() != obj.getClass()) {
             return false;
         }
-        
+
         return this.compareTo((KeywordNode) obj) == 0;
     }
 }
index 0ebeec4..db22627 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -24,7 +25,7 @@ import org.glassfish.grizzly.http.server.HttpServer;
 import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
 import org.glassfish.jersey.media.multipart.MultiPartFeature;
 import org.glassfish.jersey.server.ResourceConfig;
-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;
 
index 4ce73b7..20bd6c4 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -23,7 +24,7 @@ package org.onap.policy.apex.client.editor.rest;
 import org.glassfish.grizzly.http.server.HttpServer;
 import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
 import org.glassfish.jersey.server.ResourceConfig;
-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;
 
index 774cfc6..41890e7 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -24,7 +25,7 @@ import org.glassfish.grizzly.http.server.HttpServer;
 import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
 import org.glassfish.jersey.media.multipart.MultiPartFeature;
 import org.glassfish.jersey.server.ResourceConfig;
-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;
 
index d600fb2..e327f1b 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -23,7 +24,7 @@ package org.onap.policy.apex.client.monitoring.rest;
 import org.glassfish.grizzly.http.server.HttpServer;
 import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
 import org.glassfish.jersey.server.ResourceConfig;
-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;
 
index 221c198..f2a4d58 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -37,7 +38,7 @@ import org.onap.policy.apex.context.monitoring.ContextMonitor;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum;
-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;
 
index 55df01b..2a9b818 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -25,8 +26,8 @@ import org.onap.policy.apex.context.Distributor;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.DistributorParameters;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
-import org.onap.policy.apex.model.utilities.Assertions;
 import org.onap.policy.common.parameters.ParameterService;
+import org.onap.policy.common.utils.validation.Assertions;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
index 60de80a..74c067c 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -25,8 +26,8 @@ import org.onap.policy.apex.context.Persistor;
 import org.onap.policy.apex.context.parameters.ContextParameterConstants;
 import org.onap.policy.apex.context.parameters.PersistorParameters;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
-import org.onap.policy.apex.model.utilities.Assertions;
 import org.onap.policy.common.parameters.ParameterService;
+import org.onap.policy.common.utils.validation.Assertions;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
index 6d98313..aa641ad 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -28,7 +29,7 @@ import org.onap.policy.apex.context.SchemaHelper;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema;
-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;
 
@@ -170,7 +171,7 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
             throw new ContextRuntimeException(returnString);
         }
     }
-    
+
     /* (non-Javadoc)
      * @see org.onap.policy.apex.context.SchemaHelper#createNewSubInstance(java.lang.String)
      */
index efc89b5..4f0c233 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -30,8 +31,8 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
 import org.onap.policy.apex.model.basicmodel.service.ModelService;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas;
-import org.onap.policy.apex.model.utilities.Assertions;
 import org.onap.policy.common.parameters.ParameterService;
+import org.onap.policy.common.utils.validation.Assertions;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
index b703506..bf42193 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -20,7 +21,7 @@
 
 package org.onap.policy.apex.core.engine.engine.impl;
 
-import static org.onap.policy.apex.model.utilities.Assertions.argumentNotNull;
+import static org.onap.policy.common.utils.validation.Assertions.argumentNotNull;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -213,7 +214,7 @@ public class ApexEngineImpl implements ApexEngine {
         for (int increment = ApexEngineConstants.STOP_EXECUTION_WAIT_TIMEOUT;
                         increment > 0; increment -= ApexEngineConstants.APEX_ENGINE_STOP_EXECUTION_WAIT_INCREMENT) {
             ThreadUtilities.sleep(ApexEngineConstants.APEX_ENGINE_STOP_EXECUTION_WAIT_INCREMENT);
-            
+
             synchronized (state) {
                 switch (state) {
                     // Engine is OK to stop or has been stopped on return of an event
@@ -245,7 +246,7 @@ public class ApexEngineImpl implements ApexEngine {
         synchronized (state) {
             state = AxEngineState.STOPPED;
         }
-        
+
         throw new ApexException(STOP + key.getId() + "," + state + ", error stopping engine, engine stop timed out");
     }
 
index c30bda1..2e6d961 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -20,7 +21,7 @@
 
 package org.onap.policy.apex.core.engine.executor;
 
-import static org.onap.policy.apex.model.utilities.Assertions.argumentOfClassNotNull;
+import static org.onap.policy.common.utils.validation.Assertions.argumentOfClassNotNull;
 
 import java.util.Map;
 
index 8373471..40de843 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -31,7 +32,7 @@ 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.policymodel.concepts.AxStateOutput;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class is the output of a state, and is used by the engine to decide what the next state for execution is.
index c55d492..9c21dc5 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -20,7 +21,7 @@
 
 package org.onap.policy.apex.core.engine.executor;
 
-import static org.onap.policy.apex.model.utilities.Assertions.argumentOfClassNotNull;
+import static org.onap.policy.common.utils.validation.Assertions.argumentOfClassNotNull;
 
 import java.util.Iterator;
 import java.util.Map;
@@ -222,7 +223,7 @@ public abstract class TaskExecutor
 
     /**
      * If the input field exists on the output and it is not set in the task, then it should be copied to the output.
-     * 
+     *
      * @param field the input field
      */
     private void copyInputField2Output(String field) {
index 5d24f0d..3439655 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -20,7 +21,7 @@
 
 package org.onap.policy.apex.core.engine.executor;
 
-import static org.onap.policy.apex.model.utilities.Assertions.argumentNotNull;
+import static org.onap.policy.common.utils.validation.Assertions.argumentNotNull;
 
 import org.onap.policy.apex.context.ContextException;
 import org.onap.policy.apex.core.engine.ExecutorParameters;
index c0e24dd..7bc4379 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -38,8 +39,8 @@ import org.onap.policy.apex.core.engine.executor.exception.StateMachineRuntimeEx
 import org.onap.policy.apex.model.policymodel.concepts.AxState;
 import org.onap.policy.apex.model.policymodel.concepts.AxStateFinalizerLogic;
 import org.onap.policy.apex.model.policymodel.concepts.AxTask;
-import org.onap.policy.apex.model.utilities.Assertions;
 import org.onap.policy.common.parameters.ParameterService;
+import org.onap.policy.common.utils.validation.Assertions;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
index 7e39e58..9b1dd62 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -32,13 +33,13 @@ import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
 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;
 
 /**
  * An artifact key uniquely identifies every first order entity in the system. Every first order concept in the system
  * must have an {@link AxArtifactKey} to identify it. Concepts that are wholly contained in another concept are
  * identified using a {@link AxReferenceKey} key.
- * 
+ *
  * <p>Key validation checks that the name and version fields match the NAME_REGEXP and VERSION_REGEXP
  * regular expressions respectively.
  */
index bb66147..e9aad67 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -25,7 +26,7 @@ import java.util.List;
 
 import javax.xml.bind.annotation.XmlType;
 
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class is the base class for all Apex concept classes. It enforces implementation of abstract methods and
@@ -46,7 +47,7 @@ public abstract class AxConcept implements Serializable, Comparable<AxConcept> {
 
     /**
      * Copy constructor.
-     * 
+     *
      * @param copyConcept the concept to copy from
      */
     public AxConcept(final AxConcept copyConcept) {
index 866de80..e9c8783 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -24,7 +25,7 @@ import java.util.NavigableMap;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * Implements concept getting from navigable maps.
index 2c2952d..5bcd872 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -39,12 +40,12 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 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.dao.converters.Uuid2String;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * The key information on an {@link AxArtifactKey} key in an Apex policy model. Each {@link AxArtifactKey} must have an
  * {@link AxKeyInfo} object. THe information held is the key's UUID and it's description.
- * 
+ *
  * <p>Validation checks that all fields are defined and that the key is valid. It also observes that descriptions are
  * blank and warns if the UUID is a zero UUID.
  */
index 9afec99..2b05945 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -43,14 +44,14 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlType;
 
 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;
 
 /**
  * The Class AxKeyInformation holds a map of the key information for the entire Apex model. All Apex models
  * {@link AxModel} must have an {@link AxKeyInformation} field. The {@link AxKeyInformation} class implements the helper
  * methods of the {@link AxConceptGetter} interface to allow {@link AxKeyInfo} instances to be retrieved by calling
  * methods directly on this class without referencing the contained map.
- * 
+ *
  * <p>Validation checks that the key is not null, that the key information map is not empty, that each key and value in
  * the map is defined, that the key in each map entry matches the key if each entry value, and that no duplicate UUIDs
  * exist. Each key information entry is then validated individually.
index 09170de..b37519d 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -23,13 +24,13 @@ package org.onap.policy.apex.model.basicmodel.concepts;
 import java.util.List;
 
 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 records a usage of a key in the system. When the list of keys being used by a concept is built using the
  * getKeys() method of the {@link AxConcept} class, an instance of this class is created for every key occurrence. The
  * list of keys returned by the getKeys() method is a list of {@link AxKeyUse} objects.
- * 
+ *
  * <p>Validation checks that each key is valid.
  */
 
index 66045db..1a604a3 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -41,12 +42,12 @@ import javax.xml.bind.annotation.XmlType;
 
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult;
 import org.onap.policy.apex.model.basicmodel.service.ModelService;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class is the base class for all models in Apex. All model classes inherit from this model so all models must
  * have a key and have key information.
- * 
+ *
  * <p>Validation checks that the model key is valid. It goes on to check for null keys and checks each key for
  * uniqueness in the model. A check is carried out to ensure that an {@link AxKeyInfo} instance exists for every
  * {@link AxArtifactKey} key. For each {@link AxReferenceKey} instance, a check is made that its parent and local name
index 57196ad..04d9e23 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -32,21 +33,21 @@ import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
 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;
 
 /**
  * A reference key identifies entities in the system that are contained in other entities. Every contained concept in
  * the system must have an {@link AxReferenceKey} to identify it. Non-contained first order concepts are identified
  * using an {@link AxArtifactKey} key.
- * 
+ *
  * <p>An {@link AxReferenceKey} contains an {@link AxArtifactKey} key reference to the first order entity that contains
  * it. The local name of the reference key must uniquely identify the referenced concept among those concepts contained
  * in the reference key's parent. In other words, if a parent concept has more than one child, the local name in the key
  * of all its children must be unique.
- * 
+ *
  * <p>If a reference key's parent is itself a reference key, then the parent's local name must be set in the reference
  * key. If the parent is a first order concept, then the parent's local name in the key will be set to NULL.
- * 
+ *
  * <p>Key validation checks that the parent name and parent version fields match the NAME_REGEXP and
  * VERSION_REGEXP regular expressions respectively and that the local name fields match the
  * LOCAL_NAME_REGEXP regular expression.
index 7ca0b2f..3e09e1c 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -21,7 +22,7 @@
 package org.onap.policy.apex.model.basicmodel.concepts;
 
 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;
 
 /**
  * A validation message is created for each validation observation observed during validation of a concept. The message
index 47996d8..b374ff4 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -21,7 +22,7 @@
 package org.onap.policy.apex.model.basicmodel.dao;
 
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
-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;
 
index f340f73..1f820ef 100644 (file)
@@ -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=========================================================
  */
@@ -42,9 +43,9 @@ import org.eclipse.persistence.jaxb.MarshallerProperties;
 import org.eclipse.persistence.oxm.MediaType;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.utilities.Assertions;
 import org.onap.policy.apex.model.utilities.TextFileUtils;
 import org.onap.policy.common.utils.resources.ResourceUtils;
+import org.onap.policy.common.utils.validation.Assertions;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
index 4f3008f..50e8bb5 100644 (file)
@@ -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=========================================================
  */
@@ -24,7 +25,7 @@ import java.io.File;
 
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
-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;
 
index 92a956b..91e58d6 100644 (file)
@@ -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=========================================================
  */
@@ -24,7 +25,7 @@ import java.io.ByteArrayOutputStream;
 
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
-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;
 
index eded9fd..35c458e 100644 (file)
@@ -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.eclipse.persistence.jaxb.MarshallerProperties;
 import org.eclipse.persistence.oxm.MediaType;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-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;
 import org.w3c.dom.Document;
index 3d008e9..e27bf78 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -42,25 +43,25 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxKeyUse;
 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 define an album of context.
- * 
+ *
  * <p>A context album is a distributed map of context that will be distributed across all process instances that require
  * access to it. This class defines the schema (structure) of the items in the context album, whether the items on the
  * context album are writable or not, and what the scope of the context album is.
- * 
+ *
  * <p>The structure of items (objects) the context album is defined as a schema, which is understood by whatever schema
  * implementation is being used for the context album.
- * 
+ *
  * <p>The scope of a context album is a string field, understood by whatever distribution mechanism is being used for
  * the context album. The distribution mechanism uses the scope of the context album to decide to which executable
  * entities a given context album is distributed.
- * 
+ *
  * <p>The writable flag on a context album defines whether users of a context album can write to the context album or
  * just read objects from the context album.
- * 
+ *
  * <p>Validation checks that the album key and the context schema key are not null and that the scope field is not
  * undefined and matches the regular expression SCOPE_REGEXP.
  */
index cd452ca..ddf363e 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -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 context album container and holds a map of the context albums for an entire Apex model. All Apex
  * models that use context albums must have an {@link AxContextAlbums} field. The {@link AxContextAlbums} class
  * implements the helper methods of the {@link AxConceptGetter} interface to allow {@link AxContextAlbum} instances to
  * be retrieved by calling methods directly on this class without referencing the contained map.
- * 
+ *
  * <p>Validation checks that the container key is not null. An observation is issued if no context albums are defined in
  * the container. If context albums do exist, they are checked to ensure that keys and values are not null and that the
  * map key matches the key in the map value for all album entries. Each context album entry is then validated
index 56983f3..b2139f8 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -41,14 +42,14 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation;
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.basicmodel.service.ModelService;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * A container class for an Apex context model. This class is a container class that allows an Apex model to be
  * constructed that just contains context and the key information for that context. The model contains schema
  * definitions and the definitions of context albums that use those schemas. In the case where Apex context is being
  * used without policy or independent of policy, an Apex context model is sufficient to get Apex context working.
- * 
+ *
  * <p>Validation runs {@link AxModel} validation on the model. In addition, the {@link AxContextSchemas} and
  * {@link AxContextAlbums} validation is run on the context schemas and albums in the model.
  */
index 767b1d0..f2e3dc3 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -41,7 +42,7 @@ 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.basicmodel.dao.converters.CDataConditioner;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class holds a data schema definition in Apex. A data schema describes the structure of a single atom of data
@@ -50,13 +51,13 @@ import org.onap.policy.apex.model.utilities.Assertions;
  * schema flavour defines the type of schema being defined and the schema itself defines the schema. The schema flavour
  * is used by Apex to look up and load a plugin class that understands and interprets the schema definition and can
  * create instances of classes for the schema.
- * 
+ *
  * <p>An {@link AxContextSchema} is used to define each parameter in Apex events, the messages that enter, exit, and are
  * passed internally in Apex. In addition, an Apex {@link AxContextAlbum} instances hold a map of
  * {@link AxContextSchema} instances to represent the context being managed as an {@link AxContextAlbum}. For example,
  * the state of all cells in a mobile network might be represented as an {@link AxContextAlbum} with its
  * {@link AxContextSchema} being defined as @code cell} objects.
- * 
+ *
  * <p>Validation checks that the schema key is not null. It also checks that the schema flavour is defined and matches
  * the regular expression SCHEMA_FLAVOUR_REGEXP. Finally, validation checks that the defined schema is not a blank or
  * empty string.
index 2b31aa4..b2456bf 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -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 context schema container and holds a map of the context schemas for an entire Apex model. All Apex
  * models that use context schemas must have an {@link AxContextSchemas} field. The {@link AxContextSchemas} class
  * implements the helper methods of the {@link AxConceptGetter} interface to allow {@link AxContextSchema} instances to
  * be retrieved by calling methods directly on this class without referencing the contained map.
- * 
+ *
  * <p>Validation checks that the container key is not null. An error is issued if no context schemas are defined in the
  * container. Each context schema 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 context schema entry is then validated individually.
index 9b01555..7858455 100644 (file)
@@ -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=========================================================
  */
@@ -46,7 +47,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.Validat
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbums;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * A container class for an Apex engine model. This class is a container class that allows an Apex
@@ -55,7 +56,7 @@ import org.onap.policy.apex.model.utilities.Assertions;
  * is used by an Apex engine to pass its current execution state to any system that wishes to query
  * that information. The time stamp of the engine model is the time at which the state and
  * statistics of the engine were read.
- * 
+ *
  * <p>Validation checks that the current state {@link AxEngineState} is defined and that the time stamp
  * is set on the engine model.
  */
@@ -101,7 +102,7 @@ public class AxEngineModel extends AxContextModel {
 
     /**
      * Copy constructor.
-     * 
+     *
      * @param copyConcept the concept to copy from
      */
     public AxEngineModel(final AxEngineModel copyConcept) {
index 896794c..adda0c1 100644 (file)
@@ -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=========================================================
  */
@@ -41,7 +42,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 a java bean that is used to record statistics on Apex engines as they execute.
@@ -109,7 +110,7 @@ public class AxEngineStats extends AxConcept {
 
     /**
      * Copy constructor.
-     * 
+     *
      * @param copyConcept the concept to copy from
      */
     public AxEngineStats(final AxEngineStats copyConcept) {
index 099ee22..c83b7b8 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -47,24 +48,24 @@ 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 defines an Apex event. An {@link AxEvent} is used to kick off execution of policies in Apex and is emitted
  * by policies when they completer execution. In addition, Apex uses {@link AxEvent} instances internally to pass
  * control from one Apex state to the next during execution.
- * 
+ *
  * <p>The {@link AxArtifactKey} of an event uniquely identifies it in an Apex system and the name field in the key is
  * the name of the event.
- * 
+ *
  * <p>Each {@link AxEvent} has a name space, which is usually set to identify the domain of application of an event. For
  * example a 4G cell power event might have the name space {@code org.onap.radio.4g} and the name {@code PowerEvent}.
  * The source and target of the event are reserved to hold an identifier that defines the sender and receiver of an
  * event respectively. The definition and structure of these fields is reserved for future use and their use by
  * applications is currently not recommended.
- * 
+ *
  * <p>The parameters that an event has are defined as a map of {@link AxField} instances.
- * 
+ *
  * <p>Validation checks that the event key is valid. If name space is a blank string, a warning is issued. Blank source
  * or target fields result in observations being issued. An event may not have any parameters. If it has parameters, the
  * name and value of each parameter entry is checked to ensure they are not null. Then the local name of each parameter
index cab46cd..69ae01a 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -42,13 +43,13 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.basicmodel.service.ModelService;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * A container class for an Apex event model. This class is a container class that allows an Apex model to be
  * constructed that contains events and context and the key information for those events and context. The model contains
  * schema definitions and the definitions of events that use those schemas.
- * 
+ *
  * <p>Validation runs {@link AxModel} validation on the model. In addition, the {@link AxContextSchemas} and
  * {@link AxEvents} validation is run on the context schemas and events in the model.
  */
index e973f2e..4ec3af3 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -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 an event container and holds a map of the events for an entire Apex model. All Apex models that use
  * events must have an {@link AxEvents} field. The {@link AxEvents} class implements the helper methods of the
  * {@link AxConceptGetter} interface to allow {@link AxEvents} instances to be retrieved by calling methods directly on
  * this class without referencing the contained map.
- * 
+ *
  * <p>Validation checks that the container key is not null. An error is issued if no events are defined in the
  * container. Each event 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 event entry is then validated individually.
index 6b38ca7..300f6be 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -47,16 +48,16 @@ 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.basicmodel.xml.AxReferenceKeyAdapter;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * In Apex, a field is an input or output parameter to or from a concept. For example, the parameters of an event are
  * fields and the input and output of a task is defined as a collection of fields.
- * 
+ *
  * <p>A field has an {@link AxReferenceKey} key that defines its name and parent, and a {@link AxArtifactKey} key to a
  * context schema that defines the structure of the data atom that holds the value of the field. Fields can be specified
  * as being optional but are mandatory by default.
- * 
+ *
  * <p>Validation checks that the field key and the field schema reference key are not null.
  */
 @Entity
index 6bcf8ec..8b479eb 100644 (file)
@@ -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=========================================================
  */
@@ -29,7 +30,7 @@ import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema;
 import org.onap.policy.apex.model.modelapi.ApexApiResult;
 import org.onap.policy.apex.model.modelapi.ApexModel;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class acts as a facade for operations towards a policy model for context schema operations.
index 645ad9a..8df43f9 100644 (file)
@@ -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=========================================================
  */
@@ -32,7 +33,7 @@ import org.onap.policy.apex.model.eventmodel.concepts.AxEvent;
 import org.onap.policy.apex.model.eventmodel.concepts.AxField;
 import org.onap.policy.apex.model.modelapi.ApexApiResult;
 import org.onap.policy.apex.model.modelapi.ApexModel;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class acts as a facade for operations towards a policy model for event operations
index a440326..cba7201 100644 (file)
@@ -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,7 +28,7 @@ import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter;
 import org.onap.policy.apex.model.modelapi.ApexApiResult;
 import org.onap.policy.apex.model.modelapi.ApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class acts as a facade for operations towards a policy model.
index 0f6bd08..db4a9ab 100644 (file)
@@ -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,9 +55,9 @@ import org.onap.policy.apex.model.policymodel.handling.PolicyAnalysisResult;
 import org.onap.policy.apex.model.policymodel.handling.PolicyModelComparer;
 import org.onap.policy.apex.model.policymodel.handling.PolicyModelMerger;
 import org.onap.policy.apex.model.policymodel.handling.PolicyModelSplitter;
-import org.onap.policy.apex.model.utilities.Assertions;
 import org.onap.policy.apex.model.utilities.TextFileUtils;
 import org.onap.policy.common.utils.resources.ResourceUtils;
+import org.onap.policy.common.utils.validation.Assertions;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
index 8ab4d02..b600b15 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -43,7 +44,7 @@ import org.onap.policy.apex.model.policymodel.concepts.AxStateTaskOutputType;
 import org.onap.policy.apex.model.policymodel.concepts.AxStateTaskReference;
 import org.onap.policy.apex.model.policymodel.concepts.AxTask;
 import org.onap.policy.apex.model.policymodel.concepts.AxTaskSelectionLogic;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class acts as a facade for operations towards a policy model for policy operations.
index 77bb22d..3632e76 100644 (file)
@@ -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.modelapi.ApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxTask;
 import org.onap.policy.apex.model.policymodel.concepts.AxTaskLogic;
 import org.onap.policy.apex.model.policymodel.concepts.AxTaskParameter;
-import org.onap.policy.apex.model.utilities.Assertions;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * This class acts as a facade for operations towards a policy model for task operations.
index ad86fb4..2fed326 100644 (file)
@@ -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.
- * 
+ *
  * <p>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) {
index 3be3e4a..493cf79 100644 (file)
@@ -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.
- * 
+ *
  * <p>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<AxPolicy> {
 
     /**
      * 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<AxPolicy> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getKey()
      */
     @Override
@@ -156,7 +157,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getKeys()
      */
     @Override
@@ -202,7 +203,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
 
     /*
      * (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<AxPolicy> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#clean()
      */
     @Override
@@ -264,7 +265,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#toString()
      */
     @Override
@@ -307,7 +308,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#hashCode()
      */
     @Override
@@ -321,7 +322,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
 
     /*
      * (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<AxPolicy> {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
     @Override
index 3c43c6e..00db241 100644 (file)
@@ -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.
- * 
+ *
  * <p>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.
- * 
+ *
  * <p>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.
- * 
+ *
  * <p>During validation of a policy, the validation checks listed below are executed: <ol> <li>The policy key must not
  * be a null key <li>The policy key must be valid <li>If the policy template is not set, an observation is issued <li>At
  * least one state must be defined <li>Keys and values must all be defined, that is not null <li>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
      */
index 8233a05..acc2c8e 100644 (file)
@@ -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.
- * 
+ *
  * <p>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.
- * 
+ *
  * <p>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.
- * 
+ *
  * <p>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
index f25c228..cb5331f 100644 (file)
@@ -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;
     }
 }
index 6f61170..67ed4f1 100644 (file)
@@ -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.
- * 
+ *
  * <p>During validation of a state output, the validation checks listed below are executed:
  * <ol>
  * <li>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) {
index fdf7314..13c21b6 100644 (file)
@@ -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.
- * 
+ *
  * <p>During validation of a state task reference, the validation checks listed below are executed:
  * <ol>
  * <li>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) {
index 0233aa6..e68bf96 100644 (file)
@@ -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.
- * 
+ *
  * <p>Validation checks for recursive state use, in other words validation forbids the use of a given
  * state more than once in a state tree.
  */
index cf8f34c..bbf749a 100644 (file)
@@ -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.
- * 
+ *
  * <p>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.
- * 
+ *
  * <p>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.
- * 
+ *
  * <p>During validation of a task, the validation checks listed below are executed:
  * <ol>
  * <li>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;
     }
index 2369560..4846c59 100644 (file)
@@ -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) {
index 75fe632..b73b6d3 100644 (file)
@@ -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.
- * 
+ *
  * <p>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<AxTask> {
 
     /**
      * Copy constructor.
-     * 
+     *
      * @param copyConcept the concept to copy from
      */
     public AxTasks(final AxTasks copyConcept) {
index 244346c..d40e66e 100644 (file)
@@ -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
diff --git a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/Assertions.java b/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/Assertions.java
deleted file mode 100644 (file)
index 02a91a7..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * ================================================================================
- * 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=========================================================
- */
-
-package org.onap.policy.apex.model.utilities;
-
-import org.slf4j.ext.XLogger;
-import org.slf4j.ext.XLoggerFactory;
-
-/**
- * The Class Assertions is a template class that is used as a shorthand for assertions in the source code.
- *
- * @author Sajeevan Achuthan (sajeevan.achuthan@ericsson.com)
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
-public final class Assertions {
-    // Logger for this class
-    private static final XLogger LOGGER = XLoggerFactory.getXLogger(Assertions.class);
-
-    /**
-     * Private constructor used to prevent sub class instantiation.
-     */
-    private Assertions() {
-    }
-
-    /**
-     * Gets the validation message for a string parameter.
-     *
-     * @param parameterName the string parameter name
-     * @param parameterValue the string parameter value
-     * @param pattern The regular expression
-     * @return null if the parameter is valid, the validation message otherwise
-     */
-    public static String getStringParameterValidationMessage(final String parameterName, final String parameterValue,
-                    final String pattern) {
-        try {
-            validateStringParameter(parameterName, parameterValue, pattern);
-        } catch (IllegalArgumentException e) {
-            String message = "parameter " + parameterName + " with value " + parameterValue
-                            + " does not match regular expression " + pattern;
-            if (LOGGER.isTraceEnabled()) {
-                LOGGER.trace(message, e);
-            }
-
-            return message;
-        }
-
-        return null;
-    }
-
-    /**
-     * Checks if a string parameter matches a regular expression.
-     *
-     * @param parameterName the string parameter name
-     * @param parameterValue the string parameter value
-     * @param pattern The regular expression
-     * @return the trimmed string
-     */
-    public static String validateStringParameter(final String parameterName, final String parameterValue,
-                    final String pattern) {
-        argumentNotNull(parameterName, "parameter name is null");
-        argumentNotNull(parameterValue, "parameter \"" + parameterName + "\" is null");
-        argumentNotNull(pattern, "parameter pattern is null");
-
-        final String trimmedValue = parameterValue.trim();
-        if (trimmedValue.matches(pattern)) {
-            return trimmedValue;
-        } else {
-            throw new IllegalArgumentException("parameter \"" + parameterName + "\": value \"" + parameterValue
-                            + "\", does not match regular expression \"" + pattern + "\"");
-        }
-    }
-
-    /**
-     * Used as a shorthand to check that method arguments are not null, throws IllegalArgumentException on error.
-     *
-     * @param <T> the generic type of the argument to check
-     * @param value the value of the type
-     * @param message the error message to issue
-     */
-    public static <T> void argumentNotNull(final T value, final String message) {
-        if (value == null) {
-            throw new IllegalArgumentException(message);
-        }
-    }
-
-    /**
-     * Used as a shorthand to check that method arguments are not false, throws IllegalArgumentException on error.
-     *
-     * @param value the value to check if false
-     * @param message the error message to issue
-     */
-    public static void argumentNotFalse(final boolean value, final String message) {
-        if (!value) {
-            throw new IllegalArgumentException(message);
-        }
-    }
-
-    /**
-     * Used as a shorthand to check that method arguments are not null, throws an exception of the specified type on
-     * error.
-     *
-     * @param <T> the generic type of the argument to check
-     * @param <E> the exception to throw if incoming value is null
-     * @param value the value of the type
-     * @param exceptionClass the class of exception to return an instance of
-     * @param message the error message to issue
-     * @throws E an instance of the passed Exception Class
-     */
-    public static <T, E extends Exception> void argumentOfClassNotNull(final T value, final Class<E> exceptionClass,
-                    final String message) throws E {
-        if (value == null) {
-            // Instantiate the exception and throw it
-            try {
-                throw exceptionClass.getConstructor(String.class).newInstance(message);
-            } catch (final Exception errorException) {
-                throw new IllegalArgumentException(message, errorException);
-            }
-        }
-    }
-
-    /**
-     * Used as a shorthand to check that method argument is not false, throws an exception of the specified type on
-     * error.
-     *
-     * @param <E> the exception to throw if incoming value is false
-     * @param value the value to check if false
-     * @param exceptionClass the class of exception to return an instance of
-     * @param message the error message to issue
-     * @throws E an instance of the passed Exception Class
-     */
-    public static <E extends Exception> void argumentOfClassNotFalse(final boolean value, final Class<E> exceptionClass,
-                    final String message) throws E {
-        if (!value) {
-            // Instantiate the exception and throw it
-            try {
-                throw exceptionClass.getConstructor(String.class).newInstance(message);
-            } catch (final Exception errorException) {
-                throw new IllegalArgumentException(message, errorException);
-            }
-        }
-    }
-
-    /**
-     * Used as a shorthand to check that an object is an instance of a given class, throws IllegalArgumentException on
-     * error.
-     *
-     * @param <T> the generic type of the argument to check
-     * @param objectInstance the object instance for which to check the class
-     * @param requiredClass the class that the object should be an instance of
-     * @throws IllegalArgumentException if the incoming object is not an instance of requiredClass
-     */
-    public static <T> void instanceOf(final Object objectInstance, final Class<T> requiredClass) {
-        if (!requiredClass.isAssignableFrom(objectInstance.getClass())) {
-            throw new IllegalArgumentException(objectInstance.getClass().getCanonicalName() + " is not an instance of "
-                            + requiredClass.getCanonicalName());
-        }
-    }
-
-    /**
-     * Used as a shorthand to check that an instance of a class can be an instance of a given class, throws
-     * IllegalArgumentException on error.
-     *
-     * @param <T> the generic type of the argument to check
-     * @param checkClass the class to check
-     * @param requiredClass the class that the object should be an instance of
-     * @throws IllegalArgumentException if the incoming object is not an instance of requiredClass
-     */
-    public static <T> void assignableFrom(final Class<?> checkClass, final Class<T> requiredClass) {
-        if (!requiredClass.isAssignableFrom(checkClass)) {
-            throw new IllegalArgumentException(checkClass.getCanonicalName() + " is not an instance of "
-                            + requiredClass.getCanonicalName());
-        }
-    }
-}
diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/AssertionsTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/AssertionsTest.java
deleted file mode 100644 (file)
index d1040b6..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * ================================================================================
- * 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=========================================================
- */
-
-package org.onap.policy.apex.model.utilities;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.onap.policy.apex.model.utilities.Assertions;
-
-/**
- * The Class ResourceUtilsTest.
- *
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
-public class AssertionsTest {
-    @Test
-    public void testAssertions() {
-        Assertions.argumentNotFalse(true, "it is true");
-
-        try {
-            Assertions.argumentNotFalse(false, "it is false");
-        } catch (IllegalArgumentException e) {
-            assertEquals("it is false", e.getMessage());
-        }
-
-        Assertions.argumentOfClassNotFalse(true, ArithmeticException.class, "it is true");
-
-        try {
-            Assertions.argumentOfClassNotFalse(false, ArithmeticException.class, "it is false");
-        } catch (Exception e) {
-            assertEquals("it is false", e.getMessage());
-        }
-
-        Assertions.argumentNotNull("Hello", "it is OK");
-
-        try {
-            Assertions.argumentNotNull(null, "it is null");
-        } catch (IllegalArgumentException e) {
-            assertEquals("it is null", e.getMessage());
-        }
-
-        Assertions.argumentOfClassNotNull(true, ArithmeticException.class, "it is OK");
-
-        try {
-            Assertions.argumentOfClassNotNull(null, ArithmeticException.class, "it is null");
-        } catch (Exception e) {
-            assertEquals("it is null", e.getMessage());
-        }
-
-        Assertions.assignableFrom(java.util.TreeMap.class, java.util.Map.class);
-
-        try {
-            Assertions.assignableFrom(java.util.Map.class, java.util.TreeMap.class);
-        } catch (IllegalArgumentException e) {
-            assertEquals("java.util.Map is not an instance of java.util.TreeMap", e.getMessage());
-        }
-
-        Assertions.instanceOf("Hello", String.class);
-
-        try {
-            Assertions.instanceOf(100, String.class);
-        } catch (IllegalArgumentException e) {
-            assertEquals("java.lang.Integer is not an instance of java.lang.String", e.getMessage());
-        }
-
-        Assertions.validateStringParameter("name", "MyName", "^M.*e$");
-
-        try {
-            Assertions.validateStringParameter("name", "MyName", "^M.*f$");
-        } catch (IllegalArgumentException e) {
-            assertEquals("parameter \"name\": value \"MyName\", does not match regular expression \"^M.*f$\"",
-                            e.getMessage());
-        }
-    }
-}
index bdf6b13..9b941a3 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -20,7 +21,7 @@
 
 package org.onap.policy.apex.plugins.executor.mvel;
 
-import static org.onap.policy.apex.model.utilities.Assertions.argumentNotNull;
+import static org.onap.policy.common.utils.validation.Assertions.argumentNotNull;
 
 import java.io.Serializable;
 import java.util.HashMap;
index 1a36118..69a53a2 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -20,7 +21,7 @@
 
 package org.onap.policy.apex.plugins.executor.mvel;
 
-import static org.onap.policy.apex.model.utilities.Assertions.argumentNotNull;
+import static org.onap.policy.common.utils.validation.Assertions.argumentNotNull;
 
 import java.io.Serializable;
 import java.util.HashMap;
index f17f1b9..eefc50d 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -20,7 +21,7 @@
 
 package org.onap.policy.apex.plugins.executor.mvel;
 
-import static org.onap.policy.apex.model.utilities.Assertions.argumentNotNull;
+import static org.onap.policy.common.utils.validation.Assertions.argumentNotNull;
 
 import java.io.Serializable;
 import java.util.HashMap;
index 2458623..fa5b564 100644 (file)
@@ -33,11 +33,11 @@ import org.onap.policy.apex.context.Distributor;
 import org.onap.policy.apex.context.impl.distribution.DistributorFactory;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel;
-import org.onap.policy.apex.model.utilities.Assertions;
 import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem;
 import org.onap.policy.apex.testsuites.integration.context.factory.TestContextAlbumFactory;
 import org.onap.policy.apex.testsuites.integration.context.lock.modifier.AlbumModifier;
 import org.onap.policy.apex.testsuites.integration.context.lock.modifier.LockType;
+import org.onap.policy.common.utils.validation.Assertions;
 
 /**
  * The Class ConfigrationProviderImpl provides configuration information for a context test back to the caller.