From 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Mon, 30 Jul 2018 15:56:09 -0400 Subject: Containerization feature of SO Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18 Issue-ID: SO-670 Signed-off-by: Benjamin, Max (mb388a) --- .../adapters/network/beans/ContrailPolicyRef.java | 45 +++++ .../network/beans/ContrailPolicyRefSeq.java | 65 +++++++ .../so/adapters/network/beans/ContrailSubnet.java | 128 ++++++++++++ .../network/beans/ContrailSubnetHostRoute.java | 54 ++++++ .../network/beans/ContrailSubnetHostRoutes.java | 53 +++++ .../adapters/network/beans/ContrailSubnetIp.java | 55 ++++++ .../adapters/network/beans/ContrailSubnetPool.java | 55 ++++++ .../mappers/ContrailSubnetHostRouteMapper.java | 44 +++++ .../network/mappers/ContrailSubnetMapper.java | 135 +++++++++++++ .../network/mappers/ContrailSubnetPoolMapper.java | 43 +++++ .../onap/so/adapters/nwrest/ContrailNetwork.java | 98 ++++++++++ .../so/adapters/nwrest/CreateNetworkError.java | 45 +++++ .../so/adapters/nwrest/CreateNetworkRequest.java | 206 ++++++++++++++++++++ .../so/adapters/nwrest/CreateNetworkResponse.java | 127 ++++++++++++ .../so/adapters/nwrest/DeleteNetworkError.java | 45 +++++ .../so/adapters/nwrest/DeleteNetworkRequest.java | 105 ++++++++++ .../so/adapters/nwrest/DeleteNetworkResponse.java | 65 +++++++ .../adapters/nwrest/NetworkExceptionResponse.java | 73 +++++++ .../so/adapters/nwrest/NetworkRequestCommon.java | 109 +++++++++++ .../so/adapters/nwrest/NetworkResponseCommon.java | 86 +++++++++ .../onap/so/adapters/nwrest/NetworkTechnology.java | 26 +++ .../so/adapters/nwrest/ProviderVlanNetwork.java | 61 ++++++ .../onap/so/adapters/nwrest/QueryNetworkError.java | 31 +++ .../so/adapters/nwrest/QueryNetworkResponse.java | 135 +++++++++++++ .../so/adapters/nwrest/RollbackNetworkError.java | 45 +++++ .../so/adapters/nwrest/RollbackNetworkRequest.java | 51 +++++ .../adapters/nwrest/RollbackNetworkResponse.java | 56 ++++++ .../so/adapters/nwrest/UpdateNetworkError.java | 45 +++++ .../so/adapters/nwrest/UpdateNetworkRequest.java | 201 +++++++++++++++++++ .../so/adapters/nwrest/UpdateNetworkResponse.java | 78 ++++++++ .../so/adapters/sdncrest/RequestInformation.java | 143 ++++++++++++++ .../onap/so/adapters/sdncrest/SDNCErrorCommon.java | 38 ++++ .../org/onap/so/adapters/sdncrest/SDNCEvent.java | 142 ++++++++++++++ .../so/adapters/sdncrest/SDNCRequestCommon.java | 115 +++++++++++ .../so/adapters/sdncrest/SDNCResponseCommon.java | 124 ++++++++++++ .../so/adapters/sdncrest/SDNCServiceError.java | 51 +++++ .../so/adapters/sdncrest/SDNCServiceRequest.java | 150 ++++++++++++++ .../so/adapters/sdncrest/SDNCServiceResponse.java | 78 ++++++++ .../so/adapters/sdncrest/ServiceInformation.java | 104 ++++++++++ .../so/adapters/tenantrest/CreateTenantError.java | 73 +++++++ .../adapters/tenantrest/CreateTenantRequest.java | 98 ++++++++++ .../adapters/tenantrest/CreateTenantResponse.java | 85 ++++++++ .../so/adapters/tenantrest/DeleteTenantError.java | 73 +++++++ .../adapters/tenantrest/DeleteTenantRequest.java | 62 ++++++ .../adapters/tenantrest/DeleteTenantResponse.java | 41 ++++ .../so/adapters/tenantrest/QueryTenantError.java | 63 ++++++ .../adapters/tenantrest/QueryTenantResponse.java | 63 ++++++ .../adapters/tenantrest/RollbackTenantError.java | 69 +++++++ .../adapters/tenantrest/RollbackTenantRequest.java | 41 ++++ .../tenantrest/RollbackTenantResponse.java | 41 ++++ .../tenantrest/TenantExceptionResponse.java | 72 +++++++ .../adapters/tenantrest/TenantRequestCommon.java | 66 +++++++ .../so/adapters/tenantrest/TenantRollback.java | 80 ++++++++ .../java/org/onap/so/adapters/vdu/CloudInfo.java | 69 +++++++ .../org/onap/so/adapters/vdu/PluginAction.java | 63 ++++++ .../java/org/onap/so/adapters/vdu/VduArtifact.java | 80 ++++++++ .../org/onap/so/adapters/vdu/VduException.java | 60 ++++++ .../java/org/onap/so/adapters/vdu/VduInstance.java | 80 ++++++++ .../org/onap/so/adapters/vdu/VduModelInfo.java | 50 +++++ .../org/onap/so/adapters/vdu/VduStateType.java | 36 ++++ .../java/org/onap/so/adapters/vdu/VduStatus.java | 58 ++++++ .../so/adapters/vnfrest/CreateVfModuleRequest.java | 215 +++++++++++++++++++++ .../adapters/vnfrest/CreateVfModuleResponse.java | 105 ++++++++++ .../adapters/vnfrest/CreateVolumeGroupRequest.java | 157 +++++++++++++++ .../vnfrest/CreateVolumeGroupResponse.java | 100 ++++++++++ .../so/adapters/vnfrest/DeleteVfModuleRequest.java | 98 ++++++++++ .../adapters/vnfrest/DeleteVfModuleResponse.java | 80 ++++++++ .../adapters/vnfrest/DeleteVolumeGroupRequest.java | 90 +++++++++ .../vnfrest/DeleteVolumeGroupResponse.java | 49 +++++ .../so/adapters/vnfrest/QueryVfModuleResponse.java | 97 ++++++++++ .../adapters/vnfrest/QueryVolumeGroupResponse.java | 103 ++++++++++ .../adapters/vnfrest/RollbackVfModuleRequest.java | 45 +++++ .../adapters/vnfrest/RollbackVfModuleResponse.java | 49 +++++ .../vnfrest/RollbackVolumeGroupRequest.java | 44 +++++ .../vnfrest/RollbackVolumeGroupResponse.java | 49 +++++ .../so/adapters/vnfrest/UpdateVfModuleRequest.java | 215 +++++++++++++++++++++ .../adapters/vnfrest/UpdateVfModuleResponse.java | 85 ++++++++ .../adapters/vnfrest/UpdateVolumeGroupRequest.java | 130 +++++++++++++ .../vnfrest/UpdateVolumeGroupResponse.java | 79 ++++++++ .../vnfrest/VfModuleExceptionResponse.java | 75 +++++++ .../onap/so/adapters/vnfrest/VfModuleRollback.java | 130 +++++++++++++ .../onap/so/adapters/vnfrest/VfRequestCommon.java | 61 ++++++ .../onap/so/adapters/vnfrest/VfResponseCommon.java | 85 ++++++++ .../vnfrest/VolumeGroupExceptionResponse.java | 45 +++++ .../so/adapters/vnfrest/VolumeGroupRollback.java | 128 ++++++++++++ .../org/onap/so/openstack/beans/HeatStatus.java | 30 +++ .../org/onap/so/openstack/beans/HostRoute.java | 69 +++++++ .../org/onap/so/openstack/beans/MsoTenant.java | 66 +++++++ .../org/onap/so/openstack/beans/NetworkInfo.java | 120 ++++++++++++ .../onap/so/openstack/beans/NetworkRollback.java | 157 +++++++++++++++ .../org/onap/so/openstack/beans/NetworkStatus.java | 31 +++ .../java/org/onap/so/openstack/beans/Pool.java | 62 ++++++ .../org/onap/so/openstack/beans/RouteTarget.java | 62 ++++++ .../org/onap/so/openstack/beans/StackInfo.java | 109 +++++++++++ .../java/org/onap/so/openstack/beans/Subnet.java | 213 ++++++++++++++++++++ .../org/onap/so/openstack/beans/VnfRollback.java | 213 ++++++++++++++++++++ .../org/onap/so/openstack/beans/VnfStatus.java | 30 +++ .../openstack/exceptions/MsoAdapterException.java | 45 +++++ .../exceptions/MsoCloudIdentityNotFound.java | 56 ++++++ .../openstack/exceptions/MsoCloudSiteNotFound.java | 56 ++++++ .../onap/so/openstack/exceptions/MsoException.java | 66 +++++++ .../openstack/exceptions/MsoExceptionCategory.java | 27 +++ .../exceptions/MsoHeatNotFoundException.java | 54 ++++++ .../so/openstack/exceptions/MsoIOException.java | 53 +++++ .../exceptions/MsoNetworkAlreadyExists.java | 35 ++++ .../openstack/exceptions/MsoNetworkNotFound.java | 35 ++++ .../exceptions/MsoOpenstackException.java | 80 ++++++++ .../exceptions/MsoStackAlreadyExists.java | 35 ++++ .../so/openstack/exceptions/MsoStackNotFound.java | 44 +++++ .../exceptions/MsoTenantAlreadyExists.java | 35 ++++ .../so/openstack/exceptions/MsoTenantNotFound.java | 43 +++++ .../so/openstack/mappers/NetworkInfoMapper.java | 107 ++++++++++ .../onap/so/openstack/mappers/StackInfoMapper.java | 99 ++++++++++ .../mso/adapters/json/MapDeserializer.java | 67 ------- .../openecomp/mso/adapters/json/MapSerializer.java | 63 ------ .../mso/adapters/nwrest/ContrailNetwork.java | 90 --------- .../mso/adapters/nwrest/CreateNetworkError.java | 45 ----- .../mso/adapters/nwrest/CreateNetworkRequest.java | 196 ------------------- .../mso/adapters/nwrest/CreateNetworkResponse.java | 122 ------------ .../mso/adapters/nwrest/DeleteNetworkError.java | 45 ----- .../mso/adapters/nwrest/DeleteNetworkRequest.java | 101 ---------- .../mso/adapters/nwrest/DeleteNetworkResponse.java | 61 ------ .../adapters/nwrest/NetworkExceptionResponse.java | 69 ------- .../mso/adapters/nwrest/NetworkRequestCommon.java | 106 ---------- .../mso/adapters/nwrest/NetworkResponseCommon.java | 82 -------- .../mso/adapters/nwrest/NetworkTechnology.java | 26 --- .../mso/adapters/nwrest/ProviderVlanNetwork.java | 56 ------ .../mso/adapters/nwrest/QueryNetworkError.java | 31 --- .../mso/adapters/nwrest/QueryNetworkResponse.java | 131 ------------- .../mso/adapters/nwrest/RollbackNetworkError.java | 45 ----- .../adapters/nwrest/RollbackNetworkRequest.java | 46 ----- .../adapters/nwrest/RollbackNetworkResponse.java | 52 ----- .../mso/adapters/nwrest/UpdateNetworkError.java | 45 ----- .../mso/adapters/nwrest/UpdateNetworkRequest.java | 196 ------------------- .../mso/adapters/nwrest/UpdateNetworkResponse.java | 74 ------- .../providers/JettisonStyleMapperProvider.java | 53 ----- .../mso/adapters/sdncrest/RequestInformation.java | 115 ----------- .../mso/adapters/sdncrest/SDNCErrorCommon.java | 37 ---- .../openecomp/mso/adapters/sdncrest/SDNCEvent.java | 141 -------------- .../mso/adapters/sdncrest/SDNCRequestCommon.java | 114 ----------- .../mso/adapters/sdncrest/SDNCResponseCommon.java | 123 ------------ .../mso/adapters/sdncrest/SDNCServiceError.java | 50 ----- .../mso/adapters/sdncrest/SDNCServiceRequest.java | 146 -------------- .../mso/adapters/sdncrest/SDNCServiceResponse.java | 77 -------- .../mso/adapters/sdncrest/ServiceInformation.java | 102 ---------- .../mso/adapters/tenantrest/CreateTenantError.java | 71 ------- .../adapters/tenantrest/CreateTenantRequest.java | 96 --------- .../adapters/tenantrest/CreateTenantResponse.java | 84 -------- .../mso/adapters/tenantrest/DeleteTenantError.java | 71 ------- .../adapters/tenantrest/DeleteTenantRequest.java | 61 ------ .../adapters/tenantrest/DeleteTenantResponse.java | 41 ---- .../adapters/tenantrest/HealthCheckHandler.java | 51 ----- .../mso/adapters/tenantrest/QueryTenantError.java | 61 ------ .../adapters/tenantrest/QueryTenantResponse.java | 62 ------ .../adapters/tenantrest/RollbackTenantError.java | 67 ------- .../adapters/tenantrest/RollbackTenantRequest.java | 41 ---- .../tenantrest/RollbackTenantResponse.java | 41 ---- .../tenantrest/TenantExceptionResponse.java | 68 ------- .../adapters/tenantrest/TenantRequestCommon.java | 63 ------ .../mso/adapters/tenantrest/TenantRollback.java | 79 -------- .../adapters/vnfrest/CreateVfModuleRequest.java | 208 -------------------- .../adapters/vnfrest/CreateVfModuleResponse.java | 105 ---------- .../adapters/vnfrest/CreateVolumeGroupRequest.java | 148 -------------- .../vnfrest/CreateVolumeGroupResponse.java | 100 ---------- .../adapters/vnfrest/DeleteVfModuleRequest.java | 92 --------- .../adapters/vnfrest/DeleteVfModuleResponse.java | 80 -------- .../adapters/vnfrest/DeleteVolumeGroupRequest.java | 82 -------- .../vnfrest/DeleteVolumeGroupResponse.java | 49 ----- .../adapters/vnfrest/QueryVfModuleResponse.java | 97 ---------- .../adapters/vnfrest/QueryVolumeGroupResponse.java | 103 ---------- .../adapters/vnfrest/RollbackVfModuleRequest.java | 45 ----- .../adapters/vnfrest/RollbackVfModuleResponse.java | 49 ----- .../vnfrest/RollbackVolumeGroupRequest.java | 44 ----- .../vnfrest/RollbackVolumeGroupResponse.java | 49 ----- .../adapters/vnfrest/UpdateVfModuleRequest.java | 215 --------------------- .../adapters/vnfrest/UpdateVfModuleResponse.java | 85 -------- .../adapters/vnfrest/UpdateVolumeGroupRequest.java | 130 ------------- .../vnfrest/UpdateVolumeGroupResponse.java | 79 -------- .../vnfrest/VfModuleExceptionResponse.java | 75 ------- .../mso/adapters/vnfrest/VfModuleRollback.java | 130 ------------- .../mso/adapters/vnfrest/VfRequestCommon.java | 53 ----- .../mso/adapters/vnfrest/VfResponseCommon.java | 85 -------- .../vnfrest/VolumeGroupExceptionResponse.java | 45 ----- .../mso/adapters/vnfrest/VolumeGroupRollback.java | 128 ------------ .../openecomp/mso/openstack/beans/HeatStatus.java | 30 --- .../openecomp/mso/openstack/beans/HostRoute.java | 69 ------- .../openecomp/mso/openstack/beans/MsoTenant.java | 66 ------- .../openecomp/mso/openstack/beans/NetworkInfo.java | 151 --------------- .../mso/openstack/beans/NetworkRollback.java | 152 --------------- .../mso/openstack/beans/NetworkStatus.java | 31 --- .../org/openecomp/mso/openstack/beans/Pool.java | 69 ------- .../openecomp/mso/openstack/beans/RouteTarget.java | 56 ------ .../openecomp/mso/openstack/beans/StackInfo.java | 155 --------------- .../org/openecomp/mso/openstack/beans/Subnet.java | 207 -------------------- .../openecomp/mso/openstack/beans/VnfRollback.java | 214 -------------------- .../openecomp/mso/openstack/beans/VnfStatus.java | 30 --- .../openstack/exceptions/MsoAdapterException.java | 45 ----- .../exceptions/MsoCloudIdentityNotFound.java | 49 ----- .../openstack/exceptions/MsoCloudSiteNotFound.java | 48 ----- .../mso/openstack/exceptions/MsoException.java | 66 ------- .../openstack/exceptions/MsoExceptionCategory.java | 27 --- .../mso/openstack/exceptions/MsoIOException.java | 53 ----- .../exceptions/MsoNetworkAlreadyExists.java | 35 ---- .../openstack/exceptions/MsoNetworkNotFound.java | 35 ---- .../exceptions/MsoOpenstackException.java | 80 -------- .../exceptions/MsoStackAlreadyExists.java | 35 ---- .../mso/openstack/exceptions/MsoStackNotFound.java | 44 ----- .../exceptions/MsoTenantAlreadyExists.java | 32 --- .../openstack/exceptions/MsoTenantNotFound.java | 43 ----- 209 files changed, 9079 insertions(+), 7762 deletions(-) create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRef.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRefSeq.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnet.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoute.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoutes.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetIp.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetPool.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetHostRouteMapper.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetMapper.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetPoolMapper.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ContrailNetwork.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkExceptionResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkTechnology.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ProviderVlanNetwork.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/RequestInformation.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCErrorCommon.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/ServiceInformation.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantError.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantExceptionResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRollback.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/CloudInfo.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/PluginAction.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduException.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduInstance.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduModelInfo.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStateType.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStatus.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupRequest.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleExceptionResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleRollback.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfRequestCommon.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupExceptionResponse.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupRollback.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HeatStatus.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HostRoute.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/MsoTenant.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkInfo.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkRollback.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkStatus.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/RouteTarget.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/StackInfo.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Subnet.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfRollback.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfStatus.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoAdapterException.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFound.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFound.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoException.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoExceptionCategory.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoHeatNotFoundException.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoIOException.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExists.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkNotFound.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoOpenstackException.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExists.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackNotFound.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExists.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantNotFound.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/NetworkInfoMapper.java create mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/StackInfoMapper.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ContrailNetwork.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkExceptionResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkRequestCommon.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkResponseCommon.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkTechnology.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ProviderVlanNetwork.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/providers/JettisonStyleMapperProvider.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/RequestInformation.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCErrorCommon.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCEvent.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCRequestCommon.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCResponseCommon.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/ServiceInformation.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/HealthCheckHandler.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRollback.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVfModuleResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVolumeGroupResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupRequest.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleExceptionResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleRollback.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfRequestCommon.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfResponseCommon.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupExceptionResponse.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupRollback.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/HeatStatus.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/HostRoute.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/MsoTenant.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkRollback.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkStatus.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/Pool.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/RouteTarget.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/Subnet.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/VnfRollback.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/VnfStatus.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoAdapterException.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudIdentityNotFound.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFound.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoExceptionCategory.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExists.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFound.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExists.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFound.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExists.java delete mode 100644 adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFound.java (limited to 'adapters/mso-adapters-rest-interface/src/main/java') diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRef.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRef.java new file mode 100644 index 0000000000..f207c6185e --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRef.java @@ -0,0 +1,45 @@ +/*- + * ============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.adapters.network.beans; + + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ContrailPolicyRef { + + @JsonProperty("network_policy_refs_data_sequence") + private ContrailPolicyRefSeq seq; + + + public ContrailPolicyRefSeq getSeq() { + return seq; + } + + public void setSeq(ContrailPolicyRefSeq seq) { + this.seq = seq; + } + + public ContrailPolicyRef withRefSeq(ContrailPolicyRefSeq seq) { + this.seq = seq; + return this; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRefSeq.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRefSeq.java new file mode 100644 index 0000000000..a3a5a710ed --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRefSeq.java @@ -0,0 +1,65 @@ +/*- + * ============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.adapters.network.beans; + + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ContrailPolicyRefSeq { + + @JsonProperty("network_policy_refs_data_sequence_major") + private String major; + + @JsonProperty("network_policy_refs_data_sequence_minor") + private String minor; + + public ContrailPolicyRefSeq() { + } + + public ContrailPolicyRefSeq(String major, String minor) { + super(); + this.major = major; + this.minor = minor; + } + + public String getMajor() { + return major; + } + + public void setMajor(String major) { + this.major = major; + } + + public String getMinor() { + return minor; + } + + public void setMinor(String minor) { + this.minor = minor; + } + + @Override + public String toString() { + return "ContrailPolicyRefSeq [major=" + major + ", minor=" + minor + + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnet.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnet.java new file mode 100644 index 0000000000..fc674a0416 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnet.java @@ -0,0 +1,128 @@ +/*- + * ============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.adapters.network.beans; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ContrailSubnet { + + @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet") + private ContrailSubnetIp subnet = new ContrailSubnetIp(); + + @JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway") + private String defaultGateway; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name") + private String subnetName; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp") + private Boolean enableDhcp; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start") + private Boolean addrFromStart = true; + /** future - leave this commented + private String subnet_uuid; + private String dns_server_address; + private List dns_nameservers; + private String dhcp_option_list; + **/ + + @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools") + private List allocationPools = new ArrayList<>(); + + @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes") + private ContrailSubnetHostRoutes hostRoutes = new ContrailSubnetHostRoutes(); + + public ContrailSubnet() { + super(); + } + + public String getDefaultGateway() { + return defaultGateway; + } + + public void setDefaultGateway(String defaultGateway) { + this.defaultGateway = defaultGateway; + } + + public ContrailSubnetIp getSubnet() { + return subnet; + } + + public void setSubnet(ContrailSubnetIp subnet) { + this.subnet = subnet; + } + + public Boolean isEnableDhcp() { + return enableDhcp; + } + + public void setEnableDhcp(Boolean enableDhcp) { + this.enableDhcp = enableDhcp; + } + + public String getSubnetName() { + return subnetName; + } + + public void setSubnetName(String subnetName) { + this.subnetName = subnetName; + } + + public List getAllocationPools() { + return allocationPools; + } + + public void setAllocationPools(List allocationPools) { + this.allocationPools = allocationPools; + } + + public Boolean isAddrFromStart() { + return addrFromStart; + } + + public void setAddrFromStart(Boolean addrFromStart) { + this.addrFromStart = addrFromStart; + } + + public ContrailSubnetHostRoutes getHostRoutes() { + return hostRoutes; + } + + public void setHostRoutes(ContrailSubnetHostRoutes hostRoutes) { + this.hostRoutes = hostRoutes; + } + + @Override + public String toString() { + StringBuilder buf = new StringBuilder (); + for (ContrailSubnetPool pool : allocationPools) + { + buf.append(pool.toString()); + } + return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + defaultGateway + + " enable_dhcp=" + enableDhcp + " addr_from_start=" + addrFromStart + " subnet_name=" + subnetName + " allocation_pools=" + buf + " ]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoute.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoute.java new file mode 100644 index 0000000000..7d53715e3c --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoute.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.adapters.network.beans; + + +import com.fasterxml.jackson.annotation.JsonProperty; +public class ContrailSubnetHostRoute { + + @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route_prefix") + private String prefix; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route_next_hop") + private String nextHop; + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public String getNextHop() { + return nextHop; + } + + public void setNextHop(String nextHop) { + this.nextHop = nextHop; + } + + @Override + public String toString() { + return "ContrailSubnetHostRoute [prefix=" + prefix + ", nextHop=" + nextHop + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoutes.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoutes.java new file mode 100644 index 0000000000..cd7192b6e2 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoutes.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.adapters.network.beans; + + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; +public class ContrailSubnetHostRoutes { + + @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route") + private List hostRoutes = new ArrayList<>(); + + public List getHostRoutes() { + return hostRoutes; + } + + public void setHostRoutes(List hostRoutes) { + this.hostRoutes = hostRoutes; + } + + @Override + public String toString() { + StringBuilder buf = new StringBuilder (); + if (hostRoutes != null) + { + for (ContrailSubnetHostRoute hr : hostRoutes) + { + buf.append(hr.toString()); + } + } + return "ContrailSubnetHostRoutes [" + buf.toString() + "]"; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetIp.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetIp.java new file mode 100644 index 0000000000..3986592dde --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetIp.java @@ -0,0 +1,55 @@ +/*- + * ============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.adapters.network.beans; + + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ContrailSubnetIp { + + @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix") + private String ipPrefix; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len") + private String ipPrefixLen; + + public String getIpPrefix() { + return ipPrefix; + } + + public void setIpPrefix(String ipPrefix) { + this.ipPrefix = ipPrefix; + } + + public String getIpPrefixLen() { + return ipPrefixLen; + } + + public void setIpPrefixLen(String ipPrefixLen) { + this.ipPrefixLen = ipPrefixLen; + } + + @Override + public String toString() { + return "ContrailSubnetIp [ip_prefix=" + ipPrefix + ", ip_prefix_len=" + ipPrefixLen + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetPool.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetPool.java new file mode 100644 index 0000000000..11a06c69d5 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetPool.java @@ -0,0 +1,55 @@ +/*- + * ============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.adapters.network.beans; + + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ContrailSubnetPool { + + @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools_start") + private String start; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools_end") + private String end; + + public String getStart() { + return start; + } + + public void setStart(String start) { + this.start = start; + } + + public String getEnd() { + return end; + } + + public void setEnd(String end) { + this.end = end; + } + + @Override + public String toString() { + return "ContrailSubnetPool [start=" + start + ", end=" + end + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetHostRouteMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetHostRouteMapper.java new file mode 100644 index 0000000000..03800de5b8 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetHostRouteMapper.java @@ -0,0 +1,44 @@ +/*- + * ============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.adapters.network.mappers; + +import org.onap.so.adapters.network.beans.ContrailSubnetHostRoute; +import org.onap.so.openstack.beans.HostRoute; + +public class ContrailSubnetHostRouteMapper { + + private final HostRoute hostRoute; + public ContrailSubnetHostRouteMapper(HostRoute hostRoute) { + this.hostRoute = hostRoute; + } + + public ContrailSubnetHostRoute map() { + + final ContrailSubnetHostRoute contrailSubnetHostRoute = new ContrailSubnetHostRoute(); + + if (hostRoute != null) { + contrailSubnetHostRoute.setNextHop(hostRoute.getNextHop()); + contrailSubnetHostRoute.setPrefix(hostRoute.getPrefix()); + } + return contrailSubnetHostRoute; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetMapper.java new file mode 100644 index 0000000000..d3ccb35a60 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetMapper.java @@ -0,0 +1,135 @@ +/*- + * ============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.adapters.network.mappers; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import org.onap.so.adapters.network.beans.ContrailSubnet; +import org.onap.so.adapters.network.beans.ContrailSubnetHostRoute; +import org.onap.so.adapters.network.beans.ContrailSubnetHostRoutes; +import org.onap.so.adapters.network.beans.ContrailSubnetIp; +import org.onap.so.adapters.network.beans.ContrailSubnetPool; +import org.onap.so.openstack.beans.HostRoute; +import org.onap.so.openstack.beans.Pool; +import org.onap.so.openstack.beans.Subnet; + +public class ContrailSubnetMapper { + + private final Subnet inputSubnet; + public ContrailSubnetMapper(Subnet inputSubnet) { + this.inputSubnet = inputSubnet; + } + + public ContrailSubnet map() { + + final ContrailSubnet result = new ContrailSubnet(); + if (inputSubnet != null) { + final String subnetname = this.getSubnetName(inputSubnet); + result.setSubnetName(subnetname); + result.setEnableDhcp(inputSubnet.getEnableDHCP()); + result.setDefaultGateway(inputSubnet.getGatewayIp()); + + Optional csIp = createSubnet(inputSubnet); + if (csIp.isPresent()) { + result.setSubnet(csIp.get()); + } + Optional> pools = this.createContrailSubnetPool(inputSubnet); + if (pools.isPresent()) { + result.setAllocationPools(pools.get()); + } + Optional routes = this.createContrailSubnetHostRoutes(inputSubnet); + if (routes.isPresent()) { + result.setHostRoutes(routes.get()); + } + } + + return result; + } + + protected String getSubnetName(Subnet subnet) { + final String result; + if (!isNullOrEmpty(subnet.getSubnetName())) { + result = subnet.getSubnetName(); + } else { + result = subnet.getSubnetId(); + } + + return result; + } + + protected Optional> createContrailSubnetPool(final Subnet subnet) { + Optional> result = Optional.empty(); + if (subnet.getAllocationPools() != null) { + List pools = new ArrayList<>(); + for (Pool pool : subnet.getAllocationPools()) { + if ( !isNullOrEmpty(pool.getStart()) && !isNullOrEmpty(pool.getEnd()) ) { + + pools.add(new ContrailSubnetPoolMapper(pool).map()); + } + } + if (!pools.isEmpty()) { + result = Optional.of(pools); + } + } + + return result; + } + + protected Optional createContrailSubnetHostRoutes(final Subnet subnet) { + Optional result = Optional.empty(); + if (subnet.getHostRoutes() != null) { + ContrailSubnetHostRoutes hostRoutesObj = new ContrailSubnetHostRoutes(); + List hrList = new ArrayList<>(); + for (HostRoute hr : subnet.getHostRoutes()) { + if ( !isNullOrEmpty(hr.getPrefix()) || !isNullOrEmpty(hr.getNextHop()) ) { + hrList.add(new ContrailSubnetHostRouteMapper(hr).map()); + } + } + if (!hrList.isEmpty()) { + hostRoutesObj.setHostRoutes(hrList); + result = Optional.of(hostRoutesObj); + } + } + + return result; + + } + protected Optional createSubnet(final Subnet subnet) { + Optional result = Optional.empty(); + if (!isNullOrEmpty(subnet.getCidr()) ) { + int idx = subnet.getCidr().indexOf("/"); + final ContrailSubnetIp csIp = new ContrailSubnetIp(); + if (idx != -1) { + csIp.setIpPrefix(subnet.getCidr().substring(0, idx)); + csIp.setIpPrefixLen(subnet.getCidr().substring(idx+1)); + result = Optional.of(csIp); + } + } + + return result; + } + + protected boolean isNullOrEmpty (String s) { + return s == null || s.isEmpty(); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetPoolMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetPoolMapper.java new file mode 100644 index 0000000000..a492cd30c0 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetPoolMapper.java @@ -0,0 +1,43 @@ +/*- + * ============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.adapters.network.mappers; + +import org.onap.so.adapters.network.beans.ContrailSubnetPool; +import org.onap.so.openstack.beans.Pool; + +public class ContrailSubnetPoolMapper { + + private final Pool pool; + + public ContrailSubnetPoolMapper(Pool pool) { + this.pool = pool; + } + + public ContrailSubnetPool map() { + + ContrailSubnetPool result = new ContrailSubnetPool(); + if (pool != null) { + result.setStart(pool.getStart()); + result.setEnd(pool.getEnd()); + } + return result; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ContrailNetwork.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ContrailNetwork.java new file mode 100644 index 0000000000..9a7431130d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ContrailNetwork.java @@ -0,0 +1,98 @@ +/*- + * ============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.adapters.nwrest; + + +import java.io.Serializable; +import java.util.List; + +import org.onap.so.openstack.beans.RouteTarget; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("contrailNetwork") +public class ContrailNetwork implements Serializable{ + + + /** + * + */ + private static final long serialVersionUID = 6879356795950005963L; + private String shared = "false"; + private String external = "false"; + private List routeTargets; + private List policyFqdns; + private List routeTableFqdns; + + public ContrailNetwork() { + super(); + } + + public ContrailNetwork(String shared, String external, List routeTargets, List policyFqdns, List routeTableFqdns) { + super(); + this.shared = shared; + this.external = external; + this.routeTargets = routeTargets; + this.policyFqdns = policyFqdns; + this.routeTableFqdns = routeTableFqdns; + } + + public String getShared() { + return shared; + } + + public void setShared(String shared) { + this.shared = shared; + } + + public String getExternal() { + return external; + } + + public void setExternal(String external) { + this.external = external; + } + + public List getRouteTargets() { + return routeTargets; + } + + public void setRouteTargets(List routeTargets) { + this.routeTargets = routeTargets; + } + + public List getPolicyFqdns() { + return policyFqdns; + } + + public void setPolicyFqdns(List policyFqdns) { + this.policyFqdns = policyFqdns; + } + + public List getRouteTableFqdns() { + return routeTableFqdns; + } + + public void setRouteTableFqdns(List routeTableFqdns) { + this.routeTableFqdns = routeTableFqdns; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkError.java new file mode 100644 index 0000000000..fec9b474dd --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkError.java @@ -0,0 +1,45 @@ +/*- + * ============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.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "createNetworkError") +public class CreateNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = -4283402447149144456L; + + public CreateNetworkError() { + super(""); + } + + public CreateNetworkError(String message) { + super(message); + } + + public CreateNetworkError(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(message, category, rolledBack, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java new file mode 100644 index 0000000000..3e4d18cb1b --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java @@ -0,0 +1,206 @@ +/*- + * ============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.adapters.nwrest; + + + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; +import org.onap.so.openstack.beans.Subnet; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + + +/* README + Map elements when marshalled to XML produce a list of ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. + When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. +*/ +@JsonRootName("createNetworkRequest") +@XmlRootElement(name = "createNetworkRequest") +public class CreateNetworkRequest extends NetworkRequestCommon { + /** + * + */ + private static final long serialVersionUID = -8984362978831333521L; + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkName; + private String networkType; + private String networkTypeVersion; + private String modelCustomizationUuid; + private NetworkTechnology networkTechnology = NetworkTechnology.NEUTRON; + private List subnets; + private ProviderVlanNetwork providerVlanNetwork; + private ContrailNetwork contrailNetwork; + private Boolean failIfExists = false; + private Boolean backout = true; + private Map networkParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + @JsonProperty + private boolean contrailRequest; + + public CreateNetworkRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public String getNetworkTypeVersion() { + return networkTypeVersion; + } + + public void setNetworkTypeVersion(String networkTypeVersion) { + this.networkTypeVersion = networkTypeVersion; + } + + public NetworkTechnology getNetworkTechnology() { + return networkTechnology; + } + + public void setNetworkTechnology(NetworkTechnology networkTechnology) { + this.networkTechnology = networkTechnology; + this.contrailRequest = determineContrail(); + } + + public List getSubnets() { + return subnets; + } + + public void setSubnets(List subnets) { + this.subnets = subnets; + } + + public ProviderVlanNetwork getProviderVlanNetwork() { + return providerVlanNetwork; + } + + public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { + this.providerVlanNetwork = providerVlanNetwork; + } + + public ContrailNetwork getContrailNetwork() { + return contrailNetwork; + } + + public void setContrailNetwork(ContrailNetwork contrailNetwork) { + this.contrailNetwork = contrailNetwork; + this.contrailRequest = determineContrail(); + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map getNetworkParams() { + return networkParams; + } + + public void setNetworkParams(Map networkParams) { + this.networkParams = networkParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public boolean isContrailRequest() { + return this.contrailRequest; + } + + @JsonIgnore + protected void setContrailRequest(boolean contrailRequest) { + this.contrailRequest = contrailRequest; + } + + private boolean determineContrail() { + return (networkTechnology == NetworkTechnology.CONTRAIL && (contrailNetwork != null)); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkResponse.java new file mode 100644 index 0000000000..763732213d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkResponse.java @@ -0,0 +1,127 @@ +/*- + * ============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.adapters.nwrest; + + + +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.beans.NetworkRollback; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("createNetworkResponse") +@XmlRootElement(name = "createNetworkResponse") + +public class CreateNetworkResponse extends NetworkResponseCommon { + /** + * + */ + private static final long serialVersionUID = -7730406297031948309L; + + private String networkId; + private String neutronNetworkId; + private String networkStackId; + private String networkFqdn; + private Boolean networkCreated; + private Map subnetMap; + private NetworkRollback rollback = new NetworkRollback(); + + public CreateNetworkResponse() { + super(); + } + + public CreateNetworkResponse(String networkId, + String neutronNetworkId, + String networkStackId, + String networkFqdn, + Boolean networkCreated, + Map subnetIdMap, + NetworkRollback rollback, + String messageId) { + super(messageId); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.networkStackId = networkStackId; + this.networkFqdn = networkFqdn; + this.networkCreated = networkCreated; + this.subnetMap = subnetIdMap; + this.rollback = rollback; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkFqdn() { + return networkFqdn; + } + + public void setNetworkFqdn(String networkFqdn) { + this.networkFqdn = networkFqdn; + } + + public Boolean getNetworkCreated() { + return networkCreated; + } + + public void setNetworkCreated(Boolean networkCreated) { + this.networkCreated = networkCreated; + } + + public Map getSubnetMap() { + return subnetMap; + } + + public void setSubnetMap(Map subnetMap) { + this.subnetMap = subnetMap; + } + + public NetworkRollback getRollback() { + return rollback; + } + + public void setRollback(NetworkRollback rollback) { + this.rollback = rollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkError.java new file mode 100644 index 0000000000..f874be56a3 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkError.java @@ -0,0 +1,45 @@ +/*- + * ============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.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "deleteNetworkError") +public class DeleteNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = 2735474165790444180L; + + public DeleteNetworkError() { + super(""); + } + + public DeleteNetworkError(String message) { + super(message); + } + + public DeleteNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java new file mode 100644 index 0000000000..f069bf2ed2 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java @@ -0,0 +1,105 @@ +/*- + * ============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.adapters.nwrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonRootName; + + +@JsonRootName("deleteNetworkRequest") +@XmlRootElement(name = "deleteNetworkRequest") +public class DeleteNetworkRequest extends NetworkRequestCommon { + + /** + * + */ + private static final long serialVersionUID = -2445072708572065058L; + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkStackId; + private String networkType; + private String modelCustomizationUuid; + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteNetworkRequest() {} + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkResponse.java new file mode 100644 index 0000000000..1de7f8be76 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkResponse.java @@ -0,0 +1,65 @@ +/*- + * ============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.adapters.nwrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("deleteNetworkResponse") +@XmlRootElement(name = "deleteNetworkResponse") +public class DeleteNetworkResponse extends NetworkResponseCommon { + + /** + * + */ + private static final long serialVersionUID = 68336086339501537L; + private String networkId; + private Boolean networkDeleted; + + public DeleteNetworkResponse() { + super(); + } + + public DeleteNetworkResponse(String networkId, Boolean networkDeleted, String messageId) { + super(messageId); + this.networkId = networkId; + this.networkDeleted = networkDeleted; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public Boolean getNetworkDeleted() { + return networkDeleted; + } + + public void setNetworkDeleted(Boolean networkDeleted) { + this.networkDeleted = networkDeleted; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkExceptionResponse.java new file mode 100644 index 0000000000..4b9f283e20 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkExceptionResponse.java @@ -0,0 +1,73 @@ +/*- + * ============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.adapters.nwrest; + + + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +public class NetworkExceptionResponse extends NetworkResponseCommon { + /** + * + */ + private static final long serialVersionUID = -7160401922983004097L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public NetworkExceptionResponse () {} + + public NetworkExceptionResponse (String message) { + super(); + this.message = message; + } + + public NetworkExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(messageid); + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java new file mode 100644 index 0000000000..3d66da3a2d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java @@ -0,0 +1,109 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.nwrest; + + + +import java.io.ByteArrayOutputStream; +import java.io.Serializable; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * Everything that is common between all Network Requests. + */ +public abstract class NetworkRequestCommon implements Serializable { + private static final long serialVersionUID = -6732431343649282079L; + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, NetworkRequestCommon.class); + private Boolean skipAAI = false; + private String messageId; + private String notificationUrl; + @JsonProperty + private boolean synchronous = true; + public Boolean getSkipAAI() { + return skipAAI; + } + + public void setSkipAAI(Boolean skipAAI) { + this.skipAAI = skipAAI; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String getNotificationUrl() { + return notificationUrl; + } + + public void setNotificationUrl(String notificationUrl) { + this.notificationUrl = notificationUrl; + this.synchronous = notificationUrl == null || (notificationUrl.isEmpty()); + } + + public boolean isSynchronous() { + return this.synchronous; + } + + @JsonIgnore + protected void setSynchronous(boolean synchronous) { + this.synchronous = synchronous; + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } catch (Exception e) { + LOGGER.debug("Exception:", e); + } + return jsonString; + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + LOGGER.debug("Exception:", e); + return ""; + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java new file mode 100644 index 0000000000..d626f26aa6 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java @@ -0,0 +1,86 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.nwrest; + + + +import java.io.ByteArrayOutputStream; +import java.io.Serializable; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +/** + * Everything that is common between all Volume Group Responses, except for QueryVolumeGroupResponse. + */ +public abstract class NetworkResponseCommon implements Serializable { + + private static final long serialVersionUID = 1233520856935129726L; + private String messageId; + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, NetworkResponseCommon.class); + + public NetworkResponseCommon() { + messageId = null; + } + + public NetworkResponseCommon(String messageId) { + this.messageId = messageId; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } catch (Exception e) { + LOGGER.debug("Exception:", e); + } + return jsonString; + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + LOGGER.debug("Exception:", e); + return ""; + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkTechnology.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkTechnology.java new file mode 100644 index 0000000000..cade9b44c8 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkTechnology.java @@ -0,0 +1,26 @@ +/*- + * ============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.adapters.nwrest; + + +public enum NetworkTechnology { + NEUTRON, VMWARE, CONTRAIL +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ProviderVlanNetwork.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ProviderVlanNetwork.java new file mode 100644 index 0000000000..fbd21b8197 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ProviderVlanNetwork.java @@ -0,0 +1,61 @@ +/*- + * ============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.adapters.nwrest; + + + +import java.io.Serializable; +import java.util.List; + +public class ProviderVlanNetwork implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 6744949861614446315L; + private String physicalNetworkName; + private List vlans; + + public ProviderVlanNetwork() { + super(); + } + + public ProviderVlanNetwork(String physicalNetworkName, List vlans) { + super(); + this.physicalNetworkName = physicalNetworkName; + this.vlans = vlans; + } + + public String getPhysicalNetworkName() { + return physicalNetworkName; + } + + public void setPhysicalNetworkName(String physicalNetworkName) { + this.physicalNetworkName = physicalNetworkName; + } + + public List getVlans() { + return vlans; + } + + public void setVlans(List vlans) { + this.vlans = vlans; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkError.java new file mode 100644 index 0000000000..6e8ace9cf0 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkError.java @@ -0,0 +1,31 @@ +/*- + * ============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.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "queryNetworkError") +public class QueryNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = -6125469596399867146L; +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java new file mode 100644 index 0000000000..6953dfe7e5 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java @@ -0,0 +1,135 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.nwrest; + +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.logger.MsoLogger; +import org.onap.so.openstack.beans.NetworkStatus; +import org.onap.so.openstack.beans.RouteTarget; + +@XmlRootElement(name = "queryNetworkResponse") +public class QueryNetworkResponse extends NetworkResponseCommon { + /** + * + */ + private static final long serialVersionUID = -5251191073081795026L; + private String networkId; + private String neutronNetworkId; + private String networkStackId; + private Boolean networkExists; + private NetworkStatus networkStatus; + private List vlans; + private List routeTargets; + private Map subnetIdMap; + private Map networkOutputs; + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, QueryNetworkResponse.class); + + public QueryNetworkResponse() { + super(); + } + + public QueryNetworkResponse(String networkId, String neutronNetworkId, String networkStackId, + NetworkStatus networkStatus, Map networkOutputs) { + super(); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.networkStackId = networkStackId; + this.networkStatus = networkStatus; + this.networkOutputs = networkOutputs; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public NetworkStatus getNetworkStatus() { + return networkStatus; + } + + public void setNetworkStatus(NetworkStatus networkStatus) { + this.networkStatus = networkStatus; + } + + public Boolean getNetworkExists() { + return networkExists; + } + + public void setNetworkExists(Boolean networkExists) { + this.networkExists = networkExists; + } + + public List getVlans() { + return vlans; + } + + public void setVlans(List vlans) { + this.vlans = vlans; + } + + public List getRouteTargets() { + return routeTargets; + } + + public void setRouteTargets(List routeTargets) { + this.routeTargets = routeTargets; + } + + public Map getSubnetIdMap() { + return subnetIdMap; + } + + public void setSubnetIdMap(Map subnetIdMap) { + this.subnetIdMap = subnetIdMap; + } + + public Map getNetworkOutputs() { + return networkOutputs; + } + + public void setNetworkOutputs(Map networkOutputs) { + this.networkOutputs = networkOutputs; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkError.java new file mode 100644 index 0000000000..cb148dfcef --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkError.java @@ -0,0 +1,45 @@ +/*- + * ============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.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "rollbackNetworkError") +public class RollbackNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = -3954464103037391980L; + + public RollbackNetworkError() { + super(""); + } + + public RollbackNetworkError(String message) { + super(message); + } + + public RollbackNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkRequest.java new file mode 100644 index 0000000000..494d3123d1 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkRequest.java @@ -0,0 +1,51 @@ +/*- + * ============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.adapters.nwrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.beans.NetworkRollback; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("rollbackNetworkRequest") +@XmlRootElement(name = "rollbackNetworkRequest") +public class RollbackNetworkRequest extends NetworkRequestCommon { + /** + * + */ + private static final long serialVersionUID = -8705660877263749940L; + private NetworkRollback networkRollback; + + public RollbackNetworkRequest() { + super(); + } + + public NetworkRollback getNetworkRollback() { + return networkRollback; + } + + public void setNetworkRollback(NetworkRollback networkRollback) { + this.networkRollback = networkRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkResponse.java new file mode 100644 index 0000000000..9be8bb3a69 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkResponse.java @@ -0,0 +1,56 @@ +/*- + * ============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.adapters.nwrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + + +@JsonRootName("rollbackNetworkResponse") +@XmlRootElement(name = "rollbackNetworkResponse") +public class RollbackNetworkResponse extends NetworkResponseCommon { + + /** + * + */ + private static final long serialVersionUID = 3115905123337163846L; + private Boolean networkRolledBack; + + public RollbackNetworkResponse() { + super(); + } + + public RollbackNetworkResponse(Boolean networkRolledBack, String messageId) { + super(messageId); + this.networkRolledBack = networkRolledBack; + } + + public Boolean getNetworkRolledBack() { + return networkRolledBack; + } + + public void setNetworkRolledBack(Boolean networkRolledBack) { + this.networkRolledBack = networkRolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkError.java new file mode 100644 index 0000000000..642ac4cc64 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkError.java @@ -0,0 +1,45 @@ +/*- + * ============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.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "updateNetworkError") +public class UpdateNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = 46820809807914392L; + + public UpdateNetworkError() { + super(""); + } + + public UpdateNetworkError(String message) { + super(message); + } + + public UpdateNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java new file mode 100644 index 0000000000..c1c8258a6a --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java @@ -0,0 +1,201 @@ +/*- + * ============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.adapters.nwrest; + + + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; +import org.onap.so.logger.MsoLogger; +import org.onap.so.openstack.beans.Subnet; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("updateNetworkRequest") +@XmlRootElement(name = "updateNetworkRequest") +public class UpdateNetworkRequest extends NetworkRequestCommon { + /** + * + */ + private static final long serialVersionUID = -1219693235726357143L; + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkStackId; + private String networkName; + private String networkType; + private String networkTypeVersion; + private String modelCustomizationUuid; + private NetworkTechnology networkTechnology = NetworkTechnology.NEUTRON; + private List subnets; + private ProviderVlanNetwork providerVlanNetwork; + private ContrailNetwork contrailNetwork; + private Boolean backout = true; + private Map networkParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, UpdateNetworkRequest.class); + @JsonProperty + private boolean contrailRequest; + public UpdateNetworkRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public String getNetworkTypeVersion() { + return networkTypeVersion; + } + + public void setNetworkTypeVersion(String networkTypeVersion) { + this.networkTypeVersion = networkTypeVersion; + } + + public NetworkTechnology getNetworkTechnology() { + return networkTechnology; + } + + public void setNetworkTechnology(NetworkTechnology networkTechnology) { + this.networkTechnology = networkTechnology; + this.contrailRequest = determineContrail(); + } + + public List getSubnets() { + return subnets; + } + + public void setSubnets(List subnets) { + this.subnets = subnets; + } + + public ProviderVlanNetwork getProviderVlanNetwork() { + return providerVlanNetwork; + } + + public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { + this.providerVlanNetwork = providerVlanNetwork; + } + + public ContrailNetwork getContrailNetwork() { + return contrailNetwork; + } + + public void setContrailNetwork(ContrailNetwork contrailNetwork) { + this.contrailNetwork = contrailNetwork; + this.contrailRequest = determineContrail(); + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map getNetworkParams() { + return networkParams; + } + + public void setNetworkParams(Map networkParams) { + this.networkParams = networkParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + @JsonIgnore + protected void setContrailRequest(boolean contrailRequest) { + this.contrailRequest = contrailRequest; + } + public boolean isContrailRequest() { + return contrailRequest; + } + + private boolean determineContrail() { + return (networkTechnology == NetworkTechnology.CONTRAIL && (contrailNetwork != null)); + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkResponse.java new file mode 100644 index 0000000000..7ce66ba58e --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkResponse.java @@ -0,0 +1,78 @@ +/*- + * ============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.adapters.nwrest; + + + +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("updateNetworkResponse") +@XmlRootElement(name = "updateNetworkResponse") +public class UpdateNetworkResponse extends NetworkResponseCommon { + + /** + * + */ + private static final long serialVersionUID = -7528214382414366136L; + private String networkId; + private String neutronNetworkId; + private Map subnetMap; + + public UpdateNetworkResponse() { + /* Empty Constructor */ + } + + public UpdateNetworkResponse(String networkId, String neutronNetworkId, + Map subnetMap, String messageId) { + super(messageId); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.subnetMap = subnetMap; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public Map getSubnetMap() { + return subnetMap; + } + + public void setSubnetMap(Map subnetMap) { + this.subnetMap = subnetMap; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/RequestInformation.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/RequestInformation.java new file mode 100644 index 0000000000..ae7ff27bed --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/RequestInformation.java @@ -0,0 +1,143 @@ +/*- + * ============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.adapters.sdncrest; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlElement; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Request Information specified by the SDNC "agnostic" API. + */ +public class RequestInformation implements Serializable { + private static final long serialVersionUID = 1L; + + // Identifies the transaction MSO has with the calling system. + private String requestId; + + // Identifies the calling system, e.g. CCD. + private String source; + + // The calling system's endpoint for receiving notifications from MSO. + private String notificationUrl; + + // NOTE: these are defined in the SDNC AID, but not used by MSO: + // request-action + // request-sub-action + + // Identifies the request action + private String requestAction; + + // Identifies the request sub action + private String requestSubAction; + + @JsonProperty("orderNumber") + @XmlElement(name = "orderNumber") + private String orderNumber; + + @JsonProperty("orderVersion") + @XmlElement(name = "orderVersion") + private String orderVersion; + + public RequestInformation(String requestId, String source, String notificationUrl) { + this.requestId = requestId; + this.source = source; + this.notificationUrl = notificationUrl; + } + + public RequestInformation() { + } + + @JsonProperty("requestId") + @XmlElement(name = "requestId") + public String getRequestId() { + return requestId; + } + + @JsonProperty("requestId") + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + @JsonProperty("source") + @XmlElement(name = "source") + public String getSource() { + return source; + } + + @JsonProperty("source") + public void setSource(String source) { + this.source = source; + } + + @JsonProperty("notificationUrl") + @XmlElement(name = "notificationUrl") + public String getNotificationUrl() { + return notificationUrl; + } + + @JsonProperty("notificationUrl") + public void setNotificationUrl(String notificationUrl) { + this.notificationUrl = notificationUrl; + } + + @JsonProperty("requestAction") + @XmlElement(name = "requestAction") + public String getRequestAction() { + return requestAction; + } + + @JsonProperty("requestAction") + public void setRequestAction(String requestAction) { + this.requestAction = requestAction; + } + + @JsonProperty("requestSubAction") + @XmlElement(name = "requestSubAction") + public String getRequestSubAction() { + return requestSubAction; + } + + @JsonProperty("requestSubAction") + public void setRequestSubAction(String requestSubAction) { + this.requestSubAction = requestSubAction; + } + + public String getOrderNumber() { + return orderNumber; + } + + public void setOrderNumber(String orderNumber) { + this.orderNumber = orderNumber; + } + + public String getOrderVersion() { + return orderVersion; + } + + public void setOrderVersion(String orderVersion) { + this.orderVersion = orderVersion; + } + + +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCErrorCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCErrorCommon.java new file mode 100644 index 0000000000..b6cd6a1eed --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCErrorCommon.java @@ -0,0 +1,38 @@ +/*- + * ============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.adapters.sdncrest; + +import java.io.Serializable; + +/** + * Base class for all SDNC adapter error responses. + */ +public abstract class SDNCErrorCommon extends SDNCResponseCommon implements Serializable { + private static final long serialVersionUID = 1L; + + public SDNCErrorCommon(String sdncRequestId, String responseCode, + String responseMessage, String ackFinalIndicator) { + super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); + } + + public SDNCErrorCommon() { + } +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java new file mode 100644 index 0000000000..7d6aebdf16 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java @@ -0,0 +1,142 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.sdncrest; + +import java.io.IOException; +import java.io.Serializable; +import java.util.LinkedHashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, +// even though we are using JSON exclusively. The @NoJackson annotation +// is also required in this environment. + +/** + Map elements when marshalled to XML produce a list of ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. + When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. + * + */ +@JsonRootName("SDNCEvent") +@JsonInclude(Include.NON_NULL) +@XmlRootElement(name = "SDNCEvent") +public class SDNCEvent implements Serializable { + private static final long serialVersionUID = 1L; + + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, SDNCEvent.class); + + // Event type + private String eventType; + + // Event correlator type + private String eventCorrelatorType; + + // Event correlator value. + private String eventCorrelator; + + // Map of response parameters (possibly none). + private Map params = null; + + public SDNCEvent(String eventType, String eventCorrelatorType, String eventCorrelator) { + this.eventType = eventType; + this.eventCorrelatorType = eventCorrelatorType; + this.eventCorrelator = eventCorrelator; + } + + public SDNCEvent() { + } + + @JsonProperty("eventType") + @XmlElement(name = "eventType") + public String getEventType() { + return eventType; + } + + @JsonProperty("eventType") + public void setEventType(String eventType) { + this.eventType = eventType; + } + + @JsonProperty("eventCorrelatorType") + @XmlElement(name = "eventCorrelatorType") + public String getEventCorrelatorType() { + return eventCorrelatorType; + } + + @JsonProperty("eventCorrelatorType") + public void setEventCorrelatorType(String eventCorrelatorType) { + this.eventCorrelatorType = eventCorrelatorType; + } + + @JsonProperty("eventCorrelator") + @XmlElement(name = "eventCorrelator") + public String getEventCorrelator() { + return eventCorrelator; + } + + @JsonProperty("eventCorrelator") + public void setEventCorrelator(String eventCorrelator) { + this.eventCorrelator = eventCorrelator; + } + + @JsonProperty("params") + @XmlElement(name = "params") + public Map getParams() { + return params; + } + + @JsonProperty("params") + public void setParams(Map params) { + this.params = params; + } + + public void addParam(String name, String value) { + if (params == null) { + params = new LinkedHashMap<>(); + } + params.put(name, value); + } + + public String toJson() { + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + mapper.setSerializationInclusion(Include.NON_NULL); + return mapper.writeValueAsString(this); + } catch (IOException e) { + LOGGER.debug("Exception:", e); + throw new UnsupportedOperationException("Cannot convert " + + getClass().getSimpleName() + " to JSON", e); + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java new file mode 100644 index 0000000000..9ddf55cc21 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java @@ -0,0 +1,115 @@ +/*- + * ============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.adapters.sdncrest; + +import java.io.IOException; +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlElement; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * Base class for all SDNC adapter requests. + */ +public abstract class SDNCRequestCommon implements Serializable { + private static final long serialVersionUID = 1L; + + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, SDNCRequestCommon.class); + + // Endpoint on which BPMN can receive notifications from the SDNC adapter. + private String bpNotificationUrl; + + // BPMN flow timeout value in ISO 8601 format, e.g. PT5M. + // Not currently used by the SDNC adapter. + private String bpTimeout; + + // Identifies the MSO transaction with SDNC. + // Maps to sdnc-request-header/requestId in the SDNC request. + private String sdncRequestId; + + public SDNCRequestCommon(String sdncRequestId, String bpNotificationUrl, + String bpTimeout) { + this.sdncRequestId = sdncRequestId; + this.bpNotificationUrl = bpNotificationUrl; + this.bpTimeout = bpTimeout; + } + + public SDNCRequestCommon() { + } + + @JsonProperty("bpNotificationUrl") + @XmlElement(name = "bpNotificationUrl") + public String getBPNotificationUrl() { + return bpNotificationUrl; + } + + @JsonProperty("bpNotificationUrl") + public void setBPNotificationUrl(String bpNotificationUrl) { + this.bpNotificationUrl = bpNotificationUrl; + } + + @JsonProperty("bpTimeout") + @XmlElement(name = "bpTimeout") + public String getBPTimeout() { + return bpTimeout; + } + + @JsonProperty("bpTimeout") + public void setBPTimeout(String bpTimeout) { + this.bpTimeout = bpTimeout; + } + + @JsonProperty("sdncRequestId") + @XmlElement(name = "sdncRequestId") + public String getSdncRequestId() { + return sdncRequestId; + } + + @JsonProperty("sdncRequestId") + public void setSdncRequestId(String sdncRequestId) { + this.sdncRequestId = sdncRequestId; + } + + @JsonIgnore + public boolean isSynchronous() { + return bpNotificationUrl == null || bpNotificationUrl.isEmpty(); + } + + public String toJson() { + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + mapper.setSerializationInclusion(Include.NON_NULL); + return mapper.writeValueAsString(this); + } catch (IOException e) { + LOGGER.debug("Exception:", e); + throw new UnsupportedOperationException("Cannot convert " + + getClass().getSimpleName() + " to JSON", e); + } + } +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java new file mode 100644 index 0000000000..2da94017ca --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java @@ -0,0 +1,124 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.sdncrest; + +import java.io.IOException; +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlElement; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * Base class for all SDNC adapter responses, including errors. + */ +public abstract class SDNCResponseCommon implements Serializable { + private static final long serialVersionUID = 1L; + + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, SDNCResponseCommon.class); + + // Identifies the MSO transaction with SDNC. + private String sdncRequestId; + + // Response code, either from SDNC, or generated by the SDNC adapter. + // 2XX responses are considered success responses. + private String responseCode; + + // Response message, either from SDNC, or generated by the SDNC adapter. + private String responseMessage; + + // Indicates if the response is final (Y or N). + private String ackFinalIndicator; + + public SDNCResponseCommon(String sdncRequestId, String responseCode, + String responseMessage, String ackFinalIndicator) { + this.sdncRequestId = sdncRequestId; + this.responseCode = responseCode; + this.responseMessage = responseMessage; + this.ackFinalIndicator = ackFinalIndicator; + } + + public SDNCResponseCommon() { + } + + @JsonProperty("sdncRequestId") + @XmlElement(name = "sdncRequestId") + public String getSdncRequestId() { + return sdncRequestId; + } + + @JsonProperty("sdncRequestId") + public void setSdncRequestId(String sdncRequestId) { + this.sdncRequestId = sdncRequestId; + } + + @JsonProperty("responseCode") + @XmlElement(name = "responseCode") + public String getResponseCode() { + return responseCode; + } + + @JsonProperty("responseCode") + public void setResponseCode(String responseCode) { + this.responseCode = responseCode; + } + + @JsonProperty("responseMessage") + @XmlElement(name = "responseMessage") + public String getResponseMessage() { + return responseMessage; + } + + @JsonProperty("responseMessage") + public void setResponseMessage(String responseMessage) { + this.responseMessage = responseMessage; + } + + @JsonProperty("ackFinalIndicator") + @XmlElement(name = "ackFinalIndicator") + public String getAckFinalIndicator() { + return ackFinalIndicator; + } + + @JsonProperty("ackFinalIndicator") + public void setAckFinalIndicator(String ackFinalIndicator) { + this.ackFinalIndicator = ackFinalIndicator; + } + + public String toJson() { + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + mapper.setSerializationInclusion(Include.NON_NULL); + return mapper.writeValueAsString(this); + } catch (IOException e) { + LOGGER.debug("Exception:", e); + throw new UnsupportedOperationException("Cannot convert " + + getClass().getSimpleName() + " to JSON", e); + } + } +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceError.java new file mode 100644 index 0000000000..fdb735891c --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceError.java @@ -0,0 +1,51 @@ +/*- + * ============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.adapters.sdncrest; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonRootName; + +// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, +// even though we are using JSON exclusively. The @NoJackson annotation +// is also required in this environment. + +/** + * SDNC adapter error response for "agnostic" API services. + */ +@JsonRootName("SDNCServiceError") +@JsonInclude(Include.NON_NULL) +@XmlRootElement(name = "SDNCServiceError") +public class SDNCServiceError extends SDNCErrorCommon implements Serializable { + private static final long serialVersionUID = 1; + + public SDNCServiceError(String sdncRequestId, String responseCode, + String responseMessage, String ackFinalIndicator) { + super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); + } + + public SDNCServiceError() { + } +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java new file mode 100644 index 0000000000..b271af2f9b --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java @@ -0,0 +1,150 @@ +/*- + * ============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.adapters.sdncrest; + +import java.io.Serializable; + +import javax.ws.rs.Consumes; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, +// even though we are using JSON exclusively. The @NoJackson annotation +// is also required in this environment. + +/** + * SDNC adapter request for "agnostic" API services. + * The target action is determined by a service type and an operation. + */ +@JsonRootName("SDNCServiceRequest") +@JsonInclude(Include.NON_NULL) +@XmlRootElement(name = "SDNCServiceRequest") +public class SDNCServiceRequest extends SDNCRequestCommon implements Serializable { + private static final long serialVersionUID = 1L; + + // Request Information specified by SDNC "agnostic" API + private RequestInformation requestInformation; + + // Service Information specified by: SDNC "agnostic" API + private ServiceInformation serviceInformation; + + // The SDNC service type specified by SDNC "agnostic" API + private String sdncService; + + // The SDNC operation specified by SDNC "agnostic" API + private String sdncOperation; + + // The SDNC service data type specified by SDNC "agnostic" API + private String sdncServiceDataType; + + // The SDNC service data specified by SDNC "agnostic" API + private String sdncServiceData; + + public SDNCServiceRequest() { + } + + public SDNCServiceRequest(String bpNotificationUrl, String bpTimeout, + String sdncRequestId, String sdncService, String sdncOperation, + RequestInformation requestInformation, + ServiceInformation serviceInformation, String sdncServiceDataType, + String sndcServiceData) { + super(bpNotificationUrl, bpTimeout, sdncRequestId); + this.requestInformation = requestInformation; + this.serviceInformation = serviceInformation; + this.sdncService = sdncService; + this.sdncOperation = sdncOperation; + this.sdncServiceDataType = sdncServiceDataType; + this.sdncServiceData = sndcServiceData; + } + + @JsonProperty("requestInformation") + @XmlElement(name = "requestInformation") + public RequestInformation getRequestInformation() { + return requestInformation; + } + + @JsonProperty("requestInformation") + public void setRequestInformation(RequestInformation requestInformation) { + this.requestInformation = requestInformation; + } + + @JsonProperty("serviceInformation") + @XmlElement(name = "serviceInformation") + public ServiceInformation getServiceInformation() { + return serviceInformation; + } + + @JsonProperty("serviceInformation") + public void setServiceInformation(ServiceInformation serviceInformation) { + this.serviceInformation = serviceInformation; + } + + @JsonProperty("sdncService") + @XmlElement(name = "sdncService") + public String getSdncService() { + return sdncService; + } + + @JsonProperty("sdncService") + public void setSdncService(String sdncService) { + this.sdncService = sdncService; + } + + @JsonProperty("sdncOperation") + @XmlElement(name = "sdncOperation") + public String getSdncOperation() { + return sdncOperation; + } + + @JsonProperty("sdncOperation") + public void setSdncOperation(String sdncOperation) { + this.sdncOperation = sdncOperation; + } + + @JsonProperty("sdncServiceDataType") + @XmlElement(name = "sdncServiceDataType") + public String getSdncServiceDataType() { + return sdncServiceDataType; + } + + @JsonProperty("sdncServiceDataType") + public void setSdncServiceDataType(String sdncServiceDataType) { + this.sdncServiceDataType = sdncServiceDataType; + } + + @JsonProperty("sdncServiceData") + @XmlElement(name = "sdncServiceData") + public String getSdncServiceData() { + return sdncServiceData; + } + + @JsonProperty("sdncServiceData") + public void setSdncServiceData(String sndcServiceData) { + this.sdncServiceData = sndcServiceData; + } +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceResponse.java new file mode 100644 index 0000000000..18c9d49939 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceResponse.java @@ -0,0 +1,78 @@ +/*- + * ============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.adapters.sdncrest; + +import java.io.Serializable; +import java.util.LinkedHashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, +// even though we are using JSON exclusively. The @NoJackson annotation +// is also required in this environment. + +/** + Map elements when marshalled to XML produce a list of ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. + When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. + * + */ +@JsonRootName("SDNCServiceResponse") +@JsonInclude(Include.NON_NULL) +@XmlRootElement(name = "SDNCServiceResponse") +public class SDNCServiceResponse extends SDNCResponseCommon implements Serializable { + private static final long serialVersionUID = 1L; + + // Map of response parameters (possibly none). + private Map params = null; + + public SDNCServiceResponse(String sdncRequestId, String responseCode, + String responseMessage, String ackFinalIndicator) { + super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); + } + + public SDNCServiceResponse() { + } + + @JsonProperty("params") + @XmlElement(name = "params") + public Map getParams() { + return params; + } + + @JsonProperty("params") + public void setParams(Map params) { + this.params = params; + } + + public void addParam(String name, String value) { + if (params == null) { + params = new LinkedHashMap<>(); + } + params.put(name, value); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/ServiceInformation.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/ServiceInformation.java new file mode 100644 index 0000000000..b4fe26ac00 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/ServiceInformation.java @@ -0,0 +1,104 @@ +/*- + * ============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.adapters.sdncrest; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlElement; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service Information specified by the SDNC "agnostic" API. + */ +public class ServiceInformation implements Serializable { + private static final long serialVersionUID = 1L; + + // The subscription's service type for the target service instance. + private String serviceType; + + // Identifies the target service instance for this particular SDNC request. + // NOTE: this could be a child of the parent model instance, i.e. this + // service instance ID may be different from the service instance ID + // associated with the transaction MSO has with the system that invoked it. + private String serviceInstanceId; + + // The subscriber name. + private String subscriberName; + + // The subscriber global ID (customer ID). + private String subscriberGlobalId; + + public ServiceInformation(String serviceType, String serviceInstanceId, + String subscriberName, String subscriberGlobalId) { + this.serviceType = serviceType; + this.serviceInstanceId = serviceInstanceId; + this.subscriberName = subscriberName; + this.subscriberGlobalId = subscriberGlobalId; + } + + public ServiceInformation() { + } + + @JsonProperty("serviceType") + @XmlElement(name = "serviceType") + public String getServiceType() { + return serviceType; + } + + @JsonProperty("serviceType") + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @JsonProperty("serviceInstanceId") + @XmlElement(name = "serviceInstanceId") + public String getServiceInstanceId() { + return serviceInstanceId; + } + + @JsonProperty("serviceInstanceId") + public void setServiceInstanceId(String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + } + + @JsonProperty("subscriberName") + @XmlElement(name = "subscriberName") + public String getSubscriberName() { + return subscriberName; + } + + @JsonProperty("subscriberName") + public void setSubscriberName(String subscriberName) { + this.subscriberName = subscriberName; + } + + @JsonProperty("subscriberGlobalId") + @XmlElement(name = "subscriberGlobalId") + public String getSubscriberGlobalId() { + return subscriberGlobalId; + } + + @JsonProperty("subscriberGlobalId") + public void setSubscriberGlobalId(String subscriberGlobalId) { + this.subscriberGlobalId = subscriberGlobalId; + } +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantError.java new file mode 100644 index 0000000000..34da8c6292 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantError.java @@ -0,0 +1,73 @@ +/*- + * ============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.adapters.tenantrest; + + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "createTenantError") +public class CreateTenantError implements Serializable { + private static final long serialVersionUID = 7305288262646805568L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public CreateTenantError () {} + + public CreateTenantError (String message) { + this.message = message; + } + + public CreateTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantRequest.java new file mode 100644 index 0000000000..d52e714f70 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantRequest.java @@ -0,0 +1,98 @@ +/*- + * ============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.adapters.tenantrest; + + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +@XmlRootElement(name = "createTenantRequest") +public class CreateTenantRequest extends TenantRequestCommon { + private String cloudSiteId; + private String tenantName; + private Boolean failIfExists; + private Boolean backout; + private Map metadata = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + + public CreateTenantRequest() {} + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override + public String toString() { + return "CreateTenantRequest [cloudSiteId=" + cloudSiteId + + ", tenantName=" + tenantName + ", failIfExists=" + + failIfExists + ", backout=" + backout + ", metadata=" + + metadata + "]"; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantResponse.java new file mode 100644 index 0000000000..ec304cec41 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantResponse.java @@ -0,0 +1,85 @@ +/*- + * ============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.adapters.tenantrest; + + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "createTenantResponse") +public class CreateTenantResponse implements Serializable { + private static final long serialVersionUID = -456155026754759682L; + private String cloudSiteId; + private String tenantId; + private Boolean tenantCreated; + private TenantRollback tenantRollback = new TenantRollback(); + + public CreateTenantResponse() {} + + public CreateTenantResponse(String cloudSiteId, String tenantId, + Boolean tenantCreated, TenantRollback tenantRollback) { + this.cloudSiteId = cloudSiteId; + this.tenantId = tenantId; + this.tenantCreated = tenantCreated; + this.tenantRollback = tenantRollback; + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public Boolean getTenantCreated() { + return tenantCreated; + } + + public void setTenantCreated(Boolean tenantCreated) { + this.tenantCreated = tenantCreated; + } + + public TenantRollback getTenantRollback() { + return tenantRollback; + } + + public void setTenantRollback(TenantRollback tenantRollback) { + this.tenantRollback = tenantRollback; + } + + @Override + public String toString() { + return "CreateTenantResponse [cloudSiteId=" + cloudSiteId + + ", tenantId=" + tenantId + ", tenantCreated=" + tenantCreated + + ", tenantRollback=" + tenantRollback.toString() + "]"; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantError.java new file mode 100644 index 0000000000..d2c22e8506 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantError.java @@ -0,0 +1,73 @@ +/*- + * ============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.adapters.tenantrest; + + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "deleteTenantError") +public class DeleteTenantError implements Serializable { + private static final long serialVersionUID = -5778340182805870809L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public DeleteTenantError () {} + + public DeleteTenantError (String message) { + this.message = message; + } + + public DeleteTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantRequest.java new file mode 100644 index 0000000000..a39b7164e2 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantRequest.java @@ -0,0 +1,62 @@ +/*- + * ============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.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +@XmlRootElement(name = "deleteTenantRequest") +public class DeleteTenantRequest extends TenantRequestCommon { + + private String cloudSiteId; + private String tenantId; + + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteTenantRequest() {} + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantResponse.java new file mode 100644 index 0000000000..e7961d4607 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantResponse.java @@ -0,0 +1,41 @@ +/*- + * ============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.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "deleteTenantResponse") +public class DeleteTenantResponse { + + private Boolean tenantDeleted; + + public DeleteTenantResponse() {} + + public Boolean getTenantDeleted() { + return tenantDeleted; + } + + public void setTenantDeleted(Boolean tenantDeleted) { + this.tenantDeleted = tenantDeleted; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantError.java new file mode 100644 index 0000000000..10f4b70a07 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantError.java @@ -0,0 +1,63 @@ +/*- + * ============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.adapters.tenantrest; + + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "queryTenantError") +public class QueryTenantError implements Serializable { + private static final long serialVersionUID = 7358240830662453507L; + private String message; + private MsoExceptionCategory category; + + public QueryTenantError () {} + + public QueryTenantError (String message) { + this.message = message; + } + + public QueryTenantError (String message, MsoExceptionCategory category) { + this.message = message; + this.category = category; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantResponse.java new file mode 100644 index 0000000000..8d478cd393 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantResponse.java @@ -0,0 +1,63 @@ +/*- + * ============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.adapters.tenantrest; + + + +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "queryTenantResponse") +public class QueryTenantResponse extends TenantRequestCommon { + private String tenantId; + private String tenantName; + private Map metadata; + + public QueryTenantResponse() {} + + public QueryTenantResponse (String id, String name, Map metadata) { + this.tenantId = id; + this.tenantName = name; + this.metadata = metadata; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public Map getMetadata() { + return metadata; + } + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantError.java new file mode 100644 index 0000000000..725b40549d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantError.java @@ -0,0 +1,69 @@ +/*- + * ============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.adapters.tenantrest; + + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "rollbackTenantError") +public class RollbackTenantError implements Serializable { + private static final long serialVersionUID = -5313713674529615223L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public RollbackTenantError () {} + + public RollbackTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantRequest.java new file mode 100644 index 0000000000..d99150fc47 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantRequest.java @@ -0,0 +1,41 @@ +/*- + * ============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.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rollbackTenantRequest") +public class RollbackTenantRequest extends TenantRequestCommon { + + private TenantRollback tenantRollback; + + public RollbackTenantRequest() {} + + public TenantRollback getTenantRollback() { + return tenantRollback; + } + + public void setTenantRollback(TenantRollback tenantRollback) { + this.tenantRollback = tenantRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantResponse.java new file mode 100644 index 0000000000..25b77b3490 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantResponse.java @@ -0,0 +1,41 @@ +/*- + * ============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.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rollbackTenantResponse") +public class RollbackTenantResponse { + + private Boolean tenantRolledback; + + public RollbackTenantResponse() {} + + public Boolean getTenantRolledback() { + return tenantRolledback; + } + + public void setTenantRolledback(Boolean tenantRolledback) { + this.tenantRolledback = tenantRolledback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantExceptionResponse.java new file mode 100644 index 0000000000..f4dd7f9499 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantExceptionResponse.java @@ -0,0 +1,72 @@ +/*- + * ============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.adapters.tenantrest; + + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "createTenantResponse") +public class TenantExceptionResponse implements Serializable { + + private static final long serialVersionUID = -9062290006520066109L; + + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public TenantExceptionResponse () {} + + public TenantExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java new file mode 100644 index 0000000000..168200e477 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.tenantrest; + + +import java.io.ByteArrayOutputStream; +import java.io.Serializable; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +public abstract class TenantRequestCommon implements Serializable { + + private static final long serialVersionUID = 1486834308868170854L; + private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, TenantRequestCommon.class); + public String toJsonString() { + try { + String jsonString; + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + return jsonString; + } catch (Exception e) { + LOGGER.debug("Exception :",e); + return ""; + } + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + LOGGER.debug("Exception :",e); + return ""; + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRollback.java new file mode 100644 index 0000000000..195628167e --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRollback.java @@ -0,0 +1,80 @@ +/*- + * ============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.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +/** + * Javabean representing the rollback criteria following a "Create Tenant" + * operation. This structure can be passed back to the "Rollback Tenant" + * operation to undo the effects of the create. + * + * + */ + +@XmlRootElement(name = "rollbackTenantRequest") +public class TenantRollback extends TenantRequestCommon { + private static final long serialVersionUID = -4540810517355635993L; + private String tenantId; + private String cloudId; + private boolean tenantCreated = false; + private MsoRequest msoRequest; + + public TenantRollback() {} + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getCloudId() { + return cloudId; + } + public void setCloudId(String cloudId) { + this.cloudId = cloudId; + } + + public boolean getTenantCreated() { + return tenantCreated; + } + public void setTenantCreated(boolean tenantCreated) { + this.tenantCreated = tenantCreated; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + public void setMsoRequest (MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override + public String toString() { + return "VnfRollback: cloud=" + cloudId + ", tenant=" + tenantId + + ", tenantCreated=" + tenantCreated; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/CloudInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/CloudInfo.java new file mode 100644 index 0000000000..a56a6929a9 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/CloudInfo.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 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.adapters.vdu; + +/** + * Cloud information structure for deploying/managing a VDU. Includes the cloud site + * as well as tenant information within the site. Currently this is defined as a + * cloud site ID. which would map to a CloudConfig entry. + * Perhaps the CloudConfig entry itself should be provided, instead of requiring each + * plug-in to query it. + * + * The meaning of 'tenant' may differ by cloud provider, but every cloud supports some + * sort of tenant partitioning. + * + */ +public class CloudInfo { + + private String cloudSiteId; + private String tenantId; + private String tenantName;//bpmn query and pass + + public CloudInfo() { + } + + public CloudInfo (String cloudSiteId, String tenantId, String tenantName) { + this.cloudSiteId = cloudSiteId; + this.tenantId = tenantId; + this.tenantName = tenantName; + } + + public String getCloudSiteId() { + return cloudSiteId; + } + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public String getTenantName() { + return tenantName; + } + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/PluginAction.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/PluginAction.java new file mode 100644 index 0000000000..1f097ddd68 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/PluginAction.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 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.adapters.vdu; + +/** + * Java beam representing a detailed action performed within a plugin during VDU + * orchestration. This allows the plugin to convey more detailed information about + * recent activities it has performed. It is primarily intended for logging and + * troubleshooting, so plugins are free to populate this as desired. + */ +public class PluginAction { + + private String action; + private String status; + private String rawMessage; + + public PluginAction () { + } + + public PluginAction (String action, String status, String rawMessage) { + this.action = action; + this.status = status; + this.rawMessage = rawMessage; + } + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + public String getRawMessage() { + return rawMessage; + } + public void setRawMessage(String rawMessage) { + this.rawMessage = rawMessage; + } + +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java new file mode 100644 index 0000000000..a53cd0ce49 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java @@ -0,0 +1,80 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 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.adapters.vdu; + +import java.util.Arrays; +import java.util.Objects; + +public class VduArtifact { + + // Enumerate the types of artifacts permitted. This may need to be a variable string + // value if arbitrary (cloud-specific) artifacts may be attached to VDUs in ASDC. + public enum ArtifactType { + MAIN_TEMPLATE, NESTED_TEMPLATE, CONFIG_FILE, SCRIPT_FILE, TEXT_FILE, ENVIRONMENT + } + + private String name; + private byte[] content; + private ArtifactType type; + + // Default constructor + public VduArtifact() {} + + // Fully specified constructor + public VduArtifact (String name, byte[] content, ArtifactType type) { + this.name = name; + this.content = content; + this.type = type; + } + + public String getName() { + return name; + } + public void setName (String name) { + this.name = name; + } + public byte[] getContent() { + return content; + } + public void setContent(byte[] content) { + this.content = content; + } + public ArtifactType getType() { + return type; + } + public void setType(ArtifactType type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VduArtifact that = (VduArtifact) o; + return Objects.equals(name, that.name) && + Arrays.equals(content, that.content) && + type == that.type; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduException.java new file mode 100644 index 0000000000..c611b87e5c --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduException.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.adapters.vdu; + +import org.onap.so.openstack.exceptions.MsoException; +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +/** + * OpenStack exception. + */ +public class VduException extends MsoException +{ + + /** + * Serialization id. + */ + private static final long serialVersionUID = 3313636124141766495L; + + /** + * Constructor to create a new VduException instance + * @param detail error details + */ + public VduException (String detail) { + // Set the detailed error as the Exception 'message' + super(detail); + // TODO: Need a more generic category than OPENSTACK + super.category = MsoExceptionCategory.OPENSTACK; + } + + /** + * Constructor to create a new VduException instance + * @param detail error details + * @param e the cause + */ + public VduException (String detail, Exception e) { + // Set the detailed error as the Exception 'message' + super(detail, e); + // TODO: Need a more generic category than OPENSTACK + super.category = MsoExceptionCategory.OPENSTACK; + } + +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduInstance.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduInstance.java new file mode 100644 index 0000000000..8f5f0f9745 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduInstance.java @@ -0,0 +1,80 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.adapters.vdu; + +import java.util.Map; +import java.util.HashMap; + +/* + * This Java bean class relays VDU status information in a cloud-agnostic format. + * + * This bean is returned by all implementors of the VduPlugin interface operations + * (instantiate, query, delete). + */ + +public class VduInstance { + // Set defaults for everything + protected String vduInstanceId; + protected String vduInstanceName; + protected VduStatus status; + protected Map outputs = new HashMap<>(); + protected Map inputs = new HashMap<>(); + + public String getVduInstanceId() { + return vduInstanceId; + } + + public void setVduInstanceId(String vduInstanceId) { + this.vduInstanceId = vduInstanceId; + } + + public String getVduInstanceName() { + return vduInstanceName; + } + + public void setVduInstanceName(String vduInstanceName) { + this.vduInstanceName = vduInstanceName; + } + + public VduStatus getStatus() { + return status; + } + + public void setStatus(VduStatus status) { + this.status = status; + } + + public Map getOutputs() { + return outputs; + } + + public void setOutputs(Map outputs) { + this.outputs = outputs; + } + + public Map getInputs() { + return inputs; + } + + public void setInputs(Map inputs) { + this.inputs = inputs; + } +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduModelInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduModelInfo.java new file mode 100644 index 0000000000..47f4c74aae --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduModelInfo.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 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.adapters.vdu; + +import java.util.ArrayList; +import java.util.List; + +public class VduModelInfo { + private String modelCustomizationUUID; + private int timeoutMinutes; + private List artifacts = new ArrayList<>(); + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + public int getTimeoutMinutes() { + return timeoutMinutes; + } + public void setTimeoutMinutes(int timeoutMinutes) { + this.timeoutMinutes = timeoutMinutes; + } + public List getArtifacts() { + return artifacts; + } + public void setArtifacts(List artifacts) { + this.artifacts = artifacts; + } + +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStateType.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStateType.java new file mode 100644 index 0000000000..0b95b392f6 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStateType.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.adapters.vdu; + + +/* + * Enum status values to capture the state of a generic (cloud-agnostic) VDU. + */ +public enum VduStateType { + NOTFOUND, + INSTANTIATING, + INSTANTIATED, + DELETING, + DELETED, // Note - only returned in success response to deleteVdu call. + UPDATING, + FAILED, + UNKNOWN +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStatus.java new file mode 100644 index 0000000000..7797c997a5 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStatus.java @@ -0,0 +1,58 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 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.adapters.vdu; + +public class VduStatus { + + private VduStateType state; + private String errorMessage; + private PluginAction lastAction; + + public VduStatus(){} + public VduStatus( VduStateType state) { + this.state = state; + } + public VduStateType getState() { + return state; + } + public void setState(VduStateType state) { + this.state = state; + } + public String getErrorMessage() { + return errorMessage; + } + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + public PluginAction getLastAction() { + return lastAction; + } + public void setLastAction(PluginAction lastAction) { + this.lastAction = lastAction; + } + public void setLastAction (String action, String status, String rawCloudMessage) { + lastAction = new PluginAction(); + lastAction.setAction (action); + lastAction.setStatus (status); + lastAction.setRawMessage(rawCloudMessage); + } + +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleRequest.java new file mode 100644 index 0000000000..d0caef33e4 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleRequest.java @@ -0,0 +1,215 @@ +/*- + * ============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.adapters.vnfrest; + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonRootName; + +/* README + Map elements when marshalled to XML produce a list of ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. + When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. +*/ +@JsonRootName("createVfModuleRequest") +@XmlRootElement(name = "createVfModuleRequest") +public class CreateVfModuleRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + + private String vnfId; + private String vnfType; + private String vnfVersion; + + private String vfModuleId; + private String vfModuleName; + private String vfModuleType; + + private String volumeGroupId; + private String volumeGroupStackId; + private String baseVfModuleId; + private String baseVfModuleStackId; + private String modelCustomizationUuid; + + private String requestType; + private Boolean failIfExists; + private Boolean backout; + private Boolean enableBridge; + + private Map vfModuleParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleName() { + return vfModuleName; + } + + public void setVfModuleName(String vfModuleName) { + this.vfModuleName = vfModuleName; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public String getBaseVfModuleId() { + return baseVfModuleId; + } + + public void setBaseVfModuleId(String baseVfModuleId) { + this.baseVfModuleId = baseVfModuleId; + } + + public String getBaseVfModuleStackId() { + return baseVfModuleStackId; + } + + public void setBaseVfModuleStackId(String baseVfModuleStackId) { + this.baseVfModuleStackId = baseVfModuleStackId; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public String getRequestType() { + return requestType; + } + + public void setRequestType(String requestType) { + this.requestType = requestType; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map getVfModuleParams() { + return vfModuleParams; + } + + public void setVfModuleParams(Map vfModuleParams) { + this.vfModuleParams = vfModuleParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public Boolean getEnableBridge() { + return this.enableBridge; + } + + public void setEnableBridge(Boolean enableBridge) { + this.enableBridge = enableBridge; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleResponse.java new file mode 100644 index 0000000000..b9d1f4c376 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleResponse.java @@ -0,0 +1,105 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("createVfModuleResponse") +@XmlRootElement(name = "createVfModuleResponse") +public class CreateVfModuleResponse extends VfResponseCommon { + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private Boolean vfModuleCreated; + private Map vfModuleOutputs = new HashMap<>(); + private VfModuleRollback rollback = new VfModuleRollback(); + + public CreateVfModuleResponse() { + super(); + } + + public CreateVfModuleResponse(String vnfId, String vfModuleId, + String vfModuleStackId, Boolean vfModuleCreated, + Map vfModuleOutputs, VfModuleRollback rollback, + String messageId) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vfModuleCreated; + this.vfModuleOutputs = vfModuleOutputs; + this.rollback = rollback; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public Boolean getVfModuleCreated() { + return vfModuleCreated; + } + + public void setVfModuleCreated(Boolean vfModuleCreated) { + this.vfModuleCreated = vfModuleCreated; + } + + public Map getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } + + public VfModuleRollback getRollback() { + return rollback; + } + + public void setRollback(VfModuleRollback rollback) { + this.rollback = rollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupRequest.java new file mode 100644 index 0000000000..698b2ccebe --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupRequest.java @@ -0,0 +1,157 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("createVolumeGroupRequest") +@XmlRootElement(name = "createVolumeGroupRequest") +public class CreateVolumeGroupRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + private String volumeGroupName; + private String volumeGroupId; + private String vnfType; + private String vnfVersion; + private String vfModuleType; + private String modelCustomizationUuid; + private Map volumeGroupParams = new HashMap<>(); + private Boolean failIfExists; + private Boolean enableBridge; + private Boolean suppressBackout; + private MsoRequest msoRequest = new MsoRequest(); + + public CreateVolumeGroupRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public Map getVolumeGroupParams() { + return volumeGroupParams; + } + + public void setVolumeGroupParams(Map volumeGroupParams) { + this.volumeGroupParams = volumeGroupParams; + } + + public String getVolumeGroupName() { + return volumeGroupName; + } + + public void setVolumeGroupName(String volumeGroupName) { + this.volumeGroupName = volumeGroupName; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getSuppressBackout() { + return suppressBackout; + } + + public void setSuppressBackout(Boolean suppressBackout) { + this.suppressBackout = suppressBackout; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public Boolean getEnableBridge() { + return enableBridge; + } + + public void setEnableBridge(Boolean enableBridge) { + this.enableBridge = enableBridge; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupResponse.java new file mode 100644 index 0000000000..d98318d3e6 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupResponse.java @@ -0,0 +1,100 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + + +@JsonRootName("createVolumeGroupResponse") +@XmlRootElement(name = "createVolumeGroupResponse") +public class CreateVolumeGroupResponse extends VfResponseCommon { + private String volumeGroupId; + private String volumeGroupStackId; + private Boolean volumeGroupCreated; + private Map volumeGroupOutputs = new HashMap<>(); + private VolumeGroupRollback volumeGroupRollback = new VolumeGroupRollback(); + + public CreateVolumeGroupResponse() { + super(); + } + + public CreateVolumeGroupResponse( + String volumeGroupId, + String volumeGroupStackId, + Boolean volumeGroupCreated, + Map volumeGroupOutputs, + VolumeGroupRollback volumeGroupRollback, + String messageId) + { + super(messageId); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupCreated = volumeGroupCreated; + this.volumeGroupOutputs = volumeGroupOutputs; + this.volumeGroupRollback = volumeGroupRollback; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public Boolean getVolumeGroupCreated() { + return volumeGroupCreated; + } + + public void setVolumeGroupCreated(Boolean volumeGroupCreated) { + this.volumeGroupCreated = volumeGroupCreated; + } + + public Map getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public VolumeGroupRollback getVolumeGroupRollback() { + return volumeGroupRollback; + } + + public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { + this.volumeGroupRollback = volumeGroupRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java new file mode 100644 index 0000000000..6ce9b2fa4c --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java @@ -0,0 +1,98 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("deleteVfModuleRequest") +@XmlRootElement(name = "deleteVfModuleRequest") +public class DeleteVfModuleRequest extends VfRequestCommon implements Serializable { + /** + * + */ + private static final long serialVersionUID = -8504083539107392561L; + private String cloudSiteId; + private String tenantId; + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteVfModuleRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleResponse.java new file mode 100644 index 0000000000..ca713d36a0 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleResponse.java @@ -0,0 +1,80 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("deleteVfModuleResponse") +@XmlRootElement(name = "deleteVfModuleResponse") +public class DeleteVfModuleResponse extends VfResponseCommon { + private String vnfId; + private String vfModuleId; + private Boolean vfModuleDeleted; + private Map vfModuleOutputs = new HashMap<>(); + public DeleteVfModuleResponse() { + super(); + } + + public DeleteVfModuleResponse(String vnfId, String vfModuleId, Boolean vfModuleDeleted, String messageId, Map outputs) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleDeleted = vfModuleDeleted; + this.vfModuleOutputs = outputs; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public Boolean getVfModuleDeleted() { + return vfModuleDeleted; + } + + public void setVfModuleDeleted(Boolean vfModuleDeleted) { + this.vfModuleDeleted = vfModuleDeleted; + } + public Map getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupRequest.java new file mode 100644 index 0000000000..d17c5dd0de --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupRequest.java @@ -0,0 +1,90 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonRootName; +import org.apache.commons.lang3.builder.ToStringBuilder; + +@JsonRootName("deleteVolumeGroupRequest") +@XmlRootElement(name = "deleteVolumeGroupRequest") +public class DeleteVolumeGroupRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + private String volumeGroupId; + private String volumeGroupStackId; + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteVolumeGroupRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override + public String toString() { + return new ToStringBuilder(this).appendSuper(super.toString()).append("cloudSiteId", cloudSiteId) + .append("tenantId", tenantId).append("volumeGroupId", volumeGroupId) + .append("volumeGroupStackId", volumeGroupStackId).append("msoRequest", msoRequest).toString(); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupResponse.java new file mode 100644 index 0000000000..4a7442108a --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupResponse.java @@ -0,0 +1,49 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("deleteVolumeGroupResponse") +@XmlRootElement(name = "deleteVolumeGroupResponse") +public class DeleteVolumeGroupResponse extends VfResponseCommon { + private Boolean volumeGroupDeleted; + + public DeleteVolumeGroupResponse() { + super(); + } + + public DeleteVolumeGroupResponse(Boolean volumeGroupDeleted, String messageId) { + super(messageId); + this.volumeGroupDeleted = volumeGroupDeleted; + } + + public Boolean getVolumeGroupDeleted() { + return volumeGroupDeleted; + } + + public void setVolumeGroupDeleted(Boolean volumeGroupDeleted) { + this.volumeGroupDeleted = volumeGroupDeleted; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java new file mode 100644 index 0000000000..0214d15ee8 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.vnfrest; + +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.logger.MsoLogger; +import org.onap.so.openstack.beans.VnfStatus; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("queryVfModuleResponse") +@XmlRootElement(name = "queryVfModuleResponse") +public class QueryVfModuleResponse extends VfResponseCommon{ + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, QueryVfModuleResponse.class); + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private VnfStatus vnfStatus; + private Map vfModuleOutputs; + + public QueryVfModuleResponse() { + super(); + } + + public QueryVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, VnfStatus vnfStatus, + Map vfModuleOutputs) { + super(); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vnfStatus = vnfStatus; + this.vfModuleOutputs = vfModuleOutputs; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public VnfStatus getVnfStatus() { + return vnfStatus; + } + + public void setVnfStatus(VnfStatus vnfStatus) { + this.vnfStatus = vnfStatus; + } + + public Map getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java new file mode 100644 index 0000000000..6e8027c689 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java @@ -0,0 +1,103 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.vnfrest; + + +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.logger.MsoLogger; +import org.onap.so.openstack.beans.VnfStatus; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +@XmlRootElement(name = "queryVolumeGroupResponse") +public class QueryVolumeGroupResponse { + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, QueryVolumeGroupResponse.class); + private String volumeGroupId; + private String volumeGroupStackId; + private VnfStatus volumeGroupStatus; + private Map volumeGroupOutputs; + + public QueryVolumeGroupResponse() { + } + + public QueryVolumeGroupResponse( + String volumeGroupId, + String volumeGroupStackId, + VnfStatus volumeGroupStatus, + Map volumeGroupOutputs) + { + super(); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupStatus = volumeGroupStatus; + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public VnfStatus getVolumeGroupStatus() { + return volumeGroupStatus; + } + + public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) { + this.volumeGroupStatus = volumeGroupStatus; + } + + public Map getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } + catch (Exception e) { + LOGGER.debug("Exception :",e); + } + return jsonString; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleRequest.java new file mode 100644 index 0000000000..4ad7a7a417 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleRequest.java @@ -0,0 +1,45 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + + +@JsonRootName("rollbackVfModuleRequest") +@XmlRootElement(name = "rollbackVfModuleRequest") +public class RollbackVfModuleRequest extends VfRequestCommon { + private VfModuleRollback vfModuleRollback; + + public RollbackVfModuleRequest() { + super(); + } + + public VfModuleRollback getVfModuleRollback() { + return vfModuleRollback; + } + + public void setVfModuleRollback(VfModuleRollback vfModuleRollback) { + this.vfModuleRollback = vfModuleRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleResponse.java new file mode 100644 index 0000000000..43db90c566 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleResponse.java @@ -0,0 +1,49 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("rollbackVfModuleResponse") +@XmlRootElement(name = "rollbackVfModuleResponse") +public class RollbackVfModuleResponse extends VfResponseCommon { + private Boolean vfModuleRolledback; + + public RollbackVfModuleResponse() { + super(); + } + + public RollbackVfModuleResponse(Boolean vfModuleRolledback, String messageId) { + super(messageId); + this.vfModuleRolledback = vfModuleRolledback; + } + + public Boolean getVfModuleRolledback() { + return vfModuleRolledback; + } + + public void setVfModuleRolledback(Boolean vfModuleRolledback) { + this.vfModuleRolledback = vfModuleRolledback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupRequest.java new file mode 100644 index 0000000000..14c2c2a3d9 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupRequest.java @@ -0,0 +1,44 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("rollbackVolumeGroupRequest") +@XmlRootElement(name = "rollbackVolumeGroupRequest") +public class RollbackVolumeGroupRequest extends VfRequestCommon { + private VolumeGroupRollback volumeGroupRollback; + + public RollbackVolumeGroupRequest() { + super(); + } + + public VolumeGroupRollback getVolumeGroupRollback() { + return volumeGroupRollback; + } + + public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { + this.volumeGroupRollback = volumeGroupRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupResponse.java new file mode 100644 index 0000000000..46ac26825c --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupResponse.java @@ -0,0 +1,49 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("rollbackVolumeGroupResponse") +@XmlRootElement(name = "rollbackVolumeGroupResponse") +public class RollbackVolumeGroupResponse extends VfResponseCommon { + private Boolean volumeGroupRolledBack; + + public RollbackVolumeGroupResponse() { + super(); + } + + public RollbackVolumeGroupResponse(Boolean volumeGroupRolledBack, String messageId) { + super(messageId); + this.volumeGroupRolledBack = volumeGroupRolledBack; + } + + public Boolean getVolumeGroupRolledBack() { + return volumeGroupRolledBack; + } + + public void setVolumeGroupRolledBack(Boolean volumeGroupRolledBack) { + this.volumeGroupRolledBack = volumeGroupRolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleRequest.java new file mode 100644 index 0000000000..0fb5c05e2a --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleRequest.java @@ -0,0 +1,215 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("updateVfModuleRequest") +@XmlRootElement(name = "updateVfModuleRequest") +public class UpdateVfModuleRequest extends VfRequestCommon { + + private String cloudSiteId; + private String tenantId; + + private String vnfId; + private String vnfType; + private String vnfVersion; + + private String vfModuleName; + private String vfModuleType; + private String vfModuleId; + private String vfModuleStackId; + + private String volumeGroupId; + private String volumeGroupStackId; + + private String baseVfModuleId; + private String baseVfModuleStackId; + + private String modelCustomizationUuid; + + private String requestType; + private Boolean failIfExists; + private Boolean backout; + + private Map vfModuleParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleName() { + return vfModuleName; + } + + public void setVfModuleName(String vfModuleName) { + this.vfModuleName = vfModuleName; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public String getBaseVfModuleId() { + return baseVfModuleId; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public void setBaseVfModuleId(String baseVfModuleId) { + this.baseVfModuleId = baseVfModuleId; + } + + public String getBaseVfModuleStackId() { + return baseVfModuleStackId; + } + + public void setBaseVfModuleStackId(String baseVfModuleStackId) { + this.baseVfModuleStackId = baseVfModuleStackId; + } + + public String getRequestType() { + return requestType; + } + + public void setRequestType(String requestType) { + this.requestType = requestType; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map getVfModuleParams() { + return vfModuleParams; + } + + public void setVfModuleParams(Map vfModuleParams) { + this.vfModuleParams = vfModuleParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleResponse.java new file mode 100644 index 0000000000..4504bf3461 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleResponse.java @@ -0,0 +1,85 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("updateVfModuleResponse") +@XmlRootElement(name = "updateVfModuleResponse") +public class UpdateVfModuleResponse extends VfResponseCommon { + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private Map vfModuleOutputs = new HashMap<>(); + + public UpdateVfModuleResponse() { + super(); + } + + public UpdateVfModuleResponse(String vnfId, String vfModuleId, + String vfModuleStackId, + Map vfModuleOutputs, + String messageId) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleOutputs = vfModuleOutputs; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public Map getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupRequest.java new file mode 100644 index 0000000000..d9f83aad2f --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupRequest.java @@ -0,0 +1,130 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("updateVolumeGroupRequest") +@XmlRootElement(name = "updateVolumeGroupRequest") +public class UpdateVolumeGroupRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + private String volumeGroupId; + private String volumeGroupStackId; + private String vnfType; + private String vnfVersion; + private String vfModuleType; + private String modelCustomizationUuid; + private Map volumeGroupParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + + public UpdateVolumeGroupRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public Map getVolumeGroupParams() { + return volumeGroupParams; + } + + public void setVolumeGroupParams(Map volumeGroupParams) { + this.volumeGroupParams = volumeGroupParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupResponse.java new file mode 100644 index 0000000000..8c003b1835 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupResponse.java @@ -0,0 +1,79 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonRootName; + + +@JsonRootName("updateVolumeGroupResponse") +@XmlRootElement(name = "updateVolumeGroupResponse") +public class UpdateVolumeGroupResponse extends VfResponseCommon { + private String volumeGroupId; + private String volumeGroupStackId; + private Map volumeGroupOutputs; + + public UpdateVolumeGroupResponse() { + super(); + this.volumeGroupOutputs = new HashMap<>(); + } + + public UpdateVolumeGroupResponse( + String volumeGroupId, + String volumeGroupStackId, + Map volumeGroupOutputs, + String messageId) + { + super(messageId); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public Map getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleExceptionResponse.java new file mode 100644 index 0000000000..4f53531585 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleExceptionResponse.java @@ -0,0 +1,75 @@ +/*- + * ============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.adapters.vnfrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "vfModuleException") + +public class VfModuleExceptionResponse extends VfResponseCommon implements Serializable { + private static final long serialVersionUID = -9062290006520066109L; + + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public VfModuleExceptionResponse () {} + + public VfModuleExceptionResponse (String message) { + this.message = message; + } + + public VfModuleExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(messageid); + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleRollback.java new file mode 100644 index 0000000000..0e716e5924 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleRollback.java @@ -0,0 +1,130 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; +import org.onap.so.openstack.beans.VnfRollback; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("VfModuleRollback") +@XmlRootElement(name = "VfModuleRollback") +public class VfModuleRollback { + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private boolean vfModuleCreated = false; + private String tenantId; + private String cloudSiteId; + private MsoRequest msoRequest; + private String messageId; + private String mode = "HEAT"; // default + + public VfModuleRollback() { + } + + public VfModuleRollback(VnfRollback vrb, String vfModuleId, String vfModuleStackId, String messageId) + { + this.vnfId = vrb.getVnfId(); + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vrb.getVnfCreated(); + this.tenantId = vrb.getTenantId(); + this.cloudSiteId = vrb.getCloudSiteId(); + this.msoRequest = vrb.getMsoRequest(); + this.messageId = messageId; + this.mode = vrb.getMode(); + } + + public VfModuleRollback(String vnfId, String vfModuleId, + String vfModuleStackId, boolean vfModuleCreated, String tenantId, + String cloudSiteId, + MsoRequest msoRequest, + String messageId) { + super(); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vfModuleCreated; + this.tenantId = tenantId; + this.cloudSiteId = cloudSiteId; + this.msoRequest = msoRequest; + this.messageId = messageId; + } + + public String getVnfId() { + return vnfId; + } + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + public String getVfModuleId() { + return vfModuleId; + } + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + public String getVfModuleStackId() { + return vfModuleStackId; + } + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + public boolean isVfModuleCreated() { + return vfModuleCreated; + } + public void setVfModuleCreated(boolean vfModuleCreated) { + this.vfModuleCreated = vfModuleCreated; + } + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public String getCloudSiteId() { + return cloudSiteId; + } + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + public MsoRequest getMsoRequest() { + return msoRequest; + } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + public String getMessageId() { + return messageId; + } + public void setMessageId(String messageId) { + this.messageId = messageId; + } + public String getMode() { + return mode; + } + public void setMode(String mode) { + this.mode = mode; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfRequestCommon.java new file mode 100644 index 0000000000..f934bc63d8 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfRequestCommon.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.vnfrest; + +import org.apache.commons.lang3.builder.ToStringBuilder; + + +/** + * Everything that is common between all VfModule and VolumeGroup Requests. + */ +public abstract class VfRequestCommon extends VfResponseCommon { + private Boolean skipAAI; + private String notificationUrl; + + public Boolean getSkipAAI() { + return skipAAI; + } + + public void setSkipAAI(Boolean skipAAI) { + this.skipAAI = skipAAI; + } + + public String getNotificationUrl() { + return notificationUrl; + } + + public void setNotificationUrl(String notificationUrl) { + this.notificationUrl = notificationUrl; + } + + public boolean isSynchronous() { + return notificationUrl == null || notificationUrl.isEmpty(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("skipAAI", skipAAI).append("notificationUrl", notificationUrl) + .toString(); + } + + // getMessageId, setMessageId, toJsonString, toJsonString are all defined in VfResponseCommon. +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java new file mode 100644 index 0000000000..2828ac3d43 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.adapters.vnfrest; + + +import java.io.ByteArrayOutputStream; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.onap.so.logger.MsoLogger; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * Everything that is common between all VfModule and VolumeGroup Responses, + * except for QueryVfModuleResponse and QueryVolumeGroupResponse. + */ +public abstract class VfResponseCommon { + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, VfResponseCommon.class); + private String messageId; + + public VfResponseCommon() { + messageId = null; + } + + public VfResponseCommon(String messageId) { + this.messageId = messageId; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String toJsonString() { + try { + String jsonString; + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + return jsonString; + } catch (Exception e) { + LOGGER.debug("Exception :",e); + return ""; + } + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + LOGGER.debug("Exception :",e); + return ""; + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupExceptionResponse.java new file mode 100644 index 0000000000..2e5801b4ae --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupExceptionResponse.java @@ -0,0 +1,45 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "volumeGroupException") +public class VolumeGroupExceptionResponse extends VfModuleExceptionResponse { + // Exactly the same as a VfModuleExceptionResponse + + private static final long serialVersionUID = 1168681288205898800L; + + public VolumeGroupExceptionResponse() { + super(); + } + + public VolumeGroupExceptionResponse(String message) { + super(message); + } + + public VolumeGroupExceptionResponse(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(message, category, rolledBack, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupRollback.java new file mode 100644 index 0000000000..2795ba0de3 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupRollback.java @@ -0,0 +1,128 @@ +/*- + * ============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.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("VolumeGroupRollback") +@XmlRootElement(name = "VolumeGroupRollback") +public class VolumeGroupRollback { +// “volumeGroupRollback”: { +// “volumeGroupId”: “”, +// “volumeGroupStackId”: “”, +// “tenantId”: “”, +// “cloudSiteId”: “”, +// “volumeGroupCreated”: TRUE|FALSE, +// “msoRequest”: { +// “requestId”: “”, +// “serviceInstanceId”: “” +// } +//}, + + private String volumeGroupId; + private String volumeGroupStackId; + private String tenantId; + private String cloudSiteId; + private boolean volumeGroupCreated = false; + private MsoRequest msoRequest; + private String messageId; + + public VolumeGroupRollback() { + } + + public VolumeGroupRollback(VolumeGroupRollback vrb, String volumeGroupStackId, String messageId) + { + this.volumeGroupId = vrb.getVolumeGroupId(); + this.volumeGroupStackId = volumeGroupStackId; + this.tenantId = vrb.getTenantId(); + this.cloudSiteId = vrb.getCloudSiteId(); + this.volumeGroupCreated = vrb.isVolumeGroupCreated(); + this.msoRequest = vrb.getMsoRequest(); + this.messageId = messageId; + } + + public VolumeGroupRollback( + String volumeGroupId, + String volumeGroupStackId, + boolean volumeGroupCreated, + String tenantId, + String cloudSiteId, + MsoRequest msoRequest, + String messageId) + { + super(); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupCreated = volumeGroupCreated; + this.tenantId = tenantId; + this.cloudSiteId = cloudSiteId; + this.msoRequest = msoRequest; + this.messageId = messageId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public String getCloudSiteId() { + return cloudSiteId; + } + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + public boolean isVolumeGroupCreated() { + return volumeGroupCreated; + } + public void setVolumeGroupCreated(boolean volumeGroupCreated) { + this.volumeGroupCreated = volumeGroupCreated; + } + public MsoRequest getMsoRequest() { + return msoRequest; + } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + public String getMessageId() { + return messageId; + } + public void setMessageId(String messageId) { + this.messageId = messageId; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HeatStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HeatStatus.java new file mode 100644 index 0000000000..dd68d37736 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HeatStatus.java @@ -0,0 +1,30 @@ +/*- + * ============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.openstack.beans; + + +/* + * Enum status values to mirror the Openstack Heat stack status values + */ +public enum HeatStatus { + INIT, CREATED, NOTFOUND, FAILED, BUILDING, DELETING, UNKNOWN, UPDATING, UPDATED +} + diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HostRoute.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HostRoute.java new file mode 100644 index 0000000000..228bb2c03d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HostRoute.java @@ -0,0 +1,69 @@ +/*- + * ============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.openstack.beans; + + + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "prefix", + "nextHop" +}) +public class HostRoute { + + private String prefix; + private String nextHop; + + /** + * @return the prefix + */ + public String getPrefix() { + return prefix; + } + /** + * @param prefix the prefix to set + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + /** + * @return the nextHop + */ + public String getNextHop() { + return nextHop; + } + /** + * @param nextHop the nextHop to set + */ + public void setNextHop(String nextHop) { + this.nextHop = nextHop; + } + + @Override + public String toString() { + return "Host_route [prefix=" + prefix + ", nextHop=" + nextHop + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/MsoTenant.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/MsoTenant.java new file mode 100644 index 0000000000..b06ea0e59f --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/MsoTenant.java @@ -0,0 +1,66 @@ +/*- + * ============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.openstack.beans; + + + +import java.util.Map; + +/** + * This bean class represents the Openstack tenant properties that are + * needed by MSO. + * + * + */ +public class MsoTenant { + private String tenantId; + private String tenantName; + private Map metadata; + + public MsoTenant() {} + + public MsoTenant (String id, String name, Map metadata) { + this.tenantId = id; + this.tenantName = name; + this.metadata = metadata; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public Map getMetadata() { + return metadata; + } + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkInfo.java new file mode 100644 index 0000000000..6110fa5073 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkInfo.java @@ -0,0 +1,120 @@ +/*- + * ============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.openstack.beans; + + + +import java.util.ArrayList; +import java.util.List; + +/* + * This Java bean class relays Network details (including status) to ActiveVOS processes. + * + * This bean is returned by all Network-specific adapter operations (create, query, delete) + */ + +public class NetworkInfo { + // Set defaults for everything + private String name = ""; + private String id = ""; + private NetworkStatus status = NetworkStatus.UNKNOWN; + private String provider = ""; + private List vlans = new ArrayList<>(); + private List subnets = new ArrayList<>(); + private String shared = ""; + + public NetworkInfo () { + } + + public NetworkInfo (String name, NetworkStatus status) { + this.name = name; + this.id = name; // Don't have an ID, so just use name + this.status = status; + } + + public String getName() { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public String getId() { + return id; + } + + public void setId (String id) { + this.id = id; + } + + public NetworkStatus getStatus() { + return status; + } + + public void setStatus (NetworkStatus status) { + this.status = status; + } + + public String getProvider() { + return provider; + } + + public void setProvider (String provider) { + this.provider = provider; + } + + public List getVlans () { + return vlans; + } + + public void setVlans (List vlans) { + this.vlans = vlans; + } + + public List getSubnets () { + return subnets; + } + + public void setSubnets (List subnets) { + this.subnets = subnets; + } + + public String getShared() { + return shared; + } + + public void setShared(String shared) { + this.shared = shared; + } + + @Override + public String toString() { + return "NetworkInfo{" + "name='" + name + '\'' + + ", id='" + id + '\'' + + ", status=" + status + + ", provider='" + provider + '\'' + + ", vlans=" + vlans + + ", subnets=" + subnets + + '}'; + } +} + diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkRollback.java new file mode 100644 index 0000000000..e95c564f27 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkRollback.java @@ -0,0 +1,157 @@ +/*- + * ============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.openstack.beans; + + +import java.io.Serializable; +import java.util.List; + +import org.onap.so.entity.MsoRequest; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +/** + * Javabean representing the rollback criteria following a "Create Network" + * or "Update Network" operation. This structure can be passed back to the + * "Rollback Network" operation to undo the effects of the create/update. + * + * Once a network is created, the only possible update through MSO is to + * the set of VLANs supported by the network. The vlans attribute of the + * rollback object contains the previous VLANs before update. + * + * + */ +@JsonInclude(Include.NON_EMPTY) +public class NetworkRollback implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 11949663223019185L; + private String networkId; + private String neutronNetworkId; + private String networkStackId; + private String tenantId; + private String cloudId; + private String networkType; + private String modelCustomizationUuid; + private boolean networkCreated = false; + // Previous values for updates + private String networkName = null; + private String physicalNetwork = null; + private List vlans = null; + private MsoRequest msoRequest; + + public String getNetworkId() { + return networkId; + } + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getCloudId() { + return cloudId; + } + public void setCloudId(String cloudId) { + this.cloudId = cloudId; + } + + public String getNetworkType() { + return networkType; + } + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public boolean getNetworkCreated() { + return networkCreated; + } + public void setNetworkCreated(boolean networkCreated) { + this.networkCreated = networkCreated; + } + + public String getNetworkName() { + return networkName; + } + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getPhysicalNetwork() { + return physicalNetwork; + } + public void setPhysicalNetwork(String physicalNetwork) { + this.physicalNetwork = physicalNetwork; + } + + public List getVlans () { + return vlans; + } + public void setVlans (List vlans) { + this.vlans = vlans; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + public void setMsoRequest (MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override + public String toString() { + return "NetworkRollback [networkId=" + networkId + + ", neutronNetworkId=" + neutronNetworkId + ", networkStackId=" + + networkStackId + ", tenantId=" + tenantId + ", cloudId=" + + cloudId + ", networkType=" + networkType + + ", networkCreated=" + networkCreated + ", networkName=" + networkName + + ", physicalNetwork=" + physicalNetwork + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkStatus.java new file mode 100644 index 0000000000..b7b1366562 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkStatus.java @@ -0,0 +1,31 @@ +/*- + * ============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.openstack.beans; + + +/** + * Enum status values to mirror the Openstack Neutron + * network status values + */ +public enum NetworkStatus { + NOTFOUND, ACTIVE, DOWN, BUILD, ERROR, UNKNOWN +} + diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java new file mode 100644 index 0000000000..1c82907f80 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java @@ -0,0 +1,62 @@ +/*- + * ============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.openstack.beans; + + + + + +public class Pool { + + private String start; + private String end; + + /** + * @return the start + */ + public String getStart() { + return start; + } + /** + * @param start the start to set + */ + public void setStart(String start) { + this.start = start; + } + /** + * @return the end + */ + public String getEnd() { + return end; + } + /** + * @param end the end to set + */ + public void setEnd(String end) { + this.end = end; + } + + @Override + public String toString() { + return "Allocation_pool [start=" + start + ", end=" + end + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/RouteTarget.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/RouteTarget.java new file mode 100644 index 0000000000..fcea8796c2 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/RouteTarget.java @@ -0,0 +1,62 @@ +/*- + * ============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.openstack.beans; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "routeTarget", + "routeTargetRole" +}) +public class RouteTarget implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = 5425083030715789604L; + private String routeTarget; + private String routeTargetRole; + + public String getRouteTarget() { + return routeTarget; + } + public void setRouteTarget(String routeTarget) { + this.routeTarget = routeTarget; + } + public String getRouteTargetRole() { + return routeTargetRole; + } + public void setRouteTargetRole(String routeTargetRole) { + this.routeTargetRole = routeTargetRole; + } + + + @Override + public String toString() { + return "RouteTarget [routeTarget=" + routeTarget + ", routeTargetRole=" + routeTargetRole + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/StackInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/StackInfo.java new file mode 100644 index 0000000000..028ec9ec8d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/StackInfo.java @@ -0,0 +1,109 @@ +/*- + * ============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.openstack.beans; + + +import java.util.HashMap; +import java.util.Map; + +/* + * This Java bean class relays Heat stack status information to ActiveVOS processes. + * + * This bean is returned by all Heat-specific adapter operations (create, query, delete) + */ + +public class StackInfo { + // Set defaults for everything + private String name = ""; + private String canonicalName = ""; + private HeatStatus status = HeatStatus.UNKNOWN; + private String statusMessage = ""; + private Map outputs = new HashMap<>(); + private Map parameters = new HashMap<>(); + + public StackInfo () { + } + + public StackInfo (String name, HeatStatus status, String statusMessage, Map outputs) { + this.name = name; + this.canonicalName = name; // Don't have an ID, so just use name + + this.status = status; + if (statusMessage != null) this.statusMessage = statusMessage; + if (outputs != null) this.outputs = outputs; + } + + public StackInfo (String name, HeatStatus status) { + this.name = name; + this.canonicalName = name; // Don't have an ID, so just use name + this.status = status; + } + + public String getName() { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public String getCanonicalName() { + return canonicalName; + } + + public void setCanonicalName (String name) { + this.canonicalName = name; + } + + public HeatStatus getStatus() { + return status; + } + + public void setStatus (HeatStatus status) { + this.status = status; + } + + public String getStatusMessage() { + return statusMessage; + } + + public void setStatusMessage (String statusMessage) { + this.statusMessage = statusMessage; + } + + public Map getOutputs () { + return outputs; + } + + public void setOutputs (Map outputs) { + this.outputs = outputs; + } + + public Map getParameters () { + return parameters; + } + + public void setParameters (Map parameters) { + this.parameters = parameters; + } + +} + diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Subnet.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Subnet.java new file mode 100644 index 0000000000..3213323101 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Subnet.java @@ -0,0 +1,213 @@ +/*- + * ============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.openstack.beans; + + + +import java.io.Serializable; +import java.util.List; + +import javax.xml.bind.annotation.XmlTransient; + +public class Subnet implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -530027355187604839L; + + private String subnetName; + + private String neutronId; + + private String subnetId; // value from aai + + private String cidr; //Only field required + + private String gatewayIp; + + private String ipVersion="4"; + + private Boolean enableDHCP=false; + + private Boolean addrFromStart=true; + + private List hostRoutes; + + private List allocationPools; + + private List dnsNameServers; + + public Subnet () { + } + + public String getSubnetName() { + return subnetName; + } + + public void setSubnetName(String subnetName) { + this.subnetName = subnetName; + } + + public List getAllocationPools() { + return allocationPools; + } + + /** + * @return the cidr + */ + public String getCidr() { + return cidr; + } + + /** + * @return the dnsNames + */ + public List getDnsNameServers() { + return dnsNameServers; + } + + + public Boolean getEnableDHCP() { + return enableDHCP; + } + + public Boolean getAddrFromStart() { + return addrFromStart; + } + + public void setAddrFromStart(Boolean addrFromStart) { + this.addrFromStart = addrFromStart; + } + + /** + * @return the gw + */ + public String getGatewayIp() { + return gatewayIp; + } + + /** + * @return the hostRoutes + */ + public List getHostRoutes() { + return hostRoutes; + } + + /** + * @return the NeutronId + */ + @XmlTransient + public String getNeutronId() { + return neutronId; + } + + /** + * @return the ipversion + */ + public String getIpVersion() { + return ipVersion; + } + + /** + * @return the name + */ + public String getSubnetId() { + return subnetId; + } + + public void setAllocationPools(List allocationPools) { + this.allocationPools = allocationPools; + } + + /** + * @param cidr + * the cidr to set + */ + public void setCidr(String cidr) { + this.cidr = cidr; + } + + /** + * @param dnsNames + * the dnsNames to set + */ + public void setDnsNameServers(List dnsNameServers) { + this.dnsNameServers = dnsNameServers; + } + + /** + * @param enableDHCP + * the enableDHCP to set + */ + public void setEnableDHCP(Boolean enableDHCP) { + this.enableDHCP = enableDHCP; + } + + /** + * @param gw + * the gw to set + */ + public void setGatewayIp(String gatewayIp) { + this.gatewayIp = gatewayIp; + } + + /** + * @param hostRoutes + * the hostRoutes to set + */ + public void setHostRoutes(List hostRoutes) { + this.hostRoutes = hostRoutes; + } + + /** + * @param neutronId + * the id to set + */ + public void setNeutronId(String neutronId) { + this.neutronId = neutronId; + } + + /** + * @param ipversion + * the ipversion to set + */ + public void setIpVersion(String ipVersion) { + this.ipVersion = ipVersion; + } + + /** + * @param name + * the name to set + */ + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + @Override + public String toString() { + return "Subnet [subnetName=" + subnetName + ", neutronId=" + neutronId + ", subnetId=" + subnetId + ", cidr=" + + cidr + ", gatewayIp=" + gatewayIp + ", ipVersion=" + ipVersion + ", enableDHCP=" + enableDHCP + + ", addrFromStart=" + addrFromStart + ", hostRoutes=" + hostRoutes + ", allocationPools=" + + allocationPools + ", dnsNameServers=" + dnsNameServers + "]"; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfRollback.java new file mode 100644 index 0000000000..ba7f6532e1 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfRollback.java @@ -0,0 +1,213 @@ +/*- + * ============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.openstack.beans; + +import org.onap.so.entity.MsoRequest; +/** + * Javabean representing the rollback criteria following a "Create VNF" + * operation. This structure can be passed back to the "Rollback VNF" + * operation to undo the effects of the create. + * + * + */ +public class VnfRollback { + private String vnfId; + private String tenantId; + private String cloudSiteId; + private boolean tenantCreated = false; + private boolean vnfCreated = false; + private MsoRequest msoRequest; + private String volumeGroupName; + private String volumeGroupId; + private String requestType; + private String volumeGroupHeatStackId; + private String baseGroupHeatStackId; + private boolean isBase = false; + private String vfModuleStackId; + private String modelCustomizationUuid; //NOTE: this is the vfModule's modelCustomizationUuid + private String mode = "HEAT"; + + public VnfRollback() {} + + /** + * For backwards compatibility... orchestration mode defaults to HEAT + * + * @param vnfId + * @param tenantId + * @param cloudSiteId + * @param tenantCreated + * @param vnfCreated + * @param msoRequest + * @param volumeGroupName + * @param volumeGroupId + * @param requestType + * @param modelCustomizationUuid + */ + public VnfRollback(String vnfId, String tenantId, String cloudSiteId, + boolean tenantCreated, boolean vnfCreated, + MsoRequest msoRequest, + String volumeGroupName, String volumeGroupId, String requestType, String modelCustomizationUuid) { + super(); + this.vnfId = vnfId; + this.tenantId = tenantId; + this.cloudSiteId = cloudSiteId; + this.tenantCreated = tenantCreated; + this.vnfCreated = vnfCreated; + this.msoRequest = msoRequest; + this.volumeGroupName = volumeGroupName; + this.volumeGroupId = volumeGroupId; + this.requestType = requestType; + this.modelCustomizationUuid = modelCustomizationUuid; + } + + /** + * + * @param vnfId + * @param tenantId + * @param cloudSiteId + * @param tenantCreated + * @param vnfCreated + * @param msoRequest + * @param volumeGroupName + * @param volumeGroupId + * @param requestType + * @param modelCustomizationUuid + */ + public VnfRollback(String vnfId, String tenantId, String cloudSiteId, + boolean tenantCreated, boolean vnfCreated, + MsoRequest msoRequest, String volumeGroupName, String volumeGroupId, + String requestType, String modelCustomizationUuid, String orchestrationMode) { + super(); + this.vnfId = vnfId; + this.tenantId = tenantId; + this.cloudSiteId = cloudSiteId; + this.tenantCreated = tenantCreated; + this.vnfCreated = vnfCreated; + this.msoRequest = msoRequest; + this.volumeGroupName = volumeGroupName; + this.volumeGroupId = volumeGroupId; + this.requestType = requestType; + this.modelCustomizationUuid = modelCustomizationUuid; + this.mode = orchestrationMode; + } + + public String getVnfId() { + return vnfId; + } + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public String getCloudSiteId() { + return cloudSiteId; + } + public void setCloudSiteId(String cloudId) { + this.cloudSiteId = cloudId; + } + public boolean getTenantCreated() { + return tenantCreated; + } + public void setTenantCreated(boolean tenantCreated) { + this.tenantCreated = tenantCreated; + } + public boolean getVnfCreated() { + return vnfCreated; + } + public void setVnfCreated(boolean vnfCreated) { + this.vnfCreated = vnfCreated; + } + public MsoRequest getMsoRequest() { + return msoRequest; + } + public void setMsoRequest (MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + public String getVolumeGroupName() { + return this.volumeGroupName; + } + public void setVolumeGroupName(String volumeGroupName) { + this.volumeGroupName = volumeGroupName; + } + public String getVolumeGroupId() { + return this.volumeGroupId; + } + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + public String getRequestType() { + return this.requestType; + } + public void setRequestType(String requestType) { + this.requestType = requestType; + } + public String getVolumeGroupHeatStackId() { + return this.volumeGroupHeatStackId; + } + public void setVolumeGroupHeatStackId(String volumeGroupHeatStackId) { + this.volumeGroupHeatStackId = volumeGroupHeatStackId; + } + + public String getBaseGroupHeatStackId() { + return this.baseGroupHeatStackId; + } + public void setBaseGroupHeatStackId(String baseGroupHeatStackId) { + this.baseGroupHeatStackId = baseGroupHeatStackId; + } + + public boolean isBase() { + return this.isBase; + } + public void setIsBase(boolean isBase) { + this.isBase = isBase; + } + public String getVfModuleStackId() { + return this.vfModuleStackId; + } + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + public String getMode() { + return this.mode; + } + public void setMode(String mode) { + this.mode = mode; + } + @Override + public String toString() { + return "VnfRollback: cloud=" + cloudSiteId + ", tenant=" + tenantId + + ", vnf=" + vnfId + ", tenantCreated=" + tenantCreated + + ", vnfCreated=" + vnfCreated + ", requestType = " + requestType + + ", modelCustomizationUuid=" + this.modelCustomizationUuid + + ", mode=" + mode; + } +} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfStatus.java new file mode 100644 index 0000000000..9f1ae8813d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfStatus.java @@ -0,0 +1,30 @@ +/*- + * ============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.openstack.beans; + + +/* + * Enum status values to mirror the Openstack Heat stack status values + */ +public enum VnfStatus { + ACTIVE, FAILED, NOTFOUND, UNKNOWN +} + diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoAdapterException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoAdapterException.java new file mode 100644 index 0000000000..31c4727934 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoAdapterException.java @@ -0,0 +1,45 @@ +/*- + * ============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.openstack.exceptions; + + + +/** + * General MSO Exception class for any non-specific errors. + * + * + */ +public class MsoAdapterException extends MsoException +{ + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoException instance + public MsoAdapterException (String message) { + super(message); + super.category = MsoExceptionCategory.INTERNAL; + } + + // Constructor to wrap a nested exception + public MsoAdapterException (String message, Throwable t) { + super(message, t); + super.category = MsoExceptionCategory.INTERNAL; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFound.java new file mode 100644 index 0000000000..31f3f6f7dd --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFound.java @@ -0,0 +1,56 @@ +/*- + * ============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.openstack.exceptions; + + +/** + * Cloud site not found exception. + */ +public class MsoCloudIdentityNotFound extends MsoException { + + /** + * Serialization id. + */ + private static final long serialVersionUID = 2583769056266415665L; + + /** + * Default constructor (needed for BPEL/JAXB) + */ + public MsoCloudIdentityNotFound () { + super("Cloud Identity not found"); + super.category=MsoExceptionCategory.USERDATA; + } + + /** + * Constructor to create a new MsoOpenstackException instance + * @param cloudSite the cloud site + */ + public MsoCloudIdentityNotFound (String cloudIdentity) { + // Set the detailed error as the Exception 'message' + super("Cloud Identity [" + cloudIdentity + "] not found"); + super.category=MsoExceptionCategory.USERDATA; + } + + @Override + public String toString () { + return getMessage(); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFound.java new file mode 100644 index 0000000000..ceb08d8ccb --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFound.java @@ -0,0 +1,56 @@ +/*- + * ============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.openstack.exceptions; + + +/** + * Cloud site not found exception. + */ +public class MsoCloudSiteNotFound extends MsoException { + + /** + * Serialization id. + */ + private static final long serialVersionUID = 2583769056266415664L; + + /** + * Default constructor (needed for BPEL/JAXB) + */ + public MsoCloudSiteNotFound () { + super("Cloud site not found"); + super.category=MsoExceptionCategory.USERDATA; + } + + /** + * Constructor to create a new MsoOpenstackException instance + * @param cloudSite the cloud site + */ + public MsoCloudSiteNotFound (String cloudSite) { + // Set the detailed error as the Exception 'message' + super("Cloud Site [" + cloudSite + "] not found"); + super.category=MsoExceptionCategory.USERDATA; + } + + @Override + public String toString () { + return getMessage(); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoException.java new file mode 100644 index 0000000000..625914e820 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoException.java @@ -0,0 +1,66 @@ +/*- + * ============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.openstack.exceptions; + + + +public abstract class MsoException extends Exception +{ + private static final long serialVersionUID = 1L; + + protected MsoExceptionCategory category = MsoExceptionCategory.INTERNAL; + protected String context = null; + + protected MsoException (String message) { + super(message); + } + + protected MsoException (String message, Throwable t) { + super(message,t); + } + + public MsoExceptionCategory getCategory() { + return category; + } + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public String getContext () { + return context; + } + public void setContext (String context) { + this.context = context; + } + public void addContext (String ctx) { + if (this.context != null) + this.context = ctx + ":" + this.context; + else + this.context = ctx; + } + + public String getContextMessage () { + if (this.context == null) + return getMessage(); + else + return "[" + context + "] " + getMessage(); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoExceptionCategory.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoExceptionCategory.java new file mode 100644 index 0000000000..ed57488301 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoExceptionCategory.java @@ -0,0 +1,27 @@ +/*- + * ============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.openstack.exceptions; + + + +public enum MsoExceptionCategory { + OPENSTACK, IO, INTERNAL, USERDATA +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoHeatNotFoundException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoHeatNotFoundException.java new file mode 100644 index 0000000000..dda7384d9e --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoHeatNotFoundException.java @@ -0,0 +1,54 @@ +/*- + * ============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.openstack.exceptions; + +/** + * MSO Heat not found exception. + */ +public class MsoHeatNotFoundException extends MsoException { + /** + * Serialization id. + */ + private static final long serialVersionUID = 6547134336163166841L; + + /** + * Default constructor (needed for BPEL/JAXB) + */ + public MsoHeatNotFoundException() { + super("Heat not found"); + super.category = MsoExceptionCategory.USERDATA; + } + + /** + * Constructor to create a new MsoHeatNotFoundException instance + * @param heat the heat parameter + */ + public MsoHeatNotFoundException(String heat) { + // Set the detailed error as the Exception 'message' + super("Heat [" + heat + "] not found"); + super.category = MsoExceptionCategory.USERDATA; + } + + @Override + public String toString() { + return getMessage(); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoIOException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoIOException.java new file mode 100644 index 0000000000..35f2445d41 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoIOException.java @@ -0,0 +1,53 @@ +/*- + * ============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.openstack.exceptions; + + +/** + * I/O exception + */ +public class MsoIOException extends MsoException +{ + + /** + * Serialization id. + */ + private static final long serialVersionUID = 6752445132721635760L; + + /** + * Basic constructor with message + * @param message the error message + */ + public MsoIOException (String message) { + super(message); + super.category = MsoExceptionCategory.IO; + } + + /** + * Constructor to wrap a nested exception + * @param message the error message + * @param t the cause + */ + public MsoIOException (String message, Throwable t) { + super (message, t); + super.category = MsoExceptionCategory.IO; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExists.java new file mode 100644 index 0000000000..dd7817d310 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExists.java @@ -0,0 +1,35 @@ +/*- + * ============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.openstack.exceptions; + + + +public class MsoNetworkAlreadyExists extends MsoOpenstackException { + + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoOpenstackException instance + public MsoNetworkAlreadyExists (String stack, String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(409, "Conflict", "Stack " + stack + " already exists in Tenant " + tenant + " in Cloud " + cloud); + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkNotFound.java new file mode 100644 index 0000000000..7306142cd0 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkNotFound.java @@ -0,0 +1,35 @@ +/*- + * ============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.openstack.exceptions; + + + +public class MsoNetworkNotFound extends MsoOpenstackException { + + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoOpenstackException instance + public MsoNetworkNotFound (String networkId, String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(404, "Not Found", "Network " + networkId + " does not exist in Cloud/Tenant " + cloud + "/" + tenant); + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoOpenstackException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoOpenstackException.java new file mode 100644 index 0000000000..1410650dd2 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoOpenstackException.java @@ -0,0 +1,80 @@ +/*- + * ============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.openstack.exceptions; + + +/** + * OpenStack exception. + */ +public class MsoOpenstackException extends MsoException +{ + + /** + * Serialization id. + */ + private static final long serialVersionUID = 3313636124141766495L; + + private int statusCode; + private String statusMessage; + private String errorDetail; + + /** + * Constructor to create a new MsoOpenstackException instance + * @param code the error code + * @param message the error message + * @param detail error details + */ + public MsoOpenstackException (int code, String message, String detail) { + // Set the detailed error as the Exception 'message' + super(detail); + super.category = MsoExceptionCategory.OPENSTACK; + + this.statusCode = code; + this.statusMessage = message; + this.errorDetail = detail; + } + + /** + * Constructor to propagate the caught exception (mostly for stack trace) + * @param code the error code + * @param message the error message + * @param detail error details + * @param e the cause + */ + public MsoOpenstackException (int code, String message, String detail, Exception e) { + // Set the detailed error as the Exception 'message' + super(detail, e); + super.category = MsoExceptionCategory.OPENSTACK; + + this.statusCode = code; + this.statusMessage = message; + this.errorDetail = detail; + } + + @Override + public String toString() { + return statusCode + + " " + + statusMessage + + ": " + + errorDetail; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExists.java new file mode 100644 index 0000000000..fc98ee95ed --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExists.java @@ -0,0 +1,35 @@ +/*- + * ============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.openstack.exceptions; + + + +public class MsoStackAlreadyExists extends MsoOpenstackException { + + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoOpenstackException instance + public MsoStackAlreadyExists (String stack, String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(409, "Conflict", "Stack " + stack + " already exists in Tenant " + tenant + " in Cloud " + cloud); + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackNotFound.java new file mode 100644 index 0000000000..1cd6b9650a --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackNotFound.java @@ -0,0 +1,44 @@ +/*- + * ============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.openstack.exceptions; + + +/** + * Thrown when HEAT stack is not found or deleted. + */ +public class MsoStackNotFound extends MsoOpenstackException { + + /** + * Serialization id. + */ + private static final long serialVersionUID = 7354069716354359246L; + + /** + * Constructor to create a new MsoOpenstackException instance. + * @param stack the stack name + * @param tenant the tenant name + * @param cloud the cloud name + */ + public MsoStackNotFound (String stack, String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(404, "Not Found", "Stack " + stack + " does not exist in Cloud/Tenant " + cloud + "/" + tenant); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExists.java new file mode 100644 index 0000000000..5da32847b1 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExists.java @@ -0,0 +1,35 @@ +/*- + * ============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.openstack.exceptions; + + + +public class MsoTenantAlreadyExists extends MsoOpenstackException { + + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoOpenstackException instance + public MsoTenantAlreadyExists (String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(409, "Conflict", "Tenant " + tenant + " already exists in Cloud " + cloud); + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantNotFound.java new file mode 100644 index 0000000000..9b135b61b2 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantNotFound.java @@ -0,0 +1,43 @@ +/*- + * ============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.openstack.exceptions; + + +/** + * Tenant not found exception. + */ +public class MsoTenantNotFound extends MsoOpenstackException { + + /** + * Serialization id. + */ + private static final long serialVersionUID = 5640069939645577063L; + + /** + * Constructor to create the exception + * @param tenant the tenant id + * @param cloud the cloud id + */ + public MsoTenantNotFound (String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(404, "Not Found", "Tenant " + tenant + " does not exist in Cloud " + cloud); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/NetworkInfoMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/NetworkInfoMapper.java new file mode 100644 index 0000000000..aa0f17810e --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/NetworkInfoMapper.java @@ -0,0 +1,107 @@ +/*- + * ============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.openstack.mappers; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.javatuples.Pair; +import org.onap.so.openstack.beans.NetworkInfo; +import org.onap.so.openstack.beans.NetworkStatus; + +import com.woorea.openstack.quantum.model.Network; +import com.woorea.openstack.quantum.model.Segment; + +public class NetworkInfoMapper { + + private final Network network; + private final Map networkStatusMap = new HashMap<>(); + + public NetworkInfoMapper(Network network) { + this.network = network; + configureNetworkStatusMap(); + } + + /** + * Capture the data from a Neutron Network object. + * + * For MSO, there are assumptions regarding all networks. + * - Everything will be a provider network + * - All provider networks are VLANs + * - Multiple VLANs are supported, and indicated by multi-provider segments. + * Each will have the same physical network & network type "vlan". + * + * @param network + */ + public NetworkInfo map() { + final NetworkInfo info = new NetworkInfo(); + if (network == null) { + info.setStatus(NetworkStatus.NOTFOUND); + } else { + info.setName(network.getName()); + info.setId(network.getId()); + info.setStatus(this.mapStatus(network.getStatus())); + Pair, List> result = locateVlanInformation(network); + Optional value0 = result.getValue0(); + if (value0.isPresent()) { + info.setProvider(value0.get()); + } + info.setVlans(result.getValue1()); + info.setSubnets(network.getSubnets()); + } + return info; + } + + protected NetworkStatus mapStatus(String status) { + return networkStatusMap.getOrDefault(status, NetworkStatus.UNKNOWN); + } + + protected Pair, List> locateVlanInformation(Network network) { + final List vlans = new ArrayList<>(); + Optional provider = Optional.empty(); + if (network.getProviderPhysicalNetwork() != null) { + provider = Optional.ofNullable(network.getProviderPhysicalNetwork()); + if ("vlan".equals(network.getProviderNetworkType())) { + vlans.add(network.getProviderSegmentationId()); + } + } else if (network.getSegments() != null && !network.getSegments().isEmpty()) { + Segment s = network.getSegments().get(0); + provider = Optional.ofNullable(s.getProviderPhysicalNetwork()); + if ("vlan".equals(s.getProviderNetworkType())) { + for (Segment s1 : network.getSegments()) { + vlans.add(s1.getProviderSegmentationId()); + } + } + } + + return Pair.with(provider, vlans); + } + + private void configureNetworkStatusMap() { + networkStatusMap.put("ACTIVE", NetworkStatus.ACTIVE); + networkStatusMap.put("DOWN", NetworkStatus.DOWN); + networkStatusMap.put("BUILD", NetworkStatus.BUILD); + networkStatusMap.put("ERROR", NetworkStatus.ERROR); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/StackInfoMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/StackInfoMapper.java new file mode 100644 index 0000000000..85fd6cc279 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/StackInfoMapper.java @@ -0,0 +1,99 @@ +/*- + * ============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.openstack.mappers; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.onap.so.openstack.beans.HeatStatus; +import org.onap.so.openstack.beans.StackInfo; + +import com.woorea.openstack.heat.model.Stack; +import com.woorea.openstack.heat.model.Stack.Output; + +public class StackInfoMapper { + + private final Stack stack; + private final Map heatStatusMap = new HashMap<>(); + public StackInfoMapper(Stack stack) { + this.stack = stack; + configureHeatStatusMap(); + } + + public StackInfo map() { + final StackInfo info = new StackInfo(); + if (stack == null) { + info.setStatus(HeatStatus.NOTFOUND); + } else { + info.setName(stack.getStackName()); + info.setCanonicalName(stack.getStackName() + "/" + stack.getId()); + info.setStatus(this.mapStatus(stack.getStackStatus())); + + info.setStatusMessage(stack.getStackStatusReason()); + + Optional> result = this.mapOutputToMap(stack.getOutputs()); + if (result.isPresent()) { + info.setOutputs(result.get()); + } + + info.setParameters(stack.getParameters()); + } + + return info; + } + + protected HeatStatus mapStatus(String status) { + final HeatStatus result; + if (status == null) { + result = HeatStatus.INIT; + } else { + result = heatStatusMap.getOrDefault(status, HeatStatus.UNKNOWN); + } + + return result; + } + + protected Optional> mapOutputToMap(List outputs) { + Optional> result = Optional.empty(); + if (outputs != null) { + final HashMap map = new HashMap<>(); + for (Output output : outputs) { + map.put(output.getOutputKey(), output.getOutputValue()); + } + result = Optional.of(map); + } + + return result; + } + private void configureHeatStatusMap() { + heatStatusMap.put("CREATE_IN_PROGRESS", HeatStatus.BUILDING); + heatStatusMap.put("CREATE_COMPLETE", HeatStatus.CREATED); + heatStatusMap.put("CREATE_FAILED", HeatStatus.FAILED); + heatStatusMap.put("DELETE_IN_PROGRESS", HeatStatus.DELETING); + heatStatusMap.put("DELETE_COMPLETE", HeatStatus.NOTFOUND); + heatStatusMap.put("DELETE_FAILED", HeatStatus.FAILED); + heatStatusMap.put("UPDATE_IN_PROGRESS", HeatStatus.UPDATING); + heatStatusMap.put("UPDATE_FAILED", HeatStatus.FAILED); + heatStatusMap.put("UPDATE_COMPLETE", HeatStatus.UPDATED); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java deleted file mode 100644 index 5bb1dacb4a..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.json; - -import org.codehaus.jackson.JsonNode; -import org.codehaus.jackson.JsonParser; -import org.codehaus.jackson.map.DeserializationContext; -import org.codehaus.jackson.map.JsonDeserializer; -import org.codehaus.jackson.map.ObjectMapper; - -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Custom JSON Deserializer for Map. - * In MSO with Jackson 1.9.12 and RestEasy 3.0.8, maps in JSON are serialized as - * follows: - *
- * "params": {
- *   "entry": [
- *     {"key": "P1", "value": "V1"},
- *     {"key": "P2", "value": "V2"},
- *     ...
- *     {"key": "PN", "value": "VN"}
- *   ]
- * }
- * The implementation uses a LinkedHashMap to preserve the ordering of entries.
- * 
- */ -public class MapDeserializer extends JsonDeserializer> { - - @Override - public Map deserialize(JsonParser parser, - DeserializationContext context) throws IOException { - ObjectMapper mapper = new ObjectMapper(); - JsonNode tree = mapper.readTree(parser); - Map map = new LinkedHashMap<>(); - if (tree == null) - return map; - for (JsonNode element : tree) { - for (JsonNode arrayElement : element) { - String key = arrayElement.get("key").getTextValue(); - String value = arrayElement.get("value").getTextValue(); - map.put(key, value); - } - } - return map; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java deleted file mode 100644 index 3e9f5c6b58..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.json; - -import org.codehaus.jackson.JsonGenerator; -import org.codehaus.jackson.map.JsonSerializer; -import org.codehaus.jackson.map.SerializerProvider; - -import java.io.IOException; -import java.util.Map; - -/** - * Custom JSON Serializer for Map. - * In MSO with Jackson 1.9.12 and RestEasy 3.0.8, maps in JSON are serialized as - * follows: - *
- * "params": {
- *   "entry": [
- *     {"key": "P1", "value": "V1"},
- *     {"key": "P2", "value": "V2"},
- *     ...
- *     {"key": "PN", "value": "VN"}
- *   ]
- * }
- * 
- * The implementation uses a TreeMap, so entries are always sorted according - * to the natural ordering of the keys. - */ -public class MapSerializer extends JsonSerializer> { - @Override - public void serialize(Map map, JsonGenerator jsonGenerator, - SerializerProvider serializerProvider) throws IOException { - jsonGenerator.writeStartObject(); - jsonGenerator.writeArrayFieldStart("entry"); - for (Map.Entry entry : map.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - jsonGenerator.writeStartObject(); - jsonGenerator.writeStringField("key", key); - jsonGenerator.writeStringField("value", value); - jsonGenerator.writeEndObject(); - } - jsonGenerator.writeEndArray(); - jsonGenerator.writeEndObject(); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ContrailNetwork.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ContrailNetwork.java deleted file mode 100644 index 60684a3599..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ContrailNetwork.java +++ /dev/null @@ -1,90 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - -import java.util.List; -import org.openecomp.mso.openstack.beans.RouteTarget; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("contrailNetwork") -public class ContrailNetwork { - private String shared = "false"; - private String external = "false"; - private List routeTargets; - private List policyFqdns; - private List routeTableFqdns; - - public ContrailNetwork() { - super(); - } - - public ContrailNetwork(String shared, String external, List routeTargets, List policyFqdns, List routeTableFqdns) { - super(); - this.shared = shared; - this.external = external; - this.routeTargets = routeTargets; - this.policyFqdns = policyFqdns; - this.routeTableFqdns = routeTableFqdns; - } - - public String getShared() { - return shared; - } - - public void setShared(String shared) { - this.shared = shared; - } - - public String getExternal() { - return external; - } - - public void setExternal(String external) { - this.external = external; - } - - public List getRouteTargets() { - return routeTargets; - } - - public void setRouteTargets(List routeTargets) { - this.routeTargets = routeTargets; - } - - public List getPolicyFqdns() { - return policyFqdns; - } - - public void setPolicyFqdns(List policyFqdns) { - this.policyFqdns = policyFqdns; - } - - public List getRouteTableFqdns() { - return routeTableFqdns; - } - - public void setRouteTableFqdns(List routeTableFqdns) { - this.routeTableFqdns = routeTableFqdns; - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkError.java deleted file mode 100644 index 4b105cce92..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkError.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "createNetworkError") -public class CreateNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = -4283402447149144456L; - - public CreateNetworkError() { - super(""); - } - - public CreateNetworkError(String message) { - super(message); - } - - public CreateNetworkError(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { - super(message, category, rolledBack, messageid); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkRequest.java deleted file mode 100644 index 4c2cc36c83..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkRequest.java +++ /dev/null @@ -1,196 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; -import org.openecomp.mso.openstack.beans.Subnet; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; - - -/* README - Map elements when marshalled to XML produce a list of ${key}${value} elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. -*/ -@JsonRootName("createNetworkRequest") -@XmlRootElement(name = "createNetworkRequest") -public class CreateNetworkRequest extends NetworkRequestCommon { - private String cloudSiteId; - private String tenantId; - private String networkId; - private String networkName; - private String networkType; - private String networkTypeVersion; - private String modelCustomizationUuid; - private NetworkTechnology networkTechnology = NetworkTechnology.NEUTRON; - private List subnets; - private ProviderVlanNetwork providerVlanNetwork; - private ContrailNetwork contrailNetwork; - private Boolean failIfExists = false; - private Boolean backout = true; - private Map networkParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - @JsonProperty - private boolean contrailRequest; - - public CreateNetworkRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNetworkName() { - return networkName; - } - - public void setNetworkName(String networkName) { - this.networkName = networkName; - } - - public String getNetworkType() { - return networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public String getNetworkTypeVersion() { - return networkTypeVersion; - } - - public void setNetworkTypeVersion(String networkTypeVersion) { - this.networkTypeVersion = networkTypeVersion; - } - - public String getNetworkTechnology() { - return networkTechnology.toString(); - } - - public void setNetworkTechnology(String networkTechnology) { - this.networkTechnology = NetworkTechnology.valueOf(networkTechnology); - } - - public List getSubnets() { - return subnets; - } - - public void setSubnets(List subnets) { - this.subnets = subnets; - } - - public ProviderVlanNetwork getProviderVlanNetwork() { - return providerVlanNetwork; - } - - public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { - this.providerVlanNetwork = providerVlanNetwork; - } - - public ContrailNetwork getContrailNetwork() { - return contrailNetwork; - } - - public void setContrailNetwork(ContrailNetwork contrailNetwork) { - this.contrailNetwork = contrailNetwork; - } - - public Boolean getFailIfExists() { - return failIfExists; - } - - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } - - public Boolean getBackout() { - return backout; - } - - public void setBackout(Boolean backout) { - this.backout = backout; - } - - public Map getNetworkParams() { - return networkParams; - } - - public void setNetworkParams(Map networkParams) { - this.networkParams = networkParams; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - public boolean isContrailRequest() { - return (networkTechnology == NetworkTechnology.CONTRAIL) && (contrailNetwork != null); - } - - @JsonIgnore - public void setContrailRequest(boolean contrailRequest) { - this.contrailRequest = contrailRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkResponse.java deleted file mode 100644 index 6db7661905..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkResponse.java +++ /dev/null @@ -1,122 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.openstack.beans.NetworkRollback; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("createNetworkResponse") -@XmlRootElement(name = "createNetworkResponse") - -public class CreateNetworkResponse extends NetworkResponseCommon { - private String networkId; - private String neutronNetworkId; - private String networkStackId; - private String networkFqdn; - private Boolean networkCreated; - private Map subnetMap; - private NetworkRollback rollback = new NetworkRollback(); - - public CreateNetworkResponse() { - super(); - } - - public CreateNetworkResponse(String networkId, - String neutronNetworkId, - String networkStackId, - String networkFqdn, - Boolean networkCreated, - Map subnetIdMap, - NetworkRollback rollback, - String messageId) { - super(messageId); - this.networkId = networkId; - this.neutronNetworkId = neutronNetworkId; - this.networkStackId = networkStackId; - this.networkFqdn = networkFqdn; - this.networkCreated = networkCreated; - this.subnetMap = subnetIdMap; - this.rollback = rollback; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNeutronNetworkId() { - return neutronNetworkId; - } - - public void setNeutronNetworkId(String neutronNetworkId) { - this.neutronNetworkId = neutronNetworkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - - public String getNetworkFqdn() { - return networkFqdn; - } - - public void setNetworkFqdn(String networkFqdn) { - this.networkFqdn = networkFqdn; - } - - public Boolean getNetworkCreated() { - return networkCreated; - } - - public void setNetworkCreated(Boolean networkCreated) { - this.networkCreated = networkCreated; - } - - public Map getSubnetMap() { - return subnetMap; - } - - public void setSubnetMap(Map subnetMap) { - this.subnetMap = subnetMap; - } - - public NetworkRollback getRollback() { - return rollback; - } - - public void setRollback(NetworkRollback rollback) { - this.rollback = rollback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkError.java deleted file mode 100644 index 6a5e354f87..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkError.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "deleteNetworkError") -public class DeleteNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = 2735474165790444180L; - - public DeleteNetworkError() { - super(""); - } - - public DeleteNetworkError(String message) { - super(message); - } - - public DeleteNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { - super(message, category, unused, messageid); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkRequest.java deleted file mode 100644 index d899ac921e..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonRootName; - - -@JsonRootName("deleteNetworkRequest") -@XmlRootElement(name = "deleteNetworkRequest") -public class DeleteNetworkRequest extends NetworkRequestCommon { - - private String cloudSiteId; - private String tenantId; - private String networkId; - private String networkStackId; - private String networkType; - private String modelCustomizationUuid; - private MsoRequest msoRequest = new MsoRequest(); - - public DeleteNetworkRequest() {} - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - - public String getNetworkType() { - return networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkResponse.java deleted file mode 100644 index ee62751edb..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkResponse.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("deleteNetworkResponse") -@XmlRootElement(name = "deleteNetworkResponse") -public class DeleteNetworkResponse extends NetworkResponseCommon { - - private String networkId; - private Boolean networkDeleted; - - public DeleteNetworkResponse() { - super(); - } - - public DeleteNetworkResponse(String networkId, Boolean networkDeleted, String messageId) { - super(messageId); - this.networkId = networkId; - this.networkDeleted = networkDeleted; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public Boolean getNetworkDeleted() { - return networkDeleted; - } - - public void setNetworkDeleted(Boolean networkDeleted) { - this.networkDeleted = networkDeleted; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkExceptionResponse.java deleted file mode 100644 index 195d6da176..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkExceptionResponse.java +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -public class NetworkExceptionResponse extends NetworkResponseCommon { - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public NetworkExceptionResponse () {} - - public NetworkExceptionResponse (String message) { - super(); - this.message = message; - } - - public NetworkExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { - super(messageid); - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkRequestCommon.java deleted file mode 100644 index 56fc19870c..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkRequestCommon.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.nwrest; - - - -import java.io.ByteArrayOutputStream; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.openecomp.mso.logger.MsoLogger; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Everything that is common between all Network Requests. - */ -public abstract class NetworkRequestCommon { - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - private Boolean skipAAI = false; - private String messageId; - private String notificationUrl; - @JsonProperty - private boolean synchronous; - public Boolean getSkipAAI() { - return skipAAI; - } - - public void setSkipAAI(Boolean skipAAI) { - this.skipAAI = skipAAI; - } - - public String getMessageId() { - return messageId; - } - - public void setMessageId(String messageId) { - this.messageId = messageId; - } - - public String getNotificationUrl() { - return notificationUrl; - } - - public void setNotificationUrl(String notificationUrl) { - this.notificationUrl = notificationUrl; - } - - public boolean isSynchronous() { - return notificationUrl == null || (notificationUrl.isEmpty()); - } - - @JsonIgnore - public void setSynchronous(boolean synchronous) { - this.synchronous = synchronous; - } - - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - } catch (Exception e) { - LOGGER.debug("Exception:", e); - } - return jsonString; - } - - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - LOGGER.debug("Exception:", e); - return ""; - } - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkResponseCommon.java deleted file mode 100644 index f92f4ea769..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkResponseCommon.java +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.nwrest; - - - -import java.io.ByteArrayOutputStream; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.openecomp.mso.logger.MsoLogger; -/** - * Everything that is common between all Volume Group Responses, except for QueryVolumeGroupResponse. - */ -public abstract class NetworkResponseCommon { - private String messageId; - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - - public NetworkResponseCommon() { - messageId = null; - } - - public NetworkResponseCommon(String messageId) { - this.messageId = messageId; - } - - public String getMessageId() { - return messageId; - } - - public void setMessageId(String messageId) { - this.messageId = messageId; - } - - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - } catch (Exception e) { - LOGGER.debug("Exception:", e); - } - return jsonString; - } - - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - LOGGER.debug("Exception:", e); - return ""; - } - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkTechnology.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkTechnology.java deleted file mode 100644 index 83eddbc33d..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkTechnology.java +++ /dev/null @@ -1,26 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - -public enum NetworkTechnology { - NEUTRON, VMWARE, CONTRAIL -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ProviderVlanNetwork.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ProviderVlanNetwork.java deleted file mode 100644 index 7525da9049..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ProviderVlanNetwork.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import java.util.List; - -public class ProviderVlanNetwork { - private String physicalNetworkName; - private List vlans; - - public ProviderVlanNetwork() { - super(); - } - - public ProviderVlanNetwork(String physicalNetworkName, List vlans) { - super(); - this.physicalNetworkName = physicalNetworkName; - this.vlans = vlans; - } - - public String getPhysicalNetworkName() { - return physicalNetworkName; - } - - public void setPhysicalNetworkName(String physicalNetworkName) { - this.physicalNetworkName = physicalNetworkName; - } - - public List getVlans() { - return vlans; - } - - public void setVlans(List vlans) { - this.vlans = vlans; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkError.java deleted file mode 100644 index 5ff64a47a2..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkError.java +++ /dev/null @@ -1,31 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "queryNetworkError") -public class QueryNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = -6125469596399867146L; -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkResponse.java deleted file mode 100644 index 7df5472607..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkResponse.java +++ /dev/null @@ -1,131 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.nwrest; - -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.openstack.beans.NetworkStatus; -import org.openecomp.mso.openstack.beans.RouteTarget; - -@XmlRootElement(name = "queryNetworkResponse") -public class QueryNetworkResponse extends NetworkResponseCommon { - private String networkId; - private String neutronNetworkId; - private String networkStackId; - private Boolean networkExists; - private NetworkStatus networkStatus; - private List vlans; - private List routeTargets; - private Map subnetIdMap; - private Map networkOutputs; - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - - public QueryNetworkResponse() { - super(); - } - - public QueryNetworkResponse(String networkId, String neutronNetworkId, String networkStackId, - NetworkStatus networkStatus, Map networkOutputs) { - super(); - this.networkId = networkId; - this.neutronNetworkId = neutronNetworkId; - this.networkStackId = networkStackId; - this.networkStatus = networkStatus; - this.networkOutputs = networkOutputs; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNeutronNetworkId() { - return neutronNetworkId; - } - - public void setNeutronNetworkId(String neutronNetworkId) { - this.neutronNetworkId = neutronNetworkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - - public NetworkStatus getNetworkStatus() { - return networkStatus; - } - - public void setNetworkStatus(NetworkStatus networkStatus) { - this.networkStatus = networkStatus; - } - - public Boolean getNetworkExists() { - return networkExists; - } - - public void setNetworkExists(Boolean networkExists) { - this.networkExists = networkExists; - } - - public List getVlans() { - return vlans; - } - - public void setVlans(List vlans) { - this.vlans = vlans; - } - - public List getRouteTargets() { - return routeTargets; - } - - public void setRouteTargets(List routeTargets) { - this.routeTargets = routeTargets; - } - - public Map getSubnetIdMap() { - return subnetIdMap; - } - - public void setSubnetIdMap(Map subnetIdMap) { - this.subnetIdMap = subnetIdMap; - } - - public Map getNetworkOutputs() { - return networkOutputs; - } - - public void setNetworkOutputs(Map networkOutputs) { - this.networkOutputs = networkOutputs; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkError.java deleted file mode 100644 index 67a4b906c7..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkError.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "rollbackNetworkError") -public class RollbackNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = -3954464103037391980L; - - public RollbackNetworkError() { - super(""); - } - - public RollbackNetworkError(String message) { - super(message); - } - - public RollbackNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { - super(message, category, unused, messageid); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkRequest.java deleted file mode 100644 index 03b4123d06..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkRequest.java +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; -import org.openecomp.mso.openstack.beans.NetworkRollback; - -@JsonRootName("rollbackNetworkRequest") -@XmlRootElement(name = "rollbackNetworkRequest") -public class RollbackNetworkRequest extends NetworkRequestCommon { - private NetworkRollback networkRollback; - - public RollbackNetworkRequest() { - super(); - } - - public NetworkRollback getNetworkRollback() { - return networkRollback; - } - - public void setNetworkRollback(NetworkRollback networkRollback) { - this.networkRollback = networkRollback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkResponse.java deleted file mode 100644 index f7b80bd63e..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - - -@JsonRootName("rollbackNetworkResponse") -@XmlRootElement(name = "rollbackNetworkResponse") -public class RollbackNetworkResponse extends NetworkResponseCommon { - - private Boolean networkRolledBack; - - public RollbackNetworkResponse() { - super(); - } - - public RollbackNetworkResponse(Boolean networkRolledBack, String messageId) { - super(messageId); - this.networkRolledBack = networkRolledBack; - } - - public Boolean getNetworkRolledBack() { - return networkRolledBack; - } - - public void setNetworkRolledBack(Boolean networkRolledBack) { - this.networkRolledBack = networkRolledBack; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkError.java deleted file mode 100644 index 3385167f60..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkError.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "updateNetworkError") -public class UpdateNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = 46820809807914392L; - - public UpdateNetworkError() { - super(""); - } - - public UpdateNetworkError(String message) { - super(message); - } - - public UpdateNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { - super(message, category, unused, messageid); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkRequest.java deleted file mode 100644 index 7b3236efa5..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkRequest.java +++ /dev/null @@ -1,196 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.openstack.beans.Subnet; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("updateNetworkRequest") -@XmlRootElement(name = "updateNetworkRequest") -public class UpdateNetworkRequest extends NetworkRequestCommon { - private String cloudSiteId; - private String tenantId; - private String networkId; - private String networkStackId; - private String networkName; - private String networkType; - private String networkTypeVersion; - private String modelCustomizationUuid; - private NetworkTechnology networkTechnology = NetworkTechnology.NEUTRON; - private List subnets; - private ProviderVlanNetwork providerVlanNetwork; - private ContrailNetwork contrailNetwork; - private Boolean backout = true; - private Map networkParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - @JsonProperty - private boolean contrailRequest; - public UpdateNetworkRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - - public String getNetworkName() { - return networkName; - } - - public void setNetworkName(String networkName) { - this.networkName = networkName; - } - - public String getNetworkType() { - return networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public String getNetworkTypeVersion() { - return networkTypeVersion; - } - - public void setNetworkTypeVersion(String networkTypeVersion) { - this.networkTypeVersion = networkTypeVersion; - } - - public String getNetworkTechnology() { - return networkTechnology.toString(); - } - - public void setNetworkTechnology(String networkTechnology) { - try { - this.networkTechnology = NetworkTechnology.valueOf(networkTechnology.toUpperCase()); - } catch (IllegalArgumentException e) { - LOGGER.debug("Exception:", e); - } - } - - public List getSubnets() { - return subnets; - } - - public void setSubnets(List subnets) { - this.subnets = subnets; - } - - public ProviderVlanNetwork getProviderVlanNetwork() { - return providerVlanNetwork; - } - - public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { - this.providerVlanNetwork = providerVlanNetwork; - } - - public ContrailNetwork getContrailNetwork() { - return contrailNetwork; - } - - public void setContrailNetwork(ContrailNetwork contrailNetwork) { - this.contrailNetwork = contrailNetwork; - } - - public Boolean getBackout() { - return backout; - } - - public void setBackout(Boolean backout) { - this.backout = backout; - } - - public Map getNetworkParams() { - return networkParams; - } - - public void setNetworkParams(Map networkParams) { - this.networkParams = networkParams; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - public boolean isContrailRequest() { - return (networkTechnology == NetworkTechnology.CONTRAIL) && (contrailNetwork != null); - } - - @JsonIgnore - public void setContrailRequest() { - this.contrailRequest = contrailRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java deleted file mode 100644 index 3ca6824a49..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.nwrest; - - - -import java.util.Map; -import javax.xml.bind.annotation.XmlRootElement; -import org.jboss.resteasy.annotations.providers.NoJackson; -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("updateNetworkResponse") -@XmlRootElement(name = "updateNetworkResponse") -@NoJackson -public class UpdateNetworkResponse extends NetworkResponseCommon { - - private String networkId; - private String neutronNetworkId; - private Map subnetMap; - - public UpdateNetworkResponse() { - /* Empty Constructor */ - } - - public UpdateNetworkResponse(String networkId, String neutronNetworkId, - Map subnetMap, String messageId) { - super(messageId); - this.networkId = networkId; - this.neutronNetworkId = neutronNetworkId; - this.subnetMap = subnetMap; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNeutronNetworkId() { - return neutronNetworkId; - } - - public void setNeutronNetworkId(String neutronNetworkId) { - this.neutronNetworkId = neutronNetworkId; - } - - public Map getSubnetMap() { - return subnetMap; - } - - public void setSubnetMap(Map subnetMap) { - this.subnetMap = subnetMap; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/providers/JettisonStyleMapperProvider.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/providers/JettisonStyleMapperProvider.java deleted file mode 100644 index aa55c6349d..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/providers/JettisonStyleMapperProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.providers; - -import javax.ws.rs.Produces; -import javax.ws.rs.ext.ContextResolver; -import javax.ws.rs.ext.Provider; - -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -@Provider -@Produces("application/json") -public class JettisonStyleMapperProvider implements ContextResolver { - - final ObjectMapper mapper; - - public JettisonStyleMapperProvider() { - - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(Include.NON_NULL); - mapper.enable(MapperFeature.USE_ANNOTATIONS); - mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); - mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - } - - @Override - public ObjectMapper getContext(Class type) { - return mapper; - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/RequestInformation.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/RequestInformation.java deleted file mode 100644 index 3dc81fbdda..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/RequestInformation.java +++ /dev/null @@ -1,115 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.sdncrest; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.xml.bind.annotation.XmlElement; -import java.io.Serializable; - -/** - * Request Information specified by the SDNC "agnostic" API. - */ -public class RequestInformation implements Serializable { - private static final long serialVersionUID = 1L; - - // Identifies the transaction MSO has with the calling system. - private String requestId; - - // Identifies the calling system, e.g. CCD. - private String source; - - // The calling system's endpoint for receiving notifications from MSO. - private String notificationUrl; - - // NOTE: these are defined in the SDNC AID, but not used by MSO: - // request-action - // request-sub-action - - // Identifies the request action - private String requestAction; - - // Identifies the request sub action - private String requestSubAction; - - public RequestInformation(String requestId, String source, String notificationUrl) { - this.requestId = requestId; - this.source = source; - this.notificationUrl = notificationUrl; - } - - public RequestInformation() { - } - - @JsonProperty("requestId") - @XmlElement(name = "requestId") - public String getRequestId() { - return requestId; - } - - @JsonProperty("requestId") - public void setRequestId(String requestId) { - this.requestId = requestId; - } - - @JsonProperty("source") - @XmlElement(name = "source") - public String getSource() { - return source; - } - - @JsonProperty("source") - public void setSource(String source) { - this.source = source; - } - - @JsonProperty("notificationUrl") - @XmlElement(name = "notificationUrl") - public String getNotificationUrl() { - return notificationUrl; - } - - @JsonProperty("notificationUrl") - public void setNotificationUrl(String notificationUrl) { - this.notificationUrl = notificationUrl; - } - - @JsonProperty("requestAction") - @XmlElement(name = "requestAction") - public String getRequestAction() { - return requestAction; - } - - @JsonProperty("requestAction") - public void setRequestAction(String requestAction) { - this.requestAction = requestAction; - } - - @JsonProperty("requestSubAction") - @XmlElement(name = "requestSubAction") - public String getRequestSubAction() { - return requestSubAction; - } - - @JsonProperty("requestSubAction") - public void setRequestSubAction(String requestSubAction) { - this.requestSubAction = requestSubAction; - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCErrorCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCErrorCommon.java deleted file mode 100644 index 280703a534..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCErrorCommon.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.sdncrest; - -import java.io.Serializable; - -/** - * Base class for all SDNC adapter error responses. - */ -public abstract class SDNCErrorCommon extends SDNCResponseCommon implements Serializable { - private static final long serialVersionUID = 1L; - - public SDNCErrorCommon(String sdncRequestId, String responseCode, - String responseMessage, String ackFinalIndicator) { - super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); - } - - public SDNCErrorCommon() { - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCEvent.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCEvent.java deleted file mode 100644 index 3dbeaef17f..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCEvent.java +++ /dev/null @@ -1,141 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.sdncrest; - -import java.io.IOException; -import java.io.Serializable; -import java.util.LinkedHashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.logger.MsoLogger; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, -// even though we are using JSON exclusively. The @NoJackson annotation -// is also required in this environment. - -/** - Map elements when marshalled to XML produce a list of ${key}${value} elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. - * - */ -@JsonRootName("SDNCEvent") -@JsonInclude(Include.NON_NULL) -@XmlRootElement(name = "SDNCEvent") -public class SDNCEvent implements Serializable { - private static final long serialVersionUID = 1L; - - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - - // Event type - private String eventType; - - // Event correlator type - private String eventCorrelatorType; - - // Event correlator value. - private String eventCorrelator; - - // Map of response parameters (possibly none). - private Map params = null; - - public SDNCEvent(String eventType, String eventCorrelatorType, String eventCorrelator) { - this.eventType = eventType; - this.eventCorrelatorType = eventCorrelatorType; - this.eventCorrelator = eventCorrelator; - } - - public SDNCEvent() { - } - - @JsonProperty("eventType") - @XmlElement(name = "eventType") - public String getEventType() { - return eventType; - } - - @JsonProperty("eventType") - public void setEventType(String eventType) { - this.eventType = eventType; - } - - @JsonProperty("eventCorrelatorType") - @XmlElement(name = "eventCorrelatorType") - public String getEventCorrelatorType() { - return eventCorrelatorType; - } - - @JsonProperty("eventCorrelatorType") - public void setEventCorrelatorType(String eventCorrelatorType) { - this.eventCorrelatorType = eventCorrelatorType; - } - - @JsonProperty("eventCorrelator") - @XmlElement(name = "eventCorrelator") - public String getEventCorrelator() { - return eventCorrelator; - } - - @JsonProperty("eventCorrelator") - public void setEventCorrelator(String eventCorrelator) { - this.eventCorrelator = eventCorrelator; - } - - @JsonProperty("params") - @XmlElement(name = "params") - public Map getParams() { - return params; - } - - @JsonProperty("params") - public void setParams(Map params) { - this.params = params; - } - - public void addParam(String name, String value) { - if (params == null) { - params = new LinkedHashMap<>(); - } - params.put(name, value); - } - - public String toJson() { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - mapper.setSerializationInclusion(Include.NON_NULL); - return mapper.writeValueAsString(this); - } catch (IOException e) { - LOGGER.debug("Exception:", e); - throw new UnsupportedOperationException("Cannot convert " - + getClass().getSimpleName() + " to JSON", e); - } - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCRequestCommon.java deleted file mode 100644 index e1ee9894e2..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCRequestCommon.java +++ /dev/null @@ -1,114 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.sdncrest; - -import java.io.IOException; -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlElement; - -import org.openecomp.mso.logger.MsoLogger; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * Base class for all SDNC adapter requests. - */ -public abstract class SDNCRequestCommon implements Serializable { - private static final long serialVersionUID = 1L; - - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - - // Endpoint on which BPMN can receive notifications from the SDNC adapter. - private String bpNotificationUrl; - - // BPMN flow timeout value in ISO 8601 format, e.g. PT5M. - // Not currently used by the SDNC adapter. - private String bpTimeout; - - // Identifies the MSO transaction with SDNC. - // Maps to sdnc-request-header/requestId in the SDNC request. - private String sdncRequestId; - - public SDNCRequestCommon(String sdncRequestId, String bpNotificationUrl, - String bpTimeout) { - this.sdncRequestId = sdncRequestId; - this.bpNotificationUrl = bpNotificationUrl; - this.bpTimeout = bpTimeout; - } - - public SDNCRequestCommon() { - } - - @JsonProperty("bpNotificationUrl") - @XmlElement(name = "bpNotificationUrl") - public String getBPNotificationUrl() { - return bpNotificationUrl; - } - - @JsonProperty("bpNotificationUrl") - public void setBPNotificationUrl(String bpNotificationUrl) { - this.bpNotificationUrl = bpNotificationUrl; - } - - @JsonProperty("bpTimeout") - @XmlElement(name = "bpTimeout") - public String getBPTimeout() { - return bpTimeout; - } - - @JsonProperty("bpTimeout") - public void setBPTimeout(String bpTimeout) { - this.bpTimeout = bpTimeout; - } - - @JsonProperty("sdncRequestId") - @XmlElement(name = "sdncRequestId") - public String getSDNCRequestId() { - return sdncRequestId; - } - - @JsonProperty("sdncRequestId") - public void setSDNCRequestId(String sdncRequestId) { - this.sdncRequestId = sdncRequestId; - } - - @JsonIgnore - public boolean isSynchronous() { - return bpNotificationUrl == null || bpNotificationUrl.isEmpty(); - } - - public String toJson() { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - mapper.setSerializationInclusion(Include.NON_NULL); - return mapper.writeValueAsString(this); - } catch (IOException e) { - LOGGER.debug("Exception:", e); - throw new UnsupportedOperationException("Cannot convert " - + getClass().getSimpleName() + " to JSON", e); - } - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCResponseCommon.java deleted file mode 100644 index 7265d67923..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCResponseCommon.java +++ /dev/null @@ -1,123 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.sdncrest; - -import java.io.IOException; -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlElement; - -import org.openecomp.mso.logger.MsoLogger; - -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * Base class for all SDNC adapter responses, including errors. - */ -public abstract class SDNCResponseCommon implements Serializable { - private static final long serialVersionUID = 1L; - - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - - // Identifies the MSO transaction with SDNC. - private String sdncRequestId; - - // Response code, either from SDNC, or generated by the SDNC adapter. - // 2XX responses are considered success responses. - private String responseCode; - - // Response message, either from SDNC, or generated by the SDNC adapter. - private String responseMessage; - - // Indicates if the response is final (Y or N). - private String ackFinalIndicator; - - public SDNCResponseCommon(String sdncRequestId, String responseCode, - String responseMessage, String ackFinalIndicator) { - this.sdncRequestId = sdncRequestId; - this.responseCode = responseCode; - this.responseMessage = responseMessage; - this.ackFinalIndicator = ackFinalIndicator; - } - - public SDNCResponseCommon() { - } - - @JsonProperty("sdncRequestId") - @XmlElement(name = "sdncRequestId") - public String getSDNCRequestId() { - return sdncRequestId; - } - - @JsonProperty("sdncRequestId") - public void setSDNCRequestId(String sdncRequestId) { - this.sdncRequestId = sdncRequestId; - } - - @JsonProperty("responseCode") - @XmlElement(name = "responseCode") - public String getResponseCode() { - return responseCode; - } - - @JsonProperty("responseCode") - public void setResponseCode(String responseCode) { - this.responseCode = responseCode; - } - - @JsonProperty("responseMessage") - @XmlElement(name = "responseMessage") - public String getResponseMessage() { - return responseMessage; - } - - @JsonProperty("responseMessage") - public void setResponseMessage(String responseMessage) { - this.responseMessage = responseMessage; - } - - @JsonProperty("ackFinalIndicator") - @XmlElement(name = "ackFinalIndicator") - public String getAckFinalIndicator() { - return ackFinalIndicator; - } - - @JsonProperty("ackFinalIndicator") - public void setAckFinalIndicator(String ackFinalIndicator) { - this.ackFinalIndicator = ackFinalIndicator; - } - - public String toJson() { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - mapper.setSerializationInclusion(Include.NON_NULL); - return mapper.writeValueAsString(this); - } catch (IOException e) { - LOGGER.debug("Exception:", e); - throw new UnsupportedOperationException("Cannot convert " - + getClass().getSimpleName() + " to JSON", e); - } - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceError.java deleted file mode 100644 index 8d693e932a..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceError.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.sdncrest; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonRootName; - -// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, -// even though we are using JSON exclusively. The @NoJackson annotation -// is also required in this environment. - -/** - * SDNC adapter error response for "agnostic" API services. - */ -@JsonRootName("SDNCServiceError") -@JsonInclude(Include.NON_NULL) -@XmlRootElement(name = "SDNCServiceError") -public class SDNCServiceError extends SDNCErrorCommon implements Serializable { - private static final long serialVersionUID = 1; - - public SDNCServiceError(String sdncRequestId, String responseCode, - String responseMessage, String ackFinalIndicator) { - super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); - } - - public SDNCServiceError() { - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceRequest.java deleted file mode 100644 index a21585764f..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceRequest.java +++ /dev/null @@ -1,146 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.sdncrest; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; - -// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, -// even though we are using JSON exclusively. The @NoJackson annotation -// is also required in this environment. - -/** - * SDNC adapter request for "agnostic" API services. - * The target action is determined by a service type and an operation. - */ -@JsonRootName("SDNCServiceRequest") -@JsonInclude(Include.NON_NULL) -@XmlRootElement(name = "SDNCServiceRequest") -public class SDNCServiceRequest extends SDNCRequestCommon implements Serializable { - private static final long serialVersionUID = 1L; - - // Request Information specified by SDNC "agnostic" API - private RequestInformation requestInformation; - - // Service Information specified by: SDNC "agnostic" API - private ServiceInformation serviceInformation; - - // The SDNC service type specified by SDNC "agnostic" API - private String sdncService; - - // The SDNC operation specified by SDNC "agnostic" API - private String sdncOperation; - - // The SDNC service data type specified by SDNC "agnostic" API - private String sdncServiceDataType; - - // The SDNC service data specified by SDNC "agnostic" API - private String sndcServiceData; - - public SDNCServiceRequest() { - } - - public SDNCServiceRequest(String bpNotificationUrl, String bpTimeout, - String sdncRequestId, String sdncService, String sdncOperation, - RequestInformation requestInformation, - ServiceInformation serviceInformation, String sdncServiceDataType, - String sndcServiceData) { - super(bpNotificationUrl, bpTimeout, sdncRequestId); - this.requestInformation = requestInformation; - this.serviceInformation = serviceInformation; - this.sdncService = sdncService; - this.sdncOperation = sdncOperation; - this.sdncServiceDataType = sdncServiceDataType; - this.sndcServiceData = sndcServiceData; - } - - @JsonProperty("requestInformation") - @XmlElement(name = "requestInformation") - public RequestInformation getRequestInformation() { - return requestInformation; - } - - @JsonProperty("requestInformation") - public void setRequestInformation(RequestInformation requestInformation) { - this.requestInformation = requestInformation; - } - - @JsonProperty("serviceInformation") - @XmlElement(name = "serviceInformation") - public ServiceInformation getServiceInformation() { - return serviceInformation; - } - - @JsonProperty("serviceInformation") - public void setServiceInformation(ServiceInformation serviceInformation) { - this.serviceInformation = serviceInformation; - } - - @JsonProperty("sdncService") - @XmlElement(name = "sdncService") - public String getSDNCService() { - return sdncService; - } - - @JsonProperty("sdncService") - public void setSDNCService(String sdncService) { - this.sdncService = sdncService; - } - - @JsonProperty("sdncOperation") - @XmlElement(name = "sdncOperation") - public String getSDNCOperation() { - return sdncOperation; - } - - @JsonProperty("sdncOperation") - public void setSDNCOperation(String sdncOperation) { - this.sdncOperation = sdncOperation; - } - - @JsonProperty("sdncServiceDataType") - @XmlElement(name = "sdncServiceDataType") - public String getSDNCServiceDataType() { - return sdncServiceDataType; - } - - @JsonProperty("sdncServiceDataType") - public void setSDNCServiceDataType(String sdncServiceDataType) { - this.sdncServiceDataType = sdncServiceDataType; - } - - @JsonProperty("sdncServiceData") - @XmlElement(name = "sdncServiceData") - public String getSDNCServiceData() { - return sndcServiceData; - } - - @JsonProperty("sdncServiceData") - public void setSDNCServiceData(String sndcServiceData) { - this.sndcServiceData = sndcServiceData; - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceResponse.java deleted file mode 100644 index c74fb08972..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/SDNCServiceResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.sdncrest; - -import java.io.Serializable; -import java.util.LinkedHashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; - -// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, -// even though we are using JSON exclusively. The @NoJackson annotation -// is also required in this environment. - -/** - Map elements when marshalled to XML produce a list of ${key}${value} elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. - * - */ -@JsonRootName("SDNCServiceResponse") -@JsonInclude(Include.NON_NULL) -@XmlRootElement(name = "SDNCServiceResponse") -public class SDNCServiceResponse extends SDNCResponseCommon implements Serializable { - private static final long serialVersionUID = 1L; - - // Map of response parameters (possibly none). - private Map params = null; - - public SDNCServiceResponse(String sdncRequestId, String responseCode, - String responseMessage, String ackFinalIndicator) { - super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); - } - - public SDNCServiceResponse() { - } - - @JsonProperty("params") - @XmlElement(name = "params") - public Map getParams() { - return params; - } - - @JsonProperty("params") - public void setParams(Map params) { - this.params = params; - } - - public void addParam(String name, String value) { - if (params == null) { - params = new LinkedHashMap<>(); - } - params.put(name, value); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/ServiceInformation.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/ServiceInformation.java deleted file mode 100644 index 1cdea6518a..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/sdncrest/ServiceInformation.java +++ /dev/null @@ -1,102 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.sdncrest; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.xml.bind.annotation.XmlElement; -import java.io.Serializable; - -/** - * Service Information specified by the SDNC "agnostic" API. - */ -public class ServiceInformation implements Serializable { - private static final long serialVersionUID = 1L; - - // The subscription's service type for the target service instance. - private String serviceType; - - // Identifies the target service instance for this particular SDNC request. - // NOTE: this could be a child of the parent model instance, i.e. this - // service instance ID may be different from the service instance ID - // associated with the transaction MSO has with the system that invoked it. - private String serviceInstanceId; - - // The subscriber name. - private String subscriberName; - - // The subscriber global ID (customer ID). - private String subscriberGlobalId; - - public ServiceInformation(String serviceType, String serviceInstanceId, - String subscriberName, String subscriberGlobalId) { - this.serviceType = serviceType; - this.serviceInstanceId = serviceInstanceId; - this.subscriberName = subscriberName; - this.subscriberGlobalId = subscriberGlobalId; - } - - public ServiceInformation() { - } - - @JsonProperty("serviceType") - @XmlElement(name = "serviceType") - public String getServiceType() { - return serviceType; - } - - @JsonProperty("serviceType") - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - @JsonProperty("serviceInstanceId") - @XmlElement(name = "serviceInstanceId") - public String getServiceInstanceId() { - return serviceInstanceId; - } - - @JsonProperty("serviceInstanceId") - public void setServiceInstanceId(String serviceInstanceId) { - this.serviceInstanceId = serviceInstanceId; - } - - @JsonProperty("subscriberName") - @XmlElement(name = "subscriberName") - public String getSubscriberName() { - return subscriberName; - } - - @JsonProperty("subscriberName") - public void setSubscriberName(String subscriberName) { - this.subscriberName = subscriberName; - } - - @JsonProperty("subscriberGlobalId") - @XmlElement(name = "subscriberGlobalId") - public String getSubscriberGlobalId() { - return subscriberGlobalId; - } - - @JsonProperty("subscriberGlobalId") - public void setSubscriberGlobalId(String subscriberGlobalId) { - this.subscriberGlobalId = subscriberGlobalId; - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantError.java deleted file mode 100644 index 38fb4ac3f8..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantError.java +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import java.io.Serializable; -import javax.xml.bind.annotation.XmlRootElement; -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "createTenantError") -public class CreateTenantError implements Serializable { - private static final long serialVersionUID = 7305288262646805568L; - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public CreateTenantError () {} - - public CreateTenantError (String message) { - this.message = message; - } - - public CreateTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java deleted file mode 100644 index 227e58338d..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import org.openecomp.mso.entity.MsoRequest; -import java.util.Map; -import java.util.HashMap; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "createTenantRequest") -public class CreateTenantRequest extends TenantRequestCommon { - private String cloudSiteId; - private String tenantName; - private Boolean failIfExists; - private Boolean backout; - private Map metadata = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - - public CreateTenantRequest() {} - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantName() { - return tenantName; - } - - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - public Boolean getFailIfExists() { - return failIfExists; - } - - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } - - public Boolean getBackout() { - return backout; - } - - public void setBackout(Boolean backout) { - this.backout = backout; - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - @Override - public String toString() { - return "CreateTenantRequest [cloudSiteId=" + cloudSiteId - + ", tenantName=" + tenantName + ", failIfExists=" - + failIfExists + ", backout=" + backout + ", metadata=" - + metadata + "]"; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantResponse.java deleted file mode 100644 index f091a22bcb..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantResponse.java +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import java.io.Serializable; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "createTenantResponse") -public class CreateTenantResponse implements Serializable { - private static final long serialVersionUID = -456155026754759682L; - private String cloudSiteId; - private String tenantId; - private Boolean tenantCreated; - private TenantRollback tenantRollback = new TenantRollback(); - - public CreateTenantResponse() {} - - public CreateTenantResponse(String cloudSiteId, String tenantId, - Boolean tenantCreated, TenantRollback tenantRollback) { - this.cloudSiteId = cloudSiteId; - this.tenantId = tenantId; - this.tenantCreated = tenantCreated; - this.tenantRollback = tenantRollback; - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public Boolean getTenantCreated() { - return tenantCreated; - } - - public void setTenantCreated(Boolean tenantCreated) { - this.tenantCreated = tenantCreated; - } - - public TenantRollback getTenantRollback() { - return tenantRollback; - } - - public void setTenantRollback(TenantRollback tenantRollback) { - this.tenantRollback = tenantRollback; - } - - @Override - public String toString() { - return "CreateTenantResponse [cloudSiteId=" + cloudSiteId - + ", tenantId=" + tenantId + ", tenantCreated=" + tenantCreated - + ", tenantRollback=" + tenantRollback.toString() + "]"; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantError.java deleted file mode 100644 index 17af950f3f..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantError.java +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import java.io.Serializable; -import javax.xml.bind.annotation.XmlRootElement; -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "deleteTenantError") -public class DeleteTenantError implements Serializable { - private static final long serialVersionUID = -5778340182805870809L; - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public DeleteTenantError () {} - - public DeleteTenantError (String message) { - this.message = message; - } - - public DeleteTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantRequest.java deleted file mode 100644 index 47761ce086..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantRequest.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import org.openecomp.mso.entity.MsoRequest; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "deleteTenantRequest") -public class DeleteTenantRequest extends TenantRequestCommon { - - private String cloudSiteId; - private String tenantId; - - private MsoRequest msoRequest = new MsoRequest(); - - public DeleteTenantRequest() {} - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantResponse.java deleted file mode 100644 index 9c18734a17..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "deleteTenantResponse") -public class DeleteTenantResponse { - - private Boolean tenantDeleted; - - public DeleteTenantResponse() {} - - public Boolean getTenantDeleted() { - return tenantDeleted; - } - - public void setTenantDeleted(Boolean tenantDeleted) { - this.tenantDeleted = tenantDeleted; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/HealthCheckHandler.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/HealthCheckHandler.java deleted file mode 100644 index dac3b9ea3c..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/HealthCheckHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import javax.ws.rs.GET; -import javax.ws.rs.HEAD; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - -import org.apache.http.HttpStatus; - -import org.openecomp.mso.logger.MsoLogger; - -@Path("/") -public class HealthCheckHandler { - - private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA); - private static final String CHECK_HTML = "Health CheckApplication ready"; - private static final Response HEALTH_CHECK_RESPONSE = Response.status (HttpStatus.SC_OK) - .entity (CHECK_HTML) - .build (); - @HEAD - @GET - @Path("/healthcheck") - @Produces("text/html") - public Response healthcheck () { - msoLogger.debug ("Health check call in Tenant Adapter"); - return HEALTH_CHECK_RESPONSE; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantError.java deleted file mode 100644 index 1347f78fbe..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantError.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import java.io.Serializable; -import javax.xml.bind.annotation.XmlRootElement; -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "queryTenantError") -public class QueryTenantError implements Serializable { - private static final long serialVersionUID = 7358240830662453507L; - private String message; - private MsoExceptionCategory category; - - public QueryTenantError () {} - - public QueryTenantError (String message) { - this.message = message; - } - - public QueryTenantError (String message, MsoExceptionCategory category) { - this.message = message; - this.category = category; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantResponse.java deleted file mode 100644 index 4d667b6a0e..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantResponse.java +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import java.util.Map; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "queryTenantResponse") -public class QueryTenantResponse extends TenantRequestCommon { - private String tenantId; - private String tenantName; - private Map metadata; - - public QueryTenantResponse() {} - - public QueryTenantResponse (String id, String name, Map metadata) { - this.tenantId = id; - this.tenantName = name; - this.metadata = metadata; - } - - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getTenantName() { - return tenantName; - } - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - public Map getMetadata() { - return metadata; - } - public void setMetadata(Map metadata) { - this.metadata = metadata; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java deleted file mode 100644 index af76d689fe..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import java.io.Serializable; -import javax.xml.bind.annotation.XmlRootElement; -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "rollbackTenantError") -public class RollbackTenantError implements Serializable { - private static final long serialVersionUID = -5313713674529615223L; - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public RollbackTenantError () {} - - public RollbackTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantRequest.java deleted file mode 100644 index 7a67ffeaaa..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantRequest.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "rollbackTenantRequest") -public class RollbackTenantRequest extends TenantRequestCommon { - - private TenantRollback tenantRollback; - - public RollbackTenantRequest() {} - - public TenantRollback getTenantRollback() { - return tenantRollback; - } - - public void setTenantRollback(TenantRollback tenantRollback) { - this.tenantRollback = tenantRollback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantResponse.java deleted file mode 100644 index da329b8a29..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "rollbackTenantResponse") -public class RollbackTenantResponse { - - private Boolean tenantRolledback; - - public RollbackTenantResponse() {} - - public Boolean getTenantRolledback() { - return tenantRolledback; - } - - public void setTenantRolledback(Boolean tenantRolledback) { - this.tenantRolledback = tenantRolledback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java deleted file mode 100644 index 930f46271b..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; -import java.io.Serializable; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "createTenantResponse") -public class TenantExceptionResponse implements Serializable { - - private static final long serialVersionUID = -9062290006520066109L; - - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public TenantExceptionResponse () {} - - public TenantExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack) { - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java deleted file mode 100644 index b00b98ef3e..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.tenantrest; - - -import java.io.ByteArrayOutputStream; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -import org.openecomp.mso.logger.MsoLogger; - -public class TenantRequestCommon { - private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - public String toJsonString() { - try { - String jsonString; - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - return jsonString; - } catch (Exception e) { - LOGGER.debug("Exception :",e); - return ""; - } - } - - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - LOGGER.debug("Exception :",e); - return ""; - } - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRollback.java deleted file mode 100644 index 27aab8d3ff..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRollback.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.tenantrest; - - - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -/** - * Javabean representing the rollback criteria following a "Create Tenant" - * operation. This structure can be passed back to the "Rollback Tenant" - * operation to undo the effects of the create. - * - * - */ - -@XmlRootElement(name = "rollbackTenantRequest") -public class TenantRollback extends TenantRequestCommon { - private String tenantId; - private String cloudId; - private boolean tenantCreated = false; - private MsoRequest msoRequest; - - public TenantRollback() {} - - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getCloudId() { - return cloudId; - } - public void setCloudId(String cloudId) { - this.cloudId = cloudId; - } - - public boolean getTenantCreated() { - return tenantCreated; - } - public void setTenantCreated(boolean tenantCreated) { - this.tenantCreated = tenantCreated; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest (MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - @Override - public String toString() { - return "VnfRollback: cloud=" + cloudId + ", tenant=" + tenantId + - ", tenantCreated=" + tenantCreated; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleRequest.java deleted file mode 100644 index dac09d4cd1..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleRequest.java +++ /dev/null @@ -1,208 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonRootName; - - -/* README - Map elements when marshalled to XML produce a list of ${key}${value} elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. -*/ -@JsonRootName("createVfModuleRequest") -@XmlRootElement(name = "createVfModuleRequest") -public class CreateVfModuleRequest extends VfRequestCommon { - private String cloudSiteId; - private String tenantId; - - private String vnfId; - private String vnfType; - private String vnfVersion; - - private String vfModuleId; - private String vfModuleName; - private String vfModuleType; - - private String volumeGroupId; - private String volumeGroupStackId; - private String baseVfModuleId; - private String baseVfModuleStackId; - private String modelCustomizationUuid; - - private String requestType; - private Boolean failIfExists; - private Boolean backout; - - private Map vfModuleParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleName() { - return vfModuleName; - } - - public void setVfModuleName(String vfModuleName) { - this.vfModuleName = vfModuleName; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getVnfVersion() { - return vnfVersion; - } - - public void setVnfVersion(String vnfVersion) { - this.vnfVersion = vnfVersion; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleType() { - return vfModuleType; - } - - public void setVfModuleType(String vfModuleType) { - this.vfModuleType = vfModuleType; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public String getBaseVfModuleId() { - return baseVfModuleId; - } - - public void setBaseVfModuleId(String baseVfModuleId) { - this.baseVfModuleId = baseVfModuleId; - } - - public String getBaseVfModuleStackId() { - return baseVfModuleStackId; - } - - public void setBaseVfModuleStackId(String baseVfModuleStackId) { - this.baseVfModuleStackId = baseVfModuleStackId; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public String getRequestType() { - return requestType; - } - - public void setRequestType(String requestType) { - this.requestType = requestType; - } - - public Boolean getFailIfExists() { - return failIfExists; - } - - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } - - public Boolean getBackout() { - return backout; - } - - public void setBackout(Boolean backout) { - this.backout = backout; - } - - public Map getVfModuleParams() { - return vfModuleParams; - } - - public void setVfModuleParams(Map vfModuleParams) { - this.vfModuleParams = vfModuleParams; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleResponse.java deleted file mode 100644 index 70c9535a32..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("createVfModuleResponse") -@XmlRootElement(name = "createVfModuleResponse") -public class CreateVfModuleResponse extends VfResponseCommon { - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - private Boolean vfModuleCreated; - private Map vfModuleOutputs = new HashMap<>(); - private VfModuleRollback rollback = new VfModuleRollback(); - - public CreateVfModuleResponse() { - super(); - } - - public CreateVfModuleResponse(String vnfId, String vfModuleId, - String vfModuleStackId, Boolean vfModuleCreated, - Map vfModuleOutputs, VfModuleRollback rollback, - String messageId) { - super(messageId); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vfModuleCreated = vfModuleCreated; - this.vfModuleOutputs = vfModuleOutputs; - this.rollback = rollback; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public Boolean getVfModuleCreated() { - return vfModuleCreated; - } - - public void setVfModuleCreated(Boolean vfModuleCreated) { - this.vfModuleCreated = vfModuleCreated; - } - - public Map getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } - - public VfModuleRollback getRollback() { - return rollback; - } - - public void setRollback(VfModuleRollback rollback) { - this.rollback = rollback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupRequest.java deleted file mode 100644 index 2c684e0aa4..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupRequest.java +++ /dev/null @@ -1,148 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("createVolumeGroupRequest") -@XmlRootElement(name = "createVolumeGroupRequest") -public class CreateVolumeGroupRequest extends VfRequestCommon { - private String cloudSiteId; - private String tenantId; - private String volumeGroupName; - private String volumeGroupId; - private String vnfType; - private String vnfVersion; - private String vfModuleType; - private String modelCustomizationUuid; - private Map volumeGroupParams = new HashMap<>(); - private Boolean failIfExists; - private Boolean suppressBackout; - private MsoRequest msoRequest = new MsoRequest(); - - public CreateVolumeGroupRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getVnfVersion() { - return vnfVersion; - } - - public void setVnfVersion(String vnfVersion) { - this.vnfVersion = vnfVersion; - } - - public String getVfModuleType() { - return vfModuleType; - } - - public void setVfModuleType(String vfModuleType) { - this.vfModuleType = vfModuleType; - } - - public Map getVolumeGroupParams() { - return volumeGroupParams; - } - - public void setVolumeGroupParams(Map volumeGroupParams) { - this.volumeGroupParams = volumeGroupParams; - } - - public String getVolumeGroupName() { - return volumeGroupName; - } - - public void setVolumeGroupName(String volumeGroupName) { - this.volumeGroupName = volumeGroupName; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public Boolean getFailIfExists() { - return failIfExists; - } - - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } - - public Boolean getSuppressBackout() { - return suppressBackout; - } - - public void setSuppressBackout(Boolean suppressBackout) { - this.suppressBackout = suppressBackout; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupResponse.java deleted file mode 100644 index 18a348aa05..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupResponse.java +++ /dev/null @@ -1,100 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - - -@JsonRootName("createVolumeGroupResponse") -@XmlRootElement(name = "createVolumeGroupResponse") -public class CreateVolumeGroupResponse extends VfResponseCommon { - private String volumeGroupId; - private String volumeGroupStackId; - private Boolean volumeGroupCreated; - private Map volumeGroupOutputs = new HashMap<>(); - private VolumeGroupRollback volumeGroupRollback = new VolumeGroupRollback(); - - public CreateVolumeGroupResponse() { - super(); - } - - public CreateVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - Boolean volumeGroupCreated, - Map volumeGroupOutputs, - VolumeGroupRollback volumeGroupRollback, - String messageId) - { - super(messageId); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupCreated = volumeGroupCreated; - this.volumeGroupOutputs = volumeGroupOutputs; - this.volumeGroupRollback = volumeGroupRollback; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public Boolean getVolumeGroupCreated() { - return volumeGroupCreated; - } - - public void setVolumeGroupCreated(Boolean volumeGroupCreated) { - this.volumeGroupCreated = volumeGroupCreated; - } - - public Map getVolumeGroupOutputs() { - return volumeGroupOutputs; - } - - public void setVolumeGroupOutputs(Map volumeGroupOutputs) { - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public VolumeGroupRollback getVolumeGroupRollback() { - return volumeGroupRollback; - } - - public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { - this.volumeGroupRollback = volumeGroupRollback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleRequest.java deleted file mode 100644 index b2b602ae33..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleRequest.java +++ /dev/null @@ -1,92 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("deleteVfModuleRequest") -@XmlRootElement(name = "deleteVfModuleRequest") -public class DeleteVfModuleRequest extends VfRequestCommon { - private String cloudSiteId; - private String tenantId; - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - - private MsoRequest msoRequest = new MsoRequest(); - - public DeleteVfModuleRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleResponse.java deleted file mode 100644 index db04d5b20c..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleResponse.java +++ /dev/null @@ -1,80 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("deleteVfModuleResponse") -@XmlRootElement(name = "deleteVfModuleResponse") -public class DeleteVfModuleResponse extends VfResponseCommon { - private String vnfId; - private String vfModuleId; - private Boolean vfModuleDeleted; - private Map vfModuleOutputs = new HashMap<>(); - public DeleteVfModuleResponse() { - super(); - } - - public DeleteVfModuleResponse(String vnfId, String vfModuleId, Boolean vfModuleDeleted, String messageId, Map outputs) { - super(messageId); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleDeleted = vfModuleDeleted; - this.vfModuleOutputs = outputs; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public Boolean getVfModuleDeleted() { - return vfModuleDeleted; - } - - public void setVfModuleDeleted(Boolean vfModuleDeleted) { - this.vfModuleDeleted = vfModuleDeleted; - } - public Map getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupRequest.java deleted file mode 100644 index fc600e2d75..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupRequest.java +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("deleteVolumeGroupRequest") -@XmlRootElement(name = "deleteVolumeGroupRequest") -public class DeleteVolumeGroupRequest extends VfRequestCommon { - private String cloudSiteId; - private String tenantId; - private String volumeGroupId; - private String volumeGroupStackId; - private MsoRequest msoRequest = new MsoRequest(); - - public DeleteVolumeGroupRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupResponse.java deleted file mode 100644 index 553cc0e8e0..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("deleteVolumeGroupResponse") -@XmlRootElement(name = "deleteVolumeGroupResponse") -public class DeleteVolumeGroupResponse extends VfResponseCommon { - private Boolean volumeGroupDeleted; - - public DeleteVolumeGroupResponse() { - super(); - } - - public DeleteVolumeGroupResponse(Boolean volumeGroupDeleted, String messageId) { - super(messageId); - this.volumeGroupDeleted = volumeGroupDeleted; - } - - public Boolean getVolumeGroupDeleted() { - return volumeGroupDeleted; - } - - public void setVolumeGroupDeleted(Boolean volumeGroupDeleted) { - this.volumeGroupDeleted = volumeGroupDeleted; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVfModuleResponse.java deleted file mode 100644 index 222644ca1c..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVfModuleResponse.java +++ /dev/null @@ -1,97 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.vnfrest; - -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.openstack.beans.VnfStatus; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("queryVfModuleResponse") -@XmlRootElement(name = "queryVfModuleResponse") -public class QueryVfModuleResponse extends VfResponseCommon{ - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - private VnfStatus vnfStatus; - private Map vfModuleOutputs; - - public QueryVfModuleResponse() { - super(); - } - - public QueryVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, VnfStatus vnfStatus, - Map vfModuleOutputs) { - super(); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vnfStatus = vnfStatus; - this.vfModuleOutputs = vfModuleOutputs; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public VnfStatus getVnfStatus() { - return vnfStatus; - } - - public void setVnfStatus(VnfStatus vnfStatus) { - this.vnfStatus = vnfStatus; - } - - public Map getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVolumeGroupResponse.java deleted file mode 100644 index 41226c3696..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVolumeGroupResponse.java +++ /dev/null @@ -1,103 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.vnfrest; - - -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.openstack.beans.VnfStatus; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -@XmlRootElement(name = "queryVolumeGroupResponse") -public class QueryVolumeGroupResponse { - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - private String volumeGroupId; - private String volumeGroupStackId; - private VnfStatus volumeGroupStatus; - private Map volumeGroupOutputs; - - public QueryVolumeGroupResponse() { - } - - public QueryVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - VnfStatus volumeGroupStatus, - Map volumeGroupOutputs) - { - super(); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupStatus = volumeGroupStatus; - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public VnfStatus getVolumeGroupStatus() { - return volumeGroupStatus; - } - - public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) { - this.volumeGroupStatus = volumeGroupStatus; - } - - public Map getVolumeGroupOutputs() { - return volumeGroupOutputs; - } - - public void setVolumeGroupOutputs(Map volumeGroupOutputs) { - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - } - catch (Exception e) { - LOGGER.debug("Exception :",e); - } - return jsonString; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleRequest.java deleted file mode 100644 index aa9b35bb98..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleRequest.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - - -@JsonRootName("rollbackVfModuleRequest") -@XmlRootElement(name = "rollbackVfModuleRequest") -public class RollbackVfModuleRequest extends VfRequestCommon { - private VfModuleRollback vfModuleRollback; - - public RollbackVfModuleRequest() { - super(); - } - - public VfModuleRollback getVfModuleRollback() { - return vfModuleRollback; - } - - public void setVfModuleRollback(VfModuleRollback vfModuleRollback) { - this.vfModuleRollback = vfModuleRollback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleResponse.java deleted file mode 100644 index c77155fe81..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("rollbackVfModuleResponse") -@XmlRootElement(name = "rollbackVfModuleResponse") -public class RollbackVfModuleResponse extends VfResponseCommon { - private Boolean vfModuleRolledback; - - public RollbackVfModuleResponse() { - super(); - } - - public RollbackVfModuleResponse(Boolean vfModuleRolledback, String messageId) { - super(messageId); - this.vfModuleRolledback = vfModuleRolledback; - } - - public Boolean getVfModuleRolledback() { - return vfModuleRolledback; - } - - public void setVfModuleRolledback(Boolean vfModuleRolledback) { - this.vfModuleRolledback = vfModuleRolledback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupRequest.java deleted file mode 100644 index d7f49fd530..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupRequest.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("rollbackVolumeGroupRequest") -@XmlRootElement(name = "rollbackVolumeGroupRequest") -public class RollbackVolumeGroupRequest extends VfRequestCommon { - private VolumeGroupRollback volumeGroupRollback; - - public RollbackVolumeGroupRequest() { - super(); - } - - public VolumeGroupRollback getVolumeGroupRollback() { - return volumeGroupRollback; - } - - public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { - this.volumeGroupRollback = volumeGroupRollback; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupResponse.java deleted file mode 100644 index 22164d9508..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("rollbackVolumeGroupResponse") -@XmlRootElement(name = "rollbackVolumeGroupResponse") -public class RollbackVolumeGroupResponse extends VfResponseCommon { - private Boolean volumeGroupRolledBack; - - public RollbackVolumeGroupResponse() { - super(); - } - - public RollbackVolumeGroupResponse(Boolean volumeGroupRolledBack, String messageId) { - super(messageId); - this.volumeGroupRolledBack = volumeGroupRolledBack; - } - - public Boolean getVolumeGroupRolledBack() { - return volumeGroupRolledBack; - } - - public void setVolumeGroupRolledBack(Boolean volumeGroupRolledBack) { - this.volumeGroupRolledBack = volumeGroupRolledBack; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleRequest.java deleted file mode 100644 index c52cc60b35..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleRequest.java +++ /dev/null @@ -1,215 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("updateVfModuleRequest") -@XmlRootElement(name = "updateVfModuleRequest") -public class UpdateVfModuleRequest extends VfRequestCommon { - - private String cloudSiteId; - private String tenantId; - - private String vnfId; - private String vnfType; - private String vnfVersion; - - private String vfModuleName; - private String vfModuleType; - private String vfModuleId; - private String vfModuleStackId; - - private String volumeGroupId; - private String volumeGroupStackId; - - private String baseVfModuleId; - private String baseVfModuleStackId; - - private String modelCustomizationUuid; - - private String requestType; - private Boolean failIfExists; - private Boolean backout; - - private Map vfModuleParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleName() { - return vfModuleName; - } - - public void setVfModuleName(String vfModuleName) { - this.vfModuleName = vfModuleName; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getVnfVersion() { - return vnfVersion; - } - - public void setVnfVersion(String vnfVersion) { - this.vnfVersion = vnfVersion; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleType() { - return vfModuleType; - } - - public void setVfModuleType(String vfModuleType) { - this.vfModuleType = vfModuleType; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public String getBaseVfModuleId() { - return baseVfModuleId; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public void setBaseVfModuleId(String baseVfModuleId) { - this.baseVfModuleId = baseVfModuleId; - } - - public String getBaseVfModuleStackId() { - return baseVfModuleStackId; - } - - public void setBaseVfModuleStackId(String baseVfModuleStackId) { - this.baseVfModuleStackId = baseVfModuleStackId; - } - - public String getRequestType() { - return requestType; - } - - public void setRequestType(String requestType) { - this.requestType = requestType; - } - - public Boolean getFailIfExists() { - return failIfExists; - } - - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } - - public Boolean getBackout() { - return backout; - } - - public void setBackout(Boolean backout) { - this.backout = backout; - } - - public Map getVfModuleParams() { - return vfModuleParams; - } - - public void setVfModuleParams(Map vfModuleParams) { - this.vfModuleParams = vfModuleParams; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleResponse.java deleted file mode 100644 index aa9a3aad31..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleResponse.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("updateVfModuleResponse") -@XmlRootElement(name = "updateVfModuleResponse") -public class UpdateVfModuleResponse extends VfResponseCommon { - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - private Map vfModuleOutputs = new HashMap<>(); - - public UpdateVfModuleResponse() { - super(); - } - - public UpdateVfModuleResponse(String vnfId, String vfModuleId, - String vfModuleStackId, - Map vfModuleOutputs, - String messageId) { - super(messageId); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vfModuleOutputs = vfModuleOutputs; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public Map getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupRequest.java deleted file mode 100644 index 983e81602c..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupRequest.java +++ /dev/null @@ -1,130 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("updateVolumeGroupRequest") -@XmlRootElement(name = "updateVolumeGroupRequest") -public class UpdateVolumeGroupRequest extends VfRequestCommon { - private String cloudSiteId; - private String tenantId; - private String volumeGroupId; - private String volumeGroupStackId; - private String vnfType; - private String vnfVersion; - private String vfModuleType; - private String modelCustomizationUuid; - private Map volumeGroupParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - - public UpdateVolumeGroupRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getVnfVersion() { - return vnfVersion; - } - - public void setVnfVersion(String vnfVersion) { - this.vnfVersion = vnfVersion; - } - - public String getVfModuleType() { - return vfModuleType; - } - - public void setVfModuleType(String vfModuleType) { - this.vfModuleType = vfModuleType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public Map getVolumeGroupParams() { - return volumeGroupParams; - } - - public void setVolumeGroupParams(Map volumeGroupParams) { - this.volumeGroupParams = volumeGroupParams; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupResponse.java deleted file mode 100644 index d71ef275e1..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupResponse.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import com.fasterxml.jackson.annotation.JsonRootName; - - -@JsonRootName("updateVolumeGroupResponse") -@XmlRootElement(name = "updateVolumeGroupResponse") -public class UpdateVolumeGroupResponse extends VfResponseCommon { - private String volumeGroupId; - private String volumeGroupStackId; - private Map volumeGroupOutputs; - - public UpdateVolumeGroupResponse() { - super(); - this.volumeGroupOutputs = new HashMap<>(); - } - - public UpdateVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - Map volumeGroupOutputs, - String messageId) - { - super(messageId); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public Map getVolumeGroupOutputs() { - return volumeGroupOutputs; - } - - public void setVolumeGroupOutputs(Map volumeGroupOutputs) { - this.volumeGroupOutputs = volumeGroupOutputs; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleExceptionResponse.java deleted file mode 100644 index 6416d2df5e..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleExceptionResponse.java +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "vfModuleException") - -public class VfModuleExceptionResponse extends VfResponseCommon implements Serializable { - private static final long serialVersionUID = -9062290006520066109L; - - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public VfModuleExceptionResponse () {} - - public VfModuleExceptionResponse (String message) { - this.message = message; - } - - public VfModuleExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { - super(messageid); - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleRollback.java deleted file mode 100644 index 59bd5020d2..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleRollback.java +++ /dev/null @@ -1,130 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; -import org.openecomp.mso.openstack.beans.VnfRollback; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("VfModuleRollback") -@XmlRootElement(name = "VfModuleRollback") -public class VfModuleRollback { - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - private boolean vfModuleCreated = false; - private String tenantId; - private String cloudSiteId; - private MsoRequest msoRequest; - private String messageId; - private String mode = "HEAT"; // default - - public VfModuleRollback() { - } - - public VfModuleRollback(VnfRollback vrb, String vfModuleId, String vfModuleStackId, String messageId) - { - this.vnfId = vrb.getVnfId(); - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vfModuleCreated = vrb.getVnfCreated(); - this.tenantId = vrb.getTenantId(); - this.cloudSiteId = vrb.getCloudSiteId(); - this.msoRequest = vrb.getMsoRequest(); - this.messageId = messageId; - this.mode = vrb.getMode(); - } - - public VfModuleRollback(String vnfId, String vfModuleId, - String vfModuleStackId, boolean vfModuleCreated, String tenantId, - String cloudSiteId, - MsoRequest msoRequest, - String messageId) { - super(); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vfModuleCreated = vfModuleCreated; - this.tenantId = tenantId; - this.cloudSiteId = cloudSiteId; - this.msoRequest = msoRequest; - this.messageId = messageId; - } - - public String getVnfId() { - return vnfId; - } - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - public String getVfModuleId() { - return vfModuleId; - } - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - public String getVfModuleStackId() { - return vfModuleStackId; - } - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - public boolean isVfModuleCreated() { - return vfModuleCreated; - } - public void setVfModuleCreated(boolean vfModuleCreated) { - this.vfModuleCreated = vfModuleCreated; - } - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public String getCloudSiteId() { - return cloudSiteId; - } - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - public String getMessageId() { - return messageId; - } - public void setMessageId(String messageId) { - this.messageId = messageId; - } - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfRequestCommon.java deleted file mode 100644 index aa6af56082..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfRequestCommon.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.vnfrest; - - -/** - * Everything that is common between all VfModule and VolumeGroup Requests. - */ -public abstract class VfRequestCommon extends VfResponseCommon { - private Boolean skipAAI; - private String notificationUrl; - - public Boolean getSkipAAI() { - return skipAAI; - } - - public void setSkipAAI(Boolean skipAAI) { - this.skipAAI = skipAAI; - } - - public String getNotificationUrl() { - return notificationUrl; - } - - public void setNotificationUrl(String notificationUrl) { - this.notificationUrl = notificationUrl; - } - - public boolean isSynchronous() { - return notificationUrl == null || notificationUrl.isEmpty(); - } - - // getMessageId, setMessageId, toJsonString, toJsonString are all defined in VfResponseCommon. -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfResponseCommon.java deleted file mode 100644 index 4f55c5a615..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfResponseCommon.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.adapters.vnfrest; - - -import java.io.ByteArrayOutputStream; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; - -import org.openecomp.mso.logger.MsoLogger; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * Everything that is common between all VfModule and VolumeGroup Responses, - * except for QueryVfModuleResponse and QueryVolumeGroupResponse. - */ -public abstract class VfResponseCommon { - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - private String messageId; - - public VfResponseCommon() { - messageId = null; - } - - public VfResponseCommon(String messageId) { - this.messageId = messageId; - } - - public String getMessageId() { - return messageId; - } - - public void setMessageId(String messageId) { - this.messageId = messageId; - } - - public String toJsonString() { - try { - String jsonString; - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - return jsonString; - } catch (Exception e) { - LOGGER.debug("Exception :",e); - return ""; - } - } - - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - LOGGER.debug("Exception :",e); - return ""; - } - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupExceptionResponse.java deleted file mode 100644 index 4c3a0a6d60..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupExceptionResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; - -@XmlRootElement(name = "volumeGroupException") -public class VolumeGroupExceptionResponse extends VfModuleExceptionResponse { - // Exactly the same as a VfModuleExceptionResponse - - private static final long serialVersionUID = 1168681288205898800L; - - public VolumeGroupExceptionResponse() { - super(); - } - - public VolumeGroupExceptionResponse(String message) { - super(message); - } - - public VolumeGroupExceptionResponse(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { - super(message, category, rolledBack, messageid); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupRollback.java deleted file mode 100644 index c815a7658c..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupRollback.java +++ /dev/null @@ -1,128 +0,0 @@ -/*- - * ============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.openecomp.mso.adapters.vnfrest; - - -import javax.xml.bind.annotation.XmlRootElement; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonRootName; - -@JsonRootName("VolumeGroupRollback") -@XmlRootElement(name = "VolumeGroupRollback") -public class VolumeGroupRollback { -// “volumeGroupRollback”: { -// “volumeGroupId”: “”, -// “volumeGroupStackId”: “”, -// “tenantId”: “”, -// “cloudSiteId”: “”, -// “volumeGroupCreated”: TRUE|FALSE, -// “msoRequest”: { -// “requestId”: “”, -// “serviceInstanceId”: “” -// } -//}, - - private String volumeGroupId; - private String volumeGroupStackId; - private String tenantId; - private String cloudSiteId; - private boolean volumeGroupCreated = false; - private MsoRequest msoRequest; - private String messageId; - - public VolumeGroupRollback() { - } - - public VolumeGroupRollback(VolumeGroupRollback vrb, String volumeGroupStackId, String messageId) - { - this.volumeGroupId = vrb.getVolumeGroupId(); - this.volumeGroupStackId = volumeGroupStackId; - this.tenantId = vrb.getTenantId(); - this.cloudSiteId = vrb.getCloudSiteId(); - this.volumeGroupCreated = vrb.isVolumeGroupCreated(); - this.msoRequest = vrb.getMsoRequest(); - this.messageId = messageId; - } - - public VolumeGroupRollback( - String volumeGroupId, - String volumeGroupStackId, - boolean volumeGroupCreated, - String tenantId, - String cloudSiteId, - MsoRequest msoRequest, - String messageId) - { - super(); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupCreated = volumeGroupCreated; - this.tenantId = tenantId; - this.cloudSiteId = cloudSiteId; - this.msoRequest = msoRequest; - this.messageId = messageId; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public String getCloudSiteId() { - return cloudSiteId; - } - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - public boolean isVolumeGroupCreated() { - return volumeGroupCreated; - } - public void setVolumeGroupCreated(boolean volumeGroupCreated) { - this.volumeGroupCreated = volumeGroupCreated; - } - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - public String getMessageId() { - return messageId; - } - public void setMessageId(String messageId) { - this.messageId = messageId; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/HeatStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/HeatStatus.java deleted file mode 100644 index 8e223b7bcb..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/HeatStatus.java +++ /dev/null @@ -1,30 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - -/* - * Enum status values to mirror the Openstack Heat stack status values - */ -public enum HeatStatus { - INIT, CREATED, NOTFOUND, FAILED, BUILDING, DELETING, UNKNOWN, UPDATING, UPDATED -} - diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/HostRoute.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/HostRoute.java deleted file mode 100644 index 4d9dc0009e..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/HostRoute.java +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "prefix", - "nextHop" -}) -public class HostRoute { - - private String prefix; - private String nextHop; - - /** - * @return the prefix - */ - public String getPrefix() { - return prefix; - } - /** - * @param prefix the prefix to set - */ - public void setPrefix(String prefix) { - this.prefix = prefix; - } - /** - * @return the nextHop - */ - public String getNextHop() { - return nextHop; - } - /** - * @param nextHop the nextHop to set - */ - public void setNextHop(String nextHop) { - this.nextHop = nextHop; - } - - @Override - public String toString() { - return "Host_route [prefix=" + prefix + ", nextHop=" + nextHop + "]"; - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/MsoTenant.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/MsoTenant.java deleted file mode 100644 index 5e037096df..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/MsoTenant.java +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - - -import java.util.Map; - -/** - * This bean class represents the Openstack tenant properties that are - * needed by MSO. - * - * - */ -public class MsoTenant { - private String tenantId; - private String tenantName; - private Map metadata; - - public MsoTenant() {} - - public MsoTenant (String id, String name, Map metadata) { - this.tenantId = id; - this.tenantName = name; - this.metadata = metadata; - } - - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getTenantName() { - return tenantName; - } - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - public Map getMetadata() { - return metadata; - } - public void setMetadata(Map metadata) { - this.metadata = metadata; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java deleted file mode 100644 index 64460b20bb..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java +++ /dev/null @@ -1,151 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.HashMap; - -import com.woorea.openstack.quantum.model.Network; -import com.woorea.openstack.quantum.model.Segment; - -/* - * This Java bean class relays Network details (including status) to ActiveVOS processes. - * - * This bean is returned by all Network-specific adapter operations (create, query, delete) - */ -public class NetworkInfo { - // Set defaults for everything - private String name = ""; - private String id = ""; - private NetworkStatus status = NetworkStatus.UNKNOWN; - private String provider = ""; - private List vlans = new ArrayList<>(); - private List subnets = new ArrayList<>(); - - static Map NetworkStatusMap; - static { - NetworkStatusMap = new HashMap<>(); - NetworkStatusMap.put("ACTIVE", NetworkStatus.ACTIVE); - NetworkStatusMap.put("DOWN", NetworkStatus.DOWN); - NetworkStatusMap.put("BUILD", NetworkStatus.BUILD); - NetworkStatusMap.put("ERROR", NetworkStatus.ERROR); - } - - /** - * Capture the data from a Neutron Network object. - * - * For MSO, there are assumptions regarding all networks. - * - Everything will be a provider network - * - All provider networks are VLANs - * - Multiple VLANs are supported, and indicated by multi-provider segments. - * Each will have the same physical network & network type "vlan". - * - * @param network - */ - public NetworkInfo(Network network) { - if (network != null) { - initFieldsWithDataFromNetwork(network); - } else { - status = NetworkStatus.NOTFOUND; - } - } - - private void initFieldsWithDataFromNetwork(Network network){ - name = network.getName(); - id = network.getId(); - - if (network.getStatus() != null && NetworkStatusMap.containsKey(network.getStatus())) { - status = NetworkStatusMap.get(network.getStatus()); - } - if (network.getProviderPhysicalNetwork() != null) { - provider = network.getProviderPhysicalNetwork(); - if ("vlan".equals(network.getProviderNetworkType())) { - vlans.add(network.getProviderSegmentationId()); - } - } - else if (network.getSegments() != null && !network.getSegments().isEmpty()) { - Segment s = network.getSegments().get(0); - provider = s.getProviderPhysicalNetwork(); - if ("vlan".equals(s.getProviderNetworkType())) { - network.getSegments().forEach(segment -> vlans.add(segment.getProviderSegmentationId())); - } - } - subnets = network.getSubnets(); - } - - public String getName() { - return name; - } - - public void setName (String name) { - this.name = name; - } - - public String getId() { - return id; - } - - public void setId (String id) { - this.id = id; - } - - public NetworkStatus getStatus() { - return status; - } - - public void setStatus (NetworkStatus status) { - this.status = status; - } - - public String getProvider() { - return provider; - } - - public void setProvider (String provider) { - this.provider = provider; - } - - public List getVlans () { - return vlans; - } - - public void setVlans (List vlans) { - this.vlans = vlans; - } - - public List getSubnets () { - return subnets; - } - - @Override - public String toString() { - return "NetworkInfo{" + "name='" + name + '\'' + - ", id='" + id + '\'' + - ", status=" + status + - ", provider='" + provider + '\'' + - ", vlans=" + vlans + - ", subnets=" + subnets + - '}'; - } -} - diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkRollback.java deleted file mode 100644 index a965122921..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkRollback.java +++ /dev/null @@ -1,152 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - -import java.util.List; - -import org.openecomp.mso.entity.MsoRequest; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -/** - * Javabean representing the rollback criteria following a "Create Network" - * or "Update Network" operation. This structure can be passed back to the - * "Rollback Network" operation to undo the effects of the create/update. - * - * Once a network is created, the only possible update through MSO is to - * the set of VLANs supported by the network. The vlans attribute of the - * rollback object contains the previous VLANs before update. - * - * - */ -@JsonInclude(Include.NON_EMPTY) -public class NetworkRollback { - private String networkId; - private String neutronNetworkId; - private String networkStackId; - private String tenantId; - private String cloudId; - private String networkType; - private String modelCustomizationUuid; - private boolean networkCreated = false; - // Previous values for updates - private String networkName = null; - private String physicalNetwork = null; - private List vlans = null; - private MsoRequest msoRequest; - - public String getNetworkId() { - return networkId; - } - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNeutronNetworkId() { - return neutronNetworkId; - } - public void setNeutronNetworkId(String neutronNetworkId) { - this.neutronNetworkId = neutronNetworkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getCloudId() { - return cloudId; - } - public void setCloudId(String cloudId) { - this.cloudId = cloudId; - } - - public String getNetworkType() { - return networkType; - } - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public boolean getNetworkCreated() { - return networkCreated; - } - public void setNetworkCreated(boolean networkCreated) { - this.networkCreated = networkCreated; - } - - public String getNetworkName() { - return networkName; - } - public void setNetworkName(String networkName) { - this.networkName = networkName; - } - - public String getPhysicalNetwork() { - return physicalNetwork; - } - public void setPhysicalNetwork(String physicalNetwork) { - this.physicalNetwork = physicalNetwork; - } - - public List getVlans () { - return vlans; - } - public void setVlans (List vlans) { - this.vlans = vlans; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest (MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - @Override - public String toString() { - return "NetworkRollback [networkId=" + networkId - + ", neutronNetworkId=" + neutronNetworkId + ", networkStackId=" - + networkStackId + ", tenantId=" + tenantId + ", cloudId=" - + cloudId + ", networkType=" + networkType - + ", networkCreated=" + networkCreated + ", networkName=" + networkName - + ", physicalNetwork=" + physicalNetwork + "]"; - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkStatus.java deleted file mode 100644 index 199028e56c..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/NetworkStatus.java +++ /dev/null @@ -1,31 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - -/** - * Enum status values to mirror the Openstack Neutron - * network status values - */ -public enum NetworkStatus { - NOTFOUND, ACTIVE, DOWN, BUILD, ERROR, UNKNOWN -} - diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/Pool.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/Pool.java deleted file mode 100644 index a3a04abc60..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/Pool.java +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "start", - "end" -}) -public class Pool { - - private String start; - private String end; - - /** - * @return the start - */ - public String getStart() { - return start; - } - /** - * @param start the start to set - */ - public void setStart(String start) { - this.start = start; - } - /** - * @return the end - */ - public String getEnd() { - return end; - } - /** - * @param end the end to set - */ - public void setEnd(String end) { - this.end = end; - } - - @Override - public String toString() { - return "Allocation_pool [start=" + start + ", end=" + end + "]"; - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/RouteTarget.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/RouteTarget.java deleted file mode 100644 index 7903b08ff9..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/RouteTarget.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "routeTarget", - "routeTargetRole" -}) -public class RouteTarget { - - private String routeTarget; - private String routeTargetRole; - - public String getRouteTarget() { - return routeTarget; - } - public void setRouteTarget(String routeTarget) { - this.routeTarget = routeTarget; - } - public String getRouteTargetRole() { - return routeTargetRole; - } - public void setRole(String routeTargetRole) { - this.routeTargetRole = routeTargetRole; - } - - - @Override - public String toString() { - return "RouteTarget [routeTarget=" + routeTarget + ", routeTargetRole=" + routeTargetRole + "]"; - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java deleted file mode 100644 index e88b5f87a0..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/StackInfo.java +++ /dev/null @@ -1,155 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - -import java.util.Map; -import java.util.HashMap; - -import com.woorea.openstack.heat.model.Stack; - -/* - * This Java bean class relays Heat stack status information to ActiveVOS processes. - * - * This bean is returned by all Heat-specific adapter operations (create, query, delete) - */ - -public class StackInfo { - // Set defaults for everything - private String name = ""; - private String canonicalName = ""; - private HeatStatus status = HeatStatus.UNKNOWN; - private String statusMessage = ""; - private Map outputs = new HashMap<>(); - private Map parameters = new HashMap<>(); - - static Map HeatStatusMap; - static { - HeatStatusMap = new HashMap<>(); - HeatStatusMap.put("CREATE_IN_PROGRESS", HeatStatus.BUILDING); - HeatStatusMap.put("CREATE_COMPLETE", HeatStatus.CREATED); - HeatStatusMap.put("CREATE_FAILED", HeatStatus.FAILED); - HeatStatusMap.put("DELETE_IN_PROGRESS", HeatStatus.DELETING); - HeatStatusMap.put("DELETE_COMPLETE", HeatStatus.NOTFOUND); - HeatStatusMap.put("DELETE_FAILED", HeatStatus.FAILED); - HeatStatusMap.put("UPDATE_IN_PROGRESS", HeatStatus.UPDATING); - HeatStatusMap.put("UPDATE_FAILED", HeatStatus.FAILED); - HeatStatusMap.put("UPDATE_COMPLETE", HeatStatus.UPDATED); - } - - public StackInfo () { - } - - public StackInfo (String name, HeatStatus status, String statusMessage, Map outputs) { - this.name = name; - this.canonicalName = name; // Don't have an ID, so just use name - - this.status = status; - if (statusMessage != null) this.statusMessage = statusMessage; - if (outputs != null) this.outputs = outputs; - } - - public StackInfo (String name, HeatStatus status) { - this.name = name; - this.canonicalName = name; // Don't have an ID, so just use name - this.status = status; - } - - public StackInfo (Stack stack) - { - if (stack == null) { - this.status = HeatStatus.NOTFOUND; - return; - } - - this.name = stack.getStackName(); - this.canonicalName = stack.getStackName() + "/" + stack.getId(); - - if (stack.getStackStatus() == null) { - this.status = HeatStatus.INIT; - } else if (HeatStatusMap.containsKey(stack.getStackStatus())) { - this.status = HeatStatusMap.get(stack.getStackStatus()); - } else { - this.status = HeatStatusMap.getOrDefault(stack.getStackStatus(), HeatStatus.UNKNOWN); - } - - this.statusMessage = stack.getStackStatusReason(); - - if (stack.getOutputs() != null) { - this.outputs = new HashMap<>(); - for (Stack.Output output : stack.getOutputs()) { - this.outputs.put(output.getOutputKey(), output.getOutputValue()); - } - } - - this.parameters = stack.getParameters(); - } - - public String getName() { - return name; - } - - public void setName (String name) { - this.name = name; - } - - public String getCanonicalName() { - return canonicalName; - } - - public void setCanonicalName (String name) { - this.canonicalName = name; - } - - public HeatStatus getStatus() { - return status; - } - - public void setStatus (HeatStatus status) { - this.status = status; - } - - public String getStatusMessage() { - return statusMessage; - } - - public void setStatusMessage (String statusMessage) { - this.statusMessage = statusMessage; - } - - public Map getOutputs () { - return outputs; - } - - public void setOutputs (Map outputs) { - this.outputs = outputs; - } - - public Map getParameters () { - return parameters; - } - - public void setParameters (Map parameters) { - this.parameters = parameters; - } - -} - diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/Subnet.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/Subnet.java deleted file mode 100644 index 086395cc93..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/Subnet.java +++ /dev/null @@ -1,207 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - - -import java.util.List; - -import javax.xml.bind.annotation.XmlTransient; - -public class Subnet { - - private String subnetName; - - private String neutronId; - - private String subnetId; // value from aai - - private String cidr; //Only field required - - private String gatewayIp=""; - - private String ipVersion="4"; - - private Boolean enableDHCP=false; - - private Boolean addrFromStart=true; - - private List hostRoutes; - - private List allocationPools; - - private List dnsNameServers; - - public Subnet () { - } - - public String getSubnetName() { - return subnetName; - } - - public void setSubnetName(String subnetName) { - this.subnetName = subnetName; - } - - public List getAllocationPools() { - return allocationPools; - } - - /** - * @return the cidr - */ - public String getCidr() { - return cidr; - } - - /** - * @return the dnsNames - */ - public List getDnsNameServers() { - return dnsNameServers; - } - - - public Boolean getEnableDHCP() { - return enableDHCP; - } - - public Boolean getAddrFromStart() { - return addrFromStart; - } - - public void setAddrFromStart(Boolean addrFromStart) { - this.addrFromStart = addrFromStart; - } - - /** - * @return the gw - */ - public String getGatewayIp() { - return gatewayIp; - } - - /** - * @return the hostRoutes - */ - public List getHostRoutes() { - return hostRoutes; - } - - /** - * @return the NeutronId - */ - @XmlTransient - public String getNeutronId() { - return neutronId; - } - - /** - * @return the ipversion - */ - public String getIpVersion() { - return ipVersion; - } - - /** - * @return the name - */ - public String getSubnetId() { - return subnetId; - } - - public void setAllocationPools(List allocationPools) { - this.allocationPools = allocationPools; - } - - /** - * @param cidr - * the cidr to set - */ - public void setCidr(String cidr) { - this.cidr = cidr; - } - - /** - * @param dnsNames - * the dnsNames to set - */ - public void setDnsNameServers(List dnsNameServers) { - this.dnsNameServers = dnsNameServers; - } - - /** - * @param enableDHCP - * the enableDHCP to set - */ - public void setEnableDHCP(Boolean enableDHCP) { - this.enableDHCP = enableDHCP; - } - - /** - * @param gw - * the gw to set - */ - public void setGatewayIp(String gatewayIp) { - this.gatewayIp = gatewayIp; - } - - /** - * @param hostRoutes - * the hostRoutes to set - */ - public void setHostRoutes(List hostRoutes) { - this.hostRoutes = hostRoutes; - } - - /** - * @param neutronId - * the id to set - */ - public void setNeutronId(String neutronId) { - this.neutronId = neutronId; - } - - /** - * @param ipversion - * the ipversion to set - */ - public void setIpVersion(String ipVersion) { - this.ipVersion = ipVersion; - } - - /** - * @param name - * the name to set - */ - public void setSubnetId(String subnetId) { - this.subnetId = subnetId; - } - - @Override - public String toString() { - return "Subnet [subnetName=" + subnetName + ", neutronId=" + neutronId + ", subnetId=" + subnetId + ", cidr=" - + cidr + ", gatewayIp=" + gatewayIp + ", ipVersion=" + ipVersion + ", enableDHCP=" + enableDHCP - + ", addrFromStart=" + addrFromStart + ", hostRoutes=" + hostRoutes + ", allocationPools=" - + allocationPools + ", dnsNameServers=" + dnsNameServers + "]"; - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/VnfRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/VnfRollback.java deleted file mode 100644 index c4f63138e0..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/VnfRollback.java +++ /dev/null @@ -1,214 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - -import org.openecomp.mso.entity.MsoRequest; -/** - * Javabean representing the rollback criteria following a "Create VNF" - * operation. This structure can be passed back to the "Rollback VNF" - * operation to undo the effects of the create. - * - * - */ -public class VnfRollback { - private String vnfId; - private String tenantId; - private String cloudSiteId; - private boolean tenantCreated = false; - private boolean vnfCreated = false; - private MsoRequest msoRequest; - private String volumeGroupName; - private String volumeGroupId; - private String requestType; - private String volumeGroupHeatStackId; - private String baseGroupHeatStackId; - private boolean isBase = false; - private String vfModuleStackId; - private String modelCustomizationUuid; //NOTE: this is the vfModule's modelCustomizationUuid - private String mode = "HEAT"; - - public VnfRollback() {} - - /** - * For backwards compatibility... orchestration mode defaults to HEAT - * - * @param vnfId - * @param tenantId - * @param cloudSiteId - * @param tenantCreated - * @param vnfCreated - * @param msoRequest - * @param volumeGroupName - * @param volumeGroupId - * @param requestType - * @param modelCustomizationUuid - */ - public VnfRollback(String vnfId, String tenantId, String cloudSiteId, - boolean tenantCreated, boolean vnfCreated, - MsoRequest msoRequest, - String volumeGroupName, String volumeGroupId, String requestType, String modelCustomizationUuid) { - super(); - this.vnfId = vnfId; - this.tenantId = tenantId; - this.cloudSiteId = cloudSiteId; - this.tenantCreated = tenantCreated; - this.vnfCreated = vnfCreated; - this.msoRequest = msoRequest; - this.volumeGroupName = volumeGroupName; - this.volumeGroupId = volumeGroupId; - this.requestType = requestType; - this.modelCustomizationUuid = modelCustomizationUuid; - } - - /** - * For backwards compatibility... orchestration mode defaults to HEAT - * - * @param vnfId - * @param tenantId - * @param cloudSiteId - * @param tenantCreated - * @param vnfCreated - * @param msoRequest - * @param volumeGroupName - * @param volumeGroupId - * @param requestType - * @param modelCustomizationUuid - */ - public VnfRollback(String vnfId, String tenantId, String cloudSiteId, - boolean tenantCreated, boolean vnfCreated, - MsoRequest msoRequest, String volumeGroupName, String volumeGroupId, - String requestType, String modelCustomizationUuid, String orchestrationMode) { - super(); - this.vnfId = vnfId; - this.tenantId = tenantId; - this.cloudSiteId = cloudSiteId; - this.tenantCreated = tenantCreated; - this.vnfCreated = vnfCreated; - this.msoRequest = msoRequest; - this.volumeGroupName = volumeGroupName; - this.volumeGroupId = volumeGroupId; - this.requestType = requestType; - this.modelCustomizationUuid = modelCustomizationUuid; - this.mode = orchestrationMode; - } - - public String getVnfId() { - return vnfId; - } - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public String getCloudSiteId() { - return cloudSiteId; - } - public void setCloudSiteId(String cloudId) { - this.cloudSiteId = cloudId; - } - public boolean getTenantCreated() { - return tenantCreated; - } - public void setTenantCreated(boolean tenantCreated) { - this.tenantCreated = tenantCreated; - } - public boolean getVnfCreated() { - return vnfCreated; - } - public void setVnfCreated(boolean vnfCreated) { - this.vnfCreated = vnfCreated; - } - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest (MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - public String getVolumeGroupName() { - return this.volumeGroupName; - } - public void setVolumeGroupName(String volumeGroupName) { - this.volumeGroupName = volumeGroupName; - } - public String getVolumeGroupId() { - return this.volumeGroupId; - } - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - public String getRequestType() { - return this.requestType; - } - public void setRequestType(String requestType) { - this.requestType = requestType; - } - public String getVolumeGroupHeatStackId() { - return this.volumeGroupHeatStackId; - } - public void setVolumeGroupHeatStackId(String volumeGroupHeatStackId) { - this.volumeGroupHeatStackId = volumeGroupHeatStackId; - } - - public String getBaseGroupHeatStackId() { - return this.baseGroupHeatStackId; - } - public void setBaseGroupHeatStackId(String baseGroupHeatStackId) { - this.baseGroupHeatStackId = baseGroupHeatStackId; - } - - public boolean isBase() { - return this.isBase; - } - public void setIsBase(boolean isBase) { - this.isBase = isBase; - } - public String getVfModuleStackId() { - return this.vfModuleStackId; - } - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - public String getMode() { - return this.mode; - } - public void setMode(String mode) { - this.mode = mode; - } - @Override - public String toString() { - return "VnfRollback: cloud=" + cloudSiteId + ", tenant=" + tenantId + - ", vnf=" + vnfId + ", tenantCreated=" + tenantCreated + - ", vnfCreated=" + vnfCreated + ", requestType = " + requestType - + ", modelCustomizationUuid=" + this.modelCustomizationUuid - + ", mode=" + mode; - } -} \ No newline at end of file diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/VnfStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/VnfStatus.java deleted file mode 100644 index cc7e66eecb..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/beans/VnfStatus.java +++ /dev/null @@ -1,30 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.beans; - - -/* - * Enum status values to mirror the Openstack Heat stack status values - */ -public enum VnfStatus { - ACTIVE, FAILED, NOTFOUND, UNKNOWN -} - diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoAdapterException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoAdapterException.java deleted file mode 100644 index 454880cee1..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoAdapterException.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - - -/** - * General MSO Exception class for any non-specific errors. - * - * - */ -public class MsoAdapterException extends MsoException -{ - private static final long serialVersionUID = 1L; - - // Constructor to create a new MsoException instance - public MsoAdapterException (String message) { - super(message); - super.category = MsoExceptionCategory.INTERNAL; - } - - // Constructor to wrap a nested exception - public MsoAdapterException (String message, Throwable t) { - super(message, t); - super.category = MsoExceptionCategory.INTERNAL; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudIdentityNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudIdentityNotFound.java deleted file mode 100644 index 7e21d9d15a..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudIdentityNotFound.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - -/** - * Signals that an attempt to find a specific mso cloud identity has failed. - */ -public class MsoCloudIdentityNotFound extends MsoException { - - private static final long serialVersionUID = 2583769056266415665L; - - - /** - * Default constructor (needed for BPEL/JAXB) - */ - public MsoCloudIdentityNotFound () { - super("Cloud Identity not found"); - super.category=MsoExceptionCategory.USERDATA; - } - - public MsoCloudIdentityNotFound (String cloudIdentity) { - // Set the detailed error as the Exception 'message' - super("Cloud Identity [" + cloudIdentity + "] not found"); - super.category=MsoExceptionCategory.USERDATA; - } - - @Override - public String toString () { - return getMessage(); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFound.java deleted file mode 100644 index 7c6e98d55f..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFound.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - -/** - * Signals that an attempt to find a specific mso cloud site has failed. - */ -public class MsoCloudSiteNotFound extends MsoException { - - private static final long serialVersionUID = 2583769056266415664L; - - /** - * Default constructor (needed for BPEL/JAXB) - */ - public MsoCloudSiteNotFound () { - super("Cloud site not found"); - super.category=MsoExceptionCategory.USERDATA; - } - - public MsoCloudSiteNotFound (String cloudSite) { - // Set the detailed error as the Exception 'message' - super("Cloud Site [" + cloudSite + "] not found"); - super.category=MsoExceptionCategory.USERDATA; - } - - @Override - public String toString () { - return getMessage(); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java deleted file mode 100644 index b8a7a5571c..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - - -public abstract class MsoException extends Exception -{ - private static final long serialVersionUID = 1L; - - protected MsoExceptionCategory category = MsoExceptionCategory.INTERNAL; - protected String context = null; - - protected MsoException (String message) { - super(message); - } - - protected MsoException (String message, Throwable t) { - super(message,t); - } - - public MsoExceptionCategory getCategory() { - return category; - } - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public String getContext () { - return context; - } - public void setContext (String context) { - this.context = context; - } - public void addContext (String ctx) { - if (this.context != null) - this.context = ctx + ":" + this.context; - else - this.context = ctx; - } - - public String getContextMessage () { - if (this.context == null) - return getMessage(); - else - return "[" + context + "] " + getMessage(); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoExceptionCategory.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoExceptionCategory.java deleted file mode 100644 index 81a0edc2d3..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoExceptionCategory.java +++ /dev/null @@ -1,27 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - - -public enum MsoExceptionCategory { - OPENSTACK, IO, INTERNAL, USERDATA -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java deleted file mode 100644 index 9c7f6fa91a..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - -/** - * I/O exception - */ -public class MsoIOException extends MsoException -{ - - /** - * Serialization id. - */ - private static final long serialVersionUID = 6752445132721635760L; - - /** - * Basic constructor with message - * @param message the error message - */ - public MsoIOException (String message) { - super(message); - super.category = MsoExceptionCategory.IO; - } - - /** - * Constructor to wrap a nested exception - * @param message the error message - * @param t the cause - */ - public MsoIOException (String message, Throwable t) { - super (message, t); - super.category = MsoExceptionCategory.IO; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExists.java deleted file mode 100644 index 98b85394be..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExists.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - - -public class MsoNetworkAlreadyExists extends MsoOpenstackException { - - private static final long serialVersionUID = 1L; - - // Constructor to create a new MsoOpenstackException instance - public MsoNetworkAlreadyExists (String stack, String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(409, "Conflict", "Stack " + stack + " already exists in Tenant + " + tenant + " in Cloud " + cloud); - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFound.java deleted file mode 100644 index 5802aa1208..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFound.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - - -public class MsoNetworkNotFound extends MsoOpenstackException { - - private static final long serialVersionUID = 1L; - - // Constructor to create a new MsoOpenstackException instance - public MsoNetworkNotFound (String networkId, String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(404, "Not Found", "Network " + networkId + " does not exist in Cloud/Tenant " + cloud + "/" + tenant); - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java deleted file mode 100644 index eead8439d4..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java +++ /dev/null @@ -1,80 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - -/** - * OpenStack exception. - */ -public class MsoOpenstackException extends MsoException -{ - - /** - * Serialization id. - */ - private static final long serialVersionUID = 3313636124141766495L; - - private int statusCode; - private String statusMessage; - private String errorDetail; - - /** - * Constructor to create a new MsoOpenstackException instance - * @param code the error code - * @param message the error message - * @param detail error details - */ - public MsoOpenstackException (int code, String message, String detail) { - // Set the detailed error as the Exception 'message' - super(detail); - super.category = MsoExceptionCategory.OPENSTACK; - - this.statusCode = code; - this.statusMessage = message; - this.errorDetail = detail; - } - - /** - * Constructor to propagate the caught exception (mostly for stack trace) - * @param code the error code - * @param message the error message - * @param detail error details - * @param e the cause - */ - public MsoOpenstackException (int code, String message, String detail, Exception e) { - // Set the detailed error as the Exception 'message' - super(detail, e); - super.category = MsoExceptionCategory.OPENSTACK; - - this.statusCode = code; - this.statusMessage = message; - this.errorDetail = detail; - } - - @Override - public String toString() { - return statusCode + - " " + - statusMessage + - ": " + - errorDetail; - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExists.java deleted file mode 100644 index 2901b6b3a7..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExists.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - - -public class MsoStackAlreadyExists extends MsoOpenstackException { - - private static final long serialVersionUID = 1L; - - // Constructor to create a new MsoOpenstackException instance - public MsoStackAlreadyExists (String stack, String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(409, "Conflict", "Stack " + stack + " already exists in Tenant + " + tenant + " in Cloud " + cloud); - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFound.java deleted file mode 100644 index 21082a28c9..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFound.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - -/** - * Thrown when HEAT stack is not found or deleted. - */ -public class MsoStackNotFound extends MsoOpenstackException { - - /** - * Serialization id. - */ - private static final long serialVersionUID = 7354069716354359246L; - - /** - * Constructor to create a new MsoOpenstackException instance. - * @param stack the stack name - * @param tenant the tenant name - * @param cloud the cloud name - */ - public MsoStackNotFound (String stack, String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(404, "Not Found", "Stack " + stack + " does not exist in Cloud/Tenant " + cloud + "/" + tenant); - } -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExists.java deleted file mode 100644 index 7a597d6f4d..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExists.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - -public class MsoTenantAlreadyExists extends MsoOpenstackException { - - private static final long serialVersionUID = 1L; - - public MsoTenantAlreadyExists (String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(409, "Conflict", "Tenant " + tenant + " already exists in Cloud " + cloud); - } - -} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFound.java deleted file mode 100644 index f26d6b6d49..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFound.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ============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.openecomp.mso.openstack.exceptions; - - -/** - * Tenant not found exception. - */ -public class MsoTenantNotFound extends MsoOpenstackException { - - /** - * Serialization id. - */ - private static final long serialVersionUID = 5640069939645577063L; - - /** - * Constructor to create the exception - * @param tenant the tenant id - * @param cloud the cloud id - */ - public MsoTenantNotFound (String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(404, "Not Found", "Tenant " + tenant + " does not exist in Cloud " + cloud); - } -} -- cgit 1.2.3-korg