diff options
author | liamfallon <liam.fallon@est.tech> | 2021-01-06 15:34:58 +0000 |
---|---|---|
committer | S�bastien Determe <sebastien.determe@intl.att.com> | 2021-01-06 18:36:04 +0000 |
commit | 79b5636be43054a0c2ec7ab2450edc347e1d5043 (patch) | |
tree | 5c1947c4f0639e0d1c4816fe841d286677a31637 /src | |
parent | b6d7a6d192eddc0c52497603023e47f10599c2ae (diff) |
Merge clamp master into tosca-poc branch
This change mreges changes in clamp master into the tosca-poc branch
because the two banches have diverged.
Issue-ID: POLICY-2971
Change-Id: Iea4efe90204c98eeaae0b112ad5c964f722afdb0
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/docker/backend/Dockerfile | 13 | ||||
-rw-r--r-- | src/main/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaServiceTemplate.java | 27 | ||||
-rw-r--r-- | src/main/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaTopologyTemplate.java | 27 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/authorization/AuthorizationController.java (renamed from src/main/java/org/onap/clamp/authorization/AuthorizationController.java) | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/authorization/CldsUser.java (renamed from src/main/java/org/onap/clamp/authorization/CldsUser.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/authorization/SecureServicePermission.java (renamed from src/main/java/org/onap/clamp/authorization/SecureServicePermission.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/authorization/SecureServicePermissionDeserializer.java (renamed from src/main/java/org/onap/clamp/authorization/SecureServicePermissionDeserializer.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/authorization/UserService.java (renamed from src/main/java/org/onap/clamp/authorization/UserService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/Application.java (renamed from src/main/java/org/onap/clamp/clds/Application.java) | 14 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/ClampInUserAuditorAware.java (renamed from src/main/java/org/onap/clamp/clds/ClampInUserAuditorAware.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/ClampServlet.java (renamed from src/main/java/org/onap/clamp/clds/ClampServlet.java) | 26 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/TomcatEmbeddedServletContainerFactoryRedirection.java (renamed from src/main/java/org/onap/clamp/clds/TomcatEmbeddedServletContainerFactoryRedirection.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/client/CdsServices.java (renamed from src/main/java/org/onap/clamp/clds/client/CdsServices.java) | 12 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java (renamed from src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java) | 12 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/client/PolicyEngineServices.java (renamed from src/main/java/org/onap/clamp/clds/client/PolicyEngineServices.java) | 54 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/AafConfiguration.java (renamed from src/main/java/org/onap/clamp/clds/config/AafConfiguration.java) | 5 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java (renamed from src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/ClampProperties.java (renamed from src/main/java/org/onap/clamp/clds/config/ClampProperties.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/CldsUserJsonDecoder.java (renamed from src/main/java/org/onap/clamp/clds/config/CldsUserJsonDecoder.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/DefaultDictionaryElements.java (renamed from src/main/java/org/onap/clamp/clds/config/DefaultDictionaryElements.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/DefaultUserConfiguration.java (renamed from src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/SslConfig.java (renamed from src/main/java/org/onap/clamp/clds/config/SslConfig.java) | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/SystemPropertiesLoader.java (renamed from src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java) | 5 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcControllersConfiguration.java (renamed from src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java (renamed from src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/spring/CldsConfiguration.java (renamed from src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/config/spring/SdcControllerConfiguration.java (renamed from src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java) | 17 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/CldsConfigException.java (renamed from src/main/java/org/onap/clamp/clds/exception/CldsConfigException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/CldsUsersException.java (renamed from src/main/java/org/onap/clamp/clds/exception/CldsUsersException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/NotAuthorizedException.java (renamed from src/main/java/org/onap/clamp/clds/exception/NotAuthorizedException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/cds/CdsParametersException.java (renamed from src/main/java/org/onap/clamp/clds/exception/cds/CdsParametersException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/dcae/DcaeDeploymentException.java (renamed from src/main/java/org/onap/clamp/clds/exception/dcae/DcaeDeploymentException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/BlueprintParserException.java (renamed from src/main/java/org/onap/clamp/clds/exception/sdc/controller/BlueprintParserException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/CsarHandlerException.java (renamed from src/main/java/org/onap/clamp/clds/exception/sdc/controller/CsarHandlerException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java (renamed from src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcControllerException.java (renamed from src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcControllerException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcDownloadException.java (renamed from src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcDownloadException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcParametersException.java (renamed from src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcParametersException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/filter/ClampCadiFilter.java (renamed from src/main/java/org/onap/clamp/clds/filter/ClampCadiFilter.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/model/ClampInformation.java (renamed from src/main/java/org/onap/clamp/clds/model/ClampInformation.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/model/CldsHealthCheck.java (renamed from src/main/java/org/onap/clamp/clds/model/CldsHealthCheck.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java (renamed from src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryCache.java (renamed from src/main/java/org/onap/clamp/clds/model/dcae/DcaeInventoryCache.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponse.java (renamed from src/main/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponse.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeLinks.java (renamed from src/main/java/org/onap/clamp/clds/model/dcae/DcaeLinks.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeOperationStatusResponse.java (renamed from src/main/java/org/onap/clamp/clds/model/dcae/DcaeOperationStatusResponse.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/sdc/controller/DistributionStatusMessage.java (renamed from src/main/java/org/onap/clamp/clds/sdc/controller/DistributionStatusMessage.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/sdc/controller/SdcSingleController.java (renamed from src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java) | 79 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/sdc/controller/SdcSingleControllerStatus.java (renamed from src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleControllerStatus.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintArtifact.java (renamed from src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintArtifact.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintMicroService.java (renamed from src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintMicroService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintParser.java (renamed from src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/ChainGenerator.java (renamed from src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/CsarHandler.java (renamed from src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/service/CldsHealthcheckService.java (renamed from src/main/java/org/onap/clamp/clds/service/CldsHealthcheckService.java) | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/JsonEditorSchemaConstants.java (renamed from src/main/java/org/onap/clamp/clds/tosca/JsonEditorSchemaConstants.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/ToscaSchemaConstants.java (renamed from src/main/java/org/onap/clamp/clds/tosca/ToscaSchemaConstants.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/ToscaYamlToJsonConvertor.java (renamed from src/main/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertor.java) | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java) | 14 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/UnknownComponentException.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/UnknownComponentException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ArrayField.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/elements/ArrayField.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/Constraint.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/elements/Constraint.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ToscaElement.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElement.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ToscaElementProperty.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElementProperty.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java) | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java) | 17 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java) | 23 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaElementParser.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaElementParser.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java) | 40 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplate.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java) | 5 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateField.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateField.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateManager.java (renamed from src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java) | 28 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/util/ClampVersioning.java (renamed from src/main/java/org/onap/clamp/clds/util/ClampVersioning.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/util/CryptoUtils.java (renamed from src/main/java/org/onap/clamp/clds/util/CryptoUtils.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/util/JsonUtils.java (renamed from src/main/java/org/onap/clamp/clds/util/JsonUtils.java) | 12 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/util/LogMessages.java (renamed from src/main/java/org/onap/clamp/clds/util/LogMessages.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/util/LoggingUtils.java (renamed from src/main/java/org/onap/clamp/clds/util/LoggingUtils.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/util/OnapLogConstants.java (renamed from src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java) | 24 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/clds/util/ResourceFileUtils.java (renamed from src/main/java/org/onap/clamp/clds/util/ResourceFileUtils.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/configuration/ClampGsonDataFormat.java (renamed from src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/dao/model/gson/converter/InstantDeserializer.java (renamed from src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/dao/model/gson/converter/InstantSerializer.java (renamed from src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java (renamed from src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/dao/model/jsontype/JsonTypeDescriptor.java (renamed from src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/dao/model/jsontype/StringJsonUserType.java (renamed from src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/flow/log/FlowLogOperation.java (renamed from src/main/java/org/onap/clamp/flow/log/FlowLogOperation.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/CsarInstaller.java (renamed from src/main/java/org/onap/clamp/loop/CsarInstaller.java) | 65 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/Loop.java (renamed from src/main/java/org/onap/clamp/loop/Loop.java) | 34 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/LoopController.java (renamed from src/main/java/org/onap/clamp/loop/LoopController.java) | 14 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/LoopService.java (renamed from src/main/java/org/onap/clamp/loop/LoopService.java) | 18 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/LoopState.java (renamed from src/main/java/org/onap/clamp/loop/LoopState.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/LoopsRepository.java (renamed from src/main/java/org/onap/clamp/loop/LoopsRepository.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/cds/CdsDataInstaller.java (renamed from src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java) | 15 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/common/AuditEntity.java (renamed from src/main/java/org/onap/clamp/loop/common/AuditEntity.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/components/external/DcaeComponent.java (renamed from src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java) | 59 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/components/external/ExternalComponent.java (renamed from src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/components/external/ExternalComponentState.java (renamed from src/main/java/org/onap/clamp/loop/components/external/ExternalComponentState.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/components/external/PolicyComponent.java (renamed from src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java) | 31 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/deploy/DcaeDeployParameters.java (renamed from src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java) | 28 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/log/LogType.java (renamed from src/main/java/org/onap/clamp/loop/log/LogType.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/log/LoopLog.java (renamed from src/main/java/org/onap/clamp/loop/log/LoopLog.java) | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/log/LoopLogRepository.java (renamed from src/main/java/org/onap/clamp/loop/log/LoopLogRepository.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/log/LoopLogService.java (renamed from src/main/java/org/onap/clamp/loop/log/LoopLogService.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/service/CsarServiceInstaller.java (renamed from src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/service/Service.java (renamed from src/main/java/org/onap/clamp/loop/service/Service.java) | 13 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/service/ServicesRepository.java (renamed from src/main/java/org/onap/clamp/loop/service/ServicesRepository.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopElementModel.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopElementModel.java) | 25 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopElementModelsRepository.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopElementModelsRepository.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopTemplate.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopTemplate.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopTemplateLoopElementModel.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopTemplateLoopElementModelId.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModelId.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopTemplatesRepository.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopTemplatesService.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopTemplatesService.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopType.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopType.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/LoopTypeConvertor.java (renamed from src/main/java/org/onap/clamp/loop/template/LoopTypeConvertor.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/PolicyModel.java (renamed from src/main/java/org/onap/clamp/loop/template/PolicyModel.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/PolicyModelId.java (renamed from src/main/java/org/onap/clamp/loop/template/PolicyModelId.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/PolicyModelsRepository.java (renamed from src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/loop/template/PolicyModelsService.java (renamed from src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java) | 18 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/Policy.java (renamed from src/main/java/org/onap/clamp/policy/Policy.java) | 14 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/PolicyService.java (renamed from src/main/java/org/onap/clamp/policy/PolicyService.java) | 5 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/downloader/PolicyEngineController.java (renamed from src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicy.java (renamed from src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java) | 19 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicyRepository.java (renamed from src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyRepository.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicyService.java (renamed from src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicy.java (renamed from src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java) | 16 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepository.java (renamed from src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepository.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java (renamed from src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java) | 16 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyService.java (renamed from src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java) | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroup.java (renamed from src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpSubgroup.java (renamed from src/main/java/org/onap/clamp/policy/pdpgroup/PdpSubgroup.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/policy/pdpgroup/PolicyModelKey.java (renamed from src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java) | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/tosca/Dictionary.java (renamed from src/main/java/org/onap/clamp/tosca/Dictionary.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/tosca/DictionaryElement.java (renamed from src/main/java/org/onap/clamp/tosca/DictionaryElement.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/tosca/DictionaryElementsRepository.java (renamed from src/main/java/org/onap/clamp/tosca/DictionaryElementsRepository.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/tosca/DictionaryRepository.java (renamed from src/main/java/org/onap/clamp/tosca/DictionaryRepository.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/tosca/DictionaryService.java (renamed from src/main/java/org/onap/clamp/tosca/DictionaryService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/util/PassDecoder.java (renamed from src/main/java/org/onap/clamp/util/PassDecoder.java) | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/policy/clamp/util/SemanticVersioning.java (renamed from src/main/java/org/onap/clamp/util/SemanticVersioning.java) | 2 | ||||
-rw-r--r-- | src/main/resources/META-INF/resources/swagger.html | 156 | ||||
-rw-r--r-- | src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson | 2 | ||||
-rw-r--r-- | src/main/resources/application-noaaf.properties | 2 | ||||
-rw-r--r-- | src/main/resources/application.properties | 4 | ||||
-rw-r--r-- | src/main/resources/clds/camel/rest/clamp-api-v2.xml | 452 | ||||
-rw-r--r-- | src/main/resources/clds/camel/rest/clds-services.xml | 6 | ||||
-rw-r--r-- | src/main/resources/clds/camel/routes/cds-flows.xml | 12 | ||||
-rw-r--r-- | src/main/resources/clds/camel/routes/dcae-flows.xml | 956 | ||||
-rw-r--r-- | src/main/resources/clds/camel/routes/loop-flows.xml | 46 | ||||
-rw-r--r-- | src/main/resources/clds/camel/routes/policy-flows.xml | 80 | ||||
-rw-r--r-- | src/main/resources/clds/camel/routes/utils-flows.xml | 4 | ||||
-rw-r--r-- | src/main/resources/clds/key.properties | 2 | ||||
-rw-r--r-- | src/main/script/SelectNpmRepo.groovy | 2 | ||||
-rw-r--r-- | src/main/script/TagVersion.groovy | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaServiceTemplateTest.java | 34 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/client/CdsServicesTest.java (renamed from src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java) | 6 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/config/CldsUserJsonDecoderTest.java (renamed from src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java) | 6 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java (renamed from src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java) | 26 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/it/AuthorizationControllerItCase.java (renamed from src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java) | 10 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/it/CldsHealthcheckServiceItCase.java (renamed from src/test/java/org/onap/clamp/clds/it/CldsHealthcheckServiceItCase.java) | 6 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java (renamed from src/test/java/org/onap/clamp/clds/it/HttpsItCase.java) | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/it/RobotItCase.java (renamed from src/test/java/org/onap/clamp/clds/it/RobotItCase.java) | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/it/config/CldsReferencePropertiesItCase.java (renamed from src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java) | 9 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/it/config/SdcControllersConfigurationItCase.java (renamed from src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java) | 12 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java (renamed from src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java) | 21 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java (renamed from src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java) | 5 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseTest.java (renamed from src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java) | 3 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java (renamed from src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java) | 25 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintParserTest.java (renamed from src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java) | 6 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java (renamed from src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java) | 3 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/CsarHandlerTest.java (renamed from src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java) | 9 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java (renamed from src/test/java/org/onap/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java) | 10 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/ToscaYamlToJsonConvertorTestItCase.java (renamed from src/test/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertorTestItCase.java) | 12 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/update/ArrayFieldTest.java (renamed from src/test/java/org/onap/clamp/clds/tosca/update/ArrayFieldTest.java) | 12 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/update/ConstraintTest.java (renamed from src/test/java/org/onap/clamp/clds/tosca/update/ConstraintTest.java) | 12 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateFieldTest.java (renamed from src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java) | 12 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateManagerTest.java (renamed from src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateManagerTest.java) | 34 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateTest.java (renamed from src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateTest.java) | 6 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java (renamed from src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java) | 27 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaElementPropertyTest.java (renamed from src/test/java/org/onap/clamp/clds/tosca/update/ToscaElementPropertyTest.java) | 12 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaElementTest.java (renamed from src/test/java/org/onap/clamp/clds/tosca/update/ToscaElementTest.java) | 8 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/util/CryptoUtilsTest.java (renamed from src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java) | 4 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/util/JsonUtilsTest.java (renamed from src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java) | 8 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java (renamed from src/test/java/org/onap/clamp/clds/util/LoggingUtilsTest.java) | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/util/TestObject.java (renamed from src/test/java/org/onap/clamp/clds/util/TestObject.java) | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/clds/util/TestObject2.java (renamed from src/test/java/org/onap/clamp/clds/util/TestObject2.java) | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/flow/FlowLogOperationTest.java (renamed from src/test/java/org/onap/clamp/flow/FlowLogOperationTest.java) | 8 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/CsarInstallerItCase.java (renamed from src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java) | 100 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/DcaeComponentTest.java (renamed from src/test/java/org/onap/clamp/loop/DcaeComponentTest.java) | 16 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/DeployFlowTestItCase.java (renamed from src/test/java/org/onap/clamp/loop/DeployFlowTestItCase.java) | 12 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java (renamed from src/test/java/org/onap/clamp/loop/ExternalComponentStateTest.java) | 4 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/LoopControllerTestItCase.java (renamed from src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java) | 27 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/LoopLogServiceTestItCase.java (renamed from src/test/java/org/onap/clamp/loop/LoopLogServiceTestItCase.java) | 15 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/LoopRepositoriesItCase.java (renamed from src/test/java/org/onap/clamp/loop/LoopRepositoriesItCase.java) | 49 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/LoopServiceTestItCase.java (renamed from src/test/java/org/onap/clamp/loop/LoopServiceTestItCase.java) | 31 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/LoopTemplateLoopElementModelTest.java (renamed from src/test/java/org/onap/clamp/loop/LoopTemplateLoopElementModelTest.java) | 10 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/LoopTemplatesServiceItCase.java (renamed from src/test/java/org/onap/clamp/loop/LoopTemplatesServiceItCase.java) | 16 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/LoopToJsonTest.java (renamed from src/test/java/org/onap/clamp/loop/LoopToJsonTest.java) | 23 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/PolicyComponentTest.java (renamed from src/test/java/org/onap/clamp/loop/PolicyComponentTest.java) | 20 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/PolicyModelServiceItCase.java (renamed from src/test/java/org/onap/clamp/loop/PolicyModelServiceItCase.java) | 33 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/ServiceTest.java (renamed from src/test/java/org/onap/clamp/loop/ServiceTest.java) | 9 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/loop/deploy/BlueprintInputParametersTest.java (renamed from src/test/java/org/onap/clamp/loop/deploy/BlueprintInputParametersTest.java) | 14 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/policy/downloader/PolicyEngineControllerTestItCase.java (renamed from src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java) | 14 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/policy/microservice/MicroServicePayloadTest.java (renamed from src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java) | 15 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java (renamed from src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java) | 6 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroupTest.java (renamed from src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java) | 4 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/policy/pdpgroup/PolicyModelKeyTest.java (renamed from src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java) | 16 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/tosca/DictionaryServiceItCase.java (renamed from src/test/java/org/onap/clamp/tosca/DictionaryServiceItCase.java) | 4 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/util/PassDecoderTest.java (renamed from src/test/java/org/onap/clamp/util/PassDecoderTest.java) | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/policy/clamp/util/SemanticVersioningTest.java (renamed from src/test/java/org/onap/clamp/util/SemanticVersioningTest.java) | 2 | ||||
-rw-r--r-- | src/test/resources/application.properties | 3 | ||||
-rw-r--r-- | src/test/resources/example/sdc/blueprint-dcae/tca-guilin.yaml | 141 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec/.file (renamed from src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec/.header (renamed from src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0/.file (renamed from src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0/.header (renamed from src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/.file (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/.header (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0/.file (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0/.header (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0/.file (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0/.header (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0/.file (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0/.header (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0/.file (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0/.header (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0/.file (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0/.header (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/.file (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/.header (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/.file (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/.header (renamed from src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?connectionTimeToLive=5000/.header) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/pap/v1/pdps/.file (renamed from src/test/resources/http-cache/example/policy/pap/v1/pdps?connectionTimeToLive=5000/.file) | 0 | ||||
-rw-r--r-- | src/test/resources/http-cache/example/policy/pap/v1/pdps/.header (renamed from src/test/resources/http-cache/example/policy/pap/v1/pdps?connectionTimeToLive=5000/.header) | 0 | ||||
-rwxr-xr-x | src/test/resources/http-cache/third_party_proxy.py | 4 | ||||
-rw-r--r-- | src/test/resources/https/https-test.properties | 2 | ||||
-rw-r--r-- | src/test/resources/robotframework/Dockerfile | 12 | ||||
-rw-r--r-- | src/test/resources/robotframework/robotframework-test.properties | 2 |
240 files changed, 2015 insertions, 1938 deletions
diff --git a/src/main/docker/backend/Dockerfile b/src/main/docker/backend/Dockerfile index 06a05abf7..8712f1934 100644 --- a/src/main/docker/backend/Dockerfile +++ b/src/main/docker/backend/Dockerfile @@ -24,7 +24,7 @@ FROM onap/integration-java11:7.1.0
MAINTAINER "The Onap Team"
-LABEL Description="This immage contains alpine, openjdk 11 and clamp"
+LABEL Description="This image contains alpine, openjdk 11 and clamp"
ARG http_proxy
ARG https_proxy
@@ -32,7 +32,14 @@ ENV HTTP_PROXY=$http_proxy ENV HTTPS_PROXY=$https_proxy
ENV http_proxy=$HTTP_PROXY
ENV https_proxy=$HTTPS_PROXY
+USER root
+RUN mkdir /opt/clamp
+RUN chown -R onap:onap /opt/clamp
-VOLUME /app/config
+VOLUME /opt/clamp/config
-COPY onap-clamp-backend/clamp.jar /app/app.jar
\ No newline at end of file +COPY --chown=onap:onap onap-clamp-backend/clamp.jar /opt/clamp/app.jar
+
+USER onap
+WORKDIR /opt/clamp/
+ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=75","-jar" ,"./app.jar"]
\ No newline at end of file diff --git a/src/main/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaServiceTemplate.java b/src/main/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaServiceTemplate.java deleted file mode 100644 index 2b7ecf94f..000000000 --- a/src/main/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaServiceTemplate.java +++ /dev/null @@ -1,27 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2020 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.clamp.controlloop.models.tosca.authorative.concepts; - -import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; - -public class ControlLoopToscaServiceTemplate extends ToscaServiceTemplate { - //TODO More code to be added -}
\ No newline at end of file diff --git a/src/main/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaTopologyTemplate.java b/src/main/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaTopologyTemplate.java deleted file mode 100644 index 5f125fedd..000000000 --- a/src/main/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaTopologyTemplate.java +++ /dev/null @@ -1,27 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2020 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.clamp.controlloop.models.tosca.authorative.concepts; - -import org.onap.policy.models.tosca.authorative.concepts.ToscaTopologyTemplate; - -public class ControlLoopToscaTopologyTemplate extends ToscaTopologyTemplate { - //TODO More code to be added -}
\ No newline at end of file diff --git a/src/main/java/org/onap/clamp/authorization/AuthorizationController.java b/src/main/java/org/onap/policy/clamp/authorization/AuthorizationController.java index f4da09a2e..f703e3363 100644 --- a/src/main/java/org/onap/clamp/authorization/AuthorizationController.java +++ b/src/main/java/org/onap/policy/clamp/authorization/AuthorizationController.java @@ -23,16 +23,16 @@ * */ -package org.onap.clamp.authorization; +package org.onap.policy.clamp.authorization; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import java.util.Date; import org.apache.camel.Exchange; -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.exception.NotAuthorizedException; -import org.onap.clamp.clds.model.ClampInformation; -import org.onap.clamp.clds.util.LoggingUtils; +import org.onap.policy.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.clds.exception.NotAuthorizedException; +import org.onap.policy.clamp.clds.model.ClampInformation; +import org.onap.policy.clamp.clds.util.LoggingUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; diff --git a/src/main/java/org/onap/clamp/authorization/CldsUser.java b/src/main/java/org/onap/policy/clamp/authorization/CldsUser.java index b50f50cb2..8f1e2bf67 100644 --- a/src/main/java/org/onap/clamp/authorization/CldsUser.java +++ b/src/main/java/org/onap/policy/clamp/authorization/CldsUser.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.authorization; +package org.onap.policy.clamp.authorization; import java.util.Arrays; diff --git a/src/main/java/org/onap/clamp/authorization/SecureServicePermission.java b/src/main/java/org/onap/policy/clamp/authorization/SecureServicePermission.java index 374aab90c..41887a315 100644 --- a/src/main/java/org/onap/clamp/authorization/SecureServicePermission.java +++ b/src/main/java/org/onap/policy/clamp/authorization/SecureServicePermission.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.authorization; +package org.onap.policy.clamp.authorization; /** * Permission class that can be instantiated easily using constructor or factory @@ -83,7 +83,7 @@ public class SecureServicePermission { } /** - * Instantiate permission given type from concatenated string + * Instantiate permission given type from concatenated string. * * @param concatenatedString * the string type|instance|action, less than 3 params can be diff --git a/src/main/java/org/onap/clamp/authorization/SecureServicePermissionDeserializer.java b/src/main/java/org/onap/policy/clamp/authorization/SecureServicePermissionDeserializer.java index 026ee802c..0b178c256 100644 --- a/src/main/java/org/onap/clamp/authorization/SecureServicePermissionDeserializer.java +++ b/src/main/java/org/onap/policy/clamp/authorization/SecureServicePermissionDeserializer.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.authorization; +package org.onap.policy.clamp.authorization; import com.google.gson.Gson; diff --git a/src/main/java/org/onap/clamp/authorization/UserService.java b/src/main/java/org/onap/policy/clamp/authorization/UserService.java index b4f51c95b..c748a5a54 100644 --- a/src/main/java/org/onap/clamp/authorization/UserService.java +++ b/src/main/java/org/onap/policy/clamp/authorization/UserService.java @@ -20,7 +20,7 @@ * =================================================================== */ -package org.onap.clamp.authorization; +package org.onap.policy.clamp.authorization; import org.springframework.security.core.context.SecurityContext; diff --git a/src/main/java/org/onap/clamp/clds/Application.java b/src/main/java/org/onap/policy/clamp/clds/Application.java index e83ff3e76..79247ca63 100644 --- a/src/main/java/org/onap/clamp/clds/Application.java +++ b/src/main/java/org/onap/policy/clamp/clds/Application.java @@ -23,7 +23,7 @@ * */ -package org.onap.clamp.clds; +package org.onap.policy.clamp.clds; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -36,9 +36,9 @@ import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.Enumeration; import org.apache.catalina.connector.Connector; -import org.onap.clamp.clds.util.ClampVersioning; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.util.PassDecoder; +import org.onap.policy.clamp.clds.util.ClampVersioning; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.util.PassDecoder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; @@ -61,10 +61,10 @@ import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.annotation.EnableTransactionManagement; -@ComponentScan(basePackages = { "org.onap.clamp" }) +@ComponentScan(basePackages = { "org.onap.policy.clamp" }) @SpringBootApplication(exclude = { SecurityAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class }) -@EnableJpaRepositories(basePackages = { "org.onap.clamp" }) -@EntityScan(basePackages = { "org.onap.clamp" }) +@EnableJpaRepositories(basePackages = { "org.onap.policy.clamp" }) +@EntityScan(basePackages = { "org.onap.policy.clamp" }) @EnableTransactionManagement @EnableConfigurationProperties @EnableAsync diff --git a/src/main/java/org/onap/clamp/clds/ClampInUserAuditorAware.java b/src/main/java/org/onap/policy/clamp/clds/ClampInUserAuditorAware.java index 9351db23c..939cea49c 100644 --- a/src/main/java/org/onap/clamp/clds/ClampInUserAuditorAware.java +++ b/src/main/java/org/onap/policy/clamp/clds/ClampInUserAuditorAware.java @@ -21,10 +21,10 @@ * */ -package org.onap.clamp.clds; +package org.onap.policy.clamp.clds; import java.util.Optional; -import org.onap.clamp.authorization.AuthorizationController; +import org.onap.policy.clamp.authorization.AuthorizationController; import org.springframework.data.domain.AuditorAware; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/onap/clamp/clds/ClampServlet.java b/src/main/java/org/onap/policy/clamp/clds/ClampServlet.java index 5908201fd..801f59c31 100644 --- a/src/main/java/org/onap/clamp/clds/ClampServlet.java +++ b/src/main/java/org/onap/policy/clamp/clds/ClampServlet.java @@ -23,22 +23,21 @@ * */ -package org.onap.clamp.clds; +package org.onap.policy.clamp.clds; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; - import java.io.IOException; import java.security.Principal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - +import java.util.stream.Collectors; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - import org.apache.camel.component.servlet.CamelHttpTransportServlet; -import org.onap.clamp.authorization.SecureServicePermission; +import org.onap.policy.clamp.authorization.SecureServicePermission; import org.springframework.context.ApplicationContext; import org.springframework.http.HttpStatus; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -69,16 +68,10 @@ public class ClampServlet extends CamelHttpTransportServlet { private static List<SecureServicePermission> permissionList; - private synchronized Class loadDynamicAuthenticationClass() { - try { - String authenticationObject = WebApplicationContextUtils.getWebApplicationContext(getServletContext()) - .getEnvironment().getProperty(AUTHENTICATION_CLASS); - return Class.forName(authenticationObject); - } catch (ClassNotFoundException e) { - logger.error( - "Exception caught when attempting to create associated class of config:" + AUTHENTICATION_CLASS, e); - return Object.class; - } + private synchronized List<String> loadDynamicAuthenticationClasses() { + return Arrays.stream(WebApplicationContextUtils.getWebApplicationContext(getServletContext()) + .getEnvironment().getProperty(AUTHENTICATION_CLASS).split(",")).map(className -> className.trim()) + .collect(Collectors.toList()); } private synchronized List<SecureServicePermission> getPermissionList() { @@ -115,7 +108,8 @@ public class ClampServlet extends CamelHttpTransportServlet { @Override protected void doService(HttpServletRequest request, HttpServletResponse response) { Principal principal = request.getUserPrincipal(); - if (loadDynamicAuthenticationClass().isInstance(principal)) { + if (principal != null && loadDynamicAuthenticationClasses().stream() + .anyMatch(className -> className.equals(principal.getClass().getName()))) { // When AAF is enabled, there is a need to provision the permissions to Spring // system List<GrantedAuthority> grantedAuths = new ArrayList<>(); diff --git a/src/main/java/org/onap/clamp/clds/TomcatEmbeddedServletContainerFactoryRedirection.java b/src/main/java/org/onap/policy/clamp/clds/TomcatEmbeddedServletContainerFactoryRedirection.java index a0109a688..f66a09c41 100644 --- a/src/main/java/org/onap/clamp/clds/TomcatEmbeddedServletContainerFactoryRedirection.java +++ b/src/main/java/org/onap/policy/clamp/clds/TomcatEmbeddedServletContainerFactoryRedirection.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds; +package org.onap.policy.clamp.clds; import org.apache.catalina.Context; import org.apache.tomcat.util.descriptor.web.SecurityCollection; diff --git a/src/main/java/org/onap/clamp/clds/client/CdsServices.java b/src/main/java/org/onap/policy/clamp/clds/client/CdsServices.java index fd3b3539a..ff79ef413 100644 --- a/src/main/java/org/onap/clamp/clds/client/CdsServices.java +++ b/src/main/java/org/onap/policy/clamp/clds/client/CdsServices.java @@ -20,7 +20,7 @@ *
*/
-package org.onap.clamp.clds.client;
+package org.onap.policy.clamp.clds.client;
import static java.lang.Boolean.parseBoolean;
@@ -29,17 +29,15 @@ import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
-
import java.util.Date;
import java.util.Map;
-
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.builder.ExchangeBuilder;
-import org.onap.clamp.clds.exception.cds.CdsParametersException;
-import org.onap.clamp.clds.model.cds.CdsBpWorkFlowListResponse;
-import org.onap.clamp.clds.util.JsonUtils;
-import org.onap.clamp.clds.util.LoggingUtils;
+import org.onap.policy.clamp.clds.exception.cds.CdsParametersException;
+import org.onap.policy.clamp.clds.model.cds.CdsBpWorkFlowListResponse;
+import org.onap.policy.clamp.clds.util.JsonUtils;
+import org.onap.policy.clamp.clds.util.LoggingUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java index b24bc99b2..fed061e7d 100644 --- a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java +++ b/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java @@ -22,14 +22,12 @@ *
*/
-package org.onap.clamp.clds.client;
+package org.onap.policy.clamp.clds.client;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.io.IOException;
import java.util.Date;
-
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.builder.ExchangeBuilder;
@@ -37,10 +35,10 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
-import org.onap.clamp.clds.config.ClampProperties;
-import org.onap.clamp.clds.model.dcae.DcaeInventoryResponse;
-import org.onap.clamp.clds.util.JsonUtils;
-import org.onap.clamp.clds.util.LoggingUtils;
+import org.onap.policy.clamp.clds.config.ClampProperties;
+import org.onap.policy.clamp.clds.model.dcae.DcaeInventoryResponse;
+import org.onap.policy.clamp.clds.util.JsonUtils;
+import org.onap.policy.clamp.clds.util.LoggingUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
diff --git a/src/main/java/org/onap/clamp/clds/client/PolicyEngineServices.java b/src/main/java/org/onap/policy/clamp/clds/client/PolicyEngineServices.java index 260bd1e48..bc6a68286 100644 --- a/src/main/java/org/onap/clamp/clds/client/PolicyEngineServices.java +++ b/src/main/java/org/onap/policy/clamp/clds/client/PolicyEngineServices.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.client; +package org.onap.policy.clamp.clds.client; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -34,13 +34,12 @@ import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.builder.ExchangeBuilder; -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.sdc.controller.installer.BlueprintMicroService; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelId; -import org.onap.clamp.loop.template.PolicyModelsService; -import org.onap.clamp.policy.pdpgroup.PdpGroup; +import org.onap.policy.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.clds.sdc.controller.installer.BlueprintMicroService; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelsService; +import org.onap.policy.clamp.policy.pdpgroup.PdpGroup; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.yaml.snakeyaml.DumperOptions; @@ -87,20 +86,29 @@ public class PolicyEngineServices { /** * This method query Policy engine and create a PolicyModel object with type and version. + * If the policy already exist in the db it returns the existing one. * * @param policyType The policyType id * @param policyVersion The policy version of that type - * @return A PolicyModel created from policyEngine data + * @return A PolicyModel created from policyEngine data or null if nothing is found on policyEngine */ public PolicyModel createPolicyModelFromPolicyEngine(String policyType, String policyVersion) { - if (!policyModelsService.existsById( - new PolicyModelId(policyType, policyVersion))) { - return policyModelsService.savePolicyModelInNewTransaction( - new PolicyModel(policyType, this.downloadOnePolicy(policyType, policyVersion), policyVersion)); + PolicyModel policyModelFound = policyModelsService.getPolicyModel(policyType, policyVersion); + if (policyModelFound == null) { + String policyTosca = this.downloadOnePolicy(policyType, policyVersion); + if (policyTosca != null && !policyTosca.isEmpty()) { + return policyModelsService.savePolicyModelInNewTransaction( + new PolicyModel(policyType, policyTosca, policyVersion)); + } else { + logger.error("Policy not found in the Policy Engine, returning null: " + policyType + + "/" + policyVersion); + return null; + } + } else { + logger.info("Skipping policy model download as it exists already in the database " + policyType + + "/" + policyVersion); + return policyModelFound; } - logger.info("Skipping policy model download as it exists already in the database " + policyType - + "/" + policyVersion); - return null; } /** @@ -158,10 +166,17 @@ public class PolicyEngineServices { options.setPrettyFlow(true); options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); Yaml yamlParser = new Yaml(options); - return yamlParser.dump((Map<String, Object>) yamlParser.load(callCamelRoute( + String responseBody = callCamelRoute( ExchangeBuilder.anExchange(camelContext).withProperty("policyModelName", policyType) .withProperty("policyModelVersion", policyVersion).build(), "direct:get-policy-model", - "Get one policy"))); + "Get one policy"); + + if (responseBody == null || responseBody.isEmpty()) { + logger.warn("getPolicyModel returned by policy engine could not be decoded, as it's null or empty"); + return null; + } + + return yamlParser.dump((Map<String, Object>) yamlParser.load(responseBody)); } /** @@ -196,8 +211,7 @@ public class PolicyEngineServices { Exchange exchangeResponse = camelContext.createProducerTemplate().send(camelFlow, exchange); if (Integer.valueOf(200).equals(exchangeResponse.getIn().getHeader("CamelHttpResponseCode"))) { return (String) exchangeResponse.getIn().getBody(); - } - else { + } else { logger.info(logMsg + " query " + retryInterval + "ms before retrying ..."); // wait for a while and try to connect to DCAE again try { diff --git a/src/main/java/org/onap/clamp/clds/config/AafConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/AafConfiguration.java index d9178cb9a..30ba6e6ae 100644 --- a/src/main/java/org/onap/clamp/clds/config/AafConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/AafConfiguration.java @@ -21,11 +21,10 @@ * */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import javax.servlet.Filter; - -import org.onap.clamp.clds.filter.ClampCadiFilter; +import org.onap.policy.clamp.clds.filter.ClampCadiFilter; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java index 36e11f64f..9431f40e8 100644 --- a/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java @@ -20,7 +20,7 @@ * =================================================================== */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import java.io.IOException; import java.net.URL; @@ -45,9 +45,9 @@ import org.apache.http.conn.socket.PlainConnectionSocketFactory; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.BasicHttpClientConnectionManager; -import org.onap.clamp.clds.util.ClampVersioning; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.util.PassDecoder; +import org.onap.policy.clamp.clds.util.ClampVersioning; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.util.PassDecoder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/onap/clamp/clds/config/ClampProperties.java b/src/main/java/org/onap/policy/clamp/clds/config/ClampProperties.java index 0b5c951bf..f11e16733 100644 --- a/src/main/java/org/onap/clamp/clds/config/ClampProperties.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/ClampProperties.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import java.io.IOException; import java.net.URL; diff --git a/src/main/java/org/onap/clamp/clds/config/CldsUserJsonDecoder.java b/src/main/java/org/onap/policy/clamp/clds/config/CldsUserJsonDecoder.java index a7ef10738..20d7143fb 100644 --- a/src/main/java/org/onap/clamp/clds/config/CldsUserJsonDecoder.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/CldsUserJsonDecoder.java @@ -23,16 +23,16 @@ * */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import com.google.gson.JsonParseException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import org.apache.commons.io.IOUtils; -import org.onap.clamp.authorization.CldsUser; -import org.onap.clamp.clds.exception.CldsUsersException; -import org.onap.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.authorization.CldsUser; +import org.onap.policy.clamp.clds.exception.CldsUsersException; +import org.onap.policy.clamp.clds.util.JsonUtils; public class CldsUserJsonDecoder { diff --git a/src/main/java/org/onap/clamp/clds/config/DefaultDictionaryElements.java b/src/main/java/org/onap/policy/clamp/clds/config/DefaultDictionaryElements.java index 1c52e4100..27cf0b941 100644 --- a/src/main/java/org/onap/clamp/clds/config/DefaultDictionaryElements.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/DefaultDictionaryElements.java @@ -21,12 +21,12 @@ * */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import javax.annotation.PostConstruct; -import org.onap.clamp.tosca.Dictionary; -import org.onap.clamp.tosca.DictionaryElement; -import org.onap.clamp.tosca.DictionaryService; +import org.onap.policy.clamp.tosca.Dictionary; +import org.onap.policy.clamp.tosca.DictionaryElement; +import org.onap.policy.clamp.tosca.DictionaryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/DefaultUserConfiguration.java index cfd5f990f..015868141 100644 --- a/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/DefaultUserConfiguration.java @@ -23,14 +23,14 @@ * */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import java.io.IOException; -import org.onap.clamp.authorization.CldsUser; -import org.onap.clamp.clds.exception.CldsConfigException; -import org.onap.clamp.clds.exception.CldsUsersException; +import org.onap.policy.clamp.authorization.CldsUser; +import org.onap.policy.clamp.clds.exception.CldsConfigException; +import org.onap.policy.clamp.clds.exception.CldsUsersException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/org/onap/clamp/clds/config/SslConfig.java b/src/main/java/org/onap/policy/clamp/clds/config/SslConfig.java index 6345f4b56..329cb4bed 100644 --- a/src/main/java/org/onap/clamp/clds/config/SslConfig.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/SslConfig.java @@ -21,16 +21,15 @@ * */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import java.io.IOException; -import java.io.InputStream; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.util.PassDecoder; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.util.PassDecoder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; diff --git a/src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java b/src/main/java/org/onap/policy/clamp/clds/config/SystemPropertiesLoader.java index 7480beb8d..3e2e62b66 100644 --- a/src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/SystemPropertiesLoader.java @@ -21,15 +21,12 @@ * */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; - import java.util.Properties; - import javax.annotation.Resource; - import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcControllersConfiguration.java index ad2751bb8..4748edf6d 100644 --- a/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcControllersConfiguration.java @@ -23,7 +23,7 @@ * */ -package org.onap.clamp.clds.config.sdc; +package org.onap.policy.clamp.clds.config.sdc; import com.google.gson.JsonObject; import java.io.IOException; @@ -31,11 +31,9 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; - import javax.annotation.PostConstruct; - -import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException; -import org.onap.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcParametersException; +import org.onap.policy.clamp.clds.util.JsonUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java index da90e6060..0bbbf19dc 100644 --- a/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.config.sdc; +package org.onap.policy.clamp.clds.config.sdc; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -32,8 +32,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.commons.codec.DecoderException; -import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException; -import org.onap.clamp.clds.util.CryptoUtils; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcParametersException; +import org.onap.policy.clamp.clds.util.CryptoUtils; import org.onap.sdc.api.consumer.IConfiguration; /** diff --git a/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/spring/CldsConfiguration.java index 14c08c800..72f09ce13 100644 --- a/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/spring/CldsConfiguration.java @@ -21,9 +21,9 @@ * */ -package org.onap.clamp.clds.config.spring; +package org.onap.policy.clamp.clds.config.spring; -import org.onap.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.clds.config.ClampProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.PropertiesFactoryBean; import org.springframework.context.ApplicationContext; diff --git a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java b/src/main/java/org/onap/policy/clamp/clds/config/spring/SdcControllerConfiguration.java index eca45d66f..6005b0d39 100644 --- a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java +++ b/src/main/java/org/onap/policy/clamp/clds/config/spring/SdcControllerConfiguration.java @@ -21,23 +21,20 @@ * */ -package org.onap.clamp.clds.config.spring; +package org.onap.policy.clamp.clds.config.spring; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; - import java.util.ArrayList; import java.util.List; - import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; - -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.config.sdc.SdcControllersConfiguration; -import org.onap.clamp.clds.exception.sdc.controller.SdcControllerException; -import org.onap.clamp.clds.sdc.controller.SdcSingleController; -import org.onap.clamp.clds.sdc.controller.SdcSingleControllerStatus; -import org.onap.clamp.loop.CsarInstaller; +import org.onap.policy.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.clds.config.sdc.SdcControllersConfiguration; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcControllerException; +import org.onap.policy.clamp.clds.sdc.controller.SdcSingleController; +import org.onap.policy.clamp.clds.sdc.controller.SdcSingleControllerStatus; +import org.onap.policy.clamp.loop.CsarInstaller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/org/onap/clamp/clds/exception/CldsConfigException.java b/src/main/java/org/onap/policy/clamp/clds/exception/CldsConfigException.java index 93d98151a..ef1ced0a3 100644 --- a/src/main/java/org/onap/clamp/clds/exception/CldsConfigException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/CldsConfigException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception; +package org.onap.policy.clamp.clds.exception; /** * New exception to CldsUser errors. diff --git a/src/main/java/org/onap/clamp/clds/exception/CldsUsersException.java b/src/main/java/org/onap/policy/clamp/clds/exception/CldsUsersException.java index 270bfa1e2..4d4855b6f 100644 --- a/src/main/java/org/onap/clamp/clds/exception/CldsUsersException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/CldsUsersException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception; +package org.onap.policy.clamp.clds.exception; /** * New exception to CldsUser errors. diff --git a/src/main/java/org/onap/clamp/clds/exception/NotAuthorizedException.java b/src/main/java/org/onap/policy/clamp/clds/exception/NotAuthorizedException.java index 1bdf18e7e..73c117932 100644 --- a/src/main/java/org/onap/clamp/clds/exception/NotAuthorizedException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/NotAuthorizedException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception; +package org.onap.policy.clamp.clds.exception; /** * New exception to request errors. diff --git a/src/main/java/org/onap/clamp/clds/exception/cds/CdsParametersException.java b/src/main/java/org/onap/policy/clamp/clds/exception/cds/CdsParametersException.java index 73ce31f89..b4a013eb4 100644 --- a/src/main/java/org/onap/clamp/clds/exception/cds/CdsParametersException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/cds/CdsParametersException.java @@ -20,7 +20,7 @@ * */ -package org.onap.clamp.clds.exception.cds; +package org.onap.policy.clamp.clds.exception.cds; /** * Exception while parsing CDS response. diff --git a/src/main/java/org/onap/clamp/clds/exception/dcae/DcaeDeploymentException.java b/src/main/java/org/onap/policy/clamp/clds/exception/dcae/DcaeDeploymentException.java index e733da53d..78c2c6331 100644 --- a/src/main/java/org/onap/clamp/clds/exception/dcae/DcaeDeploymentException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/dcae/DcaeDeploymentException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception.dcae; +package org.onap.policy.clamp.clds.exception.dcae; /** * New exception to capture DCAE communication errors. diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/BlueprintParserException.java b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/BlueprintParserException.java index 7257fd8a0..6939fdf06 100644 --- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/BlueprintParserException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/BlueprintParserException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception.sdc.controller; +package org.onap.policy.clamp.clds.exception.sdc.controller; /** * Exception during blueprint parsing. diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/CsarHandlerException.java b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/CsarHandlerException.java index c3ebde1f8..e3f16f908 100644 --- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/CsarHandlerException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/CsarHandlerException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception.sdc.controller; +package org.onap.policy.clamp.clds.exception.sdc.controller; /** * Exception during Csar operations. diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java index 523766af1..1202ec199 100644 --- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception.sdc.controller; +package org.onap.policy.clamp.clds.exception.sdc.controller; /** * Exception during SDC artifact installation. diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcControllerException.java b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcControllerException.java index d73001d78..e391ee7e8 100644 --- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcControllerException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcControllerException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception.sdc.controller; +package org.onap.policy.clamp.clds.exception.sdc.controller; /** * Exception of the SDC controller. diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcDownloadException.java b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcDownloadException.java index 6cd3fb88d..3c0240ef3 100644 --- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcDownloadException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcDownloadException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception.sdc.controller; +package org.onap.policy.clamp.clds.exception.sdc.controller; /** * Exception during download from SDC. diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcParametersException.java b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcParametersException.java index bfe63cbfb..fe573882f 100644 --- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcParametersException.java +++ b/src/main/java/org/onap/policy/clamp/clds/exception/sdc/controller/SdcParametersException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.exception.sdc.controller; +package org.onap.policy.clamp.clds.exception.sdc.controller; /** * Exception of the SDC controller. diff --git a/src/main/java/org/onap/clamp/clds/filter/ClampCadiFilter.java b/src/main/java/org/onap/policy/clamp/clds/filter/ClampCadiFilter.java index c673f544a..6fa8ecb2b 100644 --- a/src/main/java/org/onap/clamp/clds/filter/ClampCadiFilter.java +++ b/src/main/java/org/onap/policy/clamp/clds/filter/ClampCadiFilter.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.filter; +package org.onap.policy.clamp.clds.filter; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -43,7 +43,7 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import org.onap.aaf.cadi.config.Config; import org.onap.aaf.cadi.filter.CadiFilter; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; diff --git a/src/main/java/org/onap/clamp/clds/model/ClampInformation.java b/src/main/java/org/onap/policy/clamp/clds/model/ClampInformation.java index d73e94204..5708cb6ec 100644 --- a/src/main/java/org/onap/clamp/clds/model/ClampInformation.java +++ b/src/main/java/org/onap/policy/clamp/clds/model/ClampInformation.java @@ -21,12 +21,12 @@ * */ -package org.onap.clamp.clds.model; +package org.onap.policy.clamp.clds.model; import com.google.gson.annotations.Expose; import java.util.ArrayList; import java.util.List; -import org.onap.clamp.clds.util.ClampVersioning; +import org.onap.policy.clamp.clds.util.ClampVersioning; public class ClampInformation { @Expose diff --git a/src/main/java/org/onap/clamp/clds/model/CldsHealthCheck.java b/src/main/java/org/onap/policy/clamp/clds/model/CldsHealthCheck.java index 651997cd3..c814a628d 100644 --- a/src/main/java/org/onap/clamp/clds/model/CldsHealthCheck.java +++ b/src/main/java/org/onap/policy/clamp/clds/model/CldsHealthCheck.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.model; +package org.onap.policy.clamp.clds.model; import com.google.gson.annotations.Expose; diff --git a/src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java b/src/main/java/org/onap/policy/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java index 66025c479..a3b42524e 100644 --- a/src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java +++ b/src/main/java/org/onap/policy/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java @@ -20,10 +20,9 @@ * */ -package org.onap.clamp.clds.model.cds; +package org.onap.policy.clamp.clds.model.cds; import com.google.gson.annotations.Expose; - import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/org/onap/clamp/clds/model/dcae/DcaeInventoryCache.java b/src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryCache.java index fc2ca5caa..a69d1a353 100644 --- a/src/main/java/org/onap/clamp/clds/model/dcae/DcaeInventoryCache.java +++ b/src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryCache.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.model.dcae; +package org.onap.policy.clamp.clds.model.dcae; import java.util.Map; import java.util.Set; diff --git a/src/main/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponse.java b/src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponse.java index 67bd026d0..72ae61359 100644 --- a/src/main/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponse.java +++ b/src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponse.java @@ -22,7 +22,7 @@ * */ -package org.onap.clamp.clds.model.dcae; +package org.onap.policy.clamp.clds.model.dcae; import com.google.gson.annotations.Expose; diff --git a/src/main/java/org/onap/clamp/clds/model/dcae/DcaeLinks.java b/src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeLinks.java index 368e1b8e6..4d6e544da 100644 --- a/src/main/java/org/onap/clamp/clds/model/dcae/DcaeLinks.java +++ b/src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeLinks.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.model.dcae; +package org.onap.policy.clamp.clds.model.dcae; import com.google.gson.annotations.Expose; diff --git a/src/main/java/org/onap/clamp/clds/model/dcae/DcaeOperationStatusResponse.java b/src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeOperationStatusResponse.java index aee7d0613..9389a51fc 100644 --- a/src/main/java/org/onap/clamp/clds/model/dcae/DcaeOperationStatusResponse.java +++ b/src/main/java/org/onap/policy/clamp/clds/model/dcae/DcaeOperationStatusResponse.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.model.dcae; +package org.onap.policy.clamp.clds.model.dcae; import com.google.gson.annotations.Expose; diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/DistributionStatusMessage.java b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/DistributionStatusMessage.java index c80441fa6..ca46c6d31 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/DistributionStatusMessage.java +++ b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/DistributionStatusMessage.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.sdc.controller; +package org.onap.policy.clamp.clds.sdc.controller; import org.onap.sdc.api.consumer.IDistributionStatusMessage; import org.onap.sdc.utils.DistributionStatusEnum; diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/SdcSingleController.java index fbb37d525..4ca6b1cf4 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java +++ b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/SdcSingleController.java @@ -22,27 +22,26 @@ * */ -package org.onap.clamp.clds.sdc.controller; +package org.onap.policy.clamp.clds.sdc.controller; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; - import java.util.Date; import java.util.Map.Entry; import java.util.concurrent.ThreadLocalRandom; - -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.config.sdc.SdcSingleControllerConfiguration; -import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException; -import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException; -import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; -import org.onap.clamp.clds.exception.sdc.controller.SdcControllerException; -import org.onap.clamp.clds.exception.sdc.controller.SdcDownloadException; -import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact; -import org.onap.clamp.clds.sdc.controller.installer.CsarHandler; -import org.onap.clamp.clds.util.LoggingUtils; -import org.onap.clamp.loop.CsarInstaller; +import org.onap.policy.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.clds.config.sdc.SdcSingleControllerConfiguration; +import org.onap.policy.clamp.clds.exception.sdc.controller.BlueprintParserException; +import org.onap.policy.clamp.clds.exception.sdc.controller.CsarHandlerException; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcControllerException; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcDownloadException; +import org.onap.policy.clamp.clds.sdc.controller.installer.BlueprintArtifact; +import org.onap.policy.clamp.clds.sdc.controller.installer.CsarHandler; +import org.onap.policy.clamp.clds.util.LoggingUtils; +import org.onap.policy.clamp.loop.CsarInstaller; import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.consumer.IComponentDoneStatusMessage; import org.onap.sdc.api.consumer.IDistributionStatusMessage; import org.onap.sdc.api.consumer.INotificationCallback; import org.onap.sdc.api.notification.IArtifactInfo; @@ -160,7 +159,8 @@ public class SdcSingleController { * @param distributionClient the distribution client */ public SdcSingleController(ClampProperties clampProp, CsarInstaller csarInstaller, - SdcSingleControllerConfiguration sdcSingleConfig, IDistributionClient distributionClient) { + SdcSingleControllerConfiguration sdcSingleConfig, + IDistributionClient distributionClient) { this.distributionClient = distributionClient; isSdcClientAutoManaged = (distributionClient == null); this.sdcConfig = sdcSingleConfig; @@ -228,7 +228,8 @@ public class SdcSingleController { } private void sendAllNotificationForCsarHandler(INotificationData notificationData, CsarHandler csar, - NotificationType notificationType, DistributionStatusEnum distributionStatus, String errorMessage) { + NotificationType notificationType, + DistributionStatusEnum distributionStatus, String errorMessage) { if (csar != null) { // Notify for the CSAR this.sendSdcNotification(notificationType, csar.getArtifactElement().getArtifactURL(), @@ -278,27 +279,33 @@ public class SdcSingleController { sendAllNotificationForCsarHandler(notificationData, csar, NotificationType.DEPLOY, DistributionStatusEnum.DEPLOY_OK, null); } + this.sendComponentStatus(notificationData, DistributionStatusEnum.COMPONENT_DONE_OK, null); } catch (SdcArtifactInstallerException | SdcToscaParserException e) { logger.error("SdcArtifactInstallerException exception caught during the notification processing", e); sendAllNotificationForCsarHandler(notificationData, csar, NotificationType.DEPLOY, DistributionStatusEnum.DEPLOY_ERROR, e.getMessage()); + this.sendComponentStatus(notificationData, DistributionStatusEnum.COMPONENT_DONE_ERROR, e.getMessage()); } catch (SdcDownloadException | CsarHandlerException e) { logger.error("SdcDownloadException exception caught during the notification processing", e); sendAllNotificationForCsarHandler(notificationData, csar, NotificationType.DOWNLOAD, DistributionStatusEnum.DOWNLOAD_ERROR, e.getMessage()); + this.sendComponentStatus(notificationData, DistributionStatusEnum.COMPONENT_DONE_ERROR, e.getMessage()); } catch (InterruptedException e) { logger.error("Interrupt exception caught during the notification processing", e); sendAllNotificationForCsarHandler(notificationData, csar, NotificationType.DEPLOY, DistributionStatusEnum.DEPLOY_ERROR, e.getMessage()); + this.sendComponentStatus(notificationData, DistributionStatusEnum.COMPONENT_DONE_ERROR, e.getMessage()); Thread.currentThread().interrupt(); } catch (BlueprintParserException e) { logger.error("BlueprintParser exception caught during the notification processing", e); sendAllNotificationForCsarHandler(notificationData, csar, NotificationType.DEPLOY, DistributionStatusEnum.DEPLOY_ERROR, e.getMessage()); + this.sendComponentStatus(notificationData, DistributionStatusEnum.COMPONENT_DONE_ERROR, e.getMessage()); } catch (RuntimeException e) { logger.error("Unexpected exception caught during the notification processing", e); sendAllNotificationForCsarHandler(notificationData, csar, NotificationType.DEPLOY, DistributionStatusEnum.DEPLOY_ERROR, e.getMessage()); + this.sendComponentStatus(notificationData, DistributionStatusEnum.COMPONENT_DONE_ERROR, e.getMessage()); } finally { this.changeControllerStatus(SdcSingleControllerStatus.IDLE); } @@ -341,7 +348,8 @@ public class SdcSingleController { } private void sendSdcNotification(NotificationType notificationType, String artifactUrl, String consumerId, - String distributionId, DistributionStatusEnum status, String errorReason, long timestamp) { + String distributionId, DistributionStatusEnum status, String errorReason, + long timestamp) { String event = "Sending " + notificationType.name() + "(" + status.name() + ")" + " notification to SDC for artifact:" + artifactUrl; if (errorReason != null) { @@ -370,6 +378,43 @@ public class SdcSingleController { logger.info("SDC Notification sent successfully(" + action + ")"); } + private void sendComponentStatus(INotificationData notificationData, DistributionStatusEnum status, + String errorReason) { + try { + IComponentDoneStatusMessage message = new IComponentDoneStatusMessage() { + + @Override public String getDistributionID() { + return notificationData.getDistributionID(); + } + + @Override public String getConsumerID() { + return sdcConfig.getConsumerID(); + } + + @Override public long getTimestamp() { + return System.currentTimeMillis(); + } + + @Override public DistributionStatusEnum getStatus() { + return status; + } + + @Override public String getComponentName() { + return sdcConfig.getUser(); + } + }; + + if (errorReason != null) { + this.distributionClient.sendComponentDoneStatus(message, errorReason); + } else { + this.distributionClient.sendComponentDoneStatus(message); + } + } catch (RuntimeException e) { + logger.warn("Unable to send the SDC Notification (" + status.name() + ") due to an exception", e); + } + logger.info("SDC Notification sent successfully(" + status.name() + ")"); + } + private void sendDownloadStatus(IDistributionStatusMessage message, String errorReason) { if (errorReason != null) { this.distributionClient.sendDownloadStatus(message, errorReason); diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleControllerStatus.java b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/SdcSingleControllerStatus.java index a50e340e3..fe269c486 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleControllerStatus.java +++ b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/SdcSingleControllerStatus.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.sdc.controller; +package org.onap.policy.clamp.clds.sdc.controller; public enum SdcSingleControllerStatus { STOPPED, IDLE, BUSY diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintArtifact.java b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintArtifact.java index 35bc909dc..df81cfb0c 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintArtifact.java +++ b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintArtifact.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.sdc.controller.installer; +package org.onap.policy.clamp.clds.sdc.controller.installer; import org.onap.sdc.api.notification.IResourceInstance; diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintMicroService.java b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintMicroService.java index e00ce9430..519a24f46 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintMicroService.java +++ b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintMicroService.java @@ -22,7 +22,7 @@ * */ -package org.onap.clamp.clds.sdc.controller.installer; +package org.onap.policy.clamp.clds.sdc.controller.installer; import java.util.Objects; diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintParser.java index 5d5027d29..ada47992a 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java +++ b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintParser.java @@ -22,7 +22,7 @@ * */ -package org.onap.clamp.clds.sdc.controller.installer; +package org.onap.policy.clamp.clds.sdc.controller.installer; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -30,7 +30,6 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; - import java.util.AbstractMap; import java.util.Collections; import java.util.HashSet; @@ -38,9 +37,8 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; - import org.json.JSONObject; -import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException; +import org.onap.policy.clamp.clds.exception.sdc.controller.BlueprintParserException; import org.yaml.snakeyaml.Yaml; public class BlueprintParser { diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/ChainGenerator.java index 2bd259c2b..10e7a56a4 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java +++ b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/ChainGenerator.java @@ -21,13 +21,12 @@ * */ -package org.onap.clamp.clds.sdc.controller.installer; +package org.onap.policy.clamp.clds.sdc.controller.installer; import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.stream.Collectors; - import org.springframework.stereotype.Component; @Component diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/CsarHandler.java index 471415a37..436e594ce 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java +++ b/src/main/java/org/onap/policy/clamp/clds/sdc/controller/installer/CsarHandler.java @@ -21,11 +21,10 @@ * */ -package org.onap.clamp.clds.sdc.controller.installer; +package org.onap.policy.clamp.clds.sdc.controller.installer; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -40,11 +39,10 @@ import java.util.Map; import java.util.Optional; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; - import org.apache.commons.io.IOUtils; import org.codehaus.plexus.util.StringUtils; -import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException; -import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; +import org.onap.policy.clamp.clds.exception.sdc.controller.CsarHandlerException; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; import org.onap.sdc.api.notification.IArtifactInfo; import org.onap.sdc.api.notification.INotificationData; import org.onap.sdc.api.notification.IResourceInstance; diff --git a/src/main/java/org/onap/clamp/clds/service/CldsHealthcheckService.java b/src/main/java/org/onap/policy/clamp/clds/service/CldsHealthcheckService.java index 3fceace55..02481494a 100644 --- a/src/main/java/org/onap/clamp/clds/service/CldsHealthcheckService.java +++ b/src/main/java/org/onap/policy/clamp/clds/service/CldsHealthcheckService.java @@ -20,13 +20,13 @@ * =================================================================== */ -package org.onap.clamp.clds.service; +package org.onap.policy.clamp.clds.service; import java.util.Date; -import org.onap.clamp.clds.model.CldsHealthCheck; -import org.onap.clamp.clds.util.LoggingUtils; -import org.onap.clamp.clds.util.OnapLogConstants; -import org.onap.clamp.loop.LoopController; +import org.onap.policy.clamp.clds.model.CldsHealthCheck; +import org.onap.policy.clamp.clds.util.LoggingUtils; +import org.onap.policy.clamp.clds.util.OnapLogConstants; +import org.onap.policy.clamp.loop.LoopController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; diff --git a/src/main/java/org/onap/clamp/clds/tosca/JsonEditorSchemaConstants.java b/src/main/java/org/onap/policy/clamp/clds/tosca/JsonEditorSchemaConstants.java index e3c661698..32f328079 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/JsonEditorSchemaConstants.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/JsonEditorSchemaConstants.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca; +package org.onap.policy.clamp.clds.tosca; public class JsonEditorSchemaConstants { diff --git a/src/main/java/org/onap/clamp/clds/tosca/ToscaSchemaConstants.java b/src/main/java/org/onap/policy/clamp/clds/tosca/ToscaSchemaConstants.java index d00c431c8..c2b5d5963 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/ToscaSchemaConstants.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/ToscaSchemaConstants.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca; +package org.onap.policy.clamp.clds.tosca; public class ToscaSchemaConstants { diff --git a/src/main/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertor.java b/src/main/java/org/onap/policy/clamp/clds/tosca/ToscaYamlToJsonConvertor.java index 45bb87ed8..d6b0a031f 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertor.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/ToscaYamlToJsonConvertor.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca; +package org.onap.policy.clamp.clds.tosca; import com.google.gson.Gson; import com.google.gson.JsonElement; @@ -37,10 +37,10 @@ import java.util.Optional; import java.util.stream.Collectors; import org.json.JSONArray; import org.json.JSONObject; -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.tosca.Dictionary; -import org.onap.clamp.tosca.DictionaryElement; -import org.onap.clamp.tosca.DictionaryService; +import org.onap.policy.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.tosca.Dictionary; +import org.onap.policy.clamp.tosca.DictionaryElement; +import org.onap.policy.clamp.tosca.DictionaryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.yaml.snakeyaml.Yaml; diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java index 5832986a1..3505c8b86 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java @@ -21,18 +21,18 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; import java.io.IOException; -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; -import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParserWithDictionarySupport; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; +import org.onap.policy.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParserWithDictionarySupport; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.service.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/UnknownComponentException.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/UnknownComponentException.java index e30f9158b..fb684b57b 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/UnknownComponentException.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/UnknownComponentException.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; public class UnknownComponentException extends Exception { public UnknownComponentException(String nameEntry) { diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/elements/ArrayField.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ArrayField.java index 83f792f3f..9834c78e7 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/elements/ArrayField.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ArrayField.java @@ -21,7 +21,7 @@ *
*/
-package org.onap.clamp.clds.tosca.update.elements;
+package org.onap.policy.clamp.clds.tosca.update.elements;
import com.google.gson.JsonArray;
import java.util.ArrayList;
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/elements/Constraint.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/Constraint.java index d6bd355e3..b41042abe 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/elements/Constraint.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/Constraint.java @@ -21,14 +21,14 @@ *
*/
-package org.onap.clamp.clds.tosca.update.elements;
+package org.onap.policy.clamp.clds.tosca.update.elements;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
-import org.onap.clamp.clds.tosca.update.templates.JsonTemplate;
+import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplate;
public class Constraint {
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElement.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ToscaElement.java index 9035a5806..0c531e9d0 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElement.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ToscaElement.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update.elements; +package org.onap.policy.clamp.clds.tosca.update.elements; import java.util.ArrayList; import java.util.LinkedHashMap; diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElementProperty.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ToscaElementProperty.java index c5ab5a18e..4db8b0356 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElementProperty.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/elements/ToscaElementProperty.java @@ -21,13 +21,13 @@ * */ -package org.onap.clamp.clds.tosca.update.elements; +package org.onap.policy.clamp.clds.tosca.update.elements; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import java.util.ArrayList; import java.util.LinkedHashMap; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplate; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplate; public class ToscaElementProperty { diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java index 885e755bd..e18af7188 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update.execution; +package org.onap.policy.clamp.clds.tosca.update.execution; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -29,10 +29,10 @@ import com.google.gson.JsonObject; import java.util.HashMap; import java.util.Map; import javax.annotation.PostConstruct; -import org.onap.clamp.clds.tosca.update.execution.cds.ToscaMetadataCdsProcess; -import org.onap.clamp.clds.tosca.update.execution.target.ToscaMetadataTargetProcess; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.tosca.DictionaryService; +import org.onap.policy.clamp.clds.tosca.update.execution.cds.ToscaMetadataCdsProcess; +import org.onap.policy.clamp.clds.tosca.update.execution.target.ToscaMetadataTargetProcess; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.tosca.DictionaryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java index 214eadb03..a1275229d 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java @@ -21,10 +21,10 @@ * */ -package org.onap.clamp.clds.tosca.update.execution; +package org.onap.policy.clamp.clds.tosca.update.execution; import com.google.gson.JsonObject; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.service.Service; /** * This code is the interface that must be implemented to have a tosca process. diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java index 39fa25a2b..bd3a1cb13 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java @@ -21,18 +21,18 @@ * */ -package org.onap.clamp.clds.tosca.update.execution.cds; - -import static org.onap.clamp.clds.tosca.ToscaSchemaConstants.TYPE; -import static org.onap.clamp.clds.tosca.ToscaSchemaConstants.TYPE_LIST; +package org.onap.policy.clamp.clds.tosca.update.execution.cds; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import java.util.Map; import java.util.Set; -import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataProcess; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.clds.tosca.ToscaSchemaConstants; +import org.onap.policy.clamp.clds.tosca.ToscaSchemaConstants; +import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataProcess; +import org.onap.policy.clamp.loop.service.Service; + /** * This class is there to add the JsonObject for CDS in the json Schema according to what is found in the Tosca model. @@ -193,12 +193,13 @@ public class ToscaMetadataCdsProcess extends ToscaMetadataProcess { if (key.equalsIgnoreCase(workFlowName + "-properties")) { addDefaultValueForData(entry.getValue().getAsJsonObject().get("properties") .getAsJsonObject(), defaultValue, workFlowName); - } else if ("object".equalsIgnoreCase(inputProperty.get(TYPE).getAsString())) { + } else if ("object".equalsIgnoreCase(inputProperty.get(ToscaSchemaConstants.TYPE).getAsString())) { JsonObject object = new JsonObject(); addDefaultValueForData(entry.getValue().getAsJsonObject().get("properties") .getAsJsonObject(), object, workFlowName); defaultValue.add(entry.getKey(), object); - } else if (TYPE_LIST.equalsIgnoreCase(inputProperty.get(TYPE).getAsString())) { + } else if (ToscaSchemaConstants.TYPE_LIST.equalsIgnoreCase(inputProperty.get(ToscaSchemaConstants.TYPE) + .getAsString())) { defaultValue.add(entry.getKey(), handleListType(entry.getValue().getAsJsonObject(), workFlowName)); } else { defaultValue.addProperty(entry.getKey(), ""); diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java index 8b8fa1784..f4ca9909b 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java @@ -21,12 +21,12 @@ * */ -package org.onap.clamp.clds.tosca.update.execution.target; +package org.onap.policy.clamp.clds.tosca.update.execution.target; import com.google.gson.JsonObject; -import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataProcess; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.policy.operational.OperationalPolicyRepresentationBuilder; +import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataProcess; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.policy.operational.OperationalPolicyRepresentationBuilder; /** * This class is there to add the JsonObject for CDS in the json Schema according to what is found in the Tosca model. diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java index 9721e33d9..c7cc7e7fa 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update.parser; +package org.onap.policy.clamp.clds.tosca.update.parser; import com.google.gson.JsonArray; import com.google.gson.JsonObject; @@ -29,11 +29,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map.Entry; -import org.onap.clamp.clds.tosca.update.elements.ToscaElement; -import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; -import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplate; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElement; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.policy.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplate; +import org.onap.policy.clamp.loop.service.Service; public class ToscaConverterToJsonSchema { private LinkedHashMap<String, ToscaElement> components; @@ -145,8 +145,7 @@ public class ToscaConverterToJsonSchema { if (getToscaElement((String) property.getValue().getItems().get("type")) != null) { jsonSchema.add(property.getValue().getName(), this.getJsonSchemaOfToscaElement((String) property.getValue().getItems().get("type"))); - } - else { + } else { jsonSchema.add(property.getValue().getName(), this.complexParse(property.getValue())); } } @@ -176,8 +175,7 @@ public class ToscaConverterToJsonSchema { String typeProperty = (String) toscaElementProperty.getItems().get("type"); if (typeProperty.toLowerCase().equals("list") || typeProperty.toLowerCase().equals("map")) { currentPropertyJsonTemplate = templates.get("object"); - } - else { + } else { String propertyType = (String) toscaElementProperty.getItems().get("type"); currentPropertyJsonTemplate = templates.get(propertyType.toLowerCase()); } @@ -264,9 +262,8 @@ public class ToscaConverterToJsonSchema { break; } - } - // Native cases - else if (toscaElementProperty.getItems().get("type").equals("list")) { + } else if (toscaElementProperty.getItems().get("type").equals("list")) { + // Native cases JsonObject itemContainer = new JsonObject(); String valueInEntrySchema = this.extractSpecificFieldFromMap(toscaElementProperty, "entry_schema"); diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaElementParser.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaElementParser.java index 090fcfcfa..a3dd9c3e1 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaElementParser.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaElementParser.java @@ -21,12 +21,12 @@ * */ -package org.onap.clamp.clds.tosca.update.parser; +package org.onap.policy.clamp.clds.tosca.update.parser; import java.util.LinkedHashMap; import java.util.Map.Entry; -import org.onap.clamp.clds.tosca.update.elements.ToscaElement; -import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElement; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElementProperty; import org.yaml.snakeyaml.Yaml; public class ToscaElementParser { diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java index f4a48139e..b2568b79f 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java @@ -21,11 +21,11 @@ * */ -package org.onap.clamp.clds.tosca.update.parser.metadata; +package org.onap.policy.clamp.clds.tosca.update.parser.metadata; import com.google.gson.JsonObject; -import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.policy.clamp.loop.service.Service; public interface ToscaMetadataParser { JsonObject processAllMetadataElement(ToscaElementProperty toscaElementProperty, Service serviceModel); diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java index 33e084279..049018ae0 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update.parser.metadata; +package org.onap.policy.clamp.clds.tosca.update.parser.metadata; import com.google.gson.JsonArray; import com.google.gson.JsonObject; @@ -29,13 +29,13 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Optional; -import org.onap.clamp.clds.tosca.JsonEditorSchemaConstants; -import org.onap.clamp.clds.tosca.ToscaSchemaConstants; -import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; -import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.tosca.DictionaryElement; -import org.onap.clamp.tosca.DictionaryService; +import org.onap.policy.clamp.clds.tosca.JsonEditorSchemaConstants; +import org.onap.policy.clamp.clds.tosca.ToscaSchemaConstants; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.tosca.DictionaryElement; +import org.onap.policy.clamp.tosca.DictionaryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -58,8 +58,7 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa if (dictionaryService != null) { return parseMetadataPossibleValues(toscaElementProperty.getItems(), dictionaryService, serviceModel, toscaMetadataExecutor); - } - else { + } else { return null; } } @@ -163,8 +162,7 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa if (dictionaryFullNames.size() > 0) { if (childObject.get(JsonEditorSchemaConstants.ENUM) != null) { childObject.get(JsonEditorSchemaConstants.ENUM).getAsJsonArray().add(dictionaryFullNames); - } - else { + } else { childObject.add(JsonEditorSchemaConstants.ENUM, dictionaryFullNames); } // Add Enum titles for generated translated values during JSON instance @@ -173,17 +171,14 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa enumTitles.add(JsonEditorSchemaConstants.ENUM_TITLES, dictionaryNames); if (childObject.get(JsonEditorSchemaConstants.OPTIONS) != null) { childObject.get(JsonEditorSchemaConstants.OPTIONS).getAsJsonArray().add(enumTitles); - } - else { + } else { childObject.add(JsonEditorSchemaConstants.OPTIONS, enumTitles); } - } - else { + } else { if (childObject.get(JsonEditorSchemaConstants.ENUM) != null) { childObject.get(JsonEditorSchemaConstants.ENUM).getAsJsonArray().add(dictionaryNames); - } - else { + } else { childObject.add(JsonEditorSchemaConstants.ENUM, dictionaryNames); } } @@ -196,8 +191,7 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa dictionaryReference.length()).split("#"); if (dictionaryKeyArray.length > 1) { processComplexDictionaryElements(dictionaryKeyArray, childObject, dictionaryService); - } - else { + } else { processSimpleDictionaryElements(dictionaryKeyArray, childObject, dictionaryService); } } @@ -206,11 +200,9 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa String jsonType = null; if (toscaType.equalsIgnoreCase(ToscaSchemaConstants.TYPE_INTEGER)) { jsonType = JsonEditorSchemaConstants.TYPE_INTEGER; - } - else if (toscaType.equalsIgnoreCase(ToscaSchemaConstants.TYPE_LIST)) { + } else if (toscaType.equalsIgnoreCase(ToscaSchemaConstants.TYPE_LIST)) { jsonType = JsonEditorSchemaConstants.TYPE_ARRAY; - } - else { + } else { jsonType = JsonEditorSchemaConstants.TYPE_STRING; } return jsonType; diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplate.java index f64ba68cf..5c96f2c4a 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplate.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update.templates; +package org.onap.policy.clamp.clds.tosca.update.templates; import com.google.gson.JsonObject; import java.util.ArrayList; @@ -197,8 +197,7 @@ public class JsonTemplate { if (fieldStaticStatus(fieldName)) { String defaultValue = (String) this.getSpecificField(fieldName).getValue(); jsonSchema.addProperty(fieldName, defaultValue); - } - else { + } else { jsonSchema.addProperty(fieldName, value); } } diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateField.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateField.java index a1e15307c..d9fd11de2 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateField.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateField.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update.templates; +package org.onap.policy.clamp.clds.tosca.update.templates; public class JsonTemplateField { private String title; diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateManager.java index 0b399ba0b..1813d0786 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateManager.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update.templates; +package org.onap.policy.clamp.clds.tosca.update.templates; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -29,13 +29,13 @@ import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.onap.clamp.clds.tosca.update.UnknownComponentException; -import org.onap.clamp.clds.tosca.update.elements.ToscaElement; -import org.onap.clamp.clds.tosca.update.parser.ToscaConverterToJsonSchema; -import org.onap.clamp.clds.tosca.update.parser.ToscaElementParser; -import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.clds.tosca.update.UnknownComponentException; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElement; +import org.onap.policy.clamp.clds.tosca.update.parser.ToscaConverterToJsonSchema; +import org.onap.policy.clamp.clds.tosca.update.parser.ToscaElementParser; +import org.onap.policy.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.service.Service; public class JsonTemplateManager { private LinkedHashMap<String, JsonTemplate> jsonSchemaTemplates; @@ -52,8 +52,7 @@ public class JsonTemplateManager { if (toscaYamlContent != null && !toscaYamlContent.isEmpty()) { this.toscaElements = ToscaElementParser.searchAllToscaElements(toscaYamlContent, nativeToscaDatatypes); this.jsonSchemaTemplates = initializeTemplates(jsonSchemaTemplates); - } - else { + } else { toscaElements = null; } } @@ -111,10 +110,9 @@ public class JsonTemplateManager { if (operation && !this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) { this.jsonSchemaTemplates.get(nameTemplate).addField(jsonTemplateField); - } - // Operation = false && field is present => remove Field - else if (!operation + } else if (!operation && this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) { + // Operation = false && field is present => remove Field this.jsonSchemaTemplates.get(nameTemplate).removeField(jsonTemplateField); } } @@ -139,8 +137,8 @@ public class JsonTemplateManager { * For a given policy type, get a corresponding JsonObject from the tosca model. * * @param policyType The policy type in the tosca - * @param toscaMetadataParser The MetadataParser class that must be used if metadata section are encountered, if null - * they will be skipped + * @param toscaMetadataParser The MetadataParser class that must be used if metadata section are encountered, + * if null they will be skipped * @return an json object defining the equivalent json schema from the tosca for a given policy type */ public JsonObject getJsonSchemaForPolicyType(String policyType, ToscaMetadataParser toscaMetadataParser, diff --git a/src/main/java/org/onap/clamp/clds/util/ClampVersioning.java b/src/main/java/org/onap/policy/clamp/clds/util/ClampVersioning.java index ec0162cb1..0890615d9 100644 --- a/src/main/java/org/onap/clamp/clds/util/ClampVersioning.java +++ b/src/main/java/org/onap/policy/clamp/clds/util/ClampVersioning.java @@ -22,11 +22,10 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; - import java.io.InputStream; import java.util.Properties; diff --git a/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java b/src/main/java/org/onap/policy/clamp/clds/util/CryptoUtils.java index 1ddf3a90a..01dd48763 100644 --- a/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java +++ b/src/main/java/org/onap/policy/clamp/clds/util/CryptoUtils.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -80,7 +80,7 @@ public final class CryptoUtils { /** * Key to read in the key.properties file. */ - private static final String KEY_PARAM = "org.onap.clamp.encryption.aes.key"; + private static final String KEY_PARAM = "org.onap.policy.clamp.encryption.aes.key"; private static final String PROPERTIES_FILE_NAME = "clds/key.properties"; /** * The SecretKeySpec created from the Base 64 String key. diff --git a/src/main/java/org/onap/clamp/clds/util/JsonUtils.java b/src/main/java/org/onap/policy/clamp/clds/util/JsonUtils.java index 8024331f2..d57ce2095 100644 --- a/src/main/java/org/onap/clamp/clds/util/JsonUtils.java +++ b/src/main/java/org/onap/policy/clamp/clds/util/JsonUtils.java @@ -21,19 +21,17 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.Gson; import com.google.gson.GsonBuilder; - import java.time.Instant; - -import org.onap.clamp.authorization.SecureServicePermission; -import org.onap.clamp.authorization.SecureServicePermissionDeserializer; -import org.onap.clamp.dao.model.gson.converter.InstantDeserializer; -import org.onap.clamp.dao.model.gson.converter.InstantSerializer; +import org.onap.policy.clamp.authorization.SecureServicePermission; +import org.onap.policy.clamp.authorization.SecureServicePermissionDeserializer; +import org.onap.policy.clamp.dao.model.gson.converter.InstantDeserializer; +import org.onap.policy.clamp.dao.model.gson.converter.InstantSerializer; /** * This class is used to access the GSON with restricted type access. diff --git a/src/main/java/org/onap/clamp/clds/util/LogMessages.java b/src/main/java/org/onap/policy/clamp/clds/util/LogMessages.java index 7f4c8781f..676206e0f 100644 --- a/src/main/java/org/onap/clamp/clds/util/LogMessages.java +++ b/src/main/java/org/onap/policy/clamp/clds/util/LogMessages.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import com.att.eelf.i18n.EELFResolvableErrorEnum; import com.att.eelf.i18n.EELFResourceManager; diff --git a/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java b/src/main/java/org/onap/policy/clamp/clds/util/LoggingUtils.java index 0ac1a14fc..d7a158e73 100644 --- a/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java +++ b/src/main/java/org/onap/policy/clamp/clds/util/LoggingUtils.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import java.net.HttpURLConnection; import java.net.InetAddress; @@ -39,7 +39,7 @@ import java.util.UUID; import javax.net.ssl.HttpsURLConnection; import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.NotNull; -import org.onap.clamp.authorization.AuthorizationController; +import org.onap.policy.clamp.authorization.AuthorizationController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; @@ -168,9 +168,9 @@ public class LoggingUtils { return dateFormat; } - /********************************************************************************************* + /* ******************************************************************************************* * Method for ONAP Application Logging Specification v1.2 - ********************************************************************************************/ + * *******************************************************************************************/ /** * Report <tt>ENTERING</tt> marker. diff --git a/src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java b/src/main/java/org/onap/policy/clamp/clds/util/OnapLogConstants.java index 8952e5df1..78b16f1a0 100644 --- a/src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java +++ b/src/main/java/org/onap/policy/clamp/clds/util/OnapLogConstants.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import org.slf4j.Marker; import org.slf4j.MarkerFactory; @@ -190,10 +190,10 @@ public final class OnapLogConstants { /** MDC reporting outcome description. */ public static final String RESPONSE_DESCRIPTION = "ResponseDesc"; - /** MDC reporting severity */ + /** MDC reporting severity. */ public static final String RESPONSE_SEVERITY = "Severity"; - /** MDC reporting response status code */ + /** MDC reporting response status code. */ public static final String RESPONSE_STATUS_CODE = "StatusCode"; /** MDC recording error code. */ @@ -267,20 +267,20 @@ public final class OnapLogConstants { ASYNCHRONOUS("ASYNCHRONOUS", Markers.INVOKE_ASYNCHRONOUS); /** Enum value. */ - private String mString; + private String enumValue; /** Corresponding marker. */ - private Marker mMarker; + private Marker marker; /** * Construct enum. * - * @param s enum value. - * @param m corresponding Marker. + * @param enumValue enum value. + * @param marker corresponding Marker. */ - InvocationMode(final String s, final Marker m) { - this.mString = s; - this.mMarker = m; + InvocationMode(final String enumValue, final Marker marker) { + this.enumValue = enumValue; + this.marker = marker; } /** @@ -289,7 +289,7 @@ public final class OnapLogConstants { * @return Marker. */ public Marker getMarker() { - return this.mMarker; + return this.marker; } /** @@ -297,7 +297,7 @@ public final class OnapLogConstants { */ @Override public String toString() { - return this.mString; + return this.enumValue; } } diff --git a/src/main/java/org/onap/clamp/clds/util/ResourceFileUtils.java b/src/main/java/org/onap/policy/clamp/clds/util/ResourceFileUtils.java index f858ed2b8..cd4700277 100644 --- a/src/main/java/org/onap/clamp/clds/util/ResourceFileUtils.java +++ b/src/main/java/org/onap/policy/clamp/clds/util/ResourceFileUtils.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java b/src/main/java/org/onap/policy/clamp/configuration/ClampGsonDataFormat.java index ca5f37656..e5f12163e 100644 --- a/src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java +++ b/src/main/java/org/onap/policy/clamp/configuration/ClampGsonDataFormat.java @@ -20,10 +20,9 @@ * =================================================================== */ -package org.onap.clamp.configuration; +package org.onap.policy.clamp.configuration; import com.google.gson.Gson; - import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStream; @@ -32,13 +31,12 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; - import org.apache.camel.Exchange; import org.apache.camel.spi.DataFormat; import org.apache.camel.spi.DataFormatName; import org.apache.camel.support.ServiceSupport; import org.apache.camel.util.IOHelper; -import org.onap.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.JsonUtils; public class ClampGsonDataFormat extends ServiceSupport implements DataFormat, DataFormatName { private Gson gson; diff --git a/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java b/src/main/java/org/onap/policy/clamp/dao/model/gson/converter/InstantDeserializer.java index 2d63e55fa..db024e07a 100644 --- a/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java +++ b/src/main/java/org/onap/policy/clamp/dao/model/gson/converter/InstantDeserializer.java @@ -21,12 +21,11 @@ * */ -package org.onap.clamp.dao.model.gson.converter; +package org.onap.policy.clamp.dao.model.gson.converter; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; - import java.lang.reflect.Type; import java.time.Instant; import java.time.ZoneId; diff --git a/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java b/src/main/java/org/onap/policy/clamp/dao/model/gson/converter/InstantSerializer.java index cdb439e46..7208a472c 100644 --- a/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java +++ b/src/main/java/org/onap/policy/clamp/dao/model/gson/converter/InstantSerializer.java @@ -21,13 +21,12 @@ * */ -package org.onap.clamp.dao.model.gson.converter; +package org.onap.policy.clamp.dao.model.gson.converter; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; - import java.lang.reflect.Type; import java.time.Instant; import java.time.format.DateTimeFormatter; diff --git a/src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java b/src/main/java/org/onap/policy/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java index f5aba4e11..d3aaa32a9 100644 --- a/src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java +++ b/src/main/java/org/onap/policy/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java @@ -21,14 +21,13 @@ * */ -package org.onap.clamp.dao.model.jsontype; +package org.onap.policy.clamp.dao.model.jsontype; import java.sql.CallableStatement; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; - import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; diff --git a/src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java b/src/main/java/org/onap/policy/clamp/dao/model/jsontype/JsonTypeDescriptor.java index 518ec2d04..ed8464b14 100644 --- a/src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java +++ b/src/main/java/org/onap/policy/clamp/dao/model/jsontype/JsonTypeDescriptor.java @@ -21,16 +21,14 @@ * */ -package org.onap.clamp.dao.model.jsontype; +package org.onap.policy.clamp.dao.model.jsontype; import com.google.gson.JsonObject; - import java.io.Serializable; - import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.AbstractTypeDescriptor; import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; -import org.onap.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.JsonUtils; public class JsonTypeDescriptor extends AbstractTypeDescriptor<JsonObject> { diff --git a/src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java b/src/main/java/org/onap/policy/clamp/dao/model/jsontype/StringJsonUserType.java index 621fa8dad..4a7b65bb4 100644 --- a/src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java +++ b/src/main/java/org/onap/policy/clamp/dao/model/jsontype/StringJsonUserType.java @@ -21,10 +21,9 @@ * */ -package org.onap.clamp.dao.model.jsontype; +package org.onap.policy.clamp.dao.model.jsontype; import com.google.gson.JsonObject; - import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; diff --git a/src/main/java/org/onap/clamp/flow/log/FlowLogOperation.java b/src/main/java/org/onap/policy/clamp/flow/log/FlowLogOperation.java index e31406b2c..d54b23b21 100644 --- a/src/main/java/org/onap/clamp/flow/log/FlowLogOperation.java +++ b/src/main/java/org/onap/policy/clamp/flow/log/FlowLogOperation.java @@ -21,12 +21,12 @@ * */ -package org.onap.clamp.flow.log; +package org.onap.policy.clamp.flow.log; import javax.servlet.http.HttpServletRequest; import org.apache.camel.Exchange; -import org.onap.clamp.clds.util.LoggingUtils; -import org.onap.clamp.clds.util.OnapLogConstants; +import org.onap.policy.clamp.clds.util.LoggingUtils; +import org.onap.policy.clamp.clds.util.OnapLogConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; diff --git a/src/main/java/org/onap/clamp/loop/CsarInstaller.java b/src/main/java/org/onap/policy/clamp/loop/CsarInstaller.java index 67c7ce5cf..753789a68 100644 --- a/src/main/java/org/onap/clamp/loop/CsarInstaller.java +++ b/src/main/java/org/onap/policy/clamp/loop/CsarInstaller.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -30,25 +30,24 @@ import java.util.HashSet; import java.util.List; import java.util.Map.Entry; import org.json.simple.parser.ParseException; -import org.onap.clamp.clds.client.DcaeInventoryServices; -import org.onap.clamp.clds.client.PolicyEngineServices; -import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException; -import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; -import org.onap.clamp.clds.model.dcae.DcaeInventoryResponse; -import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact; -import org.onap.clamp.clds.sdc.controller.installer.BlueprintMicroService; -import org.onap.clamp.clds.sdc.controller.installer.BlueprintParser; -import org.onap.clamp.clds.sdc.controller.installer.ChainGenerator; -import org.onap.clamp.clds.sdc.controller.installer.CsarHandler; -import org.onap.clamp.loop.cds.CdsDataInstaller; -import org.onap.clamp.loop.service.CsarServiceInstaller; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.LoopTemplatesRepository; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelId; -import org.onap.clamp.loop.template.PolicyModelsRepository; +import org.onap.policy.clamp.clds.client.DcaeInventoryServices; +import org.onap.policy.clamp.clds.client.PolicyEngineServices; +import org.onap.policy.clamp.clds.exception.sdc.controller.BlueprintParserException; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; +import org.onap.policy.clamp.clds.model.dcae.DcaeInventoryResponse; +import org.onap.policy.clamp.clds.sdc.controller.installer.BlueprintArtifact; +import org.onap.policy.clamp.clds.sdc.controller.installer.BlueprintMicroService; +import org.onap.policy.clamp.clds.sdc.controller.installer.BlueprintParser; +import org.onap.policy.clamp.clds.sdc.controller.installer.ChainGenerator; +import org.onap.policy.clamp.clds.sdc.controller.installer.CsarHandler; +import org.onap.policy.clamp.loop.cds.CdsDataInstaller; +import org.onap.policy.clamp.loop.service.CsarServiceInstaller; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.LoopTemplatesRepository; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelsRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @@ -152,7 +151,8 @@ public class CsarInstaller { private LoopTemplate createLoopTemplateFromBlueprint(CsarHandler csar, BlueprintArtifact blueprintArtifact, Service service) - throws IOException, ParseException, InterruptedException, BlueprintParserException { + throws IOException, ParseException, InterruptedException, BlueprintParserException, + SdcArtifactInstallerException { LoopTemplate newLoopTemplate = new LoopTemplate(); newLoopTemplate.setBlueprint(blueprintArtifact.getDcaeBlueprint()); newLoopTemplate.setName(LoopTemplate.generateLoopTemplateName(csar.getSdcNotification().getServiceName(), @@ -165,32 +165,35 @@ public class CsarInstaller { microServicesChain = BlueprintParser.fallbackToOneMicroService(); } newLoopTemplate.setModelService(service); - newLoopTemplate.addLoopElementModels(createMicroServiceModels(microServicesChain)); + newLoopTemplate.addLoopElementModels(createMicroServiceModels(blueprintArtifact, microServicesChain)); newLoopTemplate.setMaximumInstancesAllowed(0); DcaeInventoryResponse dcaeResponse = queryDcaeToGetServiceTypeId(blueprintArtifact); newLoopTemplate.setDcaeBlueprintId(dcaeResponse.getTypeId()); return newLoopTemplate; } - private HashSet<LoopElementModel> createMicroServiceModels(List<BlueprintMicroService> microServicesChain) - throws InterruptedException { + private HashSet<LoopElementModel> createMicroServiceModels(BlueprintArtifact blueprintArtifact, + List<BlueprintMicroService> microServicesChain) + throws SdcArtifactInstallerException { HashSet<LoopElementModel> newSet = new HashSet<>(); for (BlueprintMicroService microService : microServicesChain) { LoopElementModel loopElementModel = new LoopElementModel(microService.getModelType(), LoopElementModel.MICRO_SERVICE_TYPE, null); newSet.add(loopElementModel); - loopElementModel.addPolicyModel(getPolicyModel(microService)); + PolicyModel newPolicyModel = policyEngineServices.createPolicyModelFromPolicyEngine(microService); + if (newPolicyModel != null) { + loopElementModel.addPolicyModel(newPolicyModel); + } else { + throw new SdcArtifactInstallerException( + "Unable to find the policy specified in the blueprint " + blueprintArtifact + .getBlueprintArtifactName() + ") on the Policy Engine:" + + microService.getModelType() + "/" + microService.getModelVersion()); + } } return newSet; } - private PolicyModel getPolicyModel(BlueprintMicroService microService) throws InterruptedException { - return policyModelsRepository - .findById(new PolicyModelId(microService.getModelType(), microService.getModelVersion())) - .orElse(policyEngineServices.createPolicyModelFromPolicyEngine(microService)); - } - /** * Get the service blueprint Id in the Dcae inventory using the SDC UUID. * diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/policy/clamp/loop/Loop.java index 36f74221e..99d8d1e69 100644 --- a/src/main/java/org/onap/clamp/loop/Loop.java +++ b/src/main/java/org/onap/policy/clamp/loop/Loop.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; @@ -50,19 +50,19 @@ import org.hibernate.annotations.SortNatural; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.dao.model.jsontype.StringJsonUserType; -import org.onap.clamp.loop.common.AuditEntity; -import org.onap.clamp.loop.components.external.DcaeComponent; -import org.onap.clamp.loop.components.external.ExternalComponent; -import org.onap.clamp.loop.components.external.PolicyComponent; -import org.onap.clamp.loop.deploy.DcaeDeployParameters; -import org.onap.clamp.loop.log.LoopLog; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.dao.model.jsontype.StringJsonUserType; +import org.onap.policy.clamp.loop.common.AuditEntity; +import org.onap.policy.clamp.loop.components.external.DcaeComponent; +import org.onap.policy.clamp.loop.components.external.ExternalComponent; +import org.onap.policy.clamp.loop.components.external.PolicyComponent; +import org.onap.policy.clamp.loop.deploy.DcaeDeployParameters; +import org.onap.policy.clamp.loop.log.LoopLog; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; @Entity @Table(name = "loops") @@ -162,8 +162,7 @@ public class Loop extends AuditEntity implements Serializable { if (LoopElementModel.MICRO_SERVICE_TYPE.equals(element.getLoopElementModel().getLoopElementType())) { this.addMicroServicePolicy((MicroServicePolicy) element.getLoopElementModel() .createPolicyInstance(this, toscaConverter)); - } - else if (LoopElementModel.OPERATIONAL_POLICY_TYPE + } else if (LoopElementModel.OPERATIONAL_POLICY_TYPE .equals(element.getLoopElementModel().getLoopElementType())) { this.addOperationalPolicy((OperationalPolicy) element.getLoopElementModel() .createPolicyInstance(this, toscaConverter)); @@ -381,8 +380,7 @@ public class Loop extends AuditEntity implements Serializable { if (other.name != null) { return false; } - } - else if (!name.equals(other.name)) { + } else if (!name.equals(other.name)) { return false; } return true; diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/policy/clamp/loop/LoopController.java index 603726f56..98459c909 100644 --- a/src/main/java/org/onap/clamp/loop/LoopController.java +++ b/src/main/java/org/onap/policy/clamp/loop/LoopController.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import com.google.gson.JsonArray; import com.google.gson.JsonObject; @@ -29,12 +29,12 @@ import com.google.gson.reflect.TypeToken; import java.io.IOException; import java.lang.reflect.Type; import java.util.List; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.microservice.MicroServicePolicyService; -import org.onap.clamp.policy.operational.OperationalPolicy; -import org.onap.clamp.policy.operational.OperationalPolicyService; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicyService; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; diff --git a/src/main/java/org/onap/clamp/loop/LoopService.java b/src/main/java/org/onap/policy/clamp/loop/LoopService.java index 5f0822816..975011669 100644 --- a/src/main/java/org/onap/clamp/loop/LoopService.java +++ b/src/main/java/org/onap/policy/clamp/loop/LoopService.java @@ -21,21 +21,21 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import com.google.gson.JsonObject; import java.io.IOException; import java.util.List; import java.util.Set; import javax.persistence.EntityNotFoundException; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.loop.template.LoopTemplatesService; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelsService; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.microservice.MicroServicePolicyService; -import org.onap.clamp.policy.operational.OperationalPolicy; -import org.onap.clamp.policy.operational.OperationalPolicyService; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.loop.template.LoopTemplatesService; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelsService; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicyService; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/onap/clamp/loop/LoopState.java b/src/main/java/org/onap/policy/clamp/loop/LoopState.java index 4707730ce..48d4487f0 100644 --- a/src/main/java/org/onap/clamp/loop/LoopState.java +++ b/src/main/java/org/onap/policy/clamp/loop/LoopState.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; public enum LoopState { DESIGN, SUBMITTED, DEPLOYED, RUNNING, STOPPED, IN_ERROR, WAITING; diff --git a/src/main/java/org/onap/clamp/loop/LoopsRepository.java b/src/main/java/org/onap/policy/clamp/loop/LoopsRepository.java index aaa49116f..7b92ed584 100644 --- a/src/main/java/org/onap/clamp/loop/LoopsRepository.java +++ b/src/main/java/org/onap/policy/clamp/loop/LoopsRepository.java @@ -21,10 +21,9 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import java.util.List; - import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java b/src/main/java/org/onap/policy/clamp/loop/cds/CdsDataInstaller.java index d18cae1d6..68adb3887 100644 --- a/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java +++ b/src/main/java/org/onap/policy/clamp/loop/cds/CdsDataInstaller.java @@ -22,16 +22,16 @@ * */ -package org.onap.clamp.loop.cds; +package org.onap.policy.clamp.loop.cds; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; -import org.onap.clamp.clds.client.CdsServices; -import org.onap.clamp.clds.model.cds.CdsBpWorkFlowListResponse; -import org.onap.clamp.clds.sdc.controller.installer.CsarHandler; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.service.ServicesRepository; +import org.onap.policy.clamp.clds.client.CdsServices; +import org.onap.policy.clamp.clds.model.cds.CdsBpWorkFlowListResponse; +import org.onap.policy.clamp.clds.sdc.controller.installer.CsarHandler; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.service.ServicesRepository; import org.onap.sdc.tosca.parser.enums.SdcTypes; import org.onap.sdc.toscaparser.api.NodeTemplate; import org.springframework.beans.factory.annotation.Autowired; @@ -80,8 +80,7 @@ public class CdsDataInstaller { resourcesPropByType.getAsJsonObject(nodeTemplate.getName()) .add(CONTROLLER_PROPERTIES, controllerProperties); logger.info("Successfully installed the CDS data in Service"); - } - else { + } else { logger.warn("Skipping CDS data installation in Service, as sdnc_model_name and " + "sdnc_model_version are not provided in the CSAR"); } diff --git a/src/main/java/org/onap/clamp/loop/common/AuditEntity.java b/src/main/java/org/onap/policy/clamp/loop/common/AuditEntity.java index 7ce12ec6b..92c795e90 100644 --- a/src/main/java/org/onap/clamp/loop/common/AuditEntity.java +++ b/src/main/java/org/onap/policy/clamp/loop/common/AuditEntity.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.common; +package org.onap.policy.clamp.loop.common; import com.google.gson.annotations.Expose; import java.time.Instant; @@ -74,8 +74,7 @@ public class AuditEntity { public void setCreatedDate(Instant createdDate) { if (createdDate != null) { this.createdDate = createdDate.truncatedTo(ChronoUnit.SECONDS); - } - else { + } else { this.createdDate = null; } } @@ -97,8 +96,7 @@ public class AuditEntity { public void setUpdatedDate(Instant updatedDate) { if (updatedDate != null) { this.updatedDate = updatedDate.truncatedTo(ChronoUnit.SECONDS); - } - else { + } else { this.updatedDate = null; } } diff --git a/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java b/src/main/java/org/onap/policy/clamp/loop/components/external/DcaeComponent.java index 8b8547195..1b36aab55 100644 --- a/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java +++ b/src/main/java/org/onap/policy/clamp/loop/components/external/DcaeComponent.java @@ -21,28 +21,26 @@ * */ -package org.onap.clamp.loop.components.external; +package org.onap.policy.clamp.loop.components.external; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; - import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.UUID; - import javax.persistence.Transient; import org.apache.camel.Exchange; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import org.onap.clamp.clds.model.dcae.DcaeInventoryResponse; -import org.onap.clamp.clds.model.dcae.DcaeOperationStatusResponse; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.clds.model.dcae.DcaeInventoryResponse; +import org.onap.policy.clamp.clds.model.dcae.DcaeOperationStatusResponse; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; public class DcaeComponent extends ExternalComponent { @@ -209,22 +207,37 @@ public class DcaeComponent extends ExternalComponent { if (dcaeResponse == null) { setState(BLUEPRINT_DEPLOYED); - } else if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus().equals("succeeded")) { - setState(MICROSERVICE_INSTALLED_SUCCESSFULLY); - } else if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus().equals("processing")) { - setState(PROCESSING_MICROSERVICE_INSTALLATION); - } else if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus().equals("failed")) { - setState(MICROSERVICE_INSTALLATION_FAILED); - } else if (dcaeResponse.getOperationType().equals("uninstall") - && dcaeResponse.getStatus().equals("succeeded")) { - setState(MICROSERVICE_UNINSTALLED_SUCCESSFULLY); - } else if (dcaeResponse.getOperationType().equals("uninstall") - && dcaeResponse.getStatus().equals("processing")) { - setState(PROCESSING_MICROSERVICE_UNINSTALLATION); - } else if (dcaeResponse.getOperationType().equals("uninstall") && dcaeResponse.getStatus().equals("failed")) { - setState(MICROSERVICE_UNINSTALLATION_FAILED); } else { - setState(IN_ERROR); + if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus().equals("succeeded")) { + setState(MICROSERVICE_INSTALLED_SUCCESSFULLY); + } else { + if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus() + .equals("processing")) { + setState(PROCESSING_MICROSERVICE_INSTALLATION); + } else { + if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus() + .equals("failed")) { + setState(MICROSERVICE_INSTALLATION_FAILED); + } else { + if (dcaeResponse.getOperationType().equals("uninstall") + && dcaeResponse.getStatus().equals("succeeded")) { + setState(MICROSERVICE_UNINSTALLED_SUCCESSFULLY); + } else { + if (dcaeResponse.getOperationType().equals("uninstall") + && dcaeResponse.getStatus().equals("processing")) { + setState(PROCESSING_MICROSERVICE_UNINSTALLATION); + } else { + if (dcaeResponse.getOperationType().equals("uninstall") && dcaeResponse.getStatus() + .equals("failed")) { + setState(MICROSERVICE_UNINSTALLATION_FAILED); + } else { + setState(IN_ERROR); + } + } + } + } + } + } } return this.getState(); } diff --git a/src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java b/src/main/java/org/onap/policy/clamp/loop/components/external/ExternalComponent.java index 2be707fe4..ce7efe494 100644 --- a/src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java +++ b/src/main/java/org/onap/policy/clamp/loop/components/external/ExternalComponent.java @@ -21,10 +21,9 @@ * */ -package org.onap.clamp.loop.components.external; +package org.onap.policy.clamp.loop.components.external; import com.google.gson.annotations.Expose; - import org.apache.camel.Exchange; /** diff --git a/src/main/java/org/onap/clamp/loop/components/external/ExternalComponentState.java b/src/main/java/org/onap/policy/clamp/loop/components/external/ExternalComponentState.java index a57234af0..a57800025 100644 --- a/src/main/java/org/onap/clamp/loop/components/external/ExternalComponentState.java +++ b/src/main/java/org/onap/policy/clamp/loop/components/external/ExternalComponentState.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.components.external; +package org.onap.policy.clamp.loop.components.external; import com.google.gson.annotations.Expose; diff --git a/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java b/src/main/java/org/onap/policy/clamp/loop/components/external/PolicyComponent.java index 4ea5b7118..648463d78 100644 --- a/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java +++ b/src/main/java/org/onap/policy/clamp/loop/components/external/PolicyComponent.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.components.external; +package org.onap.policy.clamp.loop.components.external; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -35,9 +35,9 @@ import java.util.Map; import java.util.Map.Entry; import javax.persistence.Transient; import org.apache.camel.Exchange; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; public class PolicyComponent extends ExternalComponent { @@ -75,7 +75,8 @@ public class PolicyComponent extends ExternalComponent { /** * Generates the Json that must be sent to policy to add all policies to Active * PDP group. - * @param loop the loop object + * + * @param loop the loop object * @param action POST (to add policy to group) or DELETE (to delete policy from group) * @return The json, payload to send */ @@ -113,13 +114,11 @@ public class PolicyComponent extends ExternalComponent { if (pdpGroupMap.get(pdpGroup) == null) { pdpSubGroupMap = new HashMap<>(); policyList = new LinkedList<>(); - } - else { + } else { pdpSubGroupMap = pdpGroupMap.get(pdpGroup); if (pdpSubGroupMap.get(pdpSubGroup) == null) { policyList = new LinkedList<>(); - } - else { + } else { policyList = (List<JsonObject>) pdpSubGroupMap.get(pdpSubGroup); } } @@ -162,12 +161,14 @@ public class PolicyComponent extends ExternalComponent { ExternalComponentState newState = NOT_SENT; if (found && deployed) { newState = SENT_AND_DEPLOYED; - } - else if (found) { - newState = SENT; - } - else if (deployed) { - newState = IN_ERROR; + } else { + if (found) { + newState = SENT; + } else { + if (deployed) { + newState = IN_ERROR; + } + } } return newState; } diff --git a/src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java b/src/main/java/org/onap/policy/clamp/loop/deploy/DcaeDeployParameters.java index 65506a479..9d56f23c4 100644 --- a/src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java +++ b/src/main/java/org/onap/policy/clamp/loop/deploy/DcaeDeployParameters.java @@ -21,16 +21,16 @@ * */ -package org.onap.clamp.loop.deploy; +package org.onap.policy.clamp.loop.deploy; import com.google.gson.JsonObject; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.loop.components.external.DcaeComponent; -import org.onap.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.loop.components.external.DcaeComponent; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; import org.yaml.snakeyaml.Yaml; /** @@ -63,8 +63,7 @@ public class DcaeDeployParameters { Object defaultValue = ((Map<String, Object>) elem.getValue()).get("default"); if (defaultValue != null) { addPropertyToNode(deployJsonBody, elem.getKey(), defaultValue); - } - else { + } else { deployJsonBody.addProperty(elem.getKey(), ""); } }); @@ -75,17 +74,13 @@ public class DcaeDeployParameters { private static void addPropertyToNode(JsonObject node, String key, Object value) { if (value instanceof String) { node.addProperty(key, (String) value); - } - else if (value instanceof Number) { + } else if (value instanceof Number) { node.addProperty(key, (Number) value); - } - else if (value instanceof Boolean) { + } else if (value instanceof Boolean) { node.addProperty(key, (Boolean) value); - } - else if (value instanceof Character) { + } else if (value instanceof Character) { node.addProperty(key, (Character) value); - } - else { + } else { node.addProperty(key, JsonUtils.GSON.toJson(value)); } } @@ -105,8 +100,7 @@ public class DcaeDeployParameters { generateDcaeDeployParameter(loop.getLoopTemplate().getBlueprint(), ((MicroServicePolicy) loop.getMicroServicePolicies().toArray()[0]).getName())); - } - else { + } else { LinkedHashMap<String, JsonObject> deploymentParamMap = init(loop); for (Map.Entry<String, JsonObject> mapElement : deploymentParamMap.entrySet()) { deployParamJson.add(mapElement.getKey(), mapElement.getValue()); diff --git a/src/main/java/org/onap/clamp/loop/log/LogType.java b/src/main/java/org/onap/policy/clamp/loop/log/LogType.java index 13d9dccf8..50f6571d6 100644 --- a/src/main/java/org/onap/clamp/loop/log/LogType.java +++ b/src/main/java/org/onap/policy/clamp/loop/log/LogType.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.log; +package org.onap.policy.clamp.loop.log; public enum LogType { INFO, WARNING, ERROR; diff --git a/src/main/java/org/onap/clamp/loop/log/LoopLog.java b/src/main/java/org/onap/policy/clamp/loop/log/LoopLog.java index e49598879..00f7e1f41 100644 --- a/src/main/java/org/onap/clamp/loop/log/LoopLog.java +++ b/src/main/java/org/onap/policy/clamp/loop/log/LoopLog.java @@ -21,14 +21,12 @@ * */ -package org.onap.clamp.loop.log; +package org.onap.policy.clamp.loop.log; import com.google.gson.annotations.Expose; - import java.io.Serializable; import java.time.Instant; import java.time.temporal.ChronoUnit; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -40,8 +38,7 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; - -import org.onap.clamp.loop.Loop; +import org.onap.policy.clamp.loop.Loop; /** * This class holds the logs created by the Clamp Backend. The Instant is always diff --git a/src/main/java/org/onap/clamp/loop/log/LoopLogRepository.java b/src/main/java/org/onap/policy/clamp/loop/log/LoopLogRepository.java index 0b3c34ec0..df1f3919e 100644 --- a/src/main/java/org/onap/clamp/loop/log/LoopLogRepository.java +++ b/src/main/java/org/onap/policy/clamp/loop/log/LoopLogRepository.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.log; +package org.onap.policy.clamp.loop.log; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/loop/log/LoopLogService.java b/src/main/java/org/onap/policy/clamp/loop/log/LoopLogService.java index d02d0b278..a2f133f2f 100644 --- a/src/main/java/org/onap/clamp/loop/log/LoopLogService.java +++ b/src/main/java/org/onap/policy/clamp/loop/log/LoopLogService.java @@ -21,9 +21,9 @@ * */ -package org.onap.clamp.loop.log; +package org.onap.policy.clamp.loop.log; -import org.onap.clamp.loop.Loop; +import org.onap.policy.clamp.loop.Loop; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java b/src/main/java/org/onap/policy/clamp/loop/service/CsarServiceInstaller.java index c43f2cb6d..1429d73c2 100644 --- a/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java +++ b/src/main/java/org/onap/policy/clamp/loop/service/CsarServiceInstaller.java @@ -22,15 +22,15 @@ * */ -package org.onap.clamp.loop.service; +package org.onap.policy.clamp.loop.service; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; import java.util.Map.Entry; -import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; -import org.onap.clamp.clds.sdc.controller.installer.CsarHandler; -import org.onap.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; +import org.onap.policy.clamp.clds.sdc.controller.installer.CsarHandler; +import org.onap.policy.clamp.clds.util.JsonUtils; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.elements.queries.EntityQuery; import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; diff --git a/src/main/java/org/onap/clamp/loop/service/Service.java b/src/main/java/org/onap/policy/clamp/loop/service/Service.java index 338032a16..b7442abc5 100644 --- a/src/main/java/org/onap/clamp/loop/service/Service.java +++ b/src/main/java/org/onap/policy/clamp/loop/service/Service.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.service; +package org.onap.policy.clamp.loop.service; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -36,8 +36,8 @@ import javax.persistence.Transient; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.dao.model.jsontype.StringJsonUserType; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.dao.model.jsontype.StringJsonUserType; @Entity @Table(name = "services") @@ -158,9 +158,10 @@ public class Service implements Serializable { if (other.serviceUuid != null) { return false; } - } - else if (!serviceUuid.equals(other.serviceUuid)) { - return false; + } else { + if (!serviceUuid.equals(other.serviceUuid)) { + return false; + } } return true; } diff --git a/src/main/java/org/onap/clamp/loop/service/ServicesRepository.java b/src/main/java/org/onap/policy/clamp/loop/service/ServicesRepository.java index fe5ba8ed0..62596a08e 100644 --- a/src/main/java/org/onap/clamp/loop/service/ServicesRepository.java +++ b/src/main/java/org/onap/policy/clamp/loop/service/ServicesRepository.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.service; +package org.onap.policy.clamp.loop.service; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopElementModel.java index 70cdbe233..6eb3c7195 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopElementModel.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import com.google.gson.annotations.Expose; import java.io.Serializable; @@ -40,12 +40,12 @@ import javax.persistence.ManyToMany; import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.annotations.SortNatural; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.loop.common.AuditEntity; -import org.onap.clamp.policy.Policy; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.loop.common.AuditEntity; +import org.onap.policy.clamp.policy.Policy; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; /** * This class represents a micro service/operational/... model for a loop template. @@ -212,7 +212,7 @@ public class LoopElementModel extends AuditEntity implements Serializable { } /** - * @param shortName the shortName to set. + * * @param shortName the shortName to set. */ public void setShortName(String shortName) { this.shortName = shortName; @@ -255,11 +255,9 @@ public class LoopElementModel extends AuditEntity implements Serializable { public Policy createPolicyInstance(Loop loop, ToscaConverterWithDictionarySupport toscaConverter) { if (LoopElementModel.MICRO_SERVICE_TYPE.equals(this.getLoopElementType())) { return new MicroServicePolicy(loop, loop.getModelService(), this, toscaConverter); - } - else if (LoopElementModel.OPERATIONAL_POLICY_TYPE.equals(this.getLoopElementType())) { + } else if (LoopElementModel.OPERATIONAL_POLICY_TYPE.equals(this.getLoopElementType())) { return new OperationalPolicy(loop, loop.getModelService(), this, toscaConverter); - } - else { + } else { return null; } } @@ -288,8 +286,7 @@ public class LoopElementModel extends AuditEntity implements Serializable { if (other.name != null) { return false; } - } - else if (!name.equals(other.name)) { + } else if (!name.equals(other.name)) { return false; } return true; diff --git a/src/main/java/org/onap/clamp/loop/template/LoopElementModelsRepository.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopElementModelsRepository.java index 27b82189c..d9b879d0f 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopElementModelsRepository.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopElementModelsRepository.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTemplate.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplate.java index 6f896f3d4..ab7367aaf 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopTemplate.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplate.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import com.google.gson.annotations.Expose; import java.io.Serializable; @@ -39,8 +39,8 @@ import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.annotations.SortNatural; -import org.onap.clamp.loop.common.AuditEntity; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.common.AuditEntity; +import org.onap.policy.clamp.loop.service.Service; @Entity @Table(name = "loop_templates") @@ -223,7 +223,7 @@ public class LoopTemplate extends AuditEntity implements Serializable { * @param loopElementModel The loopElementModel to add */ public void addLoopElementModel(LoopElementModel loopElementModel) { - this.addLoopElementModel(loopElementModel,this.loopElementModelsUsed.size()); + this.addLoopElementModel(loopElementModel, this.loopElementModelsUsed.size()); } /** diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplateLoopElementModel.java index aca16bc04..c0b0c7d24 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplateLoopElementModel.java @@ -21,12 +21,10 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import com.google.gson.annotations.Expose; - import java.io.Serializable; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.EmbeddedId; diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModelId.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplateLoopElementModelId.java index cac5f088a..9da8272bd 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModelId.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplateLoopElementModelId.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import com.google.gson.annotations.Expose; import java.io.Serializable; diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplatesRepository.java index 07f304de7..3993dee34 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplatesRepository.java @@ -21,10 +21,9 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import java.util.List; - import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTemplatesService.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplatesService.java index 29382137e..974cf3b5c 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopTemplatesService.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopTemplatesService.java @@ -21,10 +21,10 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import java.util.List; -import org.onap.clamp.clds.sdc.controller.installer.ChainGenerator; +import org.onap.policy.clamp.clds.sdc.controller.installer.ChainGenerator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/onap/clamp/loop/template/LoopType.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopType.java index ccbc62a83..eacfecb5e 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopType.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopType.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; /** * Enums for AllowedLoopType in LoopTemplate enity. diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTypeConvertor.java b/src/main/java/org/onap/policy/clamp/loop/template/LoopTypeConvertor.java index 0b05613cb..81ca18d57 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopTypeConvertor.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/LoopTypeConvertor.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import java.util.stream.Stream; import javax.persistence.AttributeConverter; diff --git a/src/main/java/org/onap/clamp/loop/template/PolicyModel.java b/src/main/java/org/onap/policy/clamp/loop/template/PolicyModel.java index 3f45d0551..2414377d7 100644 --- a/src/main/java/org/onap/clamp/loop/template/PolicyModel.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/PolicyModel.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; @@ -38,9 +38,9 @@ import javax.persistence.Table; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; -import org.onap.clamp.dao.model.jsontype.StringJsonUserType; -import org.onap.clamp.loop.common.AuditEntity; -import org.onap.clamp.util.SemanticVersioning; +import org.onap.policy.clamp.dao.model.jsontype.StringJsonUserType; +import org.onap.policy.clamp.loop.common.AuditEntity; +import org.onap.policy.clamp.util.SemanticVersioning; /** * This class represents the policy model tosca revision that we can have to a diff --git a/src/main/java/org/onap/clamp/loop/template/PolicyModelId.java b/src/main/java/org/onap/policy/clamp/loop/template/PolicyModelId.java index c4dd1933b..2591bd174 100644 --- a/src/main/java/org/onap/clamp/loop/template/PolicyModelId.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/PolicyModelId.java @@ -21,10 +21,9 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import com.google.gson.annotations.Expose; - import java.io.Serializable; public class PolicyModelId implements Serializable { diff --git a/src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java b/src/main/java/org/onap/policy/clamp/loop/template/PolicyModelsRepository.java index a76e386b5..6ff7e3d0c 100644 --- a/src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/PolicyModelsRepository.java @@ -21,10 +21,9 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import java.util.List; - import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java b/src/main/java/org/onap/policy/clamp/loop/template/PolicyModelsService.java index a1b8f7cf2..8670ab73e 100644 --- a/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java +++ b/src/main/java/org/onap/policy/clamp/loop/template/PolicyModelsService.java @@ -21,17 +21,17 @@ * */ -package org.onap.clamp.loop.template; +package org.onap.policy.clamp.loop.template; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.onap.clamp.clds.tosca.ToscaSchemaConstants; -import org.onap.clamp.clds.tosca.ToscaYamlToJsonConvertor; -import org.onap.clamp.policy.pdpgroup.PdpGroup; -import org.onap.clamp.util.SemanticVersioning; +import org.onap.policy.clamp.clds.tosca.ToscaSchemaConstants; +import org.onap.policy.clamp.clds.tosca.ToscaYamlToJsonConvertor; +import org.onap.policy.clamp.policy.pdpgroup.PdpGroup; +import org.onap.policy.clamp.util.SemanticVersioning; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; @@ -100,7 +100,7 @@ public class PolicyModelsService { public PolicyModel updatePolicyModelTosca(String policyModelType, String policyModelVersion, String policyModelTosca) { JsonObject jsonObject = toscaYamlToJsonConvertor.validateAndConvertToJson(policyModelTosca); - PolicyModel thePolicyModel = getPolicyModelByType(policyModelType, policyModelVersion); + PolicyModel thePolicyModel = getPolicyModel(policyModelType, policyModelVersion); thePolicyModel.setPolicyAcronym(toscaYamlToJsonConvertor.getValueFromMetadata(jsonObject, ToscaSchemaConstants.METADATA_ACRONYM)); thePolicyModel.setPolicyModelTosca(policyModelTosca); @@ -123,10 +123,6 @@ public class PolicyModelsService { return policyModelsRepository.findByPolicyModelType(type); } - public PolicyModel getPolicyModelByType(String type, String version) { - return policyModelsRepository.findById(new PolicyModelId(type, version)).orElse(null); - } - /** * Retrieves the Tosca model Yaml string. * @@ -146,7 +142,7 @@ public class PolicyModelsService { */ @Transactional(propagation = Propagation.REQUIRES_NEW) public PolicyModel savePolicyModelInNewTransaction(PolicyModel policyModel) { - return policyModelsRepository.saveAndFlush(policyModel); + return policyModelsRepository.saveAndFlush(policyModel); } /** diff --git a/src/main/java/org/onap/clamp/policy/Policy.java b/src/main/java/org/onap/policy/clamp/policy/Policy.java index d84f2c8a0..801183cab 100644 --- a/src/main/java/org/onap/clamp/policy/Policy.java +++ b/src/main/java/org/onap/policy/clamp/policy/Policy.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.policy; +package org.onap.policy.clamp.policy; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -43,12 +43,12 @@ import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; import org.json.JSONObject; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.dao.model.jsontype.StringJsonUserType; -import org.onap.clamp.loop.common.AuditEntity; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.dao.model.jsontype.StringJsonUserType; +import org.onap.policy.clamp.loop.common.AuditEntity; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.PolicyModel; import org.yaml.snakeyaml.Yaml; @MappedSuperclass diff --git a/src/main/java/org/onap/clamp/policy/PolicyService.java b/src/main/java/org/onap/policy/clamp/policy/PolicyService.java index ae15f86da..35ffa2443 100644 --- a/src/main/java/org/onap/clamp/policy/PolicyService.java +++ b/src/main/java/org/onap/policy/clamp/policy/PolicyService.java @@ -21,12 +21,11 @@ * */ -package org.onap.clamp.policy; +package org.onap.policy.clamp.policy; import java.util.List; import java.util.Set; - -import org.onap.clamp.loop.Loop; +import org.onap.policy.clamp.loop.Loop; public interface PolicyService<T extends Policy> { diff --git a/src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java b/src/main/java/org/onap/policy/clamp/policy/downloader/PolicyEngineController.java index 0c3f677a1..569678dc7 100644 --- a/src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java +++ b/src/main/java/org/onap/policy/clamp/policy/downloader/PolicyEngineController.java @@ -21,16 +21,14 @@ * */ -package org.onap.clamp.policy.downloader; +package org.onap.policy.clamp.policy.downloader; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; - import java.time.Instant; - import org.json.simple.parser.ParseException; -import org.onap.clamp.clds.client.PolicyEngineServices; -import org.onap.clamp.loop.template.PolicyModelsRepository; +import org.onap.policy.clamp.clds.client.PolicyEngineServices; +import org.onap.policy.clamp.loop.template.PolicyModelsRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicy.java index 77627a31a..2e5db8e24 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java +++ b/src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicy.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.policy.microservice; +package org.onap.policy.clamp.policy.microservice; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; @@ -37,13 +37,13 @@ import javax.persistence.Table; import org.apache.commons.lang3.RandomStringUtils; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.dao.model.jsontype.StringJsonUserType; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.policy.Policy; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.dao.model.jsontype.StringJsonUserType; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.policy.Policy; @Entity @Table(name = "micro_service_policies") @@ -267,8 +267,7 @@ public class MicroServicePolicy extends Policy implements Serializable { if (other.name != null) { return false; } - } - else if (!name.equals(other.name)) { + } else if (!name.equals(other.name)) { return false; } return true; diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyRepository.java b/src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicyRepository.java index 38b310ce8..2ce2c4f17 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyRepository.java +++ b/src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicyRepository.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.policy.microservice; +package org.onap.policy.clamp.policy.microservice; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java b/src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicyService.java index 060e79a63..b9871049e 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java +++ b/src/main/java/org/onap/policy/clamp/policy/microservice/MicroServicePolicyService.java @@ -21,14 +21,14 @@ * */ -package org.onap.clamp.policy.microservice; +package org.onap.policy.clamp.policy.microservice; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.policy.PolicyService; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.policy.PolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicy.java index 4b052427f..5b29f319c 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java +++ b/src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicy.java @@ -22,7 +22,7 @@ * */ -package org.onap.clamp.policy.operational; +package org.onap.policy.clamp.policy.operational; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -41,13 +41,13 @@ import javax.persistence.Transient; import org.apache.commons.lang3.RandomStringUtils; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.dao.model.jsontype.StringJsonUserType; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.policy.Policy; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.dao.model.jsontype.StringJsonUserType; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.policy.Policy; @Entity @Table(name = "operational_policies") diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepository.java b/src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepository.java index c0a6e12cd..b0a33669a 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepository.java +++ b/src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepository.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.policy.operational; +package org.onap.policy.clamp.policy.operational; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java index 0381f0a2a..8a1bb1abf 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java +++ b/src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java @@ -22,22 +22,20 @@ * */ -package org.onap.clamp.policy.operational; +package org.onap.policy.clamp.policy.operational; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; - import java.io.IOException; import java.util.Map; import java.util.Map.Entry; import java.util.Set; - -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.service.Service; public class OperationalPolicyRepresentationBuilder { @@ -57,7 +55,7 @@ public class OperationalPolicyRepresentationBuilder { public static final String TYPE_ARRAY = "array"; private OperationalPolicyRepresentationBuilder() { - throw new IllegalStateException("This is Utility class, not supposed to be initiated."); + throw new IllegalStateException("This is Utility class, not supposed to be initiated."); } /** @@ -282,7 +280,7 @@ public class OperationalPolicyRepresentationBuilder { jsonObject.add("artifact_version", createSchemaProperty( "artifact version", STRING, artifactVersion, "True", null)); jsonObject.add("mode", createCdsInputProperty( - "mode", STRING, "async" ,null)); + "mode", STRING, "async", null)); jsonObject.add("data", createDataProperty(inputs, workFlowName)); return jsonObject; } @@ -308,7 +306,7 @@ public class OperationalPolicyRepresentationBuilder { dataObj, workFlowName); } else { dataObj.add(entry.getKey(), - createCdsInputProperty(key, inputProperty.get(TYPE).getAsString(),null, + createCdsInputProperty(key, inputProperty.get(TYPE).getAsString(), null, entry.getValue().getAsJsonObject())); } } diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java b/src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyService.java index d5442e145..3f3f39b45 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java +++ b/src/main/java/org/onap/policy/clamp/policy/operational/OperationalPolicyService.java @@ -21,17 +21,17 @@ * */ -package org.onap.clamp.policy.operational; +package org.onap.policy.clamp.policy.operational; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.loop.template.PolicyModelsRepository; -import org.onap.clamp.policy.PolicyService; +import org.onap.policy.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.loop.template.PolicyModelsRepository; +import org.onap.policy.clamp.policy.PolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java b/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroup.java index a3cf4e053..9cbeec109 100644 --- a/src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java +++ b/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroup.java @@ -21,12 +21,11 @@ * */ -package org.onap.clamp.policy.pdpgroup; +package org.onap.policy.clamp.policy.pdpgroup; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; - import java.util.List; /** diff --git a/src/main/java/org/onap/clamp/policy/pdpgroup/PdpSubgroup.java b/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpSubgroup.java index 28de79abf..890f90775 100644 --- a/src/main/java/org/onap/clamp/policy/pdpgroup/PdpSubgroup.java +++ b/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpSubgroup.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.policy.pdpgroup; +package org.onap.policy.clamp.policy.pdpgroup; import com.google.gson.annotations.Expose; import java.util.List; diff --git a/src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java b/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PolicyModelKey.java index 707b3bd2f..df92bfdf9 100644 --- a/src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java +++ b/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PolicyModelKey.java @@ -21,10 +21,9 @@ * */ -package org.onap.clamp.policy.pdpgroup; +package org.onap.policy.clamp.policy.pdpgroup; import com.google.gson.annotations.Expose; - import java.io.Serializable; public class PolicyModelKey implements Serializable { diff --git a/src/main/java/org/onap/clamp/tosca/Dictionary.java b/src/main/java/org/onap/policy/clamp/tosca/Dictionary.java index cf514c4bd..4b01d6902 100644 --- a/src/main/java/org/onap/clamp/tosca/Dictionary.java +++ b/src/main/java/org/onap/policy/clamp/tosca/Dictionary.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.tosca; +package org.onap.policy.clamp.tosca; import com.google.gson.annotations.Expose; import java.io.Serializable; @@ -36,7 +36,7 @@ import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.Table; -import org.onap.clamp.loop.common.AuditEntity; +import org.onap.policy.clamp.loop.common.AuditEntity; /** * Represents Dictionary. diff --git a/src/main/java/org/onap/clamp/tosca/DictionaryElement.java b/src/main/java/org/onap/policy/clamp/tosca/DictionaryElement.java index 43a3106f5..ecf4b876c 100644 --- a/src/main/java/org/onap/clamp/tosca/DictionaryElement.java +++ b/src/main/java/org/onap/policy/clamp/tosca/DictionaryElement.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.tosca; +package org.onap.policy.clamp.tosca; import com.google.gson.annotations.Expose; import java.io.Serializable; @@ -33,7 +33,7 @@ import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.Table; -import org.onap.clamp.loop.common.AuditEntity; +import org.onap.policy.clamp.loop.common.AuditEntity; /** * Represents a Dictionary Item. diff --git a/src/main/java/org/onap/clamp/tosca/DictionaryElementsRepository.java b/src/main/java/org/onap/policy/clamp/tosca/DictionaryElementsRepository.java index 43f6f1d40..0bc50fe1a 100644 --- a/src/main/java/org/onap/clamp/tosca/DictionaryElementsRepository.java +++ b/src/main/java/org/onap/policy/clamp/tosca/DictionaryElementsRepository.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.tosca; +package org.onap.policy.clamp.tosca; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/onap/clamp/tosca/DictionaryRepository.java b/src/main/java/org/onap/policy/clamp/tosca/DictionaryRepository.java index ae8430d93..a2f417d17 100644 --- a/src/main/java/org/onap/clamp/tosca/DictionaryRepository.java +++ b/src/main/java/org/onap/policy/clamp/tosca/DictionaryRepository.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.tosca; +package org.onap.policy.clamp.tosca; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/org/onap/clamp/tosca/DictionaryService.java b/src/main/java/org/onap/policy/clamp/tosca/DictionaryService.java index 6172641a7..849d4baae 100644 --- a/src/main/java/org/onap/clamp/tosca/DictionaryService.java +++ b/src/main/java/org/onap/policy/clamp/tosca/DictionaryService.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.tosca; +package org.onap.policy.clamp.tosca; import com.google.common.collect.Sets; import java.util.List; diff --git a/src/main/java/org/onap/clamp/util/PassDecoder.java b/src/main/java/org/onap/policy/clamp/util/PassDecoder.java index b2e4ca2c5..f4b8ed4dc 100644 --- a/src/main/java/org/onap/clamp/util/PassDecoder.java +++ b/src/main/java/org/onap/policy/clamp/util/PassDecoder.java @@ -20,16 +20,13 @@ * =================================================================== */ -package org.onap.clamp.util; +package org.onap.policy.clamp.util; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; -import java.io.File; -import java.io.FileInputStream; import java.io.IOException; -import java.io.InputStream; import org.onap.aaf.cadi.Symm; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; /** * PassDecoder for decrypting the truststore and keystore password. diff --git a/src/main/java/org/onap/clamp/util/SemanticVersioning.java b/src/main/java/org/onap/policy/clamp/util/SemanticVersioning.java index 8852e2a4f..58367193f 100644 --- a/src/main/java/org/onap/clamp/util/SemanticVersioning.java +++ b/src/main/java/org/onap/policy/clamp/util/SemanticVersioning.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.util; +package org.onap.policy.clamp.util; /** * This class is the base class for object that requires semantic versioning. diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html index 96f5b9ca7..ab1d4fa1a 100644 --- a/src/main/resources/META-INF/resources/swagger.html +++ b/src/main/resources/META-INF/resources/swagger.html @@ -444,31 +444,31 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </li> <li><a href="#_paths">2. Paths</a> <ul class="sectlevel2"> -<li><a href="#_route143">2.1. GET /v1/healthcheck</a> +<li><a href="#_route107">2.1. GET /v1/healthcheck</a> <ul class="sectlevel3"> <li><a href="#_responses">2.1.1. Responses</a></li> <li><a href="#_produces">2.1.2. Produces</a></li> </ul> </li> -<li><a href="#_route144">2.2. GET /v1/user/getUser</a> +<li><a href="#_route108">2.2. GET /v1/user/getUser</a> <ul class="sectlevel3"> <li><a href="#_responses_2">2.2.1. Responses</a></li> <li><a href="#_produces_2">2.2.2. Produces</a></li> </ul> </li> -<li><a href="#_route142">2.3. GET /v2/clampInformation</a> +<li><a href="#_route106">2.3. GET /v2/clampInformation</a> <ul class="sectlevel3"> <li><a href="#_responses_3">2.3.1. Responses</a></li> <li><a href="#_produces_3">2.3.2. Produces</a></li> </ul> </li> -<li><a href="#_route127">2.4. GET /v2/dictionary</a> +<li><a href="#_route91">2.4. GET /v2/dictionary</a> <ul class="sectlevel3"> <li><a href="#_responses_4">2.4.1. Responses</a></li> <li><a href="#_produces_4">2.4.2. Produces</a></li> </ul> </li> -<li><a href="#_route130">2.5. PUT /v2/dictionary</a> +<li><a href="#_route94">2.5. PUT /v2/dictionary</a> <ul class="sectlevel3"> <li><a href="#_parameters">2.5.1. Parameters</a></li> <li><a href="#_responses_5">2.5.2. Responses</a></li> @@ -476,20 +476,20 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_5">2.5.4. Produces</a></li> </ul> </li> -<li><a href="#_route128">2.6. GET /v2/dictionary/secondary/names</a> +<li><a href="#_route92">2.6. GET /v2/dictionary/secondary/names</a> <ul class="sectlevel3"> <li><a href="#_responses_6">2.6.1. Responses</a></li> <li><a href="#_produces_6">2.6.2. Produces</a></li> </ul> </li> -<li><a href="#_route129">2.7. GET /v2/dictionary/{dictionaryName}</a> +<li><a href="#_route93">2.7. GET /v2/dictionary/{dictionaryName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_2">2.7.1. Parameters</a></li> <li><a href="#_responses_7">2.7.2. Responses</a></li> <li><a href="#_produces_7">2.7.3. Produces</a></li> </ul> </li> -<li><a href="#_route131">2.8. PUT /v2/dictionary/{name}</a> +<li><a href="#_route95">2.8. PUT /v2/dictionary/{name}</a> <ul class="sectlevel3"> <li><a href="#_parameters_3">2.8.1. Parameters</a></li> <li><a href="#_responses_8">2.8.2. Responses</a></li> @@ -497,28 +497,28 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_8">2.8.4. Produces</a></li> </ul> </li> -<li><a href="#_route132">2.9. DELETE /v2/dictionary/{name}</a> +<li><a href="#_route96">2.9. DELETE /v2/dictionary/{name}</a> <ul class="sectlevel3"> <li><a href="#_parameters_4">2.9.1. Parameters</a></li> <li><a href="#_responses_9">2.9.2. Responses</a></li> <li><a href="#_produces_9">2.9.3. Produces</a></li> </ul> </li> -<li><a href="#_route133">2.10. DELETE /v2/dictionary/{name}/elements/{shortName}</a> +<li><a href="#_route97">2.10. DELETE /v2/dictionary/{name}/elements/{shortName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_5">2.10.1. Parameters</a></li> <li><a href="#_responses_10">2.10.2. Responses</a></li> <li><a href="#_produces_10">2.10.3. Produces</a></li> </ul> </li> -<li><a href="#_route124">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a> +<li><a href="#_route88">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a> <ul class="sectlevel3"> <li><a href="#_parameters_6">2.11.1. Parameters</a></li> <li><a href="#_responses_11">2.11.2. Responses</a></li> <li><a href="#_produces_11">2.11.3. Produces</a></li> </ul> </li> -<li><a href="#_route126">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a> +<li><a href="#_route90">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_7">2.12.1. Parameters</a></li> <li><a href="#_responses_12">2.12.2. Responses</a></li> @@ -526,82 +526,82 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_12">2.12.4. Produces</a></li> </ul> </li> -<li><a href="#_route122">2.13. PUT /v2/loop/delete/{loopName}</a> +<li><a href="#_route86">2.13. PUT /v2/loop/delete/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_8">2.13.1. Parameters</a></li> <li><a href="#_responses_13">2.13.2. Responses</a></li> </ul> </li> -<li><a href="#_route115">2.14. PUT /v2/loop/deploy/{loopName}</a> +<li><a href="#_route79">2.14. PUT /v2/loop/deploy/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_9">2.14.1. Parameters</a></li> <li><a href="#_responses_14">2.14.2. Responses</a></li> <li><a href="#_produces_13">2.14.3. Produces</a></li> </ul> </li> -<li><a href="#_route110">2.15. GET /v2/loop/getAllNames</a> +<li><a href="#_route74">2.15. GET /v2/loop/getAllNames</a> <ul class="sectlevel3"> <li><a href="#_responses_15">2.15.1. Responses</a></li> <li><a href="#_produces_14">2.15.2. Produces</a></li> </ul> </li> -<li><a href="#_route123">2.16. GET /v2/loop/getstatus/{loopName}</a> +<li><a href="#_route87">2.16. GET /v2/loop/getstatus/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_10">2.16.1. Parameters</a></li> <li><a href="#_responses_16">2.16.2. Responses</a></li> <li><a href="#_produces_15">2.16.3. Produces</a></li> </ul> </li> -<li><a href="#_route116">2.17. PUT /v2/loop/refreshMicroServicePolicyJsonSchema/{loopName}/{microServicePolicyName}</a> +<li><a href="#_route80">2.17. PUT /v2/loop/refreshMicroServicePolicyJsonSchema/{loopName}/{microServicePolicyName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_11">2.17.1. Parameters</a></li> <li><a href="#_responses_17">2.17.2. Responses</a></li> <li><a href="#_produces_16">2.17.3. Produces</a></li> </ul> </li> -<li><a href="#_route117">2.18. PUT /v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}</a> +<li><a href="#_route81">2.18. PUT /v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_12">2.18.1. Parameters</a></li> <li><a href="#_responses_18">2.18.2. Responses</a></li> <li><a href="#_produces_17">2.18.3. Produces</a></li> </ul> </li> -<li><a href="#_route125">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}</a> +<li><a href="#_route89">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_13">2.19.1. Parameters</a></li> <li><a href="#_responses_19">2.19.2. Responses</a></li> <li><a href="#_produces_18">2.19.3. Produces</a></li> </ul> </li> -<li><a href="#_route120">2.20. PUT /v2/loop/restart/{loopName}</a> +<li><a href="#_route84">2.20. PUT /v2/loop/restart/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_14">2.20.1. Parameters</a></li> <li><a href="#_responses_20">2.20.2. Responses</a></li> <li><a href="#_produces_19">2.20.3. Produces</a></li> </ul> </li> -<li><a href="#_route119">2.21. PUT /v2/loop/stop/{loopName}</a> +<li><a href="#_route83">2.21. PUT /v2/loop/stop/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_15">2.21.1. Parameters</a></li> <li><a href="#_responses_21">2.21.2. Responses</a></li> <li><a href="#_produces_20">2.21.3. Produces</a></li> </ul> </li> -<li><a href="#_route121">2.22. PUT /v2/loop/submit/{loopName}</a> +<li><a href="#_route85">2.22. PUT /v2/loop/submit/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_16">2.22.1. Parameters</a></li> <li><a href="#_responses_22">2.22.2. Responses</a></li> <li><a href="#_produces_21">2.22.3. Produces</a></li> </ul> </li> -<li><a href="#_route118">2.23. PUT /v2/loop/undeploy/{loopName}</a> +<li><a href="#_route82">2.23. PUT /v2/loop/undeploy/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_17">2.23.1. Parameters</a></li> <li><a href="#_responses_23">2.23.2. Responses</a></li> <li><a href="#_produces_22">2.23.3. Produces</a></li> </ul> </li> -<li><a href="#_route112">2.24. POST /v2/loop/updateGlobalProperties/{loopName}</a> +<li><a href="#_route76">2.24. POST /v2/loop/updateGlobalProperties/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_18">2.24.1. Parameters</a></li> <li><a href="#_responses_24">2.24.2. Responses</a></li> @@ -609,7 +609,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_23">2.24.4. Produces</a></li> </ul> </li> -<li><a href="#_route114">2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}</a> +<li><a href="#_route78">2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_19">2.25.1. Parameters</a></li> <li><a href="#_responses_25">2.25.2. Responses</a></li> @@ -617,7 +617,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_24">2.25.4. Produces</a></li> </ul> </li> -<li><a href="#_route113">2.26. POST /v2/loop/updateOperationalPolicies/{loopName}</a> +<li><a href="#_route77">2.26. POST /v2/loop/updateOperationalPolicies/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_20">2.26.1. Parameters</a></li> <li><a href="#_responses_26">2.26.2. Responses</a></li> @@ -625,14 +625,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_25">2.26.4. Produces</a></li> </ul> </li> -<li><a href="#_route111">2.27. GET /v2/loop/{loopName}</a> +<li><a href="#_route75">2.27. GET /v2/loop/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_21">2.27.1. Parameters</a></li> <li><a href="#_responses_27">2.27.2. Responses</a></li> <li><a href="#_produces_26">2.27.3. Produces</a></li> </ul> </li> -<li><a href="#_route137">2.28. POST /v2/policyToscaModels</a> +<li><a href="#_route101">2.28. POST /v2/policyToscaModels</a> <ul class="sectlevel3"> <li><a href="#_parameters_22">2.28.1. Parameters</a></li> <li><a href="#_responses_28">2.28.2. Responses</a></li> @@ -640,27 +640,27 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_27">2.28.4. Produces</a></li> </ul> </li> -<li><a href="#_route134">2.29. GET /v2/policyToscaModels</a> +<li><a href="#_route98">2.29. GET /v2/policyToscaModels</a> <ul class="sectlevel3"> <li><a href="#_responses_29">2.29.1. Responses</a></li> <li><a href="#_produces_28">2.29.2. Produces</a></li> </ul> </li> -<li><a href="#_route136">2.30. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a> +<li><a href="#_route100">2.30. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a> <ul class="sectlevel3"> <li><a href="#_parameters_23">2.30.1. Parameters</a></li> <li><a href="#_responses_30">2.30.2. Responses</a></li> <li><a href="#_produces_29">2.30.3. Produces</a></li> </ul> </li> -<li><a href="#_route135">2.31. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a> +<li><a href="#_route99">2.31. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a> <ul class="sectlevel3"> <li><a href="#_parameters_24">2.31.1. Parameters</a></li> <li><a href="#_responses_31">2.31.2. Responses</a></li> <li><a href="#_produces_30">2.31.3. Produces</a></li> </ul> </li> -<li><a href="#_route138">2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a> +<li><a href="#_route102">2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a> <ul class="sectlevel3"> <li><a href="#_parameters_25">2.32.1. Parameters</a></li> <li><a href="#_responses_32">2.32.2. Responses</a></li> @@ -668,19 +668,19 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_31">2.32.4. Produces</a></li> </ul> </li> -<li><a href="#_route139">2.33. GET /v2/templates</a> +<li><a href="#_route103">2.33. GET /v2/templates</a> <ul class="sectlevel3"> <li><a href="#_responses_33">2.33.1. Responses</a></li> <li><a href="#_produces_32">2.33.2. Produces</a></li> </ul> </li> -<li><a href="#_route141">2.34. GET /v2/templates/names</a> +<li><a href="#_route105">2.34. GET /v2/templates/names</a> <ul class="sectlevel3"> <li><a href="#_responses_34">2.34.1. Responses</a></li> <li><a href="#_produces_33">2.34.2. Produces</a></li> </ul> </li> -<li><a href="#_route140">2.35. GET /v2/templates/{templateName}</a> +<li><a href="#_route104">2.35. GET /v2/templates/{templateName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_26">2.35.1. Parameters</a></li> <li><a href="#_responses_35">2.35.2. Responses</a></li> @@ -723,13 +723,13 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <div class="sect2"> <h3 id="_version_information"><a class="anchor" href="#_version_information"></a><a class="link" href="#_version_information">1.1. Version information</a></h3> <div class="paragraph"> -<p><em>Version</em> : 5.1.0-SNAPSHOT</p> +<p><em>Version</em> : 5.1.5-SNAPSHOT</p> </div> </div> <div class="sect2"> <h3 id="_uri_scheme"><a class="anchor" href="#_uri_scheme"></a><a class="link" href="#_uri_scheme">1.2. URI scheme</a></h3> <div class="paragraph"> -<p><em>Host</em> : localhost:43065<br> +<p><em>Host</em> : localhost:38837<br> <em>BasePath</em> : /restservices/clds/<br> <em>Schemes</em> : HTTP</p> </div> @@ -740,7 +740,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <h2 id="_paths"><a class="anchor" href="#_paths"></a><a class="link" href="#_paths">2. Paths</a></h2> <div class="sectionbody"> <div class="sect2"> -<h3 id="_route143"><a class="anchor" href="#_route143"></a><a class="link" href="#_route143">2.1. GET /v1/healthcheck</a></h3> +<h3 id="_route107"><a class="anchor" href="#_route107"></a><a class="link" href="#_route107">2.1. GET /v1/healthcheck</a></h3> <div class="sect3"> <h4 id="_responses"><a class="anchor" href="#_responses"></a><a class="link" href="#_responses">2.1.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -777,7 +777,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route144"><a class="anchor" href="#_route144"></a><a class="link" href="#_route144">2.2. GET /v1/user/getUser</a></h3> +<h3 id="_route108"><a class="anchor" href="#_route108"></a><a class="link" href="#_route108">2.2. GET /v1/user/getUser</a></h3> <div class="sect3"> <h4 id="_responses_2"><a class="anchor" href="#_responses_2"></a><a class="link" href="#_responses_2">2.2.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -811,7 +811,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route142"><a class="anchor" href="#_route142"></a><a class="link" href="#_route142">2.3. GET /v2/clampInformation</a></h3> +<h3 id="_route106"><a class="anchor" href="#_route106"></a><a class="link" href="#_route106">2.3. GET /v2/clampInformation</a></h3> <div class="sect3"> <h4 id="_responses_3"><a class="anchor" href="#_responses_3"></a><a class="link" href="#_responses_3">2.3.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -848,7 +848,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route127"><a class="anchor" href="#_route127"></a><a class="link" href="#_route127">2.4. GET /v2/dictionary</a></h3> +<h3 id="_route91"><a class="anchor" href="#_route91"></a><a class="link" href="#_route91">2.4. GET /v2/dictionary</a></h3> <div class="sect3"> <h4 id="_responses_4"><a class="anchor" href="#_responses_4"></a><a class="link" href="#_responses_4">2.4.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -885,7 +885,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route130"><a class="anchor" href="#_route130"></a><a class="link" href="#_route130">2.5. PUT /v2/dictionary</a></h3> +<h3 id="_route94"><a class="anchor" href="#_route94"></a><a class="link" href="#_route94">2.5. PUT /v2/dictionary</a></h3> <div class="sect3"> <h4 id="_parameters"><a class="anchor" href="#_parameters"></a><a class="link" href="#_parameters">2.5.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -957,7 +957,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route128"><a class="anchor" href="#_route128"></a><a class="link" href="#_route128">2.6. GET /v2/dictionary/secondary/names</a></h3> +<h3 id="_route92"><a class="anchor" href="#_route92"></a><a class="link" href="#_route92">2.6. GET /v2/dictionary/secondary/names</a></h3> <div class="sect3"> <h4 id="_responses_6"><a class="anchor" href="#_responses_6"></a><a class="link" href="#_responses_6">2.6.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -994,7 +994,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route129"><a class="anchor" href="#_route129"></a><a class="link" href="#_route129">2.7. GET /v2/dictionary/{dictionaryName}</a></h3> +<h3 id="_route93"><a class="anchor" href="#_route93"></a><a class="link" href="#_route93">2.7. GET /v2/dictionary/{dictionaryName}</a></h3> <div class="sect3"> <h4 id="_parameters_2"><a class="anchor" href="#_parameters_2"></a><a class="link" href="#_parameters_2">2.7.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1056,7 +1056,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route131"><a class="anchor" href="#_route131"></a><a class="link" href="#_route131">2.8. PUT /v2/dictionary/{name}</a></h3> +<h3 id="_route95"><a class="anchor" href="#_route95"></a><a class="link" href="#_route95">2.8. PUT /v2/dictionary/{name}</a></h3> <div class="sect3"> <h4 id="_parameters_3"><a class="anchor" href="#_parameters_3"></a><a class="link" href="#_parameters_3">2.8.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1134,7 +1134,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route132"><a class="anchor" href="#_route132"></a><a class="link" href="#_route132">2.9. DELETE /v2/dictionary/{name}</a></h3> +<h3 id="_route96"><a class="anchor" href="#_route96"></a><a class="link" href="#_route96">2.9. DELETE /v2/dictionary/{name}</a></h3> <div class="sect3"> <h4 id="_parameters_4"><a class="anchor" href="#_parameters_4"></a><a class="link" href="#_parameters_4">2.9.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1193,7 +1193,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route133"><a class="anchor" href="#_route133"></a><a class="link" href="#_route133">2.10. DELETE /v2/dictionary/{name}/elements/{shortName}</a></h3> +<h3 id="_route97"><a class="anchor" href="#_route97"></a><a class="link" href="#_route97">2.10. DELETE /v2/dictionary/{name}/elements/{shortName}</a></h3> <div class="sect3"> <h4 id="_parameters_5"><a class="anchor" href="#_parameters_5"></a><a class="link" href="#_parameters_5">2.10.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1258,7 +1258,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route124"><a class="anchor" href="#_route124"></a><a class="link" href="#_route124">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a></h3> +<h3 id="_route88"><a class="anchor" href="#_route88"></a><a class="link" href="#_route88">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a></h3> <div class="sect3"> <h4 id="_parameters_6"><a class="anchor" href="#_parameters_6"></a><a class="link" href="#_parameters_6">2.11.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1332,7 +1332,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route126"><a class="anchor" href="#_route126"></a><a class="link" href="#_route126">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a></h3> +<h3 id="_route90"><a class="anchor" href="#_route90"></a><a class="link" href="#_route90">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a></h3> <div class="sect3"> <h4 id="_parameters_7"><a class="anchor" href="#_parameters_7"></a><a class="link" href="#_parameters_7">2.12.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1404,7 +1404,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route122"><a class="anchor" href="#_route122"></a><a class="link" href="#_route122">2.13. PUT /v2/loop/delete/{loopName}</a></h3> +<h3 id="_route86"><a class="anchor" href="#_route86"></a><a class="link" href="#_route86">2.13. PUT /v2/loop/delete/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_8"><a class="anchor" href="#_parameters_8"></a><a class="link" href="#_parameters_8">2.13.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1453,7 +1453,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route115"><a class="anchor" href="#_route115"></a><a class="link" href="#_route115">2.14. PUT /v2/loop/deploy/{loopName}</a></h3> +<h3 id="_route79"><a class="anchor" href="#_route79"></a><a class="link" href="#_route79">2.14. PUT /v2/loop/deploy/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_9"><a class="anchor" href="#_parameters_9"></a><a class="link" href="#_parameters_9">2.14.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1515,7 +1515,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route110"><a class="anchor" href="#_route110"></a><a class="link" href="#_route110">2.15. GET /v2/loop/getAllNames</a></h3> +<h3 id="_route74"><a class="anchor" href="#_route74"></a><a class="link" href="#_route74">2.15. GET /v2/loop/getAllNames</a></h3> <div class="sect3"> <h4 id="_responses_15"><a class="anchor" href="#_responses_15"></a><a class="link" href="#_responses_15">2.15.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1552,7 +1552,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route123"><a class="anchor" href="#_route123"></a><a class="link" href="#_route123">2.16. GET /v2/loop/getstatus/{loopName}</a></h3> +<h3 id="_route87"><a class="anchor" href="#_route87"></a><a class="link" href="#_route87">2.16. GET /v2/loop/getstatus/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_10"><a class="anchor" href="#_parameters_10"></a><a class="link" href="#_parameters_10">2.16.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1614,7 +1614,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route116"><a class="anchor" href="#_route116"></a><a class="link" href="#_route116">2.17. PUT /v2/loop/refreshMicroServicePolicyJsonSchema/{loopName}/{microServicePolicyName}</a></h3> +<h3 id="_route80"><a class="anchor" href="#_route80"></a><a class="link" href="#_route80">2.17. PUT /v2/loop/refreshMicroServicePolicyJsonSchema/{loopName}/{microServicePolicyName}</a></h3> <div class="sect3"> <h4 id="_parameters_11"><a class="anchor" href="#_parameters_11"></a><a class="link" href="#_parameters_11">2.17.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1682,7 +1682,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route117"><a class="anchor" href="#_route117"></a><a class="link" href="#_route117">2.18. PUT /v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}</a></h3> +<h3 id="_route81"><a class="anchor" href="#_route81"></a><a class="link" href="#_route81">2.18. PUT /v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}</a></h3> <div class="sect3"> <h4 id="_parameters_12"><a class="anchor" href="#_parameters_12"></a><a class="link" href="#_parameters_12">2.18.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1750,7 +1750,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route125"><a class="anchor" href="#_route125"></a><a class="link" href="#_route125">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}</a></h3> +<h3 id="_route89"><a class="anchor" href="#_route89"></a><a class="link" href="#_route89">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}</a></h3> <div class="sect3"> <h4 id="_parameters_13"><a class="anchor" href="#_parameters_13"></a><a class="link" href="#_parameters_13">2.19.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1830,7 +1830,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route120"><a class="anchor" href="#_route120"></a><a class="link" href="#_route120">2.20. PUT /v2/loop/restart/{loopName}</a></h3> +<h3 id="_route84"><a class="anchor" href="#_route84"></a><a class="link" href="#_route84">2.20. PUT /v2/loop/restart/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_14"><a class="anchor" href="#_parameters_14"></a><a class="link" href="#_parameters_14">2.20.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1892,7 +1892,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route119"><a class="anchor" href="#_route119"></a><a class="link" href="#_route119">2.21. PUT /v2/loop/stop/{loopName}</a></h3> +<h3 id="_route83"><a class="anchor" href="#_route83"></a><a class="link" href="#_route83">2.21. PUT /v2/loop/stop/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_15"><a class="anchor" href="#_parameters_15"></a><a class="link" href="#_parameters_15">2.21.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1954,7 +1954,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route121"><a class="anchor" href="#_route121"></a><a class="link" href="#_route121">2.22. PUT /v2/loop/submit/{loopName}</a></h3> +<h3 id="_route85"><a class="anchor" href="#_route85"></a><a class="link" href="#_route85">2.22. PUT /v2/loop/submit/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_16"><a class="anchor" href="#_parameters_16"></a><a class="link" href="#_parameters_16">2.22.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2016,7 +2016,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route118"><a class="anchor" href="#_route118"></a><a class="link" href="#_route118">2.23. PUT /v2/loop/undeploy/{loopName}</a></h3> +<h3 id="_route82"><a class="anchor" href="#_route82"></a><a class="link" href="#_route82">2.23. PUT /v2/loop/undeploy/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_17"><a class="anchor" href="#_parameters_17"></a><a class="link" href="#_parameters_17">2.23.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2078,7 +2078,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route112"><a class="anchor" href="#_route112"></a><a class="link" href="#_route112">2.24. POST /v2/loop/updateGlobalProperties/{loopName}</a></h3> +<h3 id="_route76"><a class="anchor" href="#_route76"></a><a class="link" href="#_route76">2.24. POST /v2/loop/updateGlobalProperties/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_18"><a class="anchor" href="#_parameters_18"></a><a class="link" href="#_parameters_18">2.24.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2156,7 +2156,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route114"><a class="anchor" href="#_route114"></a><a class="link" href="#_route114">2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}</a></h3> +<h3 id="_route78"><a class="anchor" href="#_route78"></a><a class="link" href="#_route78">2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_19"><a class="anchor" href="#_parameters_19"></a><a class="link" href="#_parameters_19">2.25.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2234,7 +2234,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route113"><a class="anchor" href="#_route113"></a><a class="link" href="#_route113">2.26. POST /v2/loop/updateOperationalPolicies/{loopName}</a></h3> +<h3 id="_route77"><a class="anchor" href="#_route77"></a><a class="link" href="#_route77">2.26. POST /v2/loop/updateOperationalPolicies/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_20"><a class="anchor" href="#_parameters_20"></a><a class="link" href="#_parameters_20">2.26.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2312,7 +2312,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route111"><a class="anchor" href="#_route111"></a><a class="link" href="#_route111">2.27. GET /v2/loop/{loopName}</a></h3> +<h3 id="_route75"><a class="anchor" href="#_route75"></a><a class="link" href="#_route75">2.27. GET /v2/loop/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_21"><a class="anchor" href="#_parameters_21"></a><a class="link" href="#_parameters_21">2.27.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2374,7 +2374,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route137"><a class="anchor" href="#_route137"></a><a class="link" href="#_route137">2.28. POST /v2/policyToscaModels</a></h3> +<h3 id="_route101"><a class="anchor" href="#_route101"></a><a class="link" href="#_route101">2.28. POST /v2/policyToscaModels</a></h3> <div class="sect3"> <h4 id="_parameters_22"><a class="anchor" href="#_parameters_22"></a><a class="link" href="#_parameters_22">2.28.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2446,7 +2446,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route134"><a class="anchor" href="#_route134"></a><a class="link" href="#_route134">2.29. GET /v2/policyToscaModels</a></h3> +<h3 id="_route98"><a class="anchor" href="#_route98"></a><a class="link" href="#_route98">2.29. GET /v2/policyToscaModels</a></h3> <div class="sect3"> <h4 id="_responses_29"><a class="anchor" href="#_responses_29"></a><a class="link" href="#_responses_29">2.29.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2483,7 +2483,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route136"><a class="anchor" href="#_route136"></a><a class="link" href="#_route136">2.30. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a></h3> +<h3 id="_route100"><a class="anchor" href="#_route100"></a><a class="link" href="#_route100">2.30. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a></h3> <div class="sect3"> <h4 id="_parameters_23"><a class="anchor" href="#_parameters_23"></a><a class="link" href="#_parameters_23">2.30.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2551,7 +2551,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route135"><a class="anchor" href="#_route135"></a><a class="link" href="#_route135">2.31. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a></h3> +<h3 id="_route99"><a class="anchor" href="#_route99"></a><a class="link" href="#_route99">2.31. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a></h3> <div class="sect3"> <h4 id="_parameters_24"><a class="anchor" href="#_parameters_24"></a><a class="link" href="#_parameters_24">2.31.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2619,7 +2619,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route138"><a class="anchor" href="#_route138"></a><a class="link" href="#_route138">2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a></h3> +<h3 id="_route102"><a class="anchor" href="#_route102"></a><a class="link" href="#_route102">2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a></h3> <div class="sect3"> <h4 id="_parameters_25"><a class="anchor" href="#_parameters_25"></a><a class="link" href="#_parameters_25">2.32.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2703,7 +2703,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route139"><a class="anchor" href="#_route139"></a><a class="link" href="#_route139">2.33. GET /v2/templates</a></h3> +<h3 id="_route103"><a class="anchor" href="#_route103"></a><a class="link" href="#_route103">2.33. GET /v2/templates</a></h3> <div class="sect3"> <h4 id="_responses_33"><a class="anchor" href="#_responses_33"></a><a class="link" href="#_responses_33">2.33.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2740,7 +2740,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route141"><a class="anchor" href="#_route141"></a><a class="link" href="#_route141">2.34. GET /v2/templates/names</a></h3> +<h3 id="_route105"><a class="anchor" href="#_route105"></a><a class="link" href="#_route105">2.34. GET /v2/templates/names</a></h3> <div class="sect3"> <h4 id="_responses_34"><a class="anchor" href="#_responses_34"></a><a class="link" href="#_responses_34">2.34.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2777,7 +2777,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route140"><a class="anchor" href="#_route140"></a><a class="link" href="#_route140">2.35. GET /v2/templates/{templateName}</a></h3> +<h3 id="_route104"><a class="anchor" href="#_route104"></a><a class="link" href="#_route104">2.35. GET /v2/templates/{templateName}</a></h3> <div class="sect3"> <h4 id="_parameters_26"><a class="anchor" href="#_parameters_26"></a><a class="link" href="#_parameters_26">2.35.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -3953,11 +3953,6 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td> </tr> <tr> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>legacy</strong><br> -<em>optional</em></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td> -</tr> -<tr> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopElementModel</strong><br> <em>optional</em></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loopelementmodel">LoopElementModel</a></p></td> @@ -4046,11 +4041,6 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td> </tr> <tr> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>legacy</strong><br> -<em>optional</em></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td> -</tr> -<tr> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loop</strong><br> <em>optional</em></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td> @@ -4207,7 +4197,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> <div id="footer"> <div id="footer-text"> -Last updated 2020-02-12 11:20:53 CET +Last updated 2020-12-10 09:38:32 CET </div> </div> </body> diff --git a/src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson b/src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson index 3fa78e040..04caffa99 100644 --- a/src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson +++ b/src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson @@ -20,4 +20,4 @@ * =================================================================== */ -class=org.onap.clamp.configuration.ClampGsonDataFormat
\ No newline at end of file +class=org.onap.policy.clamp.configuration.ClampGsonDataFormat
\ No newline at end of file diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties index 423c73e93..6b28cf7ef 100644 --- a/src/main/resources/application-noaaf.properties +++ b/src/main/resources/application-noaaf.properties @@ -173,7 +173,7 @@ clamp.config.security.permission.type.template=org.onap.clamp.clds.template clamp.config.security.permission.type.tosca=org.onap.clamp.clds.tosca #This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties clamp.config.security.permission.instance=dev -clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal +clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal, org.onap.aaf.cadi.principal.CachedBasicPrincipal ## Tosca converter clamp.config.tosca.converter.json.schema.templates=classpath:/clds/tosca-converter/templates.json diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index de32098fa..1b5a26d0a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -176,13 +176,13 @@ clamp.config.security.permission.type.template=org.onap.clamp.clds.template clamp.config.security.permission.type.tosca=org.onap.clamp.clds.tosca #This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties clamp.config.security.permission.instance=dev -clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal +clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal, org.onap.aaf.cadi.principal.CachedBasicPrincipal #AAF related parameters clamp.config.cadi.cadiLoglevel=DEBUG clamp.config.cadi.cadiLatitude=10 clamp.config.cadi.cadiLongitude=10 -clamp.config.cadi.aafLocateUrl=https://aaf-locate:8095 +clamp.config.cadi.aafLocateUrl=https://aaf-locate:30251 clamp.config.cadi.oauthTokenUrl= https://AAF_LOCATE_URL/locate/onap.org.osaaf.aaf.token:2.1/token clamp.config.cadi.oauthIntrospectUrll=https://AAF_LOCATE_URL/locate/onap.org.osaaf.aaf.introspect:2.1/introspect clamp.config.cadi.aafEnv=DEV diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml index 505ea30d9..c43f3297d 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -6,20 +6,20 @@ <removeHeaders pattern="*" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=getLoopNames()" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET All Loop names FAILED: ${exception.stacktrace}" /> @@ -33,26 +33,26 @@ </doTry> </route> </get> - <get uri="/v2/loop/{loopName}" outType="org.onap.clamp.loop.Loop" + <get uri="/v2/loop/{loopName}" outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Loop')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Loop')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=getLoop(${header.loopName})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET Loop request failed for loop: ${header.loopName}, ${exception.stacktrace}" /> @@ -68,32 +68,32 @@ </get> <post uri="/v2/loop/updateGlobalProperties/{loopName}" - type="com.google.gson.JsonObject" consumes="application/json" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + type="com.google.gson.JsonObject" consumes="application/json" + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <setHeader headerName="GlobalPropertiesJson"> <simple>${body}</simple> </setHeader> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${header.GlobalPropertiesJson})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${header.GlobalPropertiesJson})" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="UPDATE Global properties FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> @@ -108,36 +108,36 @@ </route> </post> <post uri="/v2/loop/updateOperationalPolicies/{loopName}" - type="com.google.gson.JsonArray" consumes="application/json" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + type="com.google.gson.JsonArray" consumes="application/json" + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update operational policies')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update operational policies')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <setHeader headerName="OperationalPoliciesArray"> <simple>${body}</simple> </setHeader> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policies UPDATED','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('Operational policies UPDATED','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="UPDATE Operational policies FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UPDATE Operational policies request FAILED, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('UPDATE Operational policies request FAILED, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> @@ -150,39 +150,39 @@ </route> </post> <post uri="/v2/loop/updateMicroservicePolicy/{loopName}" - type="org.onap.clamp.policy.microservice.MicroServicePolicy" + type="org.onap.policy.clamp.policy.microservice.MicroServicePolicy" consumes="application/json" - outType="org.onap.clamp.policy.microservice.MicroServicePolicy" + outType="org.onap.policy.clamp.policy.microservice.MicroServicePolicy" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update Microservice policies')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update Microservice policies')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <setProperty propertyName="MicroServicePolicyObject"> <simple>${body}</simple> </setProperty> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${exchangeProperty[MicroServicePolicyObject]})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${exchangeProperty[MicroServicePolicyObject]})" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="UPDATE MicroService policy FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UPDATE MicroService policy request FAILED, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('UPDATE MicroService policy request FAILED, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -194,7 +194,7 @@ </route> </post> <put uri="/v2/loop/deploy/{loopName}" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> @@ -204,32 +204,32 @@ <simple resultType="java.lang.Boolean">true</simple> </setProperty> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE DEPLOY request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE DEPLOY request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE DEPLOY request','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DCAE DEPLOY request','INFO',${exchangeProperty[loopObject]})" /> <to uri="direct:deploy-loop" /> <log loggingLevel="INFO" message="DEPLOY request successfully executed for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="DEPLOY request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -241,38 +241,38 @@ </route> </put> <put uri="/v2/loop/refreshMicroServicePolicyJsonSchema/{loopName}/{microServicePolicyName}" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName|microServicePolicyName" /> <doTry> <log loggingLevel="INFO" message="Refresh Micro Service Policy UI for loop: ${header.loopName} and ${header.microServicePolicyName}" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH Micro Service Policy UI request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH Micro Service Policy UI request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.cds.CdsDataInstaller?method=updateCdsServiceProperties(${exchangeProperty[loopObject].getModelService()})" /> + uri="bean:org.onap.policy.clamp.loop.cds.CdsDataInstaller?method=updateCdsServiceProperties(${exchangeProperty[loopObject].getModelService()})" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=refreshMicroServicePolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.microServicePolicyName})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=refreshMicroServicePolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.microServicePolicyName})" /> <log loggingLevel="INFO" message="REFRESH Micro Service policy request successfully executed for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Micro Service policy request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('REFRESH Micro Service policy request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -284,38 +284,38 @@ </route> </put> <put uri="/v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName|operationalPolicyName" /> <doTry> <log loggingLevel="INFO" message="Refresh Operational Policy UI for loop: ${header.loopName} and ${header.operationalPolicyName}" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH Operational Policy UI request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH Operational Policy UI request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.cds.CdsDataInstaller?method=updateCdsServiceProperties(${exchangeProperty[loopObject].getModelService()})" /> + uri="bean:org.onap.policy.clamp.loop.cds.CdsDataInstaller?method=updateCdsServiceProperties(${exchangeProperty[loopObject].getModelService()})" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=refreshOperationalPolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.operationalPolicyName})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=refreshOperationalPolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.operationalPolicyName})" /> <log loggingLevel="INFO" message="REFRESH operational policy request successfully executed for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH operational policy request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('REFRESH operational policy request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -327,7 +327,7 @@ </route> </put> <put uri="/v2/loop/undeploy/{loopName}" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> @@ -337,31 +337,31 @@ <simple resultType="java.lang.Boolean">true</simple> </setProperty> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE UNDEPLOY request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE UNDEPLOY request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})" /> <to uri="direct:undeploy-loop" /> <log loggingLevel="INFO" message="UNDEPLOY request successfully executed for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="UNDEPLOY request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -373,7 +373,7 @@ </route> </put> <put uri="/v2/loop/stop/{loopName}" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> @@ -383,31 +383,31 @@ <simple resultType="java.lang.Boolean">true</simple> </setProperty> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'STOP request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*,'STOP request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('STOP request','INFO',${exchangeProperty[loopObject]})" /> <to uri="direct:remove-all-policy-from-active-pdp-group" /> <log loggingLevel="INFO" message="STOP request successfully executed for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="STOP request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -419,7 +419,7 @@ </route> </put> <put uri="/v2/loop/restart/{loopName}" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> @@ -429,32 +429,32 @@ <simple resultType="java.lang.Boolean">true</simple> </setProperty> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'RESTART request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*,'RESTART request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('RESTART request','INFO',${exchangeProperty[loopObject]})" /> <to uri="direct:add-all-to-active-pdp-group" /> <log loggingLevel="INFO" message="RESTART request successfully executed for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('RESTART request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="RESTART request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -466,7 +466,7 @@ </route> </put> <put uri="/v2/loop/submit/{loopName}" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> @@ -476,12 +476,12 @@ <simple resultType="java.lang.Boolean">true</simple> </setProperty> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'POLICY SUBMIT request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'POLICY SUBMIT request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY SUBMIT request','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('POLICY SUBMIT request','INFO',${exchangeProperty[loopObject]})" /> <setProperty propertyName="raiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">false</simple> </setProperty> @@ -529,20 +529,20 @@ <log loggingLevel="INFO" message="SUBMIT request successfully executed for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="SUBMIT request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -563,12 +563,12 @@ <simple resultType="java.lang.Boolean">true</simple> </setProperty> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" /> <to uri="direct:undeploy-loop" /> <to uri="direct:remove-all-policy-from-active-pdp-group" /> <log loggingLevel="INFO" @@ -602,22 +602,22 @@ <to uri="direct:delete-policy" /> </split> <to - uri="bean:org.onap.clamp.loop.LoopController?method=deleteLoop(${header.loopName})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=deleteLoop(${header.loopName})" /> <log loggingLevel="INFO" message="DELETE request successfully executed for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="DELETE request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -629,38 +629,38 @@ </route> </put> <get uri="/v2/loop/getstatus/{loopName}" - outType="org.onap.clamp.loop.Loop" produces="application/json"> + outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName" /> <doTry> <log loggingLevel="INFO" message="GET STATUS request for loop: ${header.loopName}" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET STATUS request')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET STATUS request')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" /> <to uri="direct:update-policy-status-for-loop" /> <to uri="direct:update-dcae-status-for-loop" /> <to uri="direct:update-loop-state" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET STATUS request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" /> </doCatch> <doFinally> <setBody> @@ -674,32 +674,32 @@ </route> </get> - <put uri="/v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.clamp.loop.Loop" produces="application/json"> + <put uri="/v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add operational Policy')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add operational Policy')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=addOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=addOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="ADD operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -711,14 +711,14 @@ </doTry> </route> </put> - <put uri="/v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}" outType="org.onap.clamp.loop.Loop" produces="application/json"> + <put uri="/v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}" outType="org.onap.policy.clamp.loop.Loop" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion|policyName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REMOVE operational Policy')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REMOVE operational Policy')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> <setProperty propertyName="policyName"> <simple>${header.policyName}</simple> @@ -735,22 +735,22 @@ </setProperty> <to uri="direct:delete-policy" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=removeOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=removeOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="REMOVE operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -762,33 +762,33 @@ </route> </put> <post - uri="/v2/loop/create/{loopName}?templateName={templateName}" - outType="org.onap.clamp.loop.Loop" consumes="application/json" - produces="application/json"> + uri="/v2/loop/create/{loopName}?templateName={templateName}" + outType="org.onap.policy.clamp.loop.Loop" consumes="application/json" + produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="loopName|templateName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Create Loop')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Create Loop')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to - uri="bean:org.onap.clamp.loop.LoopController?method=createLoop(${header.loopName}, ${header.templateName})" /> + uri="bean:org.onap.policy.clamp.loop.LoopController?method=createLoop(${header.loopName}, ${header.templateName})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="CREATE Loop from Template request failed for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('CREATE Loop from template request failed','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('CREATE Loop from template request failed','ERROR',${exchangeProperty[loopObject]})" /> <setHeader headerName="CamelHttpResponseCode"> <constant>500</constant> </setHeader> @@ -800,25 +800,25 @@ </route> </post> <get uri="/v2/dictionary" - outType="org.onap.clamp.tosca.Dictionary" produces="application/json"> + outType="org.onap.policy.clamp.tosca.Dictionary" produces="application/json"> <route> <removeHeaders pattern="*" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionaries')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionaries')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> <to - uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllDictionaries()" /> + uri="bean:org.onap.policy.clamp.tosca.DictionaryService?method=getAllDictionaries()" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET Dictionary request failed: ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -838,20 +838,20 @@ <removeHeaders pattern="*" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Secondary Dictionary Level Names')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Secondary Dictionary Level Names')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> <to - uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllSecondaryLevelDictionaryNames()" /> + uri="bean:org.onap.policy.clamp.tosca.DictionaryService?method=getAllSecondaryLevelDictionaryNames()" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET Dictionary request failed: ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -865,26 +865,26 @@ </route> </get> <get uri="/v2/dictionary/{dictionaryName}" - outType="org.onap.clamp.tosca.Dictionary" produces="application/json"> + outType="org.onap.policy.clamp.tosca.Dictionary" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="dictionaryName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionary Elements for a Dictionary Name')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionary Elements for a Dictionary Name')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> <to - uri="bean:org.onap.clamp.tosca.DictionaryService?method=getDictionary(${header.dictionaryName})" /> + uri="bean:org.onap.policy.clamp.tosca.DictionaryService?method=getDictionary(${header.dictionaryName})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET Dictionary request failed for: ${header.dictionaryName}, ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -897,29 +897,29 @@ </doTry> </route> </get> - <put uri="/v2/dictionary" type="org.onap.clamp.tosca.Dictionary" - outType="org.onap.clamp.tosca.Dictionary" consumes="application/json" - produces="application/json"> + <put uri="/v2/dictionary" type="org.onap.policy.clamp.tosca.Dictionary" + outType="org.onap.policy.clamp.tosca.Dictionary" consumes="application/json" + produces="application/json"> <route> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> <setProperty propertyName="DictionaryObject"> <simple>${body}</simple> </setProperty> <to - uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionary(${exchangeProperty[DictionaryObject]})" /> + uri="bean:org.onap.policy.clamp.tosca.DictionaryService?method=saveOrUpdateDictionary(${exchangeProperty[DictionaryObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="PUT Dictionary request failed for: ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -934,30 +934,30 @@ </put> <put uri="/v2/dictionary/{name}" - type="org.onap.clamp.tosca.Dictionary" - outType="org.onap.clamp.tosca.Dictionary" consumes="application/json" - produces="application/json"> + type="org.onap.policy.clamp.tosca.Dictionary" + outType="org.onap.policy.clamp.tosca.Dictionary" consumes="application/json" + produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="name" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> <setProperty propertyName="DictionaryObject"> <simple>${body}</simple> </setProperty> <to - uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionaryElement(${header.name}, ${exchangeProperty[DictionaryObject]})" /> + uri="bean:org.onap.policy.clamp.tosca.DictionaryService?method=saveOrUpdateDictionaryElement(${header.name}, ${exchangeProperty[DictionaryObject]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="PUT Dictionary request failed for: ${header.name}, ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -976,20 +976,20 @@ <removeHeaders pattern="*" excludePattern="name" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> <to - uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionary(${header.name})" /> + uri="bean:org.onap.policy.clamp.tosca.DictionaryService?method=deleteDictionary(${header.name})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="DELETE Dictionary request failed for: ${header.name}, ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1010,20 +1010,20 @@ excludePattern="name|shortName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary Element')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary Element')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> <to - uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionaryElement(${header.name}, ${header.shortName})" /> + uri="bean:org.onap.policy.clamp.tosca.DictionaryService?method=deleteDictionaryElement(${header.name}, ${header.shortName})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="DELETE Dictionary element request failed for: ${header.name}, ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1038,26 +1038,26 @@ </delete> <get uri="/v2/policyToscaModels" - outType="org.onap.clamp.loop.template.PolicyModel" + outType="org.onap.policy.clamp.loop.template.PolicyModel" produces="application/json"> <route> <removeHeaders pattern="*" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Tosca Policy Models')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Tosca Policy Models')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> <to - uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getAllPolicyModels()" /> + uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=getAllPolicyModels()" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET Policy Models request failed for: ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1071,27 +1071,27 @@ </route> </get> <get uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}" - outType="org.onap.clamp.loop.template.PolicyModel" + outType="org.onap.policy.clamp.loop.template.PolicyModel" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="policyModelType|policyModelVersion" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> <to - uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" /> + uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET Policy Model request failed for type: ${header.policyModelType}, ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1111,20 +1111,20 @@ excludePattern="policyModelType|policyModelVersion" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" /> <to - uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" /> + uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET Policy Model YAML request failed for type: ${header.policyModelType}, ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1140,29 +1140,29 @@ <post uri="/v2/policyToscaModels" type="java.lang.String" - outType="org.onap.clamp.loop.template.PolicyModel" + outType="org.onap.policy.clamp.loop.template.PolicyModel" consumes="plain/text" produces="application/json"> <route> <removeHeaders pattern="*"/> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> <setProperty propertyName="PolicyModelTosca"> <simple>${body}</simple> </setProperty> <to - uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${exchangeProperty[PolicyModelTosca]})" /> + uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${exchangeProperty[PolicyModelTosca]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="POST Policy Model YAML request failed: ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1177,30 +1177,30 @@ </post> <put uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}" type="java.lang.String" - outType="org.onap.clamp.loop.template.PolicyModel" + outType="org.onap.policy.clamp.loop.template.PolicyModel" consumes="plain/text" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="policyModelType|policyModelVersion" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" /> <setProperty propertyName="PolicyModelTosca"> <simple>${body}</simple> </setProperty> <to - uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" /> + uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="MODIFY Policy Model YAML request failed: ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1215,26 +1215,26 @@ </put> <get uri="/v2/templates" - outType="org.onap.clamp.loop.template.LoopTemplate" + outType="org.onap.policy.clamp.loop.template.LoopTemplate" produces="application/json"> <route> <removeHeaders pattern="*" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Templates')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Templates')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" /> <to - uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getAllLoopTemplates()" /> + uri="bean:org.onap.policy.clamp.loop.template.LoopTemplatesService?method=getAllLoopTemplates()" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET ALL templates request failed: ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1248,27 +1248,27 @@ </route> </get> <get uri="/v2/templates/{templateName}" - outType="org.onap.clamp.loop.template.LoopTemplate" + outType="org.onap.policy.clamp.loop.template.LoopTemplate" produces="application/json"> <route> <removeHeaders pattern="*" excludePattern="templateName" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET a Template by NAME')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET a Template by NAME')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" /> <to - uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplate(${header.templateName})" /> + uri="bean:org.onap.policy.clamp.loop.template.LoopTemplatesService?method=getLoopTemplate(${header.templateName})" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET Template request failed for template: ${header.templateName}, ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1287,20 +1287,20 @@ <removeHeaders pattern="*" /> <doTry> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop Template Names')" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop Template Names')" /> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" /> <to - uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplateNames()" /> + uri="bean:org.onap.policy.clamp.loop.template.LoopTemplatesService?method=getLoopTemplateNames()" /> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()" /> <log loggingLevel="ERROR" message="GET All Template names request failed for template: ${exception.stacktrace}" /> <setHeader headerName="CamelHttpResponseCode"> @@ -1313,10 +1313,10 @@ </doTry> </route> </get> - <get uri="/v2/clampInformation" outType="org.onap.clamp.clds.model.ClampInformation" + <get uri="/v2/clampInformation" outType="org.onap.policy.clamp.clds.model.ClampInformation" produces="application/json"> <to - uri="bean:org.onap.clamp.authorization.AuthorizationController?method=getClampInformation()" /> + uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=getClampInformation()" /> </get> </rest> </rests> diff --git a/src/main/resources/clds/camel/rest/clds-services.xml b/src/main/resources/clds/camel/rest/clds-services.xml index ce52f31d6..61e1efbdc 100644 --- a/src/main/resources/clds/camel/rest/clds-services.xml +++ b/src/main/resources/clds/camel/rest/clds-services.xml @@ -1,10 +1,10 @@ <rests xmlns="http://camel.apache.org/schema/spring"> <rest> <get uri="/v1/healthcheck" produces="application/json" - outType="org.onap.clamp.clds.model.CldsHealthCheck"> + outType="org.onap.policy.clamp.clds.model.CldsHealthCheck"> <route> <setBody> - <method ref="org.onap.clamp.clds.service.CldsHealthcheckService" + <method ref="org.onap.policy.clamp.clds.service.CldsHealthcheckService" method="gethealthcheck()" /> </setBody> <when> @@ -18,7 +18,7 @@ </get> <get uri="/v1/user/getUser" produces="text/plain"> - <to uri="bean:org.onap.clamp.authorization.UserService?method=getUser()" /> + <to uri="bean:org.onap.policy.clamp.authorization.UserService?method=getUser()" /> </get> </rest> </rests> diff --git a/src/main/resources/clds/camel/routes/cds-flows.xml b/src/main/resources/clds/camel/routes/cds-flows.xml index 9946c990b..73f8cb849 100644 --- a/src/main/resources/clds/camel/routes/cds-flows.xml +++ b/src/main/resources/clds/camel/routes/cds-flows.xml @@ -3,7 +3,7 @@ <from uri="direct:get-blueprint-workflow-list"/> <log loggingLevel="INFO" message="Getting blueprint workflow list from CDS"/> - <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('CDS', 'Getting workflow list from CDS')"/> + <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('CDS', 'Getting workflow list from CDS')"/> <doTry> <setHeader headerName="CamelHttpMethod"> <constant>GET</constant> @@ -13,7 +13,7 @@ </setHeader> <log loggingLevel="INFO" message="Endpoint to query workflows from CDS : {{clamp.config.cds.url}}/api/v1/blueprint-model/workflows/blueprint-name/${exchangeProperty[blueprintName]}/version/${exchangeProperty[blueprintVersion]}"></log> - <toD uri="{{clamp.config.cds.url}}/api/v1/blueprint-model/workflows/blueprint-name/${exchangeProperty[blueprintName]}/version/${exchangeProperty[blueprintVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.cds.userName}}&authPassword={{clamp.config.cds.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true"/> + <toD uri="{{clamp.config.cds.url}}/api/v1/blueprint-model/workflows/blueprint-name/${exchangeProperty[blueprintName]}/version/${exchangeProperty[blueprintVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.cds.userName}}&authPassword={{clamp.config.cds.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true"/> <convertBodyTo type="java.lang.String"/> <doCatch> <exception>java.lang.Exception</exception> @@ -26,7 +26,7 @@ </doCatch> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> - <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> </doFinally> </doTry> </route> @@ -34,7 +34,7 @@ <from uri="direct:get-blueprint-workflow-input-properties"/> <log loggingLevel="INFO" message="Getting blueprint input properties for workflow"/> - <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('CDS', 'Getting input properties for workflow')"/> + <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('CDS', 'Getting input properties for workflow')"/> <doTry> <setHeader headerName="CamelHttpMethod"> <constant>POST</constant> @@ -44,7 +44,7 @@ </setHeader> <log loggingLevel="INFO" message="Endpoint to query input properties for workflow from CDS : {{clamp.config.cds.url}}/api/v1/blueprint-model/workflow-spec"></log> - <toD uri="{{clamp.config.cds.url}}/api/v1/blueprint-model/workflow-spec?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.cds.userName}}&authPassword={{clamp.config.cds.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true"/> + <toD uri="{{clamp.config.cds.url}}/api/v1/blueprint-model/workflow-spec?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.cds.userName}}&authPassword={{clamp.config.cds.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true"/> <convertBodyTo type="java.lang.String"/> <doCatch> <exception>java.lang.Exception</exception> @@ -57,7 +57,7 @@ </doCatch> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> - <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> </doFinally> </doTry> </route> diff --git a/src/main/resources/clds/camel/routes/dcae-flows.xml b/src/main/resources/clds/camel/routes/dcae-flows.xml index d71db1763..1a0eb7b9a 100644 --- a/src/main/resources/clds/camel/routes/dcae-flows.xml +++ b/src/main/resources/clds/camel/routes/dcae-flows.xml @@ -1,477 +1,491 @@ <routes xmlns="http://camel.apache.org/schema/spring"> - <route id="deploy-loop"> - <from uri="direct:deploy-loop" /> - <choice> - <when> - <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true - </simple> - <to uri="direct:deploy-loop-single-blueprint" /> - </when> - <when> - <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false - </simple> - <to uri="direct:deploy-loop-multi-blueprint" /> - </when> - </choice> - </route> - <route id="deploy-loop-multi-blueprint"> - <from uri="direct:deploy-loop-multi-blueprint" /> - <doTry> - <log loggingLevel="INFO" - message="Deploying the blueprints for loop: ${exchangeProperty[loopObject].getName()}" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploying the loop with multiple blueprints')" /> - <split> - <simple>${exchangeProperty[loopObject].getMicroServicePolicies()} - </simple> - <setProperty propertyName="microServicePolicy"> - <simple>${body}</simple> - </setProperty> - <log - loggingLevel="INFO" - message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" /> - <setProperty propertyName="raiseHttpExceptionFlag"> - <simple resultType="java.lang.Boolean">false</simple> - </setProperty> - <setBody> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="getDeployPayload(${exchangeProperty[loopObject]},${exchangeProperty[microServicePolicy]})" /> - </setBody> - <setProperty propertyName="dcaeDeploymentId"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="generateDeploymentId()" /> - </setProperty> - <setHeader headerName="CamelHttpMethod"> - <constant>PUT</constant> - </setHeader> - <setHeader headerName="Content-Type"> - <constant>application/json</constant> - </setHeader> - <setHeader headerName="X-ONAP-RequestID"> - <simple>${exchangeProperty[X-ONAP-RequestID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-InvocationID"> - <simple>${exchangeProperty[X-ONAP-InvocationID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-PartnerName"> - <simple>${exchangeProperty[X-ONAP-PartnerName]} - </simple> - </setHeader> - <log loggingLevel="INFO" - message="Endpoint to deploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}"></log> - <toD - uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=300000&authenticationPreemptive=true&connectionClose=true" /> - <convertBodyTo type="java.lang.String" /> - <setProperty propertyName="dcaeResponse"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="convertDcaeResponse(${body})" /> - </setProperty> - <setProperty propertyName="dcaeStatusUrl"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="getStatusUrl(${exchangeProperty[dcaeResponse]})" /> - </setProperty> - <to - uri="bean:org.onap.clamp.policy.microservice.MicroServicePolicyService?method=updateDcaeDeploymentFields(${exchangeProperty[microServicePolicy]},${exchangeProperty[dcaeDeploymentId]},${exchangeProperty[dcaeStatusUrl]})" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('Deploy for the micro service: ${exchangeProperty[microServicePolicy].getName()} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','DCAE',${exchangeProperty[loopObject]})" /> - </split> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <setProperty propertyName="logMessage"> - <simple>DEPLOY micro service failed - (MicroService name:${exchangeProperty[microServicePolicy].getName()}), - Dep-id:${exchangeProperty[dcaeDeploymentId]}, - StatusUrl:${exchangeProperty[dcaeStatusUrl]}) - </simple> - </setProperty> - <setProperty propertyName="logComponent"> - <simple>DCAE</simple> - </setProperty> - <to uri="direct:dump-loop-log-http-response" /> - </doCatch> - <doFinally> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doFinally> - </doTry> - </route> - <route id="deploy-loop-single-blueprint"> - <from uri="direct:deploy-loop-single-blueprint" /> - <doTry> - <log loggingLevel="INFO" - message="Deploying the loop: ${exchangeProperty[loopObject].getName()}" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploying the loop')" /> - <setBody> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="getDeployPayload(${exchangeProperty[loopObject]})" /> - </setBody> - <setProperty propertyName="dcaeDeploymentId"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="generateDeploymentId()" /> - </setProperty> - <setHeader headerName="CamelHttpMethod"> - <constant>PUT</constant> - </setHeader> - <setHeader headerName="Content-Type"> - <constant>application/json</constant> - </setHeader> - <setHeader headerName="X-ONAP-RequestID"> - <simple>${exchangeProperty[X-ONAP-RequestID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-InvocationID"> - <simple>${exchangeProperty[X-ONAP-InvocationID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-PartnerName"> - <simple>${exchangeProperty[X-ONAP-PartnerName]} - </simple> - </setHeader> - <log loggingLevel="INFO" - message="Endpoint to deploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}"></log> - <toD - uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=300000&authenticationPreemptive=true&connectionClose=true" /> - <convertBodyTo type="java.lang.String" /> - <setProperty propertyName="dcaeResponse"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="convertDcaeResponse(${body})" /> - </setProperty> - + <route id="deploy-loop"> + <from uri="direct:deploy-loop"/> + <choice> + <when> + <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true + </simple> + <to uri="direct:deploy-loop-single-blueprint"/> + </when> + <when> + <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false + </simple> + <to uri="direct:deploy-loop-multi-blueprint"/> + </when> + </choice> + </route> + <route id="deploy-loop-multi-blueprint"> + <from uri="direct:deploy-loop-multi-blueprint"/> + <doTry> + <log loggingLevel="INFO" + message="Deploying the blueprints for loop: ${exchangeProperty[loopObject].getName()}"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploying the loop with multiple blueprints')"/> + <split> + <simple>${exchangeProperty[loopObject].getMicroServicePolicies()} + </simple> + <setProperty propertyName="microServicePolicy"> + <simple>${body}</simple> + </setProperty> + <log + loggingLevel="INFO" + message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}"/> + <setProperty propertyName="raiseHttpExceptionFlag"> + <simple resultType="java.lang.Boolean">false</simple> + </setProperty> + <setBody> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="getDeployPayload(${exchangeProperty[loopObject]},${exchangeProperty[microServicePolicy]})"/> + </setBody> + <setProperty propertyName="dcaeDeploymentId"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="generateDeploymentId()"/> + </setProperty> + <setHeader headerName="CamelHttpMethod"> + <constant>PUT</constant> + </setHeader> + <setHeader headerName="Content-Type"> + <constant>application/json</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log loggingLevel="INFO" + message="Endpoint to deploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}"></log> + <toD + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=300000&authenticationPreemptive=true&connectionClose=true"/> + <convertBodyTo type="java.lang.String"/> + <setProperty propertyName="dcaeResponse"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="convertDcaeResponse(${body})"/> + </setProperty> + <setProperty propertyName="dcaeStatusUrl"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="getStatusUrl(${exchangeProperty[dcaeResponse]})"/> + </setProperty> + <to + uri="bean:org.onap.policy.clamp.policy.microservice.MicroServicePolicyService?method=updateDcaeDeploymentFields(${exchangeProperty[microServicePolicy]},${exchangeProperty[dcaeDeploymentId]},${exchangeProperty[dcaeStatusUrl]})"/> + <to + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Deploy for the micro service: ${exchangeProperty[microServicePolicy].getName()} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','DCAE',${exchangeProperty[loopObject]})"/> + </split> + <doCatch> + <exception>java.lang.Exception</exception> + <handled> + <constant>false</constant> + </handled> + <setProperty propertyName="logMessage"> + <simple>DEPLOY micro service failed + (MicroService name:${exchangeProperty[microServicePolicy].getName()}), + Dep-id:${exchangeProperty[dcaeDeploymentId]}, + StatusUrl:${exchangeProperty[dcaeStatusUrl]}) + </simple> + </setProperty> + <setProperty propertyName="logComponent"> + <simple>DCAE</simple> + </setProperty> + <to uri="direct:dump-loop-log-http-response"/> + </doCatch> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + </doFinally> + </doTry> + </route> + <route id="deploy-loop-single-blueprint"> + <from uri="direct:deploy-loop-single-blueprint"/> + <doTry> + <log loggingLevel="INFO" + message="Deploying the loop: ${exchangeProperty[loopObject].getName()}"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploying the loop')"/> + <setBody> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="getDeployPayload(${exchangeProperty[loopObject]})"/> + </setBody> + <setProperty propertyName="dcaeDeploymentId"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="generateDeploymentId()"/> + </setProperty> + <setHeader headerName="CamelHttpMethod"> + <constant>PUT</constant> + </setHeader> + <setHeader headerName="Content-Type"> + <constant>application/json</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log loggingLevel="INFO" + message="Endpoint to deploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}"></log> + <toD + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[dcaeDeploymentId]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=300000&authenticationPreemptive=true&connectionClose=true"/> + <convertBodyTo type="java.lang.String"/> + <setProperty propertyName="dcaeResponse"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="convertDcaeResponse(${body})"/> + </setProperty> - <setProperty propertyName="dcaeStatusUrl"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="getStatusUrl(${exchangeProperty[dcaeResponse]})" /> - </setProperty> - <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateDcaeDeploymentFields(${exchangeProperty[loopObject]},${exchangeProperty[dcaeDeploymentId]},${exchangeProperty[dcaeStatusUrl]})" /> - <doFinally> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - <setProperty propertyName="logMessage"> - <simple>DEPLOY loop status - (Dep-id:${exchangeProperty[dcaeDeploymentId]}, - StatusUrl:${exchangeProperty[dcaeStatusUrl]}) - </simple> - </setProperty> - <setProperty propertyName="logComponent"> - <simple>DCAE</simple> - </setProperty> - <to uri="direct:dump-loop-log-http-response" /> - </doFinally> - </doTry> - </route> - <route id="undeploy-loop"> - <from uri="direct:undeploy-loop" /> - <choice> - <when> - <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true - </simple> - <to uri="direct:undeploy-loop-single-blueprint" /> - </when> - <when> - <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false - </simple> - <to uri="direct:undeploy-loop-multi-blueprint" /> - </when> - </choice> - </route> - <route id="undeploy-loop-multi-blueprint"> - <from uri="direct:undeploy-loop-multi-blueprint" /> - <doTry> - <log loggingLevel="INFO" - message="Undeploying the blueprints for loop: ${exchangeProperty[loopObject].getName()}" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploying the loop with multiple blueprints')" /> - <split> - <simple>${exchangeProperty[loopObject].getMicroServicePolicies()} - </simple> - <setProperty propertyName="microServicePolicy"> - <simple>${body}</simple> - </setProperty> - <log - loggingLevel="INFO" - message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" /> - <choice> - <when> - <simple>${exchangeProperty[microServicePolicy].getDcaeDeploymentId()} != null - </simple> - <setBody> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="getUndeployPayload(${exchangeProperty[microServicePolicy]})" /> - </setBody> - <setHeader headerName="CamelHttpMethod"> - <constant>DELETE</constant> - </setHeader> - <setHeader headerName="Content-Type"> - <constant>application/json</constant> - </setHeader> - <setHeader headerName="X-ONAP-RequestID"> - <simple>${exchangeProperty[X-ONAP-RequestID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-InvocationID"> - <simple>${exchangeProperty[X-ONAP-InvocationID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-PartnerName"> - <simple>${exchangeProperty[X-ONAP-PartnerName]} - </simple> - </setHeader> - <log loggingLevel="INFO" - message="Endpoint to undeploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[microServicePolicy].getDcaeDeploymentId()}"></log> - <toD - uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[microServicePolicy].getDcaeDeploymentId()}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=300000&authenticationPreemptive=true&connectionClose=true" /> - <convertBodyTo type="java.lang.String" /> - <setProperty propertyName="dcaeResponse"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="convertDcaeResponse(${body})" /> - </setProperty> - <setProperty propertyName="dcaeStatusUrl"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="getStatusUrl(${exchangeProperty[dcaeResponse]})" /> - </setProperty> - <to - uri="bean:org.onap.clamp.policy.microservice.MicroServicePolicyService?method=updateDcaeDeploymentFields(${exchangeProperty[microServicePolicy]},null,${exchangeProperty[dcaeStatusUrl]})" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','DCAE',${exchangeProperty[loopObject]})" /> - </when> - <otherwise> - <log loggingLevel="WARNING" - message="Cannot Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()}, the Deployment ID does not exist !" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('Cannot Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()}, the Deployment ID does not exist !','WARNING','DCAE',${exchangeProperty[loopObject]})" /> - </otherwise> - </choice> - </split> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <setProperty propertyName="logMessage"> - <simple>UNDEPLOY micro service failed - (MicroService name:${exchangeProperty[microServicePolicy].getName()}) - </simple> - </setProperty> - <setProperty propertyName="logComponent"> - <simple>DCAE</simple> - </setProperty> - <to uri="direct:dump-loop-log-http-response" /> - </doCatch> - <doFinally> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doFinally> - </doTry> - </route> - <route id="undeploy-loop-single-blueprint"> - <from uri="direct:undeploy-loop-single-blueprint" /> - <log loggingLevel="INFO" - message="Undeploying the loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploying the loop')" /> - <choice> - <when> - <simple>${exchangeProperty[loopObject].getDcaeDeploymentId()} - != null - </simple> - <doTry> - <setBody> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="getUndeployPayload(${exchangeProperty[loopObject]})" /> - </setBody> - <setHeader headerName="CamelHttpMethod"> - <constant>DELETE</constant> - </setHeader> - <setHeader headerName="Content-Type"> - <constant>application/json</constant> - </setHeader> - <setHeader headerName="X-ONAP-RequestID"> - <simple>${exchangeProperty[X-ONAP-RequestID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-InvocationID"> - <simple>${exchangeProperty[X-ONAP-InvocationID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-PartnerName"> - <simple>${exchangeProperty[X-ONAP-PartnerName]} - </simple> - </setHeader> - <log loggingLevel="INFO" - message="Endpoint to undeploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log> - <toD - uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=300000&authenticationPreemptive=true&connectionClose=true" /> - <convertBodyTo type="java.lang.String" /> - <setProperty propertyName="dcaeResponse"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="convertDcaeResponse(${body})" /> - </setProperty> - <setProperty propertyName="dcaeStatusUrl"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="getStatusUrl(${exchangeProperty[dcaeResponse]})" /> - </setProperty> - <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateDcaeDeploymentFields(${exchangeProperty[loopObject]},null,${exchangeProperty[dcaeStatusUrl]})" /> - <doFinally> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - <setProperty propertyName="logMessage"> - <simple>UNDEPLOY loop status</simple> - </setProperty> - <setProperty propertyName="logComponent"> - <simple>DCAE</simple> - </setProperty> - <to uri="direct:dump-loop-log-http-response" /> - </doFinally> - </doTry> - </when> - <otherwise> - <log loggingLevel="WARNING" - message="Cannot Undeploy for the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Cannot Undeploy for the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !','WARNING',${exchangeProperty[loopObject]})" /> - </otherwise> - </choice> - </route> - <route id="get-dcae-deployment-status"> - <from uri="direct:get-dcae-deployment-status" /> - <log loggingLevel="INFO" - message="Getting DCAE deployment status for loop: ${exchangeProperty[loopObject].getName()} - ${exchangeProperty[dcaeComponent].getComponentName()}" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Getting Deployment status')" /> - <doTry> - <setHeader headerName="CamelHttpMethod"> - <constant>GET</constant> - </setHeader> - <setHeader headerName="X-ONAP-RequestID"> - <simple>${exchangeProperty[X-ONAP-RequestID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-InvocationID"> - <simple>${exchangeProperty[X-ONAP-InvocationID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-PartnerName"> - <simple>${exchangeProperty[X-ONAP-PartnerName]} - </simple> - </setHeader> - <log loggingLevel="INFO" - message="Endpoint to query Closed Loop status: ${exchangeProperty[getStatusUrl]}"></log> - <toD - uri="${exchangeProperty[getStatusUrl]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>true</constant> - </handled> + <setProperty propertyName="dcaeStatusUrl"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="getStatusUrl(${exchangeProperty[dcaeResponse]})"/> + </setProperty> + <to + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateDcaeDeploymentFields(${exchangeProperty[loopObject]},${exchangeProperty[dcaeDeploymentId]},${exchangeProperty[dcaeStatusUrl]})"/> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + <setProperty propertyName="logMessage"> + <simple>DEPLOY loop status + (Dep-id:${exchangeProperty[dcaeDeploymentId]}, + StatusUrl:${exchangeProperty[dcaeStatusUrl]}) + </simple> + </setProperty> + <setProperty propertyName="logComponent"> + <simple>DCAE</simple> + </setProperty> + <to uri="direct:dump-loop-log-http-response"/> + </doFinally> + </doTry> + </route> + <route id="undeploy-loop"> + <from uri="direct:undeploy-loop"/> + <choice> + <when> + <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true + </simple> + <to uri="direct:undeploy-loop-single-blueprint"/> + </when> + <when> + <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false + </simple> + <to uri="direct:undeploy-loop-multi-blueprint"/> + </when> + </choice> + </route> + <route id="undeploy-loop-multi-blueprint"> + <from uri="direct:undeploy-loop-multi-blueprint"/> + <doTry> + <log loggingLevel="INFO" + message="Undeploying the blueprints for loop: ${exchangeProperty[loopObject].getName()}"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploying the loop with multiple blueprints')"/> + <split> + <simple>${exchangeProperty[loopObject].getMicroServicePolicies()} + </simple> + <setProperty propertyName="microServicePolicy"> + <simple>${body}</simple> + </setProperty> + <log + loggingLevel="INFO" + message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}"/> + <choice> + <when> + <simple>${exchangeProperty[microServicePolicy].getDcaeDeploymentId()} != null + </simple> + <setBody> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="getUndeployPayload(${exchangeProperty[microServicePolicy]})"/> + </setBody> + <setHeader headerName="CamelHttpMethod"> + <constant>DELETE</constant> + </setHeader> + <setHeader headerName="Content-Type"> + <constant>application/json</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log loggingLevel="INFO" + message="Endpoint to undeploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[microServicePolicy].getDcaeDeploymentId()}"></log> + <toD + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[microServicePolicy].getDcaeDeploymentId()}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=300000&authenticationPreemptive=true&connectionClose=true"/> + <convertBodyTo type="java.lang.String"/> + <setProperty propertyName="dcaeResponse"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="convertDcaeResponse(${body})"/> + </setProperty> + <setProperty propertyName="dcaeStatusUrl"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="getStatusUrl(${exchangeProperty[dcaeResponse]})"/> + </setProperty> + <to + uri="bean:org.onap.policy.clamp.policy.microservice.MicroServicePolicyService?method=updateDcaeDeploymentFields(${exchangeProperty[microServicePolicy]},null,${exchangeProperty[dcaeStatusUrl]})"/> + <to + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','DCAE',${exchangeProperty[loopObject]})"/> + </when> + <otherwise> + <log loggingLevel="WARNING" + message="Cannot Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()}, the Deployment ID does not exist !"/> + <to + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Cannot Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()}, the Deployment ID does not exist !','WARNING','DCAE',${exchangeProperty[loopObject]})"/> + </otherwise> + </choice> + </split> + <doCatch> + <exception>java.lang.Exception</exception> + <handled> + <constant>false</constant> + </handled> + <setProperty propertyName="logMessage"> + <simple>UNDEPLOY micro service failed + (MicroService name:${exchangeProperty[microServicePolicy].getName()}) + </simple> + </setProperty> + <setProperty propertyName="logComponent"> + <simple>DCAE</simple> + </setProperty> + <to uri="direct:dump-loop-log-http-response"/> + </doCatch> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + </doFinally> + </doTry> + </route> + <route id="undeploy-loop-single-blueprint"> + <from uri="direct:undeploy-loop-single-blueprint"/> + <log loggingLevel="INFO" + message="Undeploying the loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploying the loop')"/> + <choice> + <when> + <simple>${exchangeProperty[loopObject].getDcaeDeploymentId()} + != null + </simple> + <doTry> + <setBody> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="getUndeployPayload(${exchangeProperty[loopObject]})"/> + </setBody> + <setHeader headerName="CamelHttpMethod"> + <constant>DELETE</constant> + </setHeader> + <setHeader headerName="Content-Type"> + <constant>application/json</constant> + </setHeader> - <log loggingLevel="ERROR" - message="GET DCAE deployment request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET DCAE deployment request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> - </doCatch> - <doFinally> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - <setProperty propertyName="logMessage"> - <simple>DCAE deployment status</simple> - </setProperty> - <setProperty propertyName="logComponent"> - <simple>DCAE</simple> - </setProperty> - <to uri="direct:dump-loop-log-http-response" /> - </doFinally> - </doTry> - </route> - <route id="get-dcae-blueprint-inventory"> - <from uri="direct:get-dcae-blueprint-inventory" /> - <log loggingLevel="INFO" - message="Getting DCAE blueprint id in inventory" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Getting blueprint id in inventory')" /> - <doTry> - <setHeader headerName="CamelHttpMethod"> - <constant>GET</constant> - </setHeader> - <setHeader headerName="X-ONAP-RequestID"> - <simple>${exchangeProperty[X-ONAP-RequestID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-InvocationID"> - <simple>${exchangeProperty[X-ONAP-InvocationID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-PartnerName"> - <simple>${exchangeProperty[X-ONAP-PartnerName]} - </simple> - </setHeader> - <log loggingLevel="INFO" - message="Endpoint to query Dcae inventory Loop status: {{clamp.config.dcae.inventory.url}}/dcae-service-types?${header[CamelHttpQuery]}"></log> - <toD - uri="{{clamp.config.dcae.inventory.url}}/dcae-service-types?asdcResourceId=${exchangeProperty[blueprintResourceId]}&asdcServiceId=${exchangeProperty[blueprintServiceId]}&typeName=${exchangeProperty[blueprintName]}&bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true" /> - <convertBodyTo type="java.lang.String" /> - <doFinally> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doFinally> - </doTry> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log loggingLevel="INFO" + message="Endpoint to undeploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log> + <toD + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=300000&authenticationPreemptive=true&connectionClose=true"/> + <convertBodyTo type="java.lang.String"/> + <setProperty propertyName="dcaeResponse"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="convertDcaeResponse(${body})"/> + </setProperty> + <setProperty propertyName="dcaeStatusUrl"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="getStatusUrl(${exchangeProperty[dcaeResponse]})"/> + </setProperty> + <to + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateDcaeDeploymentFields(${exchangeProperty[loopObject]},null,${exchangeProperty[dcaeStatusUrl]})"/> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + <setProperty propertyName="logMessage"> + <simple>UNDEPLOY loop status</simple> + </setProperty> + <setProperty propertyName="logComponent"> + <simple>DCAE</simple> + </setProperty> + <to uri="direct:dump-loop-log-http-response"/> + </doFinally> + </doTry> + </when> + <otherwise> + <log loggingLevel="WARNING" + message="Cannot Undeploy for the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !"/> + <to + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('Cannot Undeploy for the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !','WARNING',${exchangeProperty[loopObject]})"/> + </otherwise> + </choice> + </route> + <route id="get-dcae-deployment-status"> + <from uri="direct:get-dcae-deployment-status"/> + <log loggingLevel="INFO" + message="Getting DCAE deployment status for loop: ${exchangeProperty[loopObject].getName()} - ${exchangeProperty[dcaeComponent].getComponentName()}"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Getting Deployment status')"/> + <doTry> + <setHeader headerName="CamelHttpMethod"> + <constant>GET</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log loggingLevel="INFO" + message="Endpoint to query microservice deployment status: ${exchangeProperty[getStatusUrlModified]}"></log> + <choice> + <when> + <simple>${exchangeProperty[getStatusUrl].contains("?")} == true + </simple> + <setProperty propertyName="uriSeparator"> + <simple>&</simple> + </setProperty> + </when> + <otherwise> + <setProperty propertyName="uriSeparator"> + <simple>?</simple> + </setProperty> + </otherwise> + </choice> + <toD + uri="${exchangeProperty[getStatusUrl]}${exchangeProperty[uriSeparator]}bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true"/> + <doCatch> + <exception>java.lang.Exception</exception> + <handled> + <constant>true</constant> + </handled> - </route> - <route id="get-all-dcae-blueprint-inventory"> - <from uri="direct:get-all-dcae-blueprint-inventory" /> - <log loggingLevel="INFO" - message="Getting all DCAE blueprint from inventory" /> - <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Getting all blueprint from inventory')" /> - <doTry> - <setHeader headerName="CamelHttpMethod"> - <constant>GET</constant> - </setHeader> - <setHeader headerName="X-ONAP-RequestID"> - <simple>${exchangeProperty[X-ONAP-RequestID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-InvocationID"> - <simple>${exchangeProperty[X-ONAP-InvocationID]} - </simple> - </setHeader> - <setHeader headerName="X-ONAP-PartnerName"> - <simple>${exchangeProperty[X-ONAP-PartnerName]} - </simple> - </setHeader> - <log loggingLevel="INFO" - message="Endpoint to query Blueprints from DCAE inventory: {{clamp.config.dcae.inventory.url}}/dcae-service-types?${header[CamelHttpQuery]}"></log> - <toD uri="{{clamp.config.dcae.inventory.url}}/dcae-service-types;bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true" /> - <convertBodyTo type="java.lang.String" /> - <setProperty propertyName="dcaeResponseList"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" - method="convertToDcaeInventoryResponse(${body})" /> - </setProperty> - <split> - <simple>${exchangeProperty[dcaeResponseList]}</simple> - <convertBodyTo type="org.onap.clamp.clds.model.dcae.DcaeInventoryResponse" /> - <setProperty propertyName="dcaeResponse"> - <simple>${body}</simple> - </setProperty> - <to uri="bean:org.onap.clamp.clds.model.dcae.DcaeInventoryCache?method=addDcaeInventoryResponse(${exchangeProperty[dcaeResponse]})" /> - </split> - <doFinally> - <to uri="direct:reset-raise-http-exception-flag" /> - <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doFinally> - </doTry> - </route> + <log loggingLevel="ERROR" + message="GET DCAE deployment request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> + <to + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('GET DCAE deployment request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})"/> + </doCatch> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + <setProperty propertyName="logMessage"> + <simple>DCAE deployment status</simple> + </setProperty> + <setProperty propertyName="logComponent"> + <simple>DCAE</simple> + </setProperty> + <to uri="direct:dump-loop-log-http-response"/> + </doFinally> + </doTry> + </route> + <route id="get-dcae-blueprint-inventory"> + <from uri="direct:get-dcae-blueprint-inventory"/> + <log loggingLevel="INFO" + message="Getting DCAE blueprint id in inventory"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Getting blueprint id in inventory')"/> + <doTry> + <setHeader headerName="CamelHttpMethod"> + <constant>GET</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log loggingLevel="INFO" + message="Endpoint to query Dcae inventory Loop status: {{clamp.config.dcae.inventory.url}}/dcae-service-types?${header[CamelHttpQuery]}"></log> + <toD + uri="{{clamp.config.dcae.inventory.url}}/dcae-service-types?asdcResourceId=${exchangeProperty[blueprintResourceId]}&asdcServiceId=${exchangeProperty[blueprintServiceId]}&typeName=${exchangeProperty[blueprintName]}&bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true"/> + <convertBodyTo type="java.lang.String"/> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + </doFinally> + </doTry> + + </route> + <route id="get-all-dcae-blueprint-inventory"> + <from uri="direct:get-all-dcae-blueprint-inventory"/> + <log loggingLevel="INFO" + message="Getting all DCAE blueprint from inventory"/> + <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Getting all blueprint from inventory')"/> + <doTry> + <setHeader headerName="CamelHttpMethod"> + <constant>GET</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log loggingLevel="INFO" + message="Endpoint to query Blueprints from DCAE inventory: {{clamp.config.dcae.inventory.url}}/dcae-service-types?${header[CamelHttpQuery]}"></log> + <toD uri="{{clamp.config.dcae.inventory.url}}/dcae-service-types;bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=30000&authenticationPreemptive=true&connectionClose=true"/> + <convertBodyTo type="java.lang.String"/> + <setProperty propertyName="dcaeResponseList"> + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" + method="convertToDcaeInventoryResponse(${body})"/> + </setProperty> + <split> + <simple>${exchangeProperty[dcaeResponseList]}</simple> + <convertBodyTo type="org.onap.policy.clamp.clds.model.dcae.DcaeInventoryResponse"/> + <setProperty propertyName="dcaeResponse"> + <simple>${body}</simple> + </setProperty> + <to uri="bean:org.onap.policy.clamp.clds.model.dcae.DcaeInventoryCache?method=addDcaeInventoryResponse(${exchangeProperty[dcaeResponse]})"/> + </split> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag"/> + <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + </doFinally> + </doTry> + </route> </routes>
\ No newline at end of file diff --git a/src/main/resources/clds/camel/routes/loop-flows.xml b/src/main/resources/clds/camel/routes/loop-flows.xml index 691656d81..d5ab050cf 100644 --- a/src/main/resources/clds/camel/routes/loop-flows.xml +++ b/src/main/resources/clds/camel/routes/loop-flows.xml @@ -5,7 +5,7 @@ <simple>${header.loopName}</simple> </setBody> <setProperty propertyName="loopObject"> - <method ref="org.onap.clamp.loop.LoopService" method="getLoop" /> + <method ref="org.onap.policy.clamp.loop.LoopService" method="getLoop" /> </setProperty> <when> @@ -67,19 +67,9 @@ <setProperty propertyName="policyTypeVersion"> <simple>${body.getPolicyModel().getVersion()}</simple> </setProperty> - <choice> - <when> - <simple>${body.isLegacy()} == true</simple> - <setProperty propertyName="policyVersion"> - <simple>1</simple> - </setProperty> - </when> - <otherwise> - <setProperty propertyName="policyVersion"> - <simple>1.0.0</simple> - </setProperty> - </otherwise> - </choice> + <setProperty propertyName="policyVersion"> + <simple>1.0.0</simple> + </setProperty> <setProperty propertyName="operationalPolicy"> <simple>${body}</simple> </setProperty> @@ -97,7 +87,7 @@ <log loggingLevel="INFO" message="Policy state set to: ${exchangeProperty[policyState].getStateName()}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('Policy state set to: ${exchangeProperty[policyState].getStateName()}','INFO','POLICY',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Policy state set to: ${exchangeProperty[policyState].getStateName()}','INFO','POLICY',${exchangeProperty[loopObject]})" /> </route> <route id="update-dcae-status-for-loop"> <from uri="direct:update-dcae-status-for-loop" /> @@ -124,7 +114,7 @@ <simple> ${header.CamelHttpResponseCode} == 200 </simple> <convertBodyTo type="java.lang.String" /> <setProperty propertyName="dcaeResponse"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" method="convertDcaeResponse(${body})" /> </setProperty> </when> @@ -136,7 +126,7 @@ <log loggingLevel="INFO" message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[loopObject]})" /> </when> <when> <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false @@ -164,7 +154,7 @@ <simple> ${header.CamelHttpResponseCode} == 200 </simple> <convertBodyTo type="java.lang.String" /> <setProperty propertyName="dcaeResponse"> - <method ref="org.onap.clamp.loop.components.external.DcaeComponent" + <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent" method="convertDcaeResponse(${body})" /> </setProperty> </when> @@ -176,7 +166,7 @@ <log loggingLevel="INFO" message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[microServicePolicy]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[microServicePolicy]})" /> </split>> </when> </choice> @@ -192,7 +182,7 @@ == 'NOT_SENT' </simple> <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'DESIGN')" /> + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'DESIGN')" /> </when> <when> <simple>${exchangeProperty['dcaeState'].getStateName()} == 'IN_ERROR' or @@ -200,7 +190,7 @@ 'MICROSERVICE_INSTALLATION_FAILED' </simple> <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'IN_ERROR')" /> + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'IN_ERROR')" /> </when> <when> <simple>${exchangeProperty['dcaeState'].getStateName()} == @@ -208,7 +198,7 @@ ${exchangeProperty['policyState'].getStateName()} == 'IN_ERROR' </simple> <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'IN_ERROR')" /> + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'IN_ERROR')" /> </when> <when> <simple>${exchangeProperty['dcaeState'].getStateName()} == @@ -216,7 +206,7 @@ ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED' </simple> <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'RUNNING')" /> + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'RUNNING')" /> </when> <when> <simple>${exchangeProperty['dcaeState'].getStateName()} == @@ -224,7 +214,7 @@ ${exchangeProperty['policyState'].getStateName()} == 'SENT' </simple> <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'STOPPED')" /> + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'STOPPED')" /> </when> <when> <simple>${exchangeProperty['dcaeState'].getStateName()} == @@ -233,7 +223,7 @@ ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED' </simple> <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'SUBMITTED')" /> + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'SUBMITTED')" /> </when> <when> <simple>${exchangeProperty['dcaeState'].getStateName()} == @@ -243,7 +233,7 @@ ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED' </simple> <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'WAITING')" /> + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'WAITING')" /> </when> <when> <simple>${exchangeProperty['dcaeState'].getStateName()} == @@ -251,13 +241,13 @@ ${exchangeProperty['policyState'].getStateName()} != 'NOT_SENT' </simple> <to - uri="bean:org.onap.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'DEPLOYED')" /> + uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'DEPLOYED')" /> </when> </choice> <log loggingLevel="INFO" message="New loop state is: ${exchangeProperty[loopObject].getLastComputedState().toString()}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('New loop state is: ${exchangeProperty[loopObject].getLastComputedState().toString()}','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('New loop state is: ${exchangeProperty[loopObject].getLastComputedState().toString()}','INFO',${exchangeProperty[loopObject]})" /> </route> </routes>
\ No newline at end of file diff --git a/src/main/resources/clds/camel/routes/policy-flows.xml b/src/main/resources/clds/camel/routes/policy-flows.xml index f597bdc08..0ee386eb4 100644 --- a/src/main/resources/clds/camel/routes/policy-flows.xml +++ b/src/main/resources/clds/camel/routes/policy-flows.xml @@ -36,7 +36,7 @@ <log loggingLevel="INFO" message="Getting Policy: ${exchangeProperty[policyName]}"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Get Policy')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Get Policy')"/> <setHeader headerName="CamelHttpMethod"> <constant>GET</constant> </setHeader> @@ -55,7 +55,7 @@ <log loggingLevel="INFO" message="Endpoint to get policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/${exchangeProperty[policyTypeVersion]}/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}"></log> <toD - uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/${exchangeProperty[policyTypeVersion]}/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/${exchangeProperty[policyTypeVersion]}/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <doCatch> <exception>java.lang.Exception</exception> <handled> @@ -65,12 +65,12 @@ <log loggingLevel="ERROR" message="GET policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET policy request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('GET policy request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> </doCatch> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> <setProperty propertyName="logMessage"> <simple>${exchangeProperty[policyName]} GET Policy status @@ -90,7 +90,7 @@ <log loggingLevel="INFO" message="Getting the policy deployment in PDP: ${exchangeProperty[policyName]}"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy deployment in PDP')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy deployment in PDP')"/> <setHeader headerName="CamelHttpMethod"> <constant>GET</constant> </setHeader> @@ -109,7 +109,7 @@ <log loggingLevel="INFO" message="Endpoint to get policy deployment status: {{clamp.config.policy.pap.url}}/policy/pap/v1/policies/deployed/${exchangeProperty[policyName]}/1.0.0"></log> <toD - uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/policies/deployed/${exchangeProperty[policyName]}/1.0.0?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/policies/deployed/${exchangeProperty[policyName]}/1.0.0?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <doCatch> <exception>java.lang.Exception</exception> <handled> @@ -119,12 +119,12 @@ <log loggingLevel="ERROR" message="GET policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" /> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET policy request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('GET policy request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" /> </doCatch> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> <setProperty propertyName="logMessage"> <simple>${exchangeProperty[policyName]} GET Policy deployment status @@ -142,7 +142,7 @@ <doTry> <log loggingLevel="INFO" message="Getting all the policy models"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting all the policy models')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting all the policy models')"/> <setHeader headerName="CamelHttpMethod"> <constant>GET</constant> </setHeader> @@ -161,12 +161,12 @@ <log loggingLevel="INFO" message="Endpoint to get all policy models: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes"></log> <toD - uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <convertBodyTo type="java.lang.String"/> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> </doFinally> </doTry> </route> @@ -176,7 +176,7 @@ <log loggingLevel="INFO" message="Getting the policy model: ${exchangeProperty[policyModelName]}/${exchangeProperty[policyModelVersion]}"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy model')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy model')"/> <setHeader headerName="CamelHttpMethod"> <constant>GET</constant> </setHeader> @@ -195,12 +195,12 @@ <log loggingLevel="INFO" message="Endpoint to get policy model: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelName]}/versions/${exchangeProperty[policyModelVersion]}"></log> <toD - uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelName]}/versions/${exchangeProperty[policyModelVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelName]}/versions/${exchangeProperty[policyModelVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <convertBodyTo type="java.lang.String"/> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> </doFinally> </doTry> </route> @@ -210,7 +210,7 @@ <log loggingLevel="INFO" message="Creating Policy: ${exchangeProperty[policy].getName()}"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Policy')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Policy')"/> <setBody> <simple>${exchangeProperty[policy].createPolicyPayload()} </simple> @@ -236,11 +236,11 @@ <log loggingLevel="INFO" message="Endpoint to create policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}/versions/${exchangeProperty[policy].getPolicyModel().getVersion()}/policies"></log> <toD - uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}/versions/${exchangeProperty[policy].getPolicyModel().getVersion()}/policies?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}/versions/${exchangeProperty[policy].getPolicyModel().getVersion()}/policies?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> <setProperty propertyName="logMessage"> <simple>${exchangeProperty[policy].getName()} creation status @@ -260,7 +260,7 @@ <log loggingLevel="INFO" message="Deleting Policy: ${exchangeProperty[policy].getName()}"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Policy')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Policy')"/> <setBody> <constant>null</constant> </setBody> @@ -279,28 +279,18 @@ <simple>${exchangeProperty[X-ONAP-PartnerName]} </simple> </setHeader> - <choice> - <when> - <simple>${exchangeProperty[policy].isLegacy()} == true</simple> - <setProperty propertyName="policyVersion"> - <simple>1</simple> - </setProperty> - </when> - <otherwise> - <setProperty propertyName="policyVersion"> - <simple>1.0.0</simple> - </setProperty> - </otherwise> - </choice> + <setProperty propertyName="policyVersion"> + <simple>1.0.0</simple> + </setProperty> <log loggingLevel="INFO" message="Endpoint to delete policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}/versions/${exchangeProperty[policy].getPolicyModel().getVersion()}/policies/${exchangeProperty[policy].getName()}/versions/${exchangeProperty[policyVersion]}"></log> <toD - uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}/versions/${exchangeProperty[policy].getPolicyModel().getVersion()}/policies/${exchangeProperty[policy].getName()}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}/versions/${exchangeProperty[policy].getPolicyModel().getVersion()}/policies/${exchangeProperty[policy].getName()}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> <setProperty propertyName="logMessage"> <simple>${exchangeProperty[policy].getName()} removal status @@ -319,7 +309,7 @@ <log loggingLevel="INFO" message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')"/> <setBody> <simple> ${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject],"POST")} @@ -346,12 +336,12 @@ <log loggingLevel="INFO" message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch"></log> <toD - uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> <setProperty propertyName="logMessage"> <simple>PDP Group push ALL status</simple> </setProperty> @@ -369,7 +359,7 @@ <log loggingLevel="INFO" message="Removing loop policies from PDP Group: ${exchangeProperty[loopObject].getName()}"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Remove policies from PDP group')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Remove policies from PDP group')"/> <setBody> <simple> ${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject],"DELETE")} @@ -396,12 +386,12 @@ <log loggingLevel="INFO" message="Endpoint to remove policies from PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch"></log> <toD - uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> <setProperty propertyName="logMessage"> <simple>PDP Group remove ALL status</simple> </setProperty> @@ -418,7 +408,7 @@ <log loggingLevel="INFO" message="Getting the list of PDP Groups"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the PDP Group list')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the PDP Group list')"/> <setHeader headerName="CamelHttpMethod"> <constant>GET</constant> </setHeader> @@ -437,12 +427,12 @@ <log loggingLevel="INFO" message="Endpoint to get policy model: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps"></log> <toD - uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <convertBodyTo type="java.lang.String"/> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> </doFinally> </doTry> </route> @@ -452,7 +442,7 @@ <log loggingLevel="INFO" message="Removing policy from active PDP group for loop: ${exchangeProperty[loopObject].getName()}"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Removing one policy PDP group')"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Removing one policy PDP group')"/> <setBody> <constant>null</constant> </setBody> @@ -474,7 +464,7 @@ <log loggingLevel="INFO" message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log> <toD - uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> <setProperty propertyName="logMessage"> <simple>${exchangeProperty[policyName]} PDP Group removal status </simple> @@ -499,7 +489,7 @@ <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/> </doFinally> </doTry> </route> diff --git a/src/main/resources/clds/camel/routes/utils-flows.xml b/src/main/resources/clds/camel/routes/utils-flows.xml index bbbc46a20..d5da4faee 100644 --- a/src/main/resources/clds/camel/routes/utils-flows.xml +++ b/src/main/resources/clds/camel/routes/utils-flows.xml @@ -14,11 +14,11 @@ <when> <simple>${exchangeProperty[logComponent]} == null</simple> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" /> </when> <otherwise> <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','${exchangeProperty[logComponent]}',${exchangeProperty[loopObject]})" /> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','${exchangeProperty[logComponent]}',${exchangeProperty[loopObject]})" /> <setProperty propertyName="logComponent"> <constant>null</constant> </setProperty> diff --git a/src/main/resources/clds/key.properties b/src/main/resources/clds/key.properties index dda811040..dda2b87d0 100644 --- a/src/main/resources/clds/key.properties +++ b/src/main/resources/clds/key.properties @@ -1 +1 @@ -org.onap.clamp.encryption.aes.key=aa3871669d893c7fb8abbcda31b88b4f
\ No newline at end of file +org.onap.policy.clamp.encryption.aes.key=aa3871669d893c7fb8abbcda31b88b4f
\ No newline at end of file diff --git a/src/main/script/SelectNpmRepo.groovy b/src/main/script/SelectNpmRepo.groovy index 92371cfe9..797d2d003 100644 --- a/src/main/script/SelectNpmRepo.groovy +++ b/src/main/script/SelectNpmRepo.groovy @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.maven.scripts +package org.onap.policy.clamp.clds.maven.scripts println project.properties['clamp.project.version']; diff --git a/src/main/script/TagVersion.groovy b/src/main/script/TagVersion.groovy index ccfcca3c4..271e2967f 100644 --- a/src/main/script/TagVersion.groovy +++ b/src/main/script/TagVersion.groovy @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.maven.scripts +package org.onap.policy.clamp.maven.scripts println project.properties['clamp.project.version']; def versionArray; diff --git a/src/test/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaServiceTemplateTest.java b/src/test/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaServiceTemplateTest.java deleted file mode 100644 index b1bbd512e..000000000 --- a/src/test/java/org/onap/clamp/controlloop/models/tosca/authorative/concepts/ControlLoopToscaServiceTemplateTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2020 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.clamp.controlloop.models.tosca.authorative.concepts; - -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; - -public class ControlLoopToscaServiceTemplateTest { - - @Test - public void testClassDef() { - ControlLoopToscaServiceTemplate serviceTemplate = new ControlLoopToscaServiceTemplate(); - assertNotNull("ControlLoopToscaServiceTemplate is Not null", serviceTemplate); - } -}
\ No newline at end of file diff --git a/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java b/src/test/java/org/onap/policy/clamp/clds/client/CdsServicesTest.java index 3d189cf71..6e5300e23 100644 --- a/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/client/CdsServicesTest.java @@ -20,13 +20,13 @@ * */ -package org.onap.clamp.clds.client; +package org.onap.policy.clamp.clds.client; import com.google.gson.JsonObject; import java.io.IOException; import org.junit.Test; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; import org.skyscreamer.jsonassert.JSONAssert; public class CdsServicesTest { diff --git a/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java b/src/test/java/org/onap/policy/clamp/clds/config/CldsUserJsonDecoderTest.java index 7152ee11d..605ab99ae 100644 --- a/src/test/java/org/onap/clamp/clds/config/CldsUserJsonDecoderTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/config/CldsUserJsonDecoderTest.java @@ -24,13 +24,13 @@ * */ -package org.onap.clamp.clds.config; +package org.onap.policy.clamp.clds.config; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; -import org.onap.clamp.authorization.CldsUser; -import org.onap.clamp.clds.exception.CldsUsersException; +import org.onap.policy.clamp.authorization.CldsUser; +import org.onap.policy.clamp.clds.exception.CldsUsersException; public class CldsUserJsonDecoderTest { diff --git a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java b/src/test/java/org/onap/policy/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java index 06df124ce..89178b778 100644 --- a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.config.sdc; +package org.onap.policy.clamp.clds.config.sdc; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -34,9 +34,9 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import org.junit.Test; -import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcParametersException; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; /** * This class tests the SDC Controller config. @@ -44,15 +44,17 @@ import org.onap.clamp.clds.util.ResourceFileUtils; public class SdcSingleControllerConfigurationTest { /** - * @param fileName file for sdc controller configuration. + * This method loads the SDC controller configuration from a file located in the resource folder. + * + * @param fileName file for sdc controller configuration. * @param sdcControllerName sdc controller name. * @return instance of SdcSingleControllerConfiguration. */ public static SdcSingleControllerConfiguration loadControllerConfiguration(String fileName, - String sdcControllerName) { + String sdcControllerName) { InputStreamReader streamReader = new InputStreamReader(ResourceFileUtils.getResourceAsStream(fileName), - StandardCharsets.UTF_8); + StandardCharsets.UTF_8); JsonObject jsonNode = JsonUtils.GSON.fromJson(streamReader, JsonObject.class); return new SdcSingleControllerConfiguration(jsonNode, sdcControllerName); @@ -61,7 +63,7 @@ public class SdcSingleControllerConfigurationTest { @Test public final void testTheInit() throws SdcParametersException, IOException { SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-TLS.json", - "sdc-controller1"); + "sdc-controller1"); assertEquals("User", sdcConfig.getUser()); assertEquals("ThePassword", sdcConfig.getPassword()); assertEquals("consumerGroup", sdcConfig.getConsumerGroup()); @@ -72,7 +74,7 @@ public class SdcSingleControllerConfigurationTest { assertEquals(30, sdcConfig.getPollingTimeout()); assertThat(SdcSingleControllerConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST) - .hasSameSizeAs(sdcConfig.getRelevantArtifactTypes()); + .hasSameSizeAs(sdcConfig.getRelevantArtifactTypes()); assertEquals("ThePassword", sdcConfig.getKeyStorePassword()); assertTrue(sdcConfig.activateServerTLSAuth()); assertThat(sdcConfig.getMsgBusAddress()).contains("localhost"); @@ -81,7 +83,7 @@ public class SdcSingleControllerConfigurationTest { @Test(expected = SdcParametersException.class) public final void testAllRequiredParameters() throws IOException { SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-TLS.json", - "sdc-controller1"); + "sdc-controller1"); // No exception should be raised sdcConfig.testAllRequiredParameters(); sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-bad.json", "sdc-controller1"); @@ -91,7 +93,7 @@ public class SdcSingleControllerConfigurationTest { @Test public final void testAllRequiredParametersEmptyEncrypted() throws IOException { SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration( - "clds/sdc-controller-config-empty-encrypted.json", "sdc-controller1"); + "clds/sdc-controller-config-empty-encrypted.json", "sdc-controller1"); sdcConfig.testAllRequiredParameters(); assertNull(sdcConfig.getKeyStorePassword()); } @@ -99,7 +101,7 @@ public class SdcSingleControllerConfigurationTest { @Test public final void testConsumerGroupWithNull() throws IOException { SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-NULL.json", - "sdc-controller1"); + "sdc-controller1"); assertTrue(sdcConfig.getConsumerGroup() == null); } } diff --git a/src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java b/src/test/java/org/onap/policy/clamp/clds/it/AuthorizationControllerItCase.java index 207e93684..557a2e96c 100644 --- a/src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/it/AuthorizationControllerItCase.java @@ -24,7 +24,7 @@ * */ -package org.onap.clamp.clds.it; +package org.onap.policy.clamp.clds.it; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -38,9 +38,9 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; -import org.onap.clamp.authorization.AuthorizationController; -import org.onap.clamp.authorization.SecureServicePermission; -import org.onap.clamp.clds.exception.NotAuthorizedException; +import org.onap.policy.clamp.authorization.AuthorizationController; +import org.onap.policy.clamp.authorization.SecureServicePermission; +import org.onap.policy.clamp.clds.exception.NotAuthorizedException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.core.Authentication; @@ -121,7 +121,7 @@ public class AuthorizationControllerItCase { @Test public void testIsUserPermitted() { - assertEquals(AuthorizationController.getPrincipalName(sc),"admin"); + assertEquals(AuthorizationController.getPrincipalName(sc), "admin"); assertTrue(auth.isUserPermitted(new SecureServicePermission("permission-type-cl", "dev", "read"))); assertTrue(auth.isUserPermitted(new SecureServicePermission("permission-type-cl-manage", "dev", "DEPLOY"))); assertTrue(auth.isUserPermitted( diff --git a/src/test/java/org/onap/clamp/clds/it/CldsHealthcheckServiceItCase.java b/src/test/java/org/onap/policy/clamp/clds/it/CldsHealthcheckServiceItCase.java index 587b7c915..52da63952 100644 --- a/src/test/java/org/onap/clamp/clds/it/CldsHealthcheckServiceItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/it/CldsHealthcheckServiceItCase.java @@ -20,15 +20,15 @@ * =================================================================== */ -package org.onap.clamp.clds.it; +package org.onap.policy.clamp.clds.it; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.model.CldsHealthCheck; -import org.onap.clamp.clds.service.CldsHealthcheckService; +import org.onap.policy.clamp.clds.model.CldsHealthCheck; +import org.onap.policy.clamp.clds.service.CldsHealthcheckService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; diff --git a/src/test/java/org/onap/clamp/clds/it/HttpsItCase.java b/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java index 90a240181..9dd2130c6 100644 --- a/src/test/java/org/onap/clamp/clds/it/HttpsItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.it; +package org.onap.policy.clamp.clds.it; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/org/onap/clamp/clds/it/RobotItCase.java b/src/test/java/org/onap/policy/clamp/clds/it/RobotItCase.java index 5eff96e44..8c06929e1 100644 --- a/src/test/java/org/onap/clamp/clds/it/RobotItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/it/RobotItCase.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.it; +package org.onap.policy.clamp.clds.it; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; diff --git a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java b/src/test/java/org/onap/policy/clamp/clds/it/config/CldsReferencePropertiesItCase.java index c4c0c345a..c8b9932cc 100644 --- a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/it/config/CldsReferencePropertiesItCase.java @@ -21,22 +21,19 @@ * */ -package org.onap.clamp.clds.it.config; +package org.onap.policy.clamp.clds.it.config; import static org.junit.Assert.assertEquals; import java.io.IOException; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -/** - * Test corg.onap.clamp.ClampDesigner.model.refprop package using RefProp. - */ @RunWith(SpringRunner.class) @SpringBootTest public class CldsReferencePropertiesItCase { diff --git a/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java b/src/test/java/org/onap/policy/clamp/clds/it/config/SdcControllersConfigurationItCase.java index 0c08a2e36..516fc7a09 100644 --- a/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/it/config/SdcControllersConfigurationItCase.java @@ -18,22 +18,20 @@ * ============LICENSE_END========================================================= */ -package org.onap.clamp.clds.it.config; +package org.onap.policy.clamp.clds.it.config; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import com.google.gson.JsonSyntaxException; - import java.io.IOException; import java.util.Map; - import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.config.sdc.SdcControllersConfiguration; -import org.onap.clamp.clds.config.sdc.SdcSingleControllerConfiguration; -import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException; +import org.onap.policy.clamp.clds.config.sdc.SdcControllersConfiguration; +import org.onap.policy.clamp.clds.config.sdc.SdcSingleControllerConfiguration; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcParametersException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; @@ -45,7 +43,7 @@ import org.springframework.test.util.ReflectionTestUtils; */ @RunWith(SpringRunner.class) @SpringBootTest -@ActiveProfiles({"clamp-default","clamp-default-user","clamp-sdc-controller"}) +@ActiveProfiles({"clamp-default", "clamp-default-user", "clamp-sdc-controller"}) public class SdcControllersConfigurationItCase { @Autowired diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java b/src/test/java/org/onap/policy/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java index a8c3e58d4..787118902 100644 --- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java @@ -23,7 +23,7 @@ * */ -package org.onap.clamp.clds.it.sdc.controller; +package org.onap.policy.clamp.clds.it.sdc.controller; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -33,19 +33,18 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; - import org.assertj.core.api.Assertions; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; -import org.onap.clamp.clds.config.ClampProperties; -import org.onap.clamp.clds.config.sdc.SdcSingleControllerConfigurationTest; -import org.onap.clamp.clds.exception.sdc.controller.SdcControllerException; -import org.onap.clamp.clds.sdc.controller.SdcSingleController; -import org.onap.clamp.clds.sdc.controller.SdcSingleControllerStatus; -import org.onap.clamp.clds.sdc.controller.installer.CsarHandler; -import org.onap.clamp.loop.CsarInstaller; +import org.onap.policy.clamp.clds.config.ClampProperties; +import org.onap.policy.clamp.clds.config.sdc.SdcSingleControllerConfigurationTest; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcControllerException; +import org.onap.policy.clamp.clds.sdc.controller.SdcSingleController; +import org.onap.policy.clamp.clds.sdc.controller.SdcSingleControllerStatus; +import org.onap.policy.clamp.clds.sdc.controller.installer.CsarHandler; +import org.onap.policy.clamp.loop.CsarInstaller; import org.onap.sdc.api.notification.IArtifactInfo; import org.onap.sdc.api.notification.INotificationData; import org.onap.sdc.api.notification.IResourceInstance; @@ -58,7 +57,7 @@ import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest -@ActiveProfiles({"clamp-default","clamp-default-user","clamp-sdc-controller"}) +@ActiveProfiles({"clamp-default", "clamp-default-user", "clamp-sdc-controller"}) public class SdcSingleControllerItCase { private static final String CSAR_ARTIFACT_NAME = "testArtifact.csar"; @@ -133,7 +132,7 @@ public class SdcSingleControllerItCase { // given Class<?> innerClass = Class - .forName("org.onap.clamp.clds.sdc.controller.SdcSingleController$SdcNotificationCallBack"); + .forName("org.onap.policy.clamp.clds.sdc.controller.SdcSingleController$SdcNotificationCallBack"); Constructor<?> constructor = innerClass.getDeclaredConstructor(SdcSingleController.class, SdcSingleController.class); constructor.setAccessible(true); diff --git a/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java b/src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java index 50da40049..0e7fe6c7e 100644 --- a/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java @@ -21,21 +21,20 @@ * */ -package org.onap.clamp.clds.model.dcae; +package org.onap.policy.clamp.clds.model.dcae; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import java.util.HashSet; import java.util.Set; - import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.builder.ExchangeBuilder; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; +import org.onap.policy.clamp.clds.Application; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; diff --git a/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java b/src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseTest.java index fc4872c3b..a246e0efa 100644 --- a/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/model/dcae/DcaeInventoryResponseTest.java @@ -21,12 +21,11 @@ * */ -package org.onap.clamp.clds.model.dcae; +package org.onap.policy.clamp.clds.model.dcae; import static org.assertj.core.api.Assertions.assertThat; import java.util.TreeSet; - import org.junit.Test; public class DcaeInventoryResponseTest { diff --git a/src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java b/src/test/java/org/onap/policy/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java index 560f54cf4..7999709c2 100644 --- a/src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java @@ -20,15 +20,14 @@ * */ -package org.onap.clamp.clds.model.jsontype; +package org.onap.policy.clamp.clds.model.jsontype; import static org.assertj.core.api.Assertions.assertThat; import com.google.gson.JsonObject; - import org.hibernate.HibernateException; import org.junit.Test; -import org.onap.clamp.dao.model.jsontype.JsonTypeDescriptor; +import org.onap.policy.clamp.dao.model.jsontype.JsonTypeDescriptor; public class JsonTypeDescriptorTest { @@ -37,10 +36,10 @@ public class JsonTypeDescriptorTest { @Test public void testFromString() { JsonObject object = new JsonObject(); - object.addProperty("one","oneValue"); + object.addProperty("one", "oneValue"); JsonObject child = new JsonObject(); - child.addProperty("two","twoValue"); - object.add("child",child); + child.addProperty("two", "twoValue"); + object.add("child", child); JsonObject jsonResult = descriptor.fromString("{\"one\":\"oneValue\",\"child\":{\"two\":\"twoValue\"}}"); @@ -53,10 +52,10 @@ public class JsonTypeDescriptorTest { assertThat(res1).isNull(); JsonObject object = new JsonObject(); - object.addProperty("one","oneValue"); + object.addProperty("one", "oneValue"); JsonObject child = new JsonObject(); - child.addProperty("two","twoValue"); - object.add("child",child); + child.addProperty("two", "twoValue"); + object.add("child", child); String res2 = descriptor.unwrap(object, String.class, null); assertThat(res2.replace("\n", "").replace(" ", "")) .isEqualTo("{\"one\":\"oneValue\",\"child\":{\"two\":\"twoValue\"}}"); @@ -70,7 +69,7 @@ public class JsonTypeDescriptorTest { @Test(expected = HibernateException.class) public void testUnwrapExpectationThrown() { JsonObject object = new JsonObject(); - object.addProperty("one","oneValue"); + object.addProperty("one", "oneValue"); descriptor.unwrap(object, Integer.class, null); } @@ -81,10 +80,10 @@ public class JsonTypeDescriptorTest { assertThat(res1).isNull(); JsonObject object = new JsonObject(); - object.addProperty("one","oneValue"); + object.addProperty("one", "oneValue"); JsonObject child = new JsonObject(); - child.addProperty("two","twoValue"); - object.add("child",child); + child.addProperty("two", "twoValue"); + object.add("child", child); JsonObject res2 = descriptor.wrap("{\"one\":\"oneValue\",\"child\":{\"two\":\"twoValue\"}}", null); assertThat(res2).isEqualTo(object); } diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java b/src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintParserTest.java index a768526a0..085b3d187 100644 --- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/BlueprintParserTest.java @@ -23,7 +23,7 @@ * */ -package org.onap.clamp.clds.sdc.controller.installer; +package org.onap.policy.clamp.clds.sdc.controller.installer; import static org.assertj.core.api.Assertions.assertThat; @@ -42,8 +42,8 @@ import org.json.JSONObject; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.exception.sdc.controller.BlueprintParserException; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; import org.yaml.snakeyaml.Yaml; public class BlueprintParserTest { diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java b/src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java index 83b3dda01..d7a3b3823 100644 --- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java @@ -21,13 +21,12 @@ * */ -package org.onap.clamp.clds.sdc.controller.installer; +package org.onap.policy.clamp.clds.sdc.controller.installer; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; - import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java b/src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/CsarHandlerTest.java index f04e3fa3c..08e425abf 100644 --- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/sdc/controller/installer/CsarHandlerTest.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.sdc.controller.installer; +package org.onap.policy.clamp.clds.sdc.controller.installer; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -36,13 +36,12 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; - import org.apache.commons.io.IOUtils; import org.junit.Test; import org.mockito.Mockito; -import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException; -import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.exception.sdc.controller.CsarHandlerException; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; import org.onap.sdc.api.notification.IArtifactInfo; import org.onap.sdc.api.notification.INotificationData; import org.onap.sdc.api.notification.IResourceInstance; diff --git a/src/test/java/org/onap/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java b/src/test/java/org/onap/policy/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java index 01dc8404c..f70e74cd6 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java @@ -21,17 +21,17 @@ * */ -package org.onap.clamp.clds.tosca; +package org.onap.policy.clamp.clds.tosca; import static org.assertj.core.api.Assertions.assertThat; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.tosca.Dictionary; -import org.onap.clamp.tosca.DictionaryElement; -import org.onap.clamp.tosca.DictionaryRepository; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.tosca.Dictionary; +import org.onap.policy.clamp.tosca.DictionaryElement; +import org.onap.policy.clamp.tosca.DictionaryRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/src/test/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertorTestItCase.java b/src/test/java/org/onap/policy/clamp/clds/tosca/ToscaYamlToJsonConvertorTestItCase.java index e73547652..6ff82b6d7 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertorTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/ToscaYamlToJsonConvertorTestItCase.java @@ -22,7 +22,7 @@ * */ -package org.onap.clamp.clds.tosca; +package org.onap.policy.clamp.clds.tosca; import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -32,11 +32,11 @@ import java.io.IOException; import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.tosca.Dictionary; -import org.onap.clamp.tosca.DictionaryElement; -import org.onap.clamp.tosca.DictionaryService; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.tosca.Dictionary; +import org.onap.policy.clamp.tosca.DictionaryElement; +import org.onap.policy.clamp.tosca.DictionaryService; import org.skyscreamer.jsonassert.JSONAssert; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ArrayFieldTest.java b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ArrayFieldTest.java index 8a81445b2..6f6f5c104 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ArrayFieldTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ArrayFieldTest.java @@ -21,17 +21,17 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; import com.google.gson.JsonArray; import java.io.IOException; import java.util.ArrayList; import junit.framework.TestCase; -import org.onap.clamp.clds.tosca.update.elements.ArrayField; -import org.onap.clamp.clds.tosca.update.elements.ToscaElement; -import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.tosca.update.elements.ArrayField; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElement; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; public class ArrayFieldTest extends TestCase { diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ConstraintTest.java b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ConstraintTest.java index f147f404d..493ee992c 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ConstraintTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ConstraintTest.java @@ -21,17 +21,17 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; import com.google.gson.JsonObject; import java.io.IOException; import java.util.ArrayList; import junit.framework.TestCase; -import org.onap.clamp.clds.tosca.update.elements.ToscaElement; -import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplate; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElement; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplate; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; public class ConstraintTest extends TestCase { diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java b/src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateFieldTest.java index 29f5a1da8..3eaa0ce51 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateFieldTest.java @@ -21,10 +21,10 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; import junit.framework.TestCase; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateField; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateField; public class JsonTemplateFieldTest extends TestCase { @@ -39,10 +39,10 @@ public class JsonTemplateFieldTest extends TestCase { * Test fieldsEqual method. */ public void testFieldsEqualsMethod() { - assertFalse(JsonTemplateField.fieldsEquals(field1,field3)); - assertFalse(JsonTemplateField.fieldsEquals(field1,field4)); - assertFalse(JsonTemplateField.fieldsEquals(field1,field5)); - assertTrue(JsonTemplateField.fieldsEquals(field1,field6)); + assertFalse(JsonTemplateField.fieldsEquals(field1, field3)); + assertFalse(JsonTemplateField.fieldsEquals(field1, field4)); + assertFalse(JsonTemplateField.fieldsEquals(field1, field5)); + assertTrue(JsonTemplateField.fieldsEquals(field1, field6)); } /** diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateManagerTest.java b/src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateManagerTest.java index b9fcf51aa..2c8744f33 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateManagerTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateManagerTest.java @@ -21,17 +21,17 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import junit.framework.TestCase; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplate; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateField; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplate; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateField; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; public class JsonTemplateManagerTest extends TestCase { @@ -45,9 +45,9 @@ public class JsonTemplateManagerTest extends TestCase { JsonTemplateManager jsonTemplateManager = new JsonTemplateManager( ResourceFileUtils.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap" - + ".policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?" - + "connectionTimeToLive=5000/.file"), ResourceFileUtils.getResourceAsString( - "clds/tosca-converter/default-tosca-types.yaml"), + + ".policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/.file"), + ResourceFileUtils.getResourceAsString( + "clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtils.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.monitoring.cdap.tca.hi.lo.app"; jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); @@ -63,9 +63,9 @@ public class JsonTemplateManagerTest extends TestCase { JsonTemplateManager jsonTemplateManager = new JsonTemplateManager( ResourceFileUtils.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap" - + ".policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?" - + "connectionTimeToLive=5000/.file"), ResourceFileUtils.getResourceAsString( - "clds/tosca-converter/default-tosca-types.yaml"), + + ".policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0/.file"), + ResourceFileUtils.getResourceAsString( + "clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtils.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.controlloop.guard.common.FrequencyLimiter"; jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); @@ -81,9 +81,9 @@ public class JsonTemplateManagerTest extends TestCase { JsonTemplateManager jsonTemplateManager = new JsonTemplateManager( ResourceFileUtils.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap" - + ".policies.controlloop.operational.common.Apex/versions/1.0.0?" - + "connectionTimeToLive=5000/.file"), ResourceFileUtils.getResourceAsString( - "clds/tosca-converter/default-tosca-types.yaml"), + + ".policies.controlloop.operational.common.Apex/versions/1.0.0/.file"), + ResourceFileUtils.getResourceAsString( + "clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtils.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.controlloop.operational.common.Apex"; jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); @@ -99,9 +99,9 @@ public class JsonTemplateManagerTest extends TestCase { JsonTemplateManager jsonTemplateManager = new JsonTemplateManager( ResourceFileUtils.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap" - + ".policies.controlloop.operational.common.Drools/versions/1.0.0?" - + "connectionTimeToLive=5000/.file"), ResourceFileUtils.getResourceAsString( - "clds/tosca-converter/default-tosca-types.yaml"), + + ".policies.controlloop.operational.common.Drools/versions/1.0.0/.file"), + ResourceFileUtils.getResourceAsString( + "clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtils.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.controlloop.operational.common.Drools"; jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateTest.java b/src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateTest.java index dc736a48b..dc27d8aaa 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/update/JsonTemplateTest.java @@ -21,14 +21,14 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import junit.framework.TestCase; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplate; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateField; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplate; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateField; public class JsonTemplateTest extends TestCase { diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java index b5b0247c8..658419d4c 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java @@ -21,23 +21,23 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; import com.google.gson.JsonObject; import java.io.IOException; import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; -import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParserWithDictionarySupport; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.tosca.Dictionary; -import org.onap.clamp.tosca.DictionaryElement; -import org.onap.clamp.tosca.DictionaryService; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; +import org.onap.policy.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParserWithDictionarySupport; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.tosca.Dictionary; +import org.onap.policy.clamp.tosca.DictionaryElement; +import org.onap.policy.clamp.tosca.DictionaryService; import org.skyscreamer.jsonassert.JSONAssert; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -46,7 +46,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = Application.class) -@ActiveProfiles({"clamp-default","clamp-default-user","default-dictionary-elements"}) +@ActiveProfiles({"clamp-default", "clamp-default-user", "default-dictionary-elements"}) public class ToscaConverterWithDictionarySupportItCase { @Autowired @@ -132,8 +132,7 @@ public class ToscaConverterWithDictionarySupportItCase { JsonTemplateManager jsonTemplateManager = new JsonTemplateManager( ResourceFileUtils.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap" - + ".policies.controlloop.operational.common.Apex/versions/1.0" - + ".0?connectionTimeToLive=5000/.file"), + + ".policies.controlloop.operational.common.Apex/versions/1.0.0/.file"), ResourceFileUtils.getResourceAsString("clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtils.getResourceAsString("clds/tosca-converter/templates.json")); diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaElementPropertyTest.java b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaElementPropertyTest.java index 52f8444ff..5652fa9cd 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaElementPropertyTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaElementPropertyTest.java @@ -21,18 +21,18 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.policy.clamp.clds.tosca.update; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import java.io.IOException; import java.util.ArrayList; import junit.framework.TestCase; -import org.onap.clamp.clds.tosca.update.elements.ToscaElement; -import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplate; -import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager; -import org.onap.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElement; +import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplate; +import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; public class ToscaElementPropertyTest extends TestCase { public ToscaElementPropertyTest() throws IOException { diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaElementTest.java b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaElementTest.java index ba8454bb2..7b17adeec 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaElementTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaElementTest.java @@ -21,15 +21,15 @@ *
*/
-package org.onap.clamp.clds.tosca.update;
+package org.onap.policy.clamp.clds.tosca.update;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import junit.framework.TestCase;
-import org.onap.clamp.clds.tosca.update.elements.ToscaElement;
-import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager;
-import org.onap.clamp.clds.util.ResourceFileUtils;
+import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElement;
+import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager;
+import org.onap.policy.clamp.clds.util.ResourceFileUtils;
public class ToscaElementTest extends TestCase {
diff --git a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java b/src/test/java/org/onap/policy/clamp/clds/util/CryptoUtilsTest.java index f6054d538..6239fef80 100644 --- a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/util/CryptoUtilsTest.java @@ -23,7 +23,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -31,10 +31,8 @@ import static org.junit.Assert.assertNotNull; import static org.mockito.ArgumentMatchers.eq; import java.security.InvalidKeyException; - import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; - import org.apache.commons.codec.binary.Hex; import org.apache.commons.lang3.ArrayUtils; import org.junit.Test; diff --git a/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java b/src/test/java/org/onap/policy/clamp/clds/util/JsonUtilsTest.java index bc2ec2122..b2c6d282a 100644 --- a/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/util/JsonUtilsTest.java @@ -24,13 +24,12 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import java.io.IOException; - import org.junit.Test; public class JsonUtilsTest { @@ -63,8 +62,9 @@ public class JsonUtilsTest { public void testCreateBeanDeserializer() { TestClass test = new TestClass("value1", "value2"); test.setObject2(new TestObject2("test3")); - Object testObject = JsonUtils.GSON.fromJson("[\"org.onap.clamp.clds.util.JsonUtilsTest$TestClass\"" - + ",{\"test\":\"value1\",\"test2\":\"value2\",\"object2\":[\"org.onap.clamp.clds.util.TestObject2\"," + Object testObject = JsonUtils.GSON.fromJson("[\"org.onap.policy.clamp.clds.util.JsonUtilsTest$TestClass\"" + + ",{\"test\":\"value1\",\"test2\":\"value2\"," + + "\"object2\":[\"org.onap.policy.clamp.clds.util.TestObject2\"," + "{\"test3\":\"test3\"}]}]", Object.class); assertNotNull(testObject); assertFalse(testObject instanceof TestObject); diff --git a/src/test/java/org/onap/clamp/clds/util/LoggingUtilsTest.java b/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java index 7e823e163..ab6a41bca 100644 --- a/src/test/java/org/onap/clamp/clds/util/LoggingUtilsTest.java +++ b/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java @@ -19,7 +19,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; diff --git a/src/test/java/org/onap/clamp/clds/util/TestObject.java b/src/test/java/org/onap/policy/clamp/clds/util/TestObject.java index 418c80815..02cabd270 100644 --- a/src/test/java/org/onap/clamp/clds/util/TestObject.java +++ b/src/test/java/org/onap/policy/clamp/clds/util/TestObject.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; public class TestObject { diff --git a/src/test/java/org/onap/clamp/clds/util/TestObject2.java b/src/test/java/org/onap/policy/clamp/clds/util/TestObject2.java index 4fd77c230..d5abf41d0 100644 --- a/src/test/java/org/onap/clamp/clds/util/TestObject2.java +++ b/src/test/java/org/onap/policy/clamp/clds/util/TestObject2.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.util; +package org.onap.policy.clamp.clds.util; public class TestObject2 { diff --git a/src/test/java/org/onap/clamp/flow/FlowLogOperationTest.java b/src/test/java/org/onap/policy/clamp/flow/FlowLogOperationTest.java index 648c03307..51c4c078a 100644 --- a/src/test/java/org/onap/clamp/flow/FlowLogOperationTest.java +++ b/src/test/java/org/onap/policy/clamp/flow/FlowLogOperationTest.java @@ -20,7 +20,7 @@ * */ -package org.onap.clamp.flow; +package org.onap.policy.clamp.flow; import static junit.framework.Assert.assertEquals; import static org.assertj.core.api.Assertions.assertThat; @@ -31,9 +31,9 @@ import org.apache.camel.Exchange; import org.apache.camel.impl.DefaultExchange; import org.junit.Test; import org.mockito.Mockito; -import org.onap.clamp.clds.util.LoggingUtils; -import org.onap.clamp.clds.util.OnapLogConstants; -import org.onap.clamp.flow.log.FlowLogOperation; +import org.onap.policy.clamp.clds.util.LoggingUtils; +import org.onap.policy.clamp.clds.util.OnapLogConstants; +import org.onap.policy.clamp.flow.log.FlowLogOperation; import org.slf4j.MDC; import org.slf4j.spi.MDCAdapter; import org.springframework.test.util.ReflectionTestUtils; diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/policy/clamp/loop/CsarInstallerItCase.java index aa8054c47..8ef0df5e4 100644 --- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/CsarInstallerItCase.java @@ -24,7 +24,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; @@ -36,26 +36,27 @@ import java.util.Map; import java.util.Optional; import javax.transaction.Transactional; import org.apache.commons.lang3.RandomStringUtils; +import org.assertj.core.api.Assertions; import org.json.JSONException; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; -import org.onap.clamp.clds.Application; -import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException; -import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException; -import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; -import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact; -import org.onap.clamp.clds.sdc.controller.installer.CsarHandler; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.cds.CdsDataInstaller; -import org.onap.clamp.loop.service.ServicesRepository; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.LoopTemplateLoopElementModel; -import org.onap.clamp.loop.template.LoopTemplatesRepository; -import org.onap.clamp.loop.template.PolicyModelId; -import org.onap.clamp.loop.template.PolicyModelsRepository; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.clds.exception.sdc.controller.BlueprintParserException; +import org.onap.policy.clamp.clds.exception.sdc.controller.CsarHandlerException; +import org.onap.policy.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; +import org.onap.policy.clamp.clds.sdc.controller.installer.BlueprintArtifact; +import org.onap.policy.clamp.clds.sdc.controller.installer.CsarHandler; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.cds.CdsDataInstaller; +import org.onap.policy.clamp.loop.service.ServicesRepository; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.LoopTemplateLoopElementModel; +import org.onap.policy.clamp.loop.template.LoopTemplatesRepository; +import org.onap.policy.clamp.loop.template.PolicyModelId; +import org.onap.policy.clamp.loop.template.PolicyModelsRepository; import org.onap.sdc.api.notification.IArtifactInfo; import org.onap.sdc.api.notification.INotificationData; import org.onap.sdc.api.notification.IResourceInstance; @@ -112,6 +113,48 @@ public class CsarInstallerItCase { return blueprintArtifact; } + private CsarHandler buildBadFakeCsarHandler(String generatedName, String csarFileName) throws IOException, + SdcToscaParserException { + + // Build a Bad csar because the blueprint contains a link to a microservice that does not exist in the emulator + // Create fake notification + INotificationData notificationData = Mockito.mock(INotificationData.class); + Mockito.when(notificationData.getServiceVersion()).thenReturn("1.0"); + // Create fake resource in notification + CsarHandler csarHandler = Mockito.mock(CsarHandler.class); + List<IResourceInstance> listResources = new ArrayList<>(); + Mockito.when(notificationData.getResources()).thenReturn(listResources); + Map<String, BlueprintArtifact> blueprintMap = new HashMap<>(); + Mockito.when(csarHandler.getMapOfBlueprints()).thenReturn(blueprintMap); + // Create fake blueprint artifact 1 on resource1 + BlueprintArtifact blueprintArtifact = buildFakeBuildprintArtifact(RESOURCE_INSTANCE_NAME_RESOURCE1, + INVARIANT_RESOURCE1_UUID, "example/sdc/blueprint-dcae/tca-guilin.yaml", "tca-guilin.yaml", + INVARIANT_SERVICE_UUID); + listResources.add(blueprintArtifact.getResourceAttached()); + blueprintMap.put(blueprintArtifact.getBlueprintArtifactName(), blueprintArtifact); + + // Build fake csarhandler + Mockito.when(csarHandler.getSdcNotification()).thenReturn(notificationData); + // Build fake csar Helper + ISdcCsarHelper csarHelper = Mockito.mock(ISdcCsarHelper.class); + Metadata data = Mockito.mock(Metadata.class); + Mockito.when(data.getValue("name")).thenReturn(generatedName); + Mockito.when(notificationData.getServiceName()).thenReturn(generatedName); + Mockito.when(csarHelper.getServiceMetadata()).thenReturn(data); + + // Create helper based on real csar to test policy yaml and global properties + // set + SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); + String path = Thread.currentThread().getContextClassLoader().getResource(csarFileName).getFile(); + ISdcCsarHelper sdcHelper = factory.getSdcCsarHelper(path); + Mockito.when(csarHandler.getSdcCsarHelper()).thenReturn(sdcHelper); + + // Mockito.when(csarHandler.getSdcCsarHelper()).thenReturn(csarHelper); + Mockito.when(csarHandler.getPolicyModelYaml()) + .thenReturn(Optional.ofNullable(ResourceFileUtils.getResourceAsString("tosca/tosca_example.yaml"))); + return csarHandler; + } + private CsarHandler buildFakeCsarHandler(String generatedName, String csarFileName) throws IOException, SdcToscaParserException { // Create fake notification @@ -173,9 +216,8 @@ public class CsarInstallerItCase { Mockito.when(notificationData.getServiceArtifacts()).thenReturn(serviceArtifactsList); CsarHandler csarHandler = new CsarHandler(notificationData, "", ""); - csarHandler - .setFilePath(Thread.currentThread().getContextClassLoader().getResource(CSAR_ARTIFACT_NAME_CDS). - getFile()); + csarHandler.setFilePath(Thread.currentThread().getContextClassLoader().getResource(CSAR_ARTIFACT_NAME_CDS) + .getFile()); Assert.assertEquals(csarHandler.getPolicyModelYaml(), Optional .ofNullable(ResourceFileUtils.getResourceAsString("example/sdc/expected-result/policy-data.yaml"))); } @@ -203,14 +245,25 @@ public class CsarInstallerItCase { assertThat(csarInstaller.isCsarAlreadyDeployed(csarHandler)).isTrue(); } + @Test(expected = SdcArtifactInstallerException.class) + @Transactional + public void testInstallTheBadCsarTca() + throws IOException, SdcToscaParserException, InterruptedException, BlueprintParserException, + SdcArtifactInstallerException { + // This test validates that the blueprint is well rejected because the blueprint contains a link + // to a policy that does not exist on the policy engine emulator. + String generatedName = RandomStringUtils.randomAlphanumeric(5); + csarInstaller.installTheCsar(buildBadFakeCsarHandler(generatedName, CSAR_ARTIFACT_NAME_NO_CDS)); + } + @Test @Transactional @Commit public void testInstallTheCsarTca() throws SdcArtifactInstallerException, SdcToscaParserException, CsarHandlerException, IOException, JSONException, InterruptedException, BlueprintParserException { String generatedName = RandomStringUtils.randomAlphanumeric(5); - CsarHandler csar = buildFakeCsarHandler(generatedName, CSAR_ARTIFACT_NAME_CDS); - csarInstaller.installTheCsar(csar); + csarInstaller.installTheCsar(buildFakeCsarHandler(generatedName, CSAR_ARTIFACT_NAME_CDS)); + assertThat(serviceRepository.existsById("63cac700-ab9a-4115-a74f-7eac85e3fce0")).isTrue(); // We should have CDS info assertThat(serviceRepository.findById("63cac700-ab9a-4115-a74f-7eac85e3fce0").get().getResourceByType("VF") @@ -227,14 +280,15 @@ public class CsarInstallerItCase { LoopTemplate loopTemplate = loopTemplatesRepo.findById(LoopTemplate.generateLoopTemplateName(generatedName, "1.0", RESOURCE_INSTANCE_NAME_RESOURCE1, "tca.yaml")).get(); assertThat(loopTemplate.getLoopElementModelsUsed()).hasSize(1); - assertThat(loopTemplate.getModelService().getServiceUuid()).isEqualTo("63cac700-ab9a-4115-a74f-7eac85e3fce0"); + Assertions.assertThat(loopTemplate.getModelService().getServiceUuid()) + .isEqualTo("63cac700-ab9a-4115-a74f-7eac85e3fce0"); JSONAssert.assertEquals(ResourceFileUtils.getResourceAsString("tosca/model-properties.json"), JsonUtils.GSON_JPA_MODEL.toJson(loopTemplate.getModelService()), true); JSONAssert.assertEquals(ResourceFileUtils.getResourceAsString("tosca/service-details.json"), JsonUtils.GSON_JPA_MODEL.toJson(loopTemplate.getModelService().getServiceDetails()), true); JSONAssert.assertEquals(ResourceFileUtils.getResourceAsString("tosca/resource-details.json"), JsonUtils.GSON_JPA_MODEL.toJson(loopTemplate.getModelService().getResourceDetails()), true); - assertThat(((LoopTemplateLoopElementModel) (loopTemplate.getLoopElementModelsUsed().toArray()[0])) + Assertions.assertThat(((LoopTemplateLoopElementModel) (loopTemplate.getLoopElementModelsUsed().toArray()[0])) .getLoopElementModel().getName()).isNotEmpty(); loopTemplate = loopTemplatesRepo.findById(LoopTemplate.generateLoopTemplateName(generatedName, "1.0", diff --git a/src/test/java/org/onap/clamp/loop/DcaeComponentTest.java b/src/test/java/org/onap/policy/clamp/loop/DcaeComponentTest.java index 022d10eb2..c94937031 100644 --- a/src/test/java/org/onap/clamp/loop/DcaeComponentTest.java +++ b/src/test/java/org/onap/policy/clamp/loop/DcaeComponentTest.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; @@ -34,13 +34,13 @@ import org.apache.camel.Message; import org.json.simple.parser.ParseException; import org.junit.Test; import org.mockito.Mockito; -import org.onap.clamp.clds.model.dcae.DcaeInventoryResponse; -import org.onap.clamp.clds.model.dcae.DcaeOperationStatusResponse; -import org.onap.clamp.loop.components.external.DcaeComponent; -import org.onap.clamp.loop.components.external.ExternalComponentState; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.clds.model.dcae.DcaeInventoryResponse; +import org.onap.policy.clamp.clds.model.dcae.DcaeOperationStatusResponse; +import org.onap.policy.clamp.loop.components.external.DcaeComponent; +import org.onap.policy.clamp.loop.components.external.ExternalComponentState; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; public class DcaeComponentTest { diff --git a/src/test/java/org/onap/clamp/loop/DeployFlowTestItCase.java b/src/test/java/org/onap/policy/clamp/loop/DeployFlowTestItCase.java index 169db9db1..4d02b10dc 100644 --- a/src/test/java/org/onap/clamp/loop/DeployFlowTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/DeployFlowTestItCase.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; @@ -36,11 +36,11 @@ import org.apache.camel.Exchange; import org.apache.camel.builder.ExchangeBuilder; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelsService; -import org.onap.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelsService; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; diff --git a/src/test/java/org/onap/clamp/loop/ExternalComponentStateTest.java b/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java index 34fcc077f..a73b2784b 100644 --- a/src/test/java/org/onap/clamp/loop/ExternalComponentStateTest.java +++ b/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java @@ -21,12 +21,12 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; -import org.onap.clamp.loop.components.external.ExternalComponentState; +import org.onap.policy.clamp.loop.components.external.ExternalComponentState; public class ExternalComponentStateTest { private ExternalComponentState state = new ExternalComponentState("NOT_SENT", diff --git a/src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java b/src/test/java/org/onap/policy/clamp/loop/LoopControllerTestItCase.java index f170bc6df..6728d292c 100644 --- a/src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/LoopControllerTestItCase.java @@ -22,7 +22,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; @@ -33,18 +33,19 @@ import com.google.gson.JsonParser; import java.io.IOException; import java.util.Set; import javax.transaction.Transactional; +import org.assertj.core.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelsService; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.microservice.MicroServicePolicyService; -import org.onap.clamp.policy.operational.OperationalPolicy; -import org.onap.clamp.policy.operational.OperationalPolicyService; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelsService; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicyService; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @@ -163,8 +164,8 @@ public class LoopControllerTestItCase { assertThat(opPolicyList.size()).isEqualTo(1); for (OperationalPolicy policy : opPolicyList) { assertThat(policy.getName().contains("OPERATIONAL_serviceName")).isTrue(); - assertThat(policy.getPolicyModel().getPolicyModelType()).isEqualTo("testPolicyModel"); - assertThat(policy.getPolicyModel().getVersion()).isEqualTo("1.0.0"); + Assertions.assertThat(policy.getPolicyModel().getPolicyModelType()).isEqualTo("testPolicyModel"); + Assertions.assertThat(policy.getPolicyModel().getVersion()).isEqualTo("1.0.0"); } loopController.removeOperationalPolicy(EXAMPLE_LOOP_NAME, "testPolicyModel", "1.0.0"); diff --git a/src/test/java/org/onap/clamp/loop/LoopLogServiceTestItCase.java b/src/test/java/org/onap/policy/clamp/loop/LoopLogServiceTestItCase.java index ddab7b659..7b0ab8614 100644 --- a/src/test/java/org/onap/clamp/loop/LoopLogServiceTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/LoopLogServiceTestItCase.java @@ -20,20 +20,21 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; import com.google.gson.JsonObject; import java.util.Set; import javax.transaction.Transactional; +import org.assertj.core.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.log.LogType; -import org.onap.clamp.loop.log.LoopLog; -import org.onap.clamp.loop.log.LoopLogService; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.log.LogType; +import org.onap.policy.clamp.loop.log.LoopLog; +import org.onap.policy.clamp.loop.log.LoopLogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @@ -90,6 +91,6 @@ public class LoopLogServiceTestItCase { assertThat(log.getLogType()).isEqualTo(LogType.INFO); assertThat(log.getLogComponent()).isEqualTo(CLAMP_COMPONENT); assertThat(log.getId()).isEqualTo(id); - assertThat(log.getLoop()).isEqualTo(testLoop); + Assertions.assertThat(log.getLoop()).isEqualTo(testLoop); } }
\ No newline at end of file diff --git a/src/test/java/org/onap/clamp/loop/LoopRepositoriesItCase.java b/src/test/java/org/onap/policy/clamp/loop/LoopRepositoriesItCase.java index 9815575cc..e18dd2475 100644 --- a/src/test/java/org/onap/clamp/loop/LoopRepositoriesItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/LoopRepositoriesItCase.java @@ -23,7 +23,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; @@ -31,25 +31,26 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import java.time.Instant; +import org.assertj.core.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.loop.log.LogType; -import org.onap.clamp.loop.log.LoopLog; -import org.onap.clamp.loop.log.LoopLogRepository; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.service.ServicesRepository; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.LoopElementModelsRepository; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.LoopTemplatesRepository; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelId; -import org.onap.clamp.loop.template.PolicyModelsRepository; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.microservice.MicroServicePolicyService; -import org.onap.clamp.policy.operational.OperationalPolicy; -import org.onap.clamp.policy.operational.OperationalPolicyService; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.loop.log.LogType; +import org.onap.policy.clamp.loop.log.LoopLog; +import org.onap.policy.clamp.loop.log.LoopLogRepository; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.service.ServicesRepository; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.LoopElementModelsRepository; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.LoopTemplatesRepository; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelId; +import org.onap.policy.clamp.loop.template.PolicyModelsRepository; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicyService; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -201,13 +202,17 @@ public class LoopRepositoriesItCase { assertThat((LoopLog) loopInDbRetrieved.getLoopLogs().toArray()[0]).isEqualToComparingFieldByField(loopLog); assertThat((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]) .isEqualToIgnoringGivenFields(opPolicy, "createdDate", "updatedDate", "createdBy", "updatedBy"); - assertThat(((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]).getCreatedDate()) + Assertions.assertThat( + ((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]).getCreatedDate()) .isNotNull(); - assertThat(((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]).getUpdatedDate()) + Assertions.assertThat( + ((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]).getUpdatedDate()) .isNotNull(); - assertThat(((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]).getCreatedBy()) + Assertions.assertThat( + ((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]).getCreatedBy()) .isNotNull(); - assertThat(((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]).getUpdatedBy()) + Assertions.assertThat( + ((OperationalPolicy) loopInDbRetrieved.getOperationalPolicies().toArray()[0]).getUpdatedBy()) .isNotNull(); assertThat((MicroServicePolicy) loopInDbRetrieved.getMicroServicePolicies().toArray()[0]) diff --git a/src/test/java/org/onap/clamp/loop/LoopServiceTestItCase.java b/src/test/java/org/onap/policy/clamp/loop/LoopServiceTestItCase.java index 15cf59f38..010c4978a 100644 --- a/src/test/java/org/onap/clamp/loop/LoopServiceTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/LoopServiceTestItCase.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; @@ -29,21 +29,22 @@ import com.google.gson.JsonObject; import java.util.Set; import java.util.stream.Collectors; import javax.transaction.Transactional; +import org.assertj.core.api.Assertions; import org.assertj.core.util.Lists; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.log.LogType; -import org.onap.clamp.loop.log.LoopLog; -import org.onap.clamp.loop.log.LoopLogService; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelsService; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.microservice.MicroServicePolicyService; -import org.onap.clamp.policy.operational.OperationalPolicy; -import org.onap.clamp.policy.operational.OperationalPolicyService; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.log.LogType; +import org.onap.policy.clamp.loop.log.LoopLog; +import org.onap.policy.clamp.loop.log.LoopLogService; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelsService; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicyService; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @@ -114,7 +115,7 @@ public class LoopServiceTestItCase { .usingElementComparatorIgnoringFields("loop", "createdBy", "createdDate", "updatedBy", "updatedDate") .contains(operationalPolicy); OperationalPolicy savedPolicy = savedPolicies.iterator().next(); - assertThat(savedPolicy.getLoop().getName()).isEqualTo(EXAMPLE_LOOP_NAME); + Assertions.assertThat(savedPolicy.getLoop().getName()).isEqualTo(EXAMPLE_LOOP_NAME); } @@ -280,7 +281,7 @@ public class LoopServiceTestItCase { .usingElementComparatorIgnoringFields("loop", "createdDate", "updatedDate", "createdBy", "updatedBy") .containsExactly(secondOperationalPolicy); OperationalPolicy savedPolicy = savedPolicies.iterator().next(); - assertThat(savedPolicy.getLoop().getName()).isEqualTo(EXAMPLE_LOOP_NAME); + Assertions.assertThat(savedPolicy.getLoop().getName()).isEqualTo(EXAMPLE_LOOP_NAME); } diff --git a/src/test/java/org/onap/clamp/loop/LoopTemplateLoopElementModelTest.java b/src/test/java/org/onap/policy/clamp/loop/LoopTemplateLoopElementModelTest.java index 70ff9b118..9dcd71ef1 100644 --- a/src/test/java/org/onap/clamp/loop/LoopTemplateLoopElementModelTest.java +++ b/src/test/java/org/onap/policy/clamp/loop/LoopTemplateLoopElementModelTest.java @@ -23,15 +23,15 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.LoopTemplateLoopElementModel; -import org.onap.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.LoopTemplateLoopElementModel; +import org.onap.policy.clamp.loop.template.PolicyModel; public class LoopTemplateLoopElementModelTest { diff --git a/src/test/java/org/onap/clamp/loop/LoopTemplatesServiceItCase.java b/src/test/java/org/onap/policy/clamp/loop/LoopTemplatesServiceItCase.java index b8b1144f6..d608075fc 100644 --- a/src/test/java/org/onap/clamp/loop/LoopTemplatesServiceItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/LoopTemplatesServiceItCase.java @@ -21,7 +21,7 @@ *
*/
-package org.onap.clamp.loop;
+package org.onap.policy.clamp.loop;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
@@ -33,13 +33,13 @@ import java.util.SortedSet; import javax.transaction.Transactional;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.clamp.clds.Application;
-import org.onap.clamp.loop.template.LoopElementModel;
-import org.onap.clamp.loop.template.LoopTemplate;
-import org.onap.clamp.loop.template.LoopTemplateLoopElementModel;
-import org.onap.clamp.loop.template.LoopTemplatesService;
-import org.onap.clamp.loop.template.LoopType;
-import org.onap.clamp.loop.template.PolicyModel;
+import org.onap.policy.clamp.clds.Application;
+import org.onap.policy.clamp.loop.template.LoopElementModel;
+import org.onap.policy.clamp.loop.template.LoopTemplate;
+import org.onap.policy.clamp.loop.template.LoopTemplateLoopElementModel;
+import org.onap.policy.clamp.loop.template.LoopTemplatesService;
+import org.onap.policy.clamp.loop.template.LoopType;
+import org.onap.policy.clamp.loop.template.PolicyModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
diff --git a/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java b/src/test/java/org/onap/policy/clamp/loop/LoopToJsonTest.java index 1d6940f83..0fc4b0b5c 100644 --- a/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java +++ b/src/test/java/org/onap/policy/clamp/loop/LoopToJsonTest.java @@ -23,10 +23,11 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertNotNull; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; @@ -34,16 +35,16 @@ import com.google.gson.JsonSyntaxException; import java.io.IOException; import java.util.Random; import org.junit.Test; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.log.LogType; -import org.onap.clamp.loop.log.LoopLog; -import org.onap.clamp.loop.service.Service; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.operational.OperationalPolicy; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.log.LogType; +import org.onap.policy.clamp.loop.log.LoopLog; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; public class LoopToJsonTest { diff --git a/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java b/src/test/java/org/onap/policy/clamp/loop/PolicyComponentTest.java index 4d2bfe280..ea8785855 100644 --- a/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java +++ b/src/test/java/org/onap/policy/clamp/loop/PolicyComponentTest.java @@ -21,7 +21,9 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; + +import static org.assertj.core.api.Assertions.assertThat; import com.google.gson.Gson; import com.google.gson.JsonObject; @@ -30,15 +32,13 @@ import org.apache.camel.Exchange; import org.apache.camel.Message; import org.junit.Test; import org.mockito.Mockito; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.components.external.ExternalComponentState; -import org.onap.clamp.loop.components.external.PolicyComponent; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.policy.microservice.MicroServicePolicy; -import org.onap.clamp.policy.operational.OperationalPolicy; - -import static org.assertj.core.api.Assertions.assertThat; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.components.external.ExternalComponentState; +import org.onap.policy.clamp.loop.components.external.PolicyComponent; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.policy.operational.OperationalPolicy; public class PolicyComponentTest { diff --git a/src/test/java/org/onap/clamp/loop/PolicyModelServiceItCase.java b/src/test/java/org/onap/policy/clamp/loop/PolicyModelServiceItCase.java index 6f6cad815..e7df80cd8 100644 --- a/src/test/java/org/onap/clamp/loop/PolicyModelServiceItCase.java +++ b/src/test/java/org/onap/policy/clamp/loop/PolicyModelServiceItCase.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; @@ -33,18 +33,19 @@ import java.util.SortedSet; import java.util.TreeSet; import java.util.stream.Collectors; import javax.transaction.Transactional; +import org.assertj.core.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelId; -import org.onap.clamp.loop.template.PolicyModelsRepository; -import org.onap.clamp.loop.template.PolicyModelsService; -import org.onap.clamp.policy.pdpgroup.PdpGroup; -import org.onap.clamp.policy.pdpgroup.PdpSubgroup; -import org.onap.clamp.policy.pdpgroup.PolicyModelKey; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelId; +import org.onap.policy.clamp.loop.template.PolicyModelsRepository; +import org.onap.policy.clamp.loop.template.PolicyModelsService; +import org.onap.policy.clamp.policy.pdpgroup.PdpGroup; +import org.onap.policy.clamp.policy.pdpgroup.PdpSubgroup; +import org.onap.policy.clamp.policy.pdpgroup.PolicyModelKey; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @@ -69,7 +70,7 @@ public class PolicyModelServiceItCase { private static final String POLICY_MODEL_TYPE_2_VERSION_2 = "2.0.0"; private PolicyModel getPolicyModel(String policyType, String policyModelTosca, String version, - String policyAcronym, String policyVariant, String createdBy) { + String policyAcronym, String policyVariant, String createdBy) { PolicyModel policyModel = new PolicyModel(); policyModel.setCreatedBy(createdBy); policyModel.setPolicyAcronym(policyAcronym); @@ -101,13 +102,13 @@ public class PolicyModelServiceItCase { .get()); assertThat(actualPolicyModel.getPolicyModelType()) .isEqualTo(policyModel.getPolicyModelType()); - assertThat(actualPolicyModel.getCreatedBy()).isEqualTo("Not found"); - assertThat(actualPolicyModel.getCreatedDate()).isNotNull(); + Assertions.assertThat(actualPolicyModel.getCreatedBy()).isEqualTo("Not found"); + Assertions.assertThat(actualPolicyModel.getCreatedDate()).isNotNull(); assertThat(actualPolicyModel.getPolicyAcronym()).isEqualTo(policyModel.getPolicyAcronym()); assertThat(actualPolicyModel.getPolicyModelTosca()) .isEqualTo(policyModel.getPolicyModelTosca()); - assertThat(actualPolicyModel.getUpdatedBy()).isEqualTo("Not found"); - assertThat(actualPolicyModel.getUpdatedDate()).isNotNull(); + Assertions.assertThat(actualPolicyModel.getUpdatedBy()).isEqualTo("Not found"); + Assertions.assertThat(actualPolicyModel.getUpdatedDate()).isNotNull(); assertThat(actualPolicyModel.getVersion()).isEqualTo(policyModel.getVersion()); assertThat( diff --git a/src/test/java/org/onap/clamp/loop/ServiceTest.java b/src/test/java/org/onap/policy/clamp/loop/ServiceTest.java index 2b6fab8b6..8f28299fd 100644 --- a/src/test/java/org/onap/clamp/loop/ServiceTest.java +++ b/src/test/java/org/onap/policy/clamp/loop/ServiceTest.java @@ -21,15 +21,14 @@ * */ -package org.onap.clamp.loop; +package org.onap.policy.clamp.loop; import static org.assertj.core.api.Assertions.assertThat; import com.google.gson.JsonObject; - import org.junit.Test; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.service.Service; public class ServiceTest { @@ -40,7 +39,7 @@ public class ServiceTest { String serviceStr3 = "{\"name\": \"vLoadBalancerMS\",\"UUID\": \"63cac700-ab9a-4115-a74f-7eac85e3fc11\"}"; String resourceStr = "{\"CP\": {}}"; - Service service1 = new Service(JsonUtils.GSON.fromJson(serviceStr1, JsonObject.class), + Service service1 = new Service(JsonUtils.GSON.fromJson(serviceStr1, JsonObject.class), JsonUtils.GSON.fromJson(resourceStr, JsonObject.class), "1.0"); Service service2 = new Service(JsonUtils.GSON.fromJson(serviceStr2, JsonObject.class), null, "1.0"); diff --git a/src/test/java/org/onap/clamp/loop/deploy/BlueprintInputParametersTest.java b/src/test/java/org/onap/policy/clamp/loop/deploy/BlueprintInputParametersTest.java index 8a5b5876f..f7f6baa0c 100644 --- a/src/test/java/org/onap/clamp/loop/deploy/BlueprintInputParametersTest.java +++ b/src/test/java/org/onap/policy/clamp/loop/deploy/BlueprintInputParametersTest.java @@ -24,7 +24,7 @@ * */ -package org.onap.clamp.loop.deploy; +package org.onap.policy.clamp.loop.deploy; import com.google.gson.JsonObject; import java.io.IOException; @@ -32,12 +32,12 @@ import java.util.LinkedHashSet; import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.Loop; -import org.onap.clamp.loop.template.LoopElementModel; -import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.policy.microservice.MicroServicePolicy; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.Loop; +import org.onap.policy.clamp.loop.template.LoopElementModel; +import org.onap.policy.clamp.loop.template.LoopTemplate; +import org.onap.policy.clamp.policy.microservice.MicroServicePolicy; import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException; public class BlueprintInputParametersTest { diff --git a/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java b/src/test/java/org/onap/policy/clamp/policy/downloader/PolicyEngineControllerTestItCase.java index 51b93767f..657adf1d1 100644 --- a/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java +++ b/src/test/java/org/onap/policy/clamp/policy/downloader/PolicyEngineControllerTestItCase.java @@ -1,4 +1,4 @@ -package org.onap.clamp.policy.downloader; +package org.onap.policy.clamp.policy.downloader; /*- * ============LICENSE_START======================================================= * ONAP CLAMP @@ -33,11 +33,11 @@ import javax.transaction.Transactional; import org.json.simple.parser.ParseException; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.loop.template.PolicyModel; -import org.onap.clamp.loop.template.PolicyModelId; -import org.onap.clamp.loop.template.PolicyModelsRepository; +import org.onap.policy.clamp.clds.Application; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.loop.template.PolicyModelId; +import org.onap.policy.clamp.loop.template.PolicyModelsRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; @@ -45,7 +45,7 @@ import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest(classes = Application.class) -@ActiveProfiles({"clamp-default","clamp-policy-controller"}) +@ActiveProfiles({"clamp-default", "clamp-policy-controller"}) public class PolicyEngineControllerTestItCase { @Autowired diff --git a/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java b/src/test/java/org/onap/policy/clamp/policy/microservice/MicroServicePayloadTest.java index 0bfb6ece0..4bb850c35 100644 --- a/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java +++ b/src/test/java/org/onap/policy/clamp/policy/microservice/MicroServicePayloadTest.java @@ -21,14 +21,14 @@ * */ -package org.onap.clamp.policy.microservice; +package org.onap.policy.clamp.policy.microservice; import com.google.gson.JsonObject; import java.io.IOException; import org.junit.Test; -import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.template.PolicyModel; +import org.onap.policy.clamp.clds.util.JsonUtils; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.template.PolicyModel; import org.skyscreamer.jsonassert.JSONAssert; public class MicroServicePayloadTest { @@ -37,10 +37,11 @@ public class MicroServicePayloadTest { public void testPayloadConstruction() throws IOException { MicroServicePolicy policy = new MicroServicePolicy("testPolicy", new PolicyModel( "onap.policies.monitoring.cdap.tca.hi.lo.app", - ResourceFileUtils.getResourceAsString("tosca/tosca_example.yaml"),"1.0.0"), false,null,null, null,null); + ResourceFileUtils.getResourceAsString("tosca/tosca_example.yaml"), "1.0.0"), false, null, null, null, + null); policy.setConfigurationsJson(JsonUtils.GSON.fromJson( - ResourceFileUtils.getResourceAsString("tosca/micro-service-policy-properties.json"), JsonObject.class)); + ResourceFileUtils.getResourceAsString("tosca/micro-service-policy-properties.json"), JsonObject.class)); JSONAssert.assertEquals(ResourceFileUtils.getResourceAsString("tosca/micro-service-policy-payload.json"), - policy.createPolicyPayload(), false); + policy.createPolicyPayload(), false); } } diff --git a/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java b/src/test/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java index 322548bb4..136430c8f 100644 --- a/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java +++ b/src/test/java/org/onap/policy/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.policy.operational; +package org.onap.policy.clamp.policy.operational; import static org.assertj.core.api.Assertions.assertThat; @@ -29,8 +29,8 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import java.io.IOException; import org.junit.Test; -import org.onap.clamp.clds.util.ResourceFileUtils; -import org.onap.clamp.loop.service.Service; +import org.onap.policy.clamp.clds.util.ResourceFileUtils; +import org.onap.policy.clamp.loop.service.Service; import org.skyscreamer.jsonassert.JSONAssert; public class OperationalPolicyRepresentationBuilderTest { diff --git a/src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java b/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroupTest.java index b6f7c5491..699693de0 100644 --- a/src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java +++ b/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroupTest.java @@ -21,17 +21,15 @@ * */ -package org.onap.clamp.policy.pdpgroup; +package org.onap.policy.clamp.policy.pdpgroup; import static org.assertj.core.api.Assertions.assertThat; import com.google.gson.JsonArray; import com.google.gson.JsonObject; - import java.io.IOException; import java.util.LinkedList; import java.util.List; - import org.junit.Test; public class PdpGroupTest { diff --git a/src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java b/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PolicyModelKeyTest.java index 413ce60ab..d4cf27392 100644 --- a/src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java +++ b/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PolicyModelKeyTest.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.policy.pdpgroup; +package org.onap.policy.clamp.policy.pdpgroup; import static org.assertj.core.api.Assertions.assertThat; @@ -32,9 +32,9 @@ public class PolicyModelKeyTest { @Test public void testEqualsMethod() throws IOException { - PolicyModelKey key1 = new PolicyModelKey("name1","1.0.0"); - PolicyModelKey key2 = new PolicyModelKey(null,"1.0.0"); - PolicyModelKey key3 = new PolicyModelKey("name1",null); + PolicyModelKey key1 = new PolicyModelKey("name1", "1.0.0"); + PolicyModelKey key2 = new PolicyModelKey(null, "1.0.0"); + PolicyModelKey key3 = new PolicyModelKey("name1", null); assertThat(key1.equals(null)).isFalse(); assertThat(key1.equals("key2")).isFalse(); @@ -42,13 +42,13 @@ public class PolicyModelKeyTest { assertThat(key2.equals(key1)).isFalse(); assertThat(key3.equals(key1)).isFalse(); - PolicyModelKey key4 = new PolicyModelKey("name2","1.0.0"); - PolicyModelKey key5 = new PolicyModelKey("name1","2.0.0"); + PolicyModelKey key4 = new PolicyModelKey("name2", "1.0.0"); + PolicyModelKey key5 = new PolicyModelKey("name1", "2.0.0"); assertThat(key1.equals(key4)).isFalse(); assertThat(key1.equals(key5)).isFalse(); - PolicyModelKey key6 = new PolicyModelKey("name(.*)","1.0.0"); - PolicyModelKey key7 = new PolicyModelKey("name1","1.0.0"); + PolicyModelKey key6 = new PolicyModelKey("name(.*)", "1.0.0"); + PolicyModelKey key7 = new PolicyModelKey("name1", "1.0.0"); assertThat(key1.equals(key6)).isTrue(); assertThat(key1.equals(key7)).isTrue(); } diff --git a/src/test/java/org/onap/clamp/tosca/DictionaryServiceItCase.java b/src/test/java/org/onap/policy/clamp/tosca/DictionaryServiceItCase.java index 55d347ceb..fdde53a21 100644 --- a/src/test/java/org/onap/clamp/tosca/DictionaryServiceItCase.java +++ b/src/test/java/org/onap/policy/clamp/tosca/DictionaryServiceItCase.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.tosca; +package org.onap.policy.clamp.tosca; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertNotNull; @@ -32,7 +32,7 @@ import javax.persistence.EntityNotFoundException; import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.clamp.clds.Application; +import org.onap.policy.clamp.clds.Application; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; diff --git a/src/test/java/org/onap/clamp/util/PassDecoderTest.java b/src/test/java/org/onap/policy/clamp/util/PassDecoderTest.java index e5de8b0a8..83e894130 100644 --- a/src/test/java/org/onap/clamp/util/PassDecoderTest.java +++ b/src/test/java/org/onap/policy/clamp/util/PassDecoderTest.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.util; +package org.onap.policy.clamp.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; diff --git a/src/test/java/org/onap/clamp/util/SemanticVersioningTest.java b/src/test/java/org/onap/policy/clamp/util/SemanticVersioningTest.java index 88f2bbe1b..604ce55db 100644 --- a/src/test/java/org/onap/clamp/util/SemanticVersioningTest.java +++ b/src/test/java/org/onap/policy/clamp/util/SemanticVersioningTest.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.util; +package org.onap.policy.clamp.util; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index a8ec7add1..5a668dcf4 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -160,8 +160,7 @@ clamp.config.security.permission.type.template=permission-type-template clamp.config.security.permission.type.tosca=permission-type-tosca #This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties clamp.config.security.permission.instance=dev -clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal - +clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal, org.onap.aaf.cadi.principal.CachedBasicPrincipal # Configuration settings for CDS clamp.config.cds.url=http4://localhost:${docker.http-cache.port.host} clamp.config.cds.userName=ccsdkapps diff --git a/src/test/resources/example/sdc/blueprint-dcae/tca-guilin.yaml b/src/test/resources/example/sdc/blueprint-dcae/tca-guilin.yaml new file mode 100644 index 000000000..e7d967a26 --- /dev/null +++ b/src/test/resources/example/sdc/blueprint-dcae/tca-guilin.yaml @@ -0,0 +1,141 @@ +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (C) 2019-2020 AT&T Intellectual Property. 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. +# ============LICENSE_END====================================================== +#k8s-tca-gen2-v3.yaml + +tosca_definitions_version: cloudify_dsl_1_3 +imports: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - plugin:k8splugin?version=3.4.2 + - plugin:clamppolicyplugin?version=1.1.0 +inputs: + service_name: + type: string + default: 'dcae-tcagen2' + log_directory: + type: string + default: "/opt/logs/dcae-analytics-tca" + replicas: + type: integer + description: number of instances + default: 1 + spring.data.mongodb.uri: + type: string + default: "mongodb://dcae-mongohost/dcae-tcagen2" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.analytics.tca-gen2.dcae-analytics-tca-web:1.2.1" + tca.aai.password: + type: string + default: "DCAE" + tca.aai.url: + type: string + default: "http://aai.onap.svc.cluster.local" + tca.aai.username: + type: string + default: "DCAE" + tca_handle_in_subscribe_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT" + tca_handle_out_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.DCAE_CL_OUTPUT" + tca_consumer_group: + type: string + default: "cg1" + policy_model_id: + type: string + default: "onap.policies.monitoring.tcagen2" + policy_id: + type: string + default: "onap.restart.tca" +node_templates: + docker.tca: + type: dcae.nodes.ContainerizedServiceComponent + relationships: + - target: tcagen2_policy + type: cloudify.relationships.depends_on + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - concat: ["9091:", "0"] + properties: + application_config: + service_calls: [] + streams_publishes: + tca_handle_out: + dmaap_info: + topic_url: + get_input: tca_handle_out_publish_url + type: message_router + streams_subscribes: + tca_handle_in: + dmaap_info: + topic_url: + get_input: tca_handle_in_subscribe_url + type: message_router + spring.data.mongodb.uri: + get_input: spring.data.mongodb.uri + streams_subscribes.tca_handle_in.consumer_group: + get_input: tca_consumer_group + streams_subscribes.tca_handle_in.consumer_ids[0]: c0 + streams_subscribes.tca_handle_in.consumer_ids[1]: c1 + streams_subscribes.tca_handle_in.message_limit: 50000 + streams_subscribes.tca_handle_in.polling.auto_adjusting.max: 60000 + streams_subscribes.tca_handle_in.polling.auto_adjusting.min: 30000 + streams_subscribes.tca_handle_in.polling.auto_adjusting.step_down: 30000 + streams_subscribes.tca_handle_in.polling.auto_adjusting.step_up: 10000 + streams_subscribes.tca_handle_in.polling.fixed_rate: 0 + streams_subscribes.tca_handle_in.timeout: -1 + tca.aai.enable_enrichment: true + tca.aai.generic_vnf_path: aai/v11/network/generic-vnfs/generic-vnf + tca.aai.node_query_path: aai/v11/search/nodes-query + tca.aai.password: + get_input: tca.aai.password + tca.aai.url: + get_input: tca.aai.url + tca.aai.username: + get_input: tca.aai.username + tca.policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}' + tca.processing_batch_size: 10000 + tca.enable_abatement: true + tca.enable_ecomp_logging: true + docker_config: + healthcheck: + endpoint: /actuator/health + interval: 30s + timeout: 10s + type: http + image: + get_input: tag_version + log_info: + log_directory: + get_input: log_directory + tls_info: + use_tls: true + cert_directory: '/etc/tca-gen2/ssl' + replicas: + get_input: replicas + service_component_type: { get_input: service_name } + tcagen2_policy: + type: clamp.nodes.policy + properties: + policy_id: + get_input: policy_id + policy_model_id: + get_input: policy_model_id diff --git a/src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec/.file index 9e616dfea..9e616dfea 100644 --- a/src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec/.file diff --git a/src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/api/v1/blueprint-model/workflow-spec/.header diff --git a/src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0/.file index 58975d86a..58975d86a 100644 --- a/src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0/.file diff --git a/src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/api/v1/blueprint-model/workflows/blueprint-name/baseconfiguration/version/1.0.0/.header diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/.file index 7f5b897bf..7f5b897bf 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/.file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/.header diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0/.file index 79e79f0fe..79e79f0fe 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0/.file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.Blacklist/versions/1.0.0/.header diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0/.file index 163027e46..163027e46 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0/.file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0/.header diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0/.file index 778efae9e..778efae9e 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0/.file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/1.0.0/.header diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0/.file index 78bdde746..78bdde746 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0/.file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.guard.common.MinMax/versions/2.0.0/.header diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0/.file index 14ae7acd8..14ae7acd8 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0/.file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0/.header diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/.file index af7a61ef7..af7a61ef7 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/.file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/.header diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/.file index 3c17c9004..3c17c9004 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/.file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/.header diff --git a/src/test/resources/http-cache/example/policy/pap/v1/pdps?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/pap/v1/pdps/.file index f16f4e899..f16f4e899 100644 --- a/src/test/resources/http-cache/example/policy/pap/v1/pdps?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/pap/v1/pdps/.file diff --git a/src/test/resources/http-cache/example/policy/pap/v1/pdps?connectionTimeToLive=5000/.header b/src/test/resources/http-cache/example/policy/pap/v1/pdps/.header index 6a280d972..6a280d972 100644 --- a/src/test/resources/http-cache/example/policy/pap/v1/pdps?connectionTimeToLive=5000/.header +++ b/src/test/resources/http-cache/example/policy/pap/v1/pdps/.header diff --git a/src/test/resources/http-cache/third_party_proxy.py b/src/test/resources/http-cache/third_party_proxy.py index 97a2a1a18..7fe316852 100755 --- a/src/test/resources/http-cache/third_party_proxy.py +++ b/src/test/resources/http-cache/third_party_proxy.py @@ -179,7 +179,7 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): elif self.path.startswith("/dcae-deployments/") and http_type == "PUT": print "self.path start with /dcae-deployments/ DEPLOY, generating response json..." #jsondata = json.loads(self.data_string) - jsonGenerated = "{\"operationType\":\"install\",\"status\":\"processing\",\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus/install\"}}" + jsonGenerated = "{\"operationType\":\"install\",\"status\":\"processing\",\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus/install?test=test\"}}" print "jsonGenerated: " + jsonGenerated if not os.path.exists(cached_file_folder): os.makedirs(cached_file_folder, 0777) @@ -191,7 +191,7 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): elif self.path.startswith("/dcae-deployments/") and http_type == "DELETE": print "self.path start with /dcae-deployments/ UNDEPLOY, generating response json..." #jsondata = json.loads(self.data_string) - jsonGenerated = "{\"operationType\":\"uninstall\",\"status\":\"processing\",\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus/uninstall\"}}" + jsonGenerated = "{\"operationType\":\"uninstall\",\"status\":\"processing\",\"links\":{\"status\":\"http:\/\/" + PROXY_ADDRESS + "\/dcae-operationstatus/uninstall?test=test\"}}" print "jsonGenerated: " + jsonGenerated if not os.path.exists(cached_file_folder): os.makedirs(cached_file_folder, 0777) diff --git a/src/test/resources/https/https-test.properties b/src/test/resources/https/https-test.properties index 6f3a405fc..86e444efe 100644 --- a/src/test/resources/https/https-test.properties +++ b/src/test/resources/https/https-test.properties @@ -116,7 +116,7 @@ clamp.config.security.permission.type.template=org.onap.clamp.clds.template clamp.config.security.permission.type.tosca=org.onap.clamp.clds.tosca #This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties clamp.config.security.permission.instance=dev -clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal +clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal, org.onap.aaf.cadi.principal.CachedBasicPrincipal #AAF related parameters clamp.config.cadi.cadiLoglevel=DEBUG diff --git a/src/test/resources/robotframework/Dockerfile b/src/test/resources/robotframework/Dockerfile index 4ae08208e..7e0bf8a26 100644 --- a/src/test/resources/robotframework/Dockerfile +++ b/src/test/resources/robotframework/Dockerfile @@ -1,9 +1,5 @@ -#FROM robotframework/rfdocker -# -#### Uncomment following two lines if having external test libraries: -##COPY --chown=robot:robot requirements.txt . -#RUN pip3 install --no-cache-dir -r requirements.txt -#COPY *.robot /home/robot/atest -FROM ppodgorsek/robot-framework:3.0.3 +FROM ppodgorsek/robot-framework:latest + +USER root COPY requirements.txt . -RUN pip install -r requirements.txt
\ No newline at end of file +RUN pip3 install --no-cache-dir -r requirements.txt
\ No newline at end of file diff --git a/src/test/resources/robotframework/robotframework-test.properties b/src/test/resources/robotframework/robotframework-test.properties index 4ec657355..665842b84 100644 --- a/src/test/resources/robotframework/robotframework-test.properties +++ b/src/test/resources/robotframework/robotframework-test.properties @@ -160,7 +160,7 @@ clamp.config.security.permission.type.template=permission-type-template clamp.config.security.permission.type.tosca=permission-type-tosca #This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties clamp.config.security.permission.instance=dev -clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal +clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal, org.onap.aaf.cadi.principal.CachedBasicPrincipal # Configuration settings for CDS clamp.config.cds.url=http4://localhost:${docker.http-cache.port.host} |