diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-09-29 10:41:54 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-11-05 10:22:41 -0500 |
commit | 6fa3d2b80d2384b830e3231fe69a8daf7884a35e (patch) | |
tree | 565014596071f8b57919d762dc4d9733de7ea92f /mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap | |
parent | 6b4910cc194286bccb2a63f63d12bfefcdb7fb3f (diff) |
Springboot 2.0 upgrade
corrected typo in CloudConfiguration class
removed files which should not have been merged
updated gr api test cases with dynamic cloud owner
updated groovy files to allow for dynamic cloud owner values
moved VFModularity folder to mso-infrastructure bpmn
updated GR API layer to include cloud owner
added enum for default cloud owner
- fixing junit test cases for using catalogDb client r2
- fixing junit test cases for using catalogDb client
- Internal review comments incorporated for merging mocking into
BaseTest
- Internal review comments incorporated for removing direct repo calls
- CLONE - Key Management Hardcoded encryption key | fixing junits
- CLONE - Key Management Hardcoded encryption key
Updated builder to use String.format
Added exception specifically for issues interacting with
requestdbadapter
Updated exception message and added junit test case
removed useless error handling test case from workflow
changed method name and added junit coverage to errors
added max retry and success status after completed bb
Added case to handle when homing is not called during assign vnf.
Fixing fortify issues | Implementing review comments
- Key Management Hardcoded encryption key - fixing prop files
- Key Management Hardcoded encryption key
include network ID for completion handler
Added exception handling for saving to requestdb
- Adding a check on the predicate availability on the repository before
firing the query with default conditions. This ensures that the api
returns data only when there is an input against which it was able to
form some conditions
Modify UT to show that the API does not behave
- adding negative test case for checkInstanceNameDuplicate
added assertion that global count var was reset to 0
updated rollback to reset current sequence count var
workflowaction calls rollback is complete before error
workflowaction will set failure on successful rollback
added check for isrollback to know which complete to call
removed file which should not have been added
add fabric check before running vf module a la carte
Enhance UCPEMigrateService junits and add them to Jenkins build..
Added back removed test case for ManualTasks
Added test case for response error
Added rainy day test cases for ManualTasks
revert the other change and fix the rollback logic instead
fixed current sequence and updated rollback code
added network cloud heat template parameters to mapper
Generate a unique subRequestId for each request to APP-C.
reverted conditional logic for determining fabric
Fix Bean scanning so it picks up the resttemplate
removed unnecessary RestTemplate Bean configurations
removed file which should not have been added
workflowaction calls rollback is complete before error
workflowaction will set failure on successful rollback
added check for isrollback to know which complete to call
add fabric check before running vf module a la carte
added assertion that global count var was reset to 0
updated rollback to reset current sequence count var
include network ID for completion handler
Revert Application.yaml change accidentally checked in
Added exception handling for saving to requestdb
Added case to handle when homing is not called during assign vnf.
removed useless error handling test case from workflow
changed method name and added junit coverage to errors
...
add cloud owner variable to camunda in mapping
Revert "Pass cloudOwner to subflow DoCreateVfModuleVolumeV2. Added
juint test to verify variables are set in the execution. Set default
cloudOwner in main module CreateVfModuleVolumeInfraV2"
updated cloud configuration pojo to inlcude defaults
Revert "Test to verify ServiceInstance object mapping"
Test to verify ServiceInstance object mapping
Pass cloudOwner to subflow DoCreateVfModuleVolumeV2. Added juint test
to verify variables are set in the execution. Set default cloudOwner in
main module CreateVfModuleVolumeInfraV2
Pass cloudOwner to subflow DoCreateVfModuleVolumeV2. Set default
cloudOwner 'att-aic' if null per old requirements.
removed references to att-aic from BBInputSetup
Changes done in encryption decryption logic | used
DelegateExecutionFake in Tests
Changes done in encryption decryption logic | used
DelegateExecutionFake in Tests
Changes done in encryption decryption logic
Changes done in encryption decryption logic | removed Default Auth
Constant as per the comments
Changes done in encryption decryption logic | Fixed UT
Changes done in encryption decryption logic | Added XmlComparator
assertion for verifying XML
Changes done in encryption decryption logic | Reverted as per the
review comment
Changes done in encryption decryption logic | Fixed UTs
Changes done in encryption decryption logic | Fixed UTs
Changes done in encryption decryption logic | modified related
encrypted properties in test yaml files
Changes done in encryption decryption logic for fortify issue
resolution | Fixed UTs
Changes done in encryption decryption logic | modified related
encrypted properties in yaml files
Changes done in encryption decryption logic for fortify issue
resolution.
Fixed Property fetching issue in required file
Added TasksBeansTest using openpojo
Removed renamed test file from tasksbeans
Updated imports on TasksBeansTest
Added openpojo test to replace the individual tests
Removed tests that provided no coverage
script clean up -Update reference data to support distinct recreate and
replace requests with their own sequences
Update reference data to support distinct recreate and replace requests
with their own sequences- Fix seq number
Update reference data to support distinct recreate and replace requests
with their own sequences
added null check to mdc and interceptors to sdnc cxf
validations can now match against multiple BBs
reverted changes to BBInputSetup class
added support for pre and post validation for BBs
initial commit of generic building block validator
converted test to no longer be a springboot test
Remove cosmetic changes from BPMN files to be consistent.
Remove minor changes that are not related to functionality.
Rework to implement the functionality as part of Validator
Combine the verification methods into one based on the flow's name;
change the logging.
Add verification of status of other VF Modules in the VNF for the
delete/deactivate/unassign.
added network-technology validation for CreateNetworkBB
Sonar Issue Fix | Changes done in encryption decryption logic |
Refactoring
Changes done in encryption decryption logic| Used AES/GCM/NoPadding
algorithm | fixed sonar issues
added network-type and network-technology to mapper
Continue the fight to make JUNITS work properly
Update ASDC ATT to be springboot 2.0 compliant
Continue to fix Unit tests for springboot 2.0 port
removed autowired from workflowactionbbtaskstest
fixed workflowactiontest and reduced size by 500 lines
Update last of UT for mockito upgrade to 2.0
Fix more JUNITS due to mockito 2.0 upgrade
Unit Test fixes to use proper mockito not spring
Update Base Test to import proper packages for compile
Additional Springboot 2.0 changes, for tests
Additional springboot 2.0 fixes and upgrades
Update Migration to be Flyway 5 Compliant
Fix MSOBPMN Infrastructure common tests
Fix Groovy Unit Tests in CommonBPMN Project
Update MSO common BPMN to Springboot 2.0
Upgrade ASDC controller to SpringBoot 2.0
Port Openstack adapters to springboot 2.0
Fix VFC Adapter to be springboot 2 compatible
Port CatalogDB adapter code to springboot 2
Port SDNC Adapter to Springboot 2.0
...
added update scripts to macro data instead of v12 sql
added secondarypolicy to rainy day handling table
confirm subnet map is not null in adapter response
shallow copy subnet before AAI udpate
update AAIObjectType to use uriTemplate
extract subnet data from adapter response
update correct AAIObjectType for subnet query
update subnet(s) in AAI on network create completion
confirm subnet map is not null in adapter response
shallow copy subnet before AAI udpate
update AAIObjectType to use uriTemplate
extract subnet data from adapter response
update correct AAIObjectType for subnet query
update subnet(s) in AAI on network create completion
fixed test http entity unit test to remove testing appid and
transaction id
added unit test for querySubsystemHealth method. also added
resttemplate mock to implement healthcheck endpoint
fixed unit test to use mock instead of actually goes out to health
check endpoint
added code to extend globalhealthcheck to include pinging other
components and consolidate the responses
converted test to no longer be a springboot test
Remove cosmetic changes from BPMN files to be consistent.
Remove minor changes that are not related to functionality.
added update scripts to macro data instead of v12 sql
Rework to implement the functionality as part of Validator
added secondarypolicy to rainy day handling table
added network-type and network-technology to mapper
Combine the verification methods into one based on the flow's name;
change the logging.
Add verification of status of other VF Modules in the VNF for the
delete/deactivate/unassign.
updated how request db is set to failure in workflowA
corrected code to match existing unit tests
corrected tests after springboot 2 upgrade
Added Required UTs in UpdateConfigurationStateTest and also fixed some
UTs.
added in missing parenthesis on method call
added back execution variable for allotted uri
addressed comments on pull request
refactor AAI Rest calls from groovy files - Changes as per review
comments
checkin to refactor AAI rest | Fixing AAIResourceClient.update call
refactor AAI Rest calls from groovy files - UpdateConfiguration
refactor AAI Rest calls from groovy file - DeleteConfiguration
refactor AAI Rest calls from groovy file - UpdateConfiguration
refactor AAI Rest calls from groovy file - CreateConfiguration &
ConfigurationUtils
refactor AAI Rest calls from groovy files - Fix getARByID issue
checkin to refactor AAI rest | Adding Junits
checkin to refactor AAI rest | Adding few more classes
checkin to refactor AAI rest of DoCreateVfModuleVolumeV2
checkin to refactor AAI rest | Update junit
checkin to refactor AAI rest of DoCreateVfModuleVolumeV2 | Adding junits
checkin to refactor AAI rest of DoCreateVfModuleVolumeV2 | Adding junits
checkin to refactor AAI rest of DoCreateVfModuleVolumeV2.groovy
...
updated in and out mapping to be generalBuildingBlock
change source out mapping to generalBuildingBlock
Change-Id: I122f1ebe3e15b77da0a55af201d89d47e326bf83
Issue-ID: SO-1098
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap')
8 files changed, 407 insertions, 19 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java index 7a8035ac63..70603e5911 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java @@ -20,6 +20,13 @@ package org.onap.so.apihandlerinfra; + +import java.net.URI; +import java.util.Collections; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +import javax.annotation.PostConstruct; import javax.transaction.Transactional; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; @@ -29,42 +36,190 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import java.util.UUID; import org.apache.http.HttpStatus; import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; -import org.onap.so.utils.UUIDChecker; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.Environment; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; import org.springframework.stereotype.Component; - +import org.springframework.web.client.RestTemplate; +import org.springframework.http.HttpMethod; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; - @Component @Path("/globalhealthcheck") @Api(value="/globalhealthcheck",description="APIH Infra Global Health Check") public class GlobalHealthcheckHandler { + private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH, GlobalHealthcheckHandler.class); + private static final String CONTEXTPATH_PROPERTY = "management.context-path"; + private static final String PROPERTY_DOMAIN = "mso.health.endpoints"; + private static final String CATALOGDB_PROPERTY = PROPERTY_DOMAIN+".catalogdb"; + private static final String REQUESTDB_PROPERTY = PROPERTY_DOMAIN+".requestdb"; + private static final String SDNC_PROPERTY = PROPERTY_DOMAIN+".sdnc"; + private static final String OPENSTACK_PROPERTY = PROPERTY_DOMAIN+".openstack"; + private static final String BPMN_PROPERTY = PROPERTY_DOMAIN+".bpmn"; + private static final String ASDC_PROPERTY = PROPERTY_DOMAIN+".asdc"; + private static final String REQUESTDBATTSVC_PROPERTY = PROPERTY_DOMAIN+".requestdbattsvc"; + private static final String DEFAULT_PROPERTY_VALUE = ""; + + // e.g. /manage + private String actuatorContextPath; + private String endpointCatalogdb; + private String endpointRequestdb; + private String endpointSdnc; + private String endpointOpenstack; + private String endpointBpmn; + private String endpointAsdc; + private String endpointRequestdbAttsvc; + + @Autowired + private Environment env; - private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH,GlobalHealthcheckHandler.class); - private static final String CHECK_HTML = "<!DOCTYPE html><html><head><meta charset=\"ISO-8859-1\"><title>Health Check</title></head><body>Application ready</body></html>"; + @Autowired + private RestTemplate restTemplate; + private final String health = "/health"; - public static final Response HEALTH_CHECK_RESPONSE = Response.status (HttpStatus.SC_OK) - .entity (CHECK_HTML) - .build (); + + @PostConstruct + protected void init() { + actuatorContextPath = env.getProperty(CONTEXTPATH_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE); + endpointCatalogdb = env.getProperty(CATALOGDB_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE); + endpointRequestdb = env.getProperty(REQUESTDB_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE); + endpointSdnc = env.getProperty(SDNC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE); + endpointOpenstack = env.getProperty(OPENSTACK_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE); + endpointBpmn = env.getProperty(BPMN_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE); + endpointAsdc = env.getProperty(ASDC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE); + endpointRequestdbAttsvc = env.getProperty(REQUESTDBATTSVC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE); + } @GET - @Produces("text/html") + @Produces("application/json") @ApiOperation(value="Performing global health check",response=Response.class) @Transactional public Response globalHealthcheck (@DefaultValue("true") @QueryParam("enableBpmn") boolean enableBpmn, @Context ContainerRequestContext requestContext) { - long startTime = System.currentTimeMillis (); - MsoLogger.setServiceName ("GlobalHealthcheck"); - // Generated RequestId - String requestId = requestContext.getProperty("requestId").toString(); - MsoLogger.setLogContext(requestId, null); - msoLogger.info(MessageEnum.APIH_GENERATED_REQUEST_ID, requestId, "", ""); + Response HEALTH_CHECK_RESPONSE = null; + // Build internal response object + HealthcheckResponse rsp = new HealthcheckResponse(); + + try{ + long startTime = System.currentTimeMillis (); + MsoLogger.setServiceName ("GlobalHealthcheck"); + // Generated RequestId + String requestId = requestContext.getProperty("requestId").toString(); + MsoLogger.setLogContext(requestId, null); + msoLogger.info(MessageEnum.APIH_GENERATED_REQUEST_ID, requestId, "", ""); + + // set APIH status, this is the main entry point + rsp.setApih(HealthcheckStatus.UP.toString()); + // set BPMN + rsp.setBpmn(querySubsystemHealth(MsoSubsystems.BPMN)); + // set SDNCAdapter + rsp.setSdncAdapter(querySubsystemHealth(MsoSubsystems.SDNC)); + // set ASDCController + rsp.setAsdcController(querySubsystemHealth(MsoSubsystems.ASDC)); + // set CatalogDbAdapter + rsp.setCatalogdbAdapter(querySubsystemHealth(MsoSubsystems.CATALOGDB)); + // set RequestDbAdapter + rsp.setRequestdbAdapter(querySubsystemHealth(MsoSubsystems.REQUESTDB)); + // set OpenStackAdapter + rsp.setOpenstackAdapter(querySubsystemHealth(MsoSubsystems.OPENSTACK)); + // set RequestDbAdapterAttSvc + rsp.setRequestdbAdapterAttsvc(querySubsystemHealth(MsoSubsystems.REQUESTDBATT)); + // set Message + rsp.setMessage(String.format("HttpStatus: %s", HttpStatus.SC_OK)); + msoLogger.info(rsp.toString(), "", ""); + + HEALTH_CHECK_RESPONSE = Response.status (HttpStatus.SC_OK) + .entity (rsp) + .build (); + + }catch (Exception ex){ + msoLogger.error(ex); + rsp.setMessage(ex.getMessage()); + HEALTH_CHECK_RESPONSE = Response.status (HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity (rsp) + .build (); + } + return HEALTH_CHECK_RESPONSE; - } + } + + protected HttpEntity<String> buildHttpEntityForRequest(){ + HttpHeaders headers = new HttpHeaders(); + headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); + headers.set("Content-Type", "application/json"); + HttpEntity<String> entity = new HttpEntity<>("parameters", headers); + return entity; + } + + protected String querySubsystemHealth(MsoSubsystems subsystem){ + try{ + // get port number for the subsystem + String ept = getEndpointUrlForSubsystemEnum(subsystem); + + // build final endpoint url + UriBuilder builder = UriBuilder.fromPath(ept).path(actuatorContextPath).path(health); + URI uri = builder.build(); + msoLogger.info("Calculated URL: "+uri.toString(), "", ""); + + ResponseEntity<SubsystemHealthcheckResponse> result = + restTemplate.exchange(uri, HttpMethod.GET, buildHttpEntityForRequest(), SubsystemHealthcheckResponse.class); + + return processResponseFromSubsystem(result,subsystem); + + }catch(Exception ex){ + msoLogger.error(ex.getMessage()); + return HealthcheckStatus.DOWN.toString(); + } + } + protected String processResponseFromSubsystem(ResponseEntity<SubsystemHealthcheckResponse> result, MsoSubsystems subsystem){ + if(result == null || result.getStatusCodeValue() != HttpStatus.SC_OK){ + msoLogger.error(String.format("Globalhealthcheck: checking subsystem: %s failed ! result object is: %s", + subsystem, + result == null? "NULL": result)); + return HealthcheckStatus.DOWN.toString(); + } + + SubsystemHealthcheckResponse body = result.getBody(); + + String status = body.getStatus(); + if("UP".equalsIgnoreCase(status)){ + return HealthcheckStatus.UP.toString(); + }else{ + msoLogger.error(subsystem + ", query health endpoint did not return UP status!"); + return HealthcheckStatus.DOWN.toString(); + } + } + + + protected String getEndpointUrlForSubsystemEnum(MsoSubsystems subsystem){ + switch (subsystem){ + case SDNC: + return this.endpointSdnc; + case ASDC: + return this.endpointAsdc; + case BPMN: + return this.endpointBpmn; + case CATALOGDB: + return this.endpointCatalogdb; + case OPENSTACK: + return this.endpointOpenstack; + case REQUESTDB: + return this.endpointRequestdb; + case REQUESTDBATT: + return this.endpointRequestdbAttsvc; + default: + return ""; + } + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java new file mode 100644 index 0000000000..8f0bbc4e1f --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java @@ -0,0 +1,121 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 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.apihandlerinfra; + +import org.apache.commons.lang3.builder.ToStringBuilder; + +public class HealthcheckResponse { + private String apih; + private String bpmn; + private String sdncAdapter; + private String asdcController; + private String catalogdbAdapter; + private String requestdbAdapter; + private String openstackAdapter; + private String requestdbAdapterAttsvc; + private String message = ""; + + public String getApih() { + return apih; + } + + public void setApih(String apih) { + this.apih = apih; + } + + public String getBpmn() { + return bpmn; + } + + public void setBpmn(String bpmn) { + this.bpmn = bpmn; + } + + public String getSdncAdapter() { + return sdncAdapter; + } + + public void setSdncAdapter(String sdncAdapter) { + this.sdncAdapter = sdncAdapter; + } + + public String getAsdcController() { + return asdcController; + } + + public void setAsdcController(String asdcController) { + this.asdcController = asdcController; + } + + public String getCatalogdbAdapter() { + return catalogdbAdapter; + } + + public void setCatalogdbAdapter(String catalogdbAdapter) { + this.catalogdbAdapter = catalogdbAdapter; + } + + public String getRequestdbAdapter() { + return requestdbAdapter; + } + + public void setRequestdbAdapter(String requestdbAdapter) { + this.requestdbAdapter = requestdbAdapter; + } + + public String getOpenstackAdapter() { + return openstackAdapter; + } + + public void setOpenstackAdapter(String openstackAdapter) { + this.openstackAdapter = openstackAdapter; + } + + public String getRequestdbAdapterAttsvc() { + return requestdbAdapterAttsvc; + } + + public void setRequestdbAdapterAttsvc(String requestdbAdapterAttsvc) { + this.requestdbAdapterAttsvc = requestdbAdapterAttsvc; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public String toString() { + return new ToStringBuilder(this). + append("apih", this.apih). + append("pbmn", this.bpmn). + append("sdncAdapter", this.sdncAdapter). + append("asdcController", this.asdcController). + append("catalogdbAdapter", this.catalogdbAdapter). + append("requestdbAdapter", this.requestdbAdapter). + append("openstackAdapter", this.openstackAdapter). + append("requestdbAdapterAttsvc", this.requestdbAdapterAttsvc). + append("message", this.message). + toString(); + } +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java new file mode 100644 index 0000000000..89c4e0efda --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 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.apihandlerinfra; + +public enum HealthcheckStatus { + UP("UP"), DOWN("DOWN"); + + private String status; + private HealthcheckStatus(String status) { + this.status = status; + } + + @Override + public String toString(){ + return status; + } +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java new file mode 100644 index 0000000000..cfdce473a4 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 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.apihandlerinfra; + +public enum MsoSubsystems { + APIH ("API Handler"), + ASDC ("ASDC Controller"), + BPMN ("BPMN Infra"), + CATALOGDB ("CatalogDb Adapter"), + OPENSTACK ("Openstack Adapter"), + REQUESTDB ("RequestDB Adapter"), + REQUESTDBATT ("RequestDB Adapter ATT Svc"), + SDNC ("SDNC Adapter"); + private String subsystem; + private MsoSubsystems(String subsystem){ + this.subsystem = subsystem; + } + + @Override + public String toString(){ + return subsystem; + } + +} + diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java index 8047893bb4..e2b12349c1 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java @@ -111,7 +111,7 @@ public class ServiceInstances { private static String NAME = "name"; private static String VALUE = "value"; private static final String SAVE_TO_DB = "save instance to db"; - + @Autowired private Environment env; diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SubsystemHealthcheckResponse.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SubsystemHealthcheckResponse.java new file mode 100644 index 0000000000..625df66d2a --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SubsystemHealthcheckResponse.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 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.apihandlerinfra; + +import java.io.Serializable; + +public class SubsystemHealthcheckResponse implements Serializable { + private static final long serialVersionUID = 1L; + private String status; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/configuration/CatalogDBConfig.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/configuration/CatalogDBConfig.java index f7d719048f..3aa54bdfb3 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/configuration/CatalogDBConfig.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/configuration/CatalogDBConfig.java @@ -25,7 +25,7 @@ import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; +import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/configuration/RequestDBConfig.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/configuration/RequestDBConfig.java index 2298ccdb26..908b864536 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/configuration/RequestDBConfig.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/configuration/RequestDBConfig.java @@ -25,7 +25,7 @@ import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; +import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; |