From 61affc6311906aee71b16ee8632c1e7468cd1990 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Mon, 5 Nov 2018 11:00:36 -0500 Subject: Catchup commits for Dublin added property for retry timer multiplier for testing Infra APIH table, fixed test assertNull condition. Infra APIH table, added tests for request-url = null. Infra APIH should write request_url to infra_active_requests. Return SelfLink URL on ServiceInstantiation SyncResponse. Added JUNITS. Added helper method to get AAI ResourceUri to faciliate unit test. Fixed code to correctly extract related generic vnf or vce id. updated unit test coverage for update network Handle REST NotFoundException for serviceInstance nodes query. Process should continue for new order request and throw exception only for SUPP request. Added disconnect functionality to the gw vnf test tool. Added conversion of vnf management option to dhv change speed sync subnet status with network update updated macroData vol assigned delete continue script Correct the name of DeleteVfModuleBB subprocess. fix the custom resolver to not convert int in string to int Write the returned value from Homing to gBBInput Use explicit conversion to JSON to read cloudConfiguration settings. added property for retry timer multiplier for testing avoid storing AAI yang models in execution added handlingCode to rollback test in workflowactionbb passed in alacarte flag to execute layer for rainy day added test cases for RollbackToAssigned rainy day hand added rollback to assign in catalog db rainy day hand Updated vnf adapter delete stubs to be a post for test. Added a javadoc to basic auth override method Added a check to not add blank headers to the headerMap in httpClient. Added check for if entity exist before calling readEntity. Fixed failing junits and updated way the body is obtained Added missing import statement for http client. Fixed mistakes and made updates caught during review. Removed post and httpPost methods from RESTClient and refactored references Refactored multiple http post references to use httpClient instead. Removed close connection method and randomized port in unit test Added http client unit test, coverage is currently at 90 percent Resolve conflict in sdnc adapter reste v1 method Began removing http delete and delete methods from RESTClient and aaiUtil. Removed http put method and executeput method, refactored references. fixed broken tests in the branch in jenkins build Fix Springboot 2.0 start up issues, and other issues added in implementation to generate self link if there isnt one removed dbcp2 from poms that still had them added rollbackstatusmessage to stub in testprocess added rollback_status_message to the schema sql file Added variable for rollbackStatusMessage Added rollbackStatusMessage to get response added rollback status message to archived infra request set rollback status message to successful on boolean added logic to split rollback and regular error message added rollback status message to infra active requests pushing the cloud config changes as well Added media type and fixed cast plural issue. Made various updated and fixes to code that was changed. Removed all no longer used RESTClient imports from classes Removed and refactored references for aaiUtil methods and all remaining RESTClient methods, removed RESTClient project and updated poms. Return canonical stack id on multicloud create Fix OOF Config Ingestion Fix variable to retrieve sdnc endpoint Prepare resources for service uuid req Fix swapped parameters for multicloud DELETE Update msb-java-sdk to resolve license issues cloud owner support for SDNC interface correlationId is now read from userParams Fix up request body of multicloud adapter body removed LinkedHashMap from java classes Cut over logging project to release not snapshot Update unit tests, revert test code, fix comments Fix remaining number of Unit Tests, on avpn flow Fix JUNITS add callback url, fix BPMN issues Update SDNC interaction to support a-sync updated bpm assert import and corrected tests updated test case to be mockito 2 compliant additional changes to import statements and tests Change the place where the data for multistage gets set Update treatment of PENDING_ACTIVATION VF_MODULE CREATE entries to SILENT_SUCCESS to support first stage of multistage. Implement second stage of multistage design VF Module Creation removed LinkedHashMap from java classes Removed SNAPSHOT from dependency Cut over logging project to release not snapshot Fixed failing BBInputSetup tests Update unit tests, revert test code, fix comments Updated apih tests to use networkInstanceGroup Updated ModelType enum and fixed compilation issues Fix remaining number of Unit Tests, on avpn flow Fix JUNITS add callback url, fix BPMN issues Implementation of the first stage of multistage design for VF Module creation. Update SDNC interaction to support a-sync no longer leave modified files after test runs Remove generated CSAR, that occurs during JUNIT Update Camunda Pods to use Flyway Migration in 1902 Updated hashcode method and removed comment. Added aggregate routes to the sdnw request and updated pom sdnw dependency. Began to set aggreagate route information for vrf configuration. modified remaining files with att-aic references Correct rollbackData setting and protect against potential null objects. correct AAIObjectPlurals enum value name Update POJO to use type URL for selfLink. Optional - construct SelfLink Url format. Construct SelfLink Url format from full Url. added missing properties to application-test.yaml fixed compliation error after merge of unit test restored files which should not have been deleted Fix SO vulnerabilities with cxf Fixing bpmn infra endpoint in so-monitoring yaml removed att-aic from codebase default cloud owner now configurable Set homingService in WorkflowAction Fix Java Ex in Homing Version should be 1.3.1 to release new dockers Pnf Spring Environment correction test property now has dynamic wiremock port removed test specific wiremock rule that was causing problems re-enabled and corrected integration tests for so-bpmn-tasks Test to get sniro homing v2 test working by splitting test suites for each spring application Reverted changes to old migration scripts.. Fixed spring context issue with test HomingV2. Removed unused import to fix compilation errors Fixed onap changes to homing, migrated homingV2 to homingBB, fixed broken junits again. - Updated isUseHttpsWithDmaapTest to check assertTrue rather than assertFalse. - Upgraded code to make the isUseHttpsWithDmaap configurable. It will default to true if no value is found in the config file. moved workflowaction test class to the test section added status message update for retry and rollback beefed up error message debug logging and req db msg added debug lines to workflowactionbbtasks reqdbcall Issue-ID: SO-1187 Change-Id: Iec1aff4ed30a43c0e0b2cdb06c28d8db8a99a830 Signed-off-by: Benjamin, Max (mb388a) --- .../workflow/context/WorkflowContextHolder.java | 5 +- .../bbobjects/AggregateRoute.java | 107 +++++++++++++++++++++ .../servicedecomposition/bbobjects/L3Network.java | 13 ++- .../tasks/ExecuteBuildingBlockRainyDay.java | 16 ++- 4 files changed, 131 insertions(+), 10 deletions(-) create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java (limited to 'bpmn/MSOCommonBPMN/src/main/java/org/onap') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/workflow/context/WorkflowContextHolder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/workflow/context/WorkflowContextHolder.java index 39c32de77d..eb7290b685 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/workflow/context/WorkflowContextHolder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/workflow/context/WorkflowContextHolder.java @@ -81,13 +81,10 @@ public class WorkflowContextHolder { public WorkflowContext getWorkflowContext(String requestId) { // Note: DelayQueue interator is threadsafe for (WorkflowContext context : responseQueue) { - if (requestId.equals(context.getRequestId())) { - msoLogger.debug("Found context for request id: " + requestId); + if (requestId.equals(context.getRequestId())) { return context; } } - - msoLogger.debug("Unable to find context for request id: " + requestId); return null; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java new file mode 100644 index 0000000000..cb9c681fd5 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java @@ -0,0 +1,107 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 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========================================================= + */ + +package org.onap.so.bpmn.servicedecomposition.bbobjects; + +import java.io.Serializable; + +import javax.persistence.Id; + +import org.onap.so.bpmn.servicedecomposition.ShallowCopy; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.EqualsBuilder; + +@JsonRootName("aggregate-route") +public class AggregateRoute implements Serializable, ShallowCopy{ + + private static final long serialVersionUID = -1059128545462701696L; + + @Id + @JsonProperty("route-id") + private String routeId; + @JsonProperty("route-name") + private String routeName; + @JsonProperty("network-start-address") + private String networkStartAddress; + @JsonProperty("cidr-mask") + private String cidrMask; + @JsonProperty("ip-version") + private String ipVersion; + + + public String getRouteId(){ + return routeId; + } + + public void setRouteId(String routeId){ + this.routeId = routeId; + } + + public String getRouteName(){ + return routeName; + } + + public void setRouteName(String routeName){ + this.routeName = routeName; + } + + public String getNetworkStartAddress(){ + return networkStartAddress; + } + + public void setNetworkStartAddress(String networkStartAddress){ + this.networkStartAddress = networkStartAddress; + } + + public String getCidrMask(){ + return cidrMask; + } + + public void setCidrMask(String cidrMask){ + this.cidrMask = cidrMask; + } + + public String getIpVersion(){ + return ipVersion; + } + + public void setIpVersion(String ipVersion){ + this.ipVersion = ipVersion; + } + + @Override + public boolean equals(final Object other){ + if(!(other instanceof AggregateRoute)){ + return false; + } + AggregateRoute castOther = (AggregateRoute) other; + return new EqualsBuilder().append(routeId, castOther.routeId).isEquals(); + } + + @Override + public int hashCode(){ + return new HashCodeBuilder().append(routeId).toHashCode(); + } + + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java index 5f43ba076a..343bd95eaa 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java @@ -7,9 +7,9 @@ * 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. @@ -41,7 +41,7 @@ import com.fasterxml.jackson.annotation.JsonRootName; public class L3Network implements Serializable, ShallowCopy { private static final long serialVersionUID = 4434492567957111317L; - + @Id @JsonProperty("network-id") private String networkId; @@ -99,6 +99,8 @@ public class L3Network implements Serializable, ShallowCopy { private List segmentationAssignments = new ArrayList<>(); @JsonProperty("model-info-network") private ModelInfoNetwork modelInfoNetwork; + @JsonProperty("aggregate-routes") + private List aggregateRoutes = new ArrayList<>(); public ModelInfoNetwork getModelInfoNetwork() { return modelInfoNetwork; @@ -254,6 +256,11 @@ public class L3Network implements Serializable, ShallowCopy { public void setCloudParams(Map cloudParams) { this.cloudParams = cloudParams; } + + public List getAggregateRoutes(){ + return aggregateRoutes; + } + @Override public boolean equals(final Object other) { if (!(other instanceof L3Network)) { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java index e815051eaa..32540eb996 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java @@ -33,6 +33,7 @@ import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus; import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.logger.MsoLogger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @Component @@ -44,12 +45,17 @@ public class ExecuteBuildingBlockRainyDay { @Autowired private CatalogDbClient catalogDbClient; private static final String ASTERISK = "*"; + + @Autowired + private Environment environment; + protected String retryDurationPath = "mso.rainyDay.retryDurationMultiplier"; public void setRetryTimer(DelegateExecution execution) { try { + int retryDurationMult = Integer.parseInt(this.environment.getProperty(retryDurationPath)); int retryCount = (int) execution.getVariable("retryCount"); - int retryTimeToWait = (int) Math.pow(5, retryCount); - String RetryDuration = "PT" + retryTimeToWait + "M"; + int retryTimeToWait = (int) Math.pow(retryDurationMult, retryCount) * 10; + String RetryDuration = "PT" + retryTimeToWait + "S"; execution.setVariable("RetryDuration", RetryDuration); } catch (Exception e) { msoLogger.error(e); @@ -64,6 +70,7 @@ public class ExecuteBuildingBlockRainyDay { GeneralBuildingBlock gBBInput = (GeneralBuildingBlock) execution.getVariable("gBBInput"); Map lookupKeyMap = (Map) execution.getVariable("lookupKeyMap"); String serviceType = ASTERISK; + boolean aLaCarte = (boolean) execution.getVariable("aLaCarte"); try { serviceType = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0).getModelInfoServiceInstance().getServiceType(); } catch (Exception ex) { @@ -115,10 +122,13 @@ public class ExecuteBuildingBlockRainyDay { handlingCode = rainyDayHandlerStatus.getSecondaryPolicy(); } } + if(handlingCode.equals("RollbackToAssigned")&&!aLaCarte){ + handlingCode = "Rollback"; + } msoLogger.debug("RainyDayHandler Status Code is: " + handlingCode); execution.setVariable(HANDLING_CODE, handlingCode); } catch (Exception e) { - msoLogger.debug("RainyDayHandler Status Code is: Abort"); + msoLogger.error("Failed to determine RainyDayHandler Status. Seting handlingCode = Abort"); execution.setVariable(HANDLING_CODE, "Abort"); } } -- cgit 1.2.3-korg