diff options
7 files changed, 45 insertions, 10 deletions
diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/RequestValidatorImpl.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/RequestValidatorImpl.java index e97f7c05f..da571bd15 100644 --- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/RequestValidatorImpl.java +++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/RequestValidatorImpl.java @@ -396,6 +396,7 @@ public class RequestValidatorImpl extends AbstractRequestValidatorImpl { request.getActionIdentifier().setVnfId(null); } + request.setTargetId(record.getTargetId()); inProgressRequests.add(request); } diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/model/RequestModel.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/model/RequestModel.java index 692f5a4aa..61da106c4 100644 --- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/model/RequestModel.java +++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/model/RequestModel.java @@ -4,8 +4,6 @@ * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= * 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 @@ -33,6 +31,8 @@ public class RequestModel { private String action; @JsonProperty("action-identifiers") private ActionIdentifierModel actionIdentifier; + @JsonProperty("target-id") + private String targetId; public ActionIdentifierModel getActionIdentifier() { return actionIdentifier; @@ -49,5 +49,13 @@ public class RequestModel { public void setAction(String action) { this.action = action; } + + public String getTargetId() { + return targetId; + } + + public void setTargetId(String targetId) { + this.targetId = targetId; + } } diff --git a/appc-inbound/appc-interfaces-service/bundle/pom.xml b/appc-inbound/appc-interfaces-service/bundle/pom.xml index f9d21e13e..bf85243db 100644 --- a/appc-inbound/appc-interfaces-service/bundle/pom.xml +++ b/appc-inbound/appc-interfaces-service/bundle/pom.xml @@ -41,10 +41,10 @@ <configuration> <instructions> <Export-Package>org.onap.appc.interfaces.services</Export-Package> - <Import-Package>org.onap.appc.aai.client,*;resolution:=optional</Import-Package> + <Import-Package>org.onap.appc.aai.client,org.onap.appc.aai.client.*,*;resolution:=optional</Import-Package> <Embed-Dependency>jackson-dataformat-yaml</Embed-Dependency> <DynamicImport-Package>*</DynamicImport-Package> - <Embed-Transitive>true</Embed-Transitive> + <Embed-Transitive>true</Embed-Transitive> </instructions> </configuration> </plugin> @@ -57,7 +57,7 @@ <artifactId>appc-interfaces-service-model</artifactId> <version>${project.version}</version> </dependency> - <dependency> + <dependency> <groupId>org.onap.appc</groupId> <artifactId>appc-aai-client-provider</artifactId> <version>${project.version}</version> diff --git a/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/data/Request.java b/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/data/Request.java index d43c9277b..918883559 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/data/Request.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/data/Request.java @@ -32,6 +32,9 @@ public class Request { @JsonProperty("action-identifiers") private ActionIdentifier actionIdentifiers; + + @JsonProperty("target-id") + private String targetId; public String getAction() { return action; @@ -49,4 +52,11 @@ public class Request { this.actionIdentifiers = actionIdentifiers; } + public String getTargetId() { + return targetId; + } + + public void setTargetId(String targetId) { + this.targetId = targetId; + } } diff --git a/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java b/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java index f38ea83e6..cafa8dc18 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java @@ -4,8 +4,6 @@ * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= * 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 @@ -74,6 +72,10 @@ public class ServiceExecutorImpl { } if (scopeOverlap.getCurrentRequest().getActionIdentifiers().getVnfId() != null) { return Boolean.TRUE; + } else if (!Strings.isNullOrEmpty(scopeOverlap.getVnfId()) + && scopeOverlap.getInProgressRequest().size() > 0) { + log.info("Checking overlap for similar vnfid :" + isVnfIdOverlap(scopeOverlap)); + return isVnfIdOverlap(scopeOverlap); } else if (scopeOverlap.getCurrentRequest().getActionIdentifiers().getVfModuleId() != null) { return Boolean.TRUE; } else if (scopeOverlap.getCurrentRequest().getActionIdentifiers().getvServerId() != null) { @@ -152,4 +154,18 @@ public class ServiceExecutorImpl { } return isVnfcNameOverLap(scopeOverlap); } + + private boolean isVnfIdOverlap(ScopeOverlap scopeOverlap) throws Exception { + List<Request> inProgressRequests = scopeOverlap.getInProgressRequest(); + log.info("inProgressRequests list"+inProgressRequests.toString()); + for (Request request : inProgressRequests) { + log.info("request list"+request.getTargetId()); + if (!Strings.isNullOrEmpty(scopeOverlap.getVnfId()) + && !Strings.isNullOrEmpty(request.getTargetId()) + && (request.getTargetId() + .equals(scopeOverlap.getVnfId()))) + return Boolean.TRUE; + } + return Boolean.FALSE; + } } diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java index 735b8d985..6567a2cce 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaceService/serviceExecutor/TestServiceExecutor.java @@ -102,8 +102,8 @@ public class TestServiceExecutor { public void serviceExecutorRqstEx() throws Exception { ServiceExecutor sei = new ServiceExecutor(); String action ="isScopeOverlap"; - String requestDataType = ""; - String requestData = "{\"vnf-id\":\"ibcx8888v\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id1\",\"vnf-id\" : \"vnf-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnf-id\" : \"vnf-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\": \"vserver-id2\"}}]}"; + String requestData = ""; + String requestDataType = "{\"vnf-id\":\"ibcx8888v\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id\"}},\"in-progress-requests\" :[{\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id1\",\"vnf-id\" : \"vnf-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vf-module-id\" : \"vf-module-id\",\"vserver-id\": \"vserver-id1\"}},{\"action\" : \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnf-id\" : \"vnf-id2\",\"vnfc-name\" : \"vnfc-name2\",\"vf-module-id\" : \"vf-module-id2\",\"vserver-id\": \"vserver-id2\"},\"target-id\":\"ibcx0001v\"}]}"; sei.execute(action, requestData, requestDataType); } diff --git a/appc-outbound/appc-aai-client/provider/pom.xml b/appc-outbound/appc-aai-client/provider/pom.xml index 836e298ea..126e46136 100755 --- a/appc-outbound/appc-aai-client/provider/pom.xml +++ b/appc-outbound/appc-aai-client/provider/pom.xml @@ -134,7 +134,7 @@ <instructions>
<Bundle-SymbolicName>org.onap.appc.aai.client</Bundle-SymbolicName>
<Bundle-Activator>org.onap.appc.aai.client.AppcAaiClientActivator</Bundle-Activator>
- <Export-Package>org.onap.appc.aai.client</Export-Package>
+ <Export-Package>org.onap.appc.aai.client,org.onap.appc.aai.client.*</Export-Package>
<Import-Package>*</Import-Package>
<DynamicImport-Package>*</DynamicImport-Package>
<Embed-Dependency>eelf-core,logback-core,logback-classic</Embed-Dependency>
|