diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2020-02-28 08:23:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-02-28 08:23:35 +0000 |
commit | 193879d40aaf11af615ff4daffbf4c17caaa6227 (patch) | |
tree | 542a93d56aa2d6d02be8e29ca42f269364bafb94 /adapters/mso-requests-db-adapter/src/main/java/org/onap | |
parent | 3139a60fab32caaa0d7c96ba87115309cd255ee8 (diff) | |
parent | 2363c37d07e37317252e843c28f410519f83588d (diff) |
Merge "Modification of VFC adapter code to make it SOL005 compliant"
Diffstat (limited to 'adapters/mso-requests-db-adapter/src/main/java/org/onap')
2 files changed, 54 insertions, 0 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java index 110fc6c03e..84ff054a7c 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java @@ -26,6 +26,7 @@ import javax.jws.WebService; import javax.xml.bind.annotation.XmlElement; import org.onap.so.adapters.requestsdb.exceptions.MsoRequestsDbException; import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.db.request.beans.InstanceNfvoMapping; import org.onap.so.db.request.beans.ResourceOperationStatus; /** @@ -55,6 +56,20 @@ public interface MsoRequestsDbAdapter { throws MsoRequestsDbException; @WebMethod + public void setInstanceNfvoMappingRepository( + @WebParam(name = "instanceId") @XmlElement(required = true) String instanceId, + @WebParam(name = "nfvoName") @XmlElement(required = true) String nfvoName, + @WebParam(name = "endpoint") @XmlElement(required = true) String endpoint, + @WebParam(name = "username") @XmlElement(required = true) String username, + @WebParam(name = "password") @XmlElement(required = true) String password, + @WebParam(name = "apiRoot") @XmlElement(required = false) String apiRoot) throws MsoRequestsDbException; + + @WebMethod + public InstanceNfvoMapping getInstanceNfvoMapping( + @WebParam(name = "instanceId") @XmlElement(required = true) String instanceId) + throws MsoRequestsDbException; + + @WebMethod public InfraActiveRequests getInfraRequest( @WebParam(name = "requestId") @XmlElement(required = true) String requestId) throws MsoRequestsDbException; diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java index 085a255948..052a53bb1f 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java @@ -31,12 +31,14 @@ import org.onap.so.adapters.requestsdb.exceptions.MsoRequestsDbException; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.beans.OperationStatus; import org.onap.so.db.request.beans.ResourceOperationStatus; +import org.onap.so.db.request.beans.InstanceNfvoMapping; import org.onap.so.db.request.beans.ResourceOperationStatusId; import org.onap.so.db.request.beans.SiteStatus; import org.onap.so.db.request.data.repository.InfraActiveRequestsRepository; import org.onap.so.db.request.data.repository.OperationStatusRepository; import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository; import org.onap.so.db.request.data.repository.SiteStatusRepository; +import org.onap.so.db.request.data.repository.InstanceNfvoMappingRepository; import org.onap.so.logger.ErrorCode; import org.onap.so.requestsdb.RequestsDbConstant; import org.slf4j.Logger; @@ -59,6 +61,9 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { private InfraActiveRequestsRepository infraActive; @Autowired + private InstanceNfvoMappingRepository instanceNfvoMappingRepository; + + @Autowired private SiteStatusRepository siteRepo; @Autowired @@ -69,6 +74,40 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { @Transactional @Override + public void setInstanceNfvoMappingRepository(String instanceId, String nfvoName, String endpoint, String username, + String password, String apiRoot) { + InstanceNfvoMapping instanceNfvoMapping = new InstanceNfvoMapping(); + if (apiRoot != null) { + instanceNfvoMapping.setApiRoot(apiRoot); + } + if (endpoint != null) { + instanceNfvoMapping.setEndpoint(endpoint); + } + if (instanceId != null) { + instanceNfvoMapping.setInstanceId(instanceId); + } + if (nfvoName != null) { + instanceNfvoMapping.setNfvoName(nfvoName); + } + if (username != null) { + instanceNfvoMapping.setUsername(username); + } + if (password != null) { + instanceNfvoMapping.setPassword(password); + } + + instanceNfvoMappingRepository.save(instanceNfvoMapping); + } + + @Transactional + @Override + public InstanceNfvoMapping getInstanceNfvoMapping(String instanceId) { + InstanceNfvoMapping instanceNfvoMapping = instanceNfvoMappingRepository.findOneByInstanceId(instanceId); + return instanceNfvoMapping; + } + + @Transactional + @Override public void updateInfraRequest(String requestId, String lastModifiedBy, String statusMessage, String responseBody, RequestStatusType requestStatus, String progress, String vnfOutputs, String serviceInstanceId, String networkId, String vnfId, String vfModuleId, String volumeGroupId, String serviceInstanceName, |