X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=esr-mgr%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fesr%2Futil%2FThirdpartySdncManagerUtil.java;h=19448aff15751c14ead857c17d8d0a20536517a6;hb=06fe3f5d62f9b986ebb8babf6fb140baed44769f;hp=d0f61cac5a46c5a44f35b21c07d6129e19502f10;hpb=6011cbc9b4031f3ce25a82ccb1c0fedf4a2bf57a;p=aai%2Fesr-server.git diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java index d0f61ca..19448af 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java @@ -16,7 +16,7 @@ package org.onap.aai.esr.util; import java.util.ArrayList; - +import java.util.List; import org.onap.aai.esr.common.SystemType; import org.onap.aai.esr.entity.aai.EsrSystemInfo; import org.onap.aai.esr.entity.aai.EsrSystemInfoList; @@ -24,51 +24,51 @@ import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail; import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo; public class ThirdpartySdncManagerUtil { - private static ExtsysUtil extsysUtil = new ExtsysUtil(); - - public EsrThirdpartySdncDetail sdncRegisterInfo2EsrSdnc(ThirdpartySdncRegisterInfo sdncRegisterInfo) { - EsrThirdpartySdncDetail esrThirdpartySdnc = new EsrThirdpartySdncDetail(); - sdncRegisterInfo.setThirdpartySdncId(extsysUtil.generateId()); - esrThirdpartySdnc.setThirdpartySdncId(sdncRegisterInfo.getThirdpartySdncId()); - esrThirdpartySdnc.setLocation(sdncRegisterInfo.getLocation()); - esrThirdpartySdnc.setProductName(sdncRegisterInfo.getProductName()); - esrThirdpartySdnc.setEsrSystemInfoList(getEsrSystemInfoList(sdncRegisterInfo)); - return esrThirdpartySdnc; - } - - private EsrSystemInfoList getEsrSystemInfoList(ThirdpartySdncRegisterInfo sdncRegisterInfo) { - EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - ArrayList esrSystemInfo = new ArrayList(); - EsrSystemInfo authInfo = new EsrSystemInfo(); - authInfo.setEsrSystemInfoId(extsysUtil.generateId()); - authInfo.setVersion(sdncRegisterInfo.getVersion()); - authInfo.setSystemName(sdncRegisterInfo.getName()); - authInfo.setServiceUrl(sdncRegisterInfo.getUrl()); - authInfo.setVendor(sdncRegisterInfo.getVendor()); - authInfo.setType(sdncRegisterInfo.getType()); - authInfo.setUserName(sdncRegisterInfo.getUserName()); - authInfo.setPassword(sdncRegisterInfo.getPassword()); - authInfo.setProtocol(sdncRegisterInfo.getProtocol()); - authInfo.setSystemType(SystemType.thirdparty_SDNC.toString()); - esrSystemInfo.add(authInfo); - esrSystemInfoList.setEsrSystemInfo(esrSystemInfo); - return esrSystemInfoList; - } + private static ExtsysUtil extsysUtil = new ExtsysUtil(); + + public EsrThirdpartySdncDetail sdncRegisterInfo2EsrSdnc(ThirdpartySdncRegisterInfo sdncRegisterInfo) { + EsrThirdpartySdncDetail esrThirdpartySdnc = new EsrThirdpartySdncDetail(); + sdncRegisterInfo.setThirdpartySdncId(extsysUtil.generateId()); + esrThirdpartySdnc.setThirdpartySdncId(sdncRegisterInfo.getThirdpartySdncId()); + esrThirdpartySdnc.setLocation(sdncRegisterInfo.getLocation()); + esrThirdpartySdnc.setProductName(sdncRegisterInfo.getProductName()); + esrThirdpartySdnc.setEsrSystemInfoList(getEsrSystemInfoList(sdncRegisterInfo)); + return esrThirdpartySdnc; + } + + private EsrSystemInfoList getEsrSystemInfoList(ThirdpartySdncRegisterInfo sdncRegisterInfo) { + EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); + List esrSystemInfo = new ArrayList<>(); + EsrSystemInfo authInfo = new EsrSystemInfo(); + authInfo.setEsrSystemInfoId(extsysUtil.generateId()); + authInfo.setVersion(sdncRegisterInfo.getVersion()); + authInfo.setSystemName(sdncRegisterInfo.getName()); + authInfo.setServiceUrl(sdncRegisterInfo.getUrl()); + authInfo.setVendor(sdncRegisterInfo.getVendor()); + authInfo.setType(sdncRegisterInfo.getType()); + authInfo.setUserName(sdncRegisterInfo.getUserName()); + authInfo.setPassword(sdncRegisterInfo.getPassword()); + authInfo.setProtocol(sdncRegisterInfo.getProtocol()); + authInfo.setSystemType(SystemType.thirdparty_SDNC.toString()); + esrSystemInfo.add(authInfo); + esrSystemInfoList.setEsrSystemInfo(esrSystemInfo); + return esrSystemInfoList; + } - public ThirdpartySdncRegisterInfo esrSdnc2SdncRegisterInfo(EsrThirdpartySdncDetail esrSdnc) { - ThirdpartySdncRegisterInfo registerSdncInfo = new ThirdpartySdncRegisterInfo(); - EsrSystemInfo esrSystemInfo = esrSdnc.getEsrSystemInfoList().getEsrSystemInfo().get(0); - registerSdncInfo.setThirdpartySdncId(esrSdnc.getThirdpartySdncId()); - registerSdncInfo.setLocation(esrSdnc.getLocation()); - registerSdncInfo.setProductName(esrSdnc.getProductName()); - registerSdncInfo.setName(esrSystemInfo.getSystemName()); - registerSdncInfo.setPassword(esrSystemInfo.getPassword()); - registerSdncInfo.setProtocol(esrSystemInfo.getProtocol()); - registerSdncInfo.setType(esrSystemInfo.getType()); - registerSdncInfo.setUrl(esrSystemInfo.getServiceUrl()); - registerSdncInfo.setUserName(esrSystemInfo.getUserName()); - registerSdncInfo.setVendor(esrSystemInfo.getVendor()); - registerSdncInfo.setVersion(esrSystemInfo.getVersion()); - return registerSdncInfo; - } + public ThirdpartySdncRegisterInfo esrSdnc2SdncRegisterInfo(EsrThirdpartySdncDetail esrSdnc) { + ThirdpartySdncRegisterInfo registerSdncInfo = new ThirdpartySdncRegisterInfo(); + EsrSystemInfo esrSystemInfo = esrSdnc.getEsrSystemInfoList().getEsrSystemInfo().get(0); + registerSdncInfo.setThirdpartySdncId(esrSdnc.getThirdpartySdncId()); + registerSdncInfo.setLocation(esrSdnc.getLocation()); + registerSdncInfo.setProductName(esrSdnc.getProductName()); + registerSdncInfo.setName(esrSystemInfo.getSystemName()); + registerSdncInfo.setPassword(esrSystemInfo.getPassword()); + registerSdncInfo.setProtocol(esrSystemInfo.getProtocol()); + registerSdncInfo.setType(esrSystemInfo.getType()); + registerSdncInfo.setUrl(esrSystemInfo.getServiceUrl()); + registerSdncInfo.setUserName(esrSystemInfo.getUserName()); + registerSdncInfo.setVendor(esrSystemInfo.getVendor()); + registerSdncInfo.setVersion(esrSystemInfo.getVersion()); + return registerSdncInfo; + } }