request.getActionIdentifier().setVnfId(null);
}
+ request.setTargetId(record.getTargetId());
inProgressRequests.add(request);
}
* ================================================================================
* 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
private String action;
@JsonProperty("action-identifiers")
private ActionIdentifierModel actionIdentifier;
+ @JsonProperty("target-id")
+ private String targetId;
public ActionIdentifierModel getActionIdentifier() {
return actionIdentifier;
public void setAction(String action) {
this.action = action;
}
+
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
}
<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>
<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>
@JsonProperty("action-identifiers")
private ActionIdentifier actionIdentifiers;
+
+ @JsonProperty("target-id")
+ private String targetId;
public String getAction() {
return action;
this.actionIdentifiers = actionIdentifiers;
}
+ public String getTargetId() {
+ return targetId;
+ }
+
+ public void setTargetId(String targetId) {
+ this.targetId = targetId;
+ }
}
* ================================================================================
* 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
}
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) {
}
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;
+ }
}
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);
}
<instructions>\r
<Bundle-SymbolicName>org.onap.appc.aai.client</Bundle-SymbolicName>\r
<Bundle-Activator>org.onap.appc.aai.client.AppcAaiClientActivator</Bundle-Activator>\r
- <Export-Package>org.onap.appc.aai.client</Export-Package>\r
+ <Export-Package>org.onap.appc.aai.client,org.onap.appc.aai.client.*</Export-Package>\r
<Import-Package>*</Import-Package>\r
<DynamicImport-Package>*</DynamicImport-Package>\r
<Embed-Dependency>eelf-core,logback-core,logback-classic</Embed-Dependency>\r