-/*\r
- * ============LICENSE_START========================================================================\r
- * ONAP : tr-069-adapter\r
- * =================================================================================================\r
- * Copyright (C) 2020 CommScope Inc Intellectual Property.\r
- * =================================================================================================\r
- * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,\r
- * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You\r
- * may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\r
- * either express or implied. See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ===============LICENSE_END=======================================================================\r
- */\r
-\r
-package org.commscope.tr069adapter.acs.requestprocessor.util;\r
-\r
-import java.util.Date;\r
-\r
-import org.commscope.tr069adapter.acs.common.dto.TR069DeviceDetails;\r
-import org.commscope.tr069adapter.acs.requestprocessor.entity.TR069DeviceEntity;\r
-\r
-public class TR069NBIUtility {\r
-\r
- private TR069NBIUtility() {\r
- super();\r
- }\r
-\r
- /**\r
- * A utility method to convert the DTO to Domain object\r
- * \r
- * @param tr069DeviceDetails\r
- * @return\r
- */\r
-\r
- public static TR069DeviceEntity convertToEntity(TR069DeviceDetails tr069DeviceDetails) {\r
- TR069DeviceEntity tr069DeviceEntity = new TR069DeviceEntity();\r
- tr069DeviceEntity.setDeviceId(tr069DeviceDetails.getDeviceId());\r
- tr069DeviceEntity.setUserName(tr069DeviceDetails.getUsername());\r
- tr069DeviceEntity.setPassword(tr069DeviceDetails.getPassword());\r
- tr069DeviceEntity.setLastUpdatedTime(new Date());\r
-\r
- if (tr069DeviceDetails.getConnectionRequestURL() != null) {\r
- tr069DeviceEntity.setConnectionReqURL(tr069DeviceDetails.getConnectionRequestURL());\r
- }\r
- if (tr069DeviceDetails.getSoftwareVersion() != null) {\r
- tr069DeviceEntity.setSwVersion(tr069DeviceDetails.getSoftwareVersion());\r
- }\r
- if (tr069DeviceDetails.getHardwareVersion() != null) {\r
- tr069DeviceEntity.setHwVersion(tr069DeviceDetails.getHardwareVersion());\r
- }\r
-\r
- return tr069DeviceEntity;\r
- }\r
-\r
- /**\r
- * A utility method to convert the Domain object to DTO\r
- * \r
- * @param entity\r
- * @return\r
- */\r
- public static TR069DeviceDetails convertToDTO(TR069DeviceEntity entity) {\r
- TR069DeviceDetails tr069DeviceDetails = new TR069DeviceDetails();\r
-\r
- tr069DeviceDetails.setDeviceId(entity.getDeviceId());\r
- tr069DeviceDetails.setUsername(entity.getUserName());\r
- tr069DeviceDetails.setPassword(entity.getPassword());\r
- tr069DeviceDetails.setSoftwareVersion(entity.getSwVersion());\r
- tr069DeviceDetails.setHardwareVersion(entity.getHwVersion());\r
- tr069DeviceDetails.setConnectionRequestURL(entity.getConnectionReqURL());\r
-\r
- return tr069DeviceDetails;\r
- }\r
-\r
-}\r
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : tr-069-adapter
+ * =================================================================================================
+ * Copyright (C) 2020 CommScope Inc Intellectual Property.
+ * =================================================================================================
+ * This tr-069-adapter software file is distributed by CommScope Inc 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
+ *
+ * This file 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.commscope.tr069adapter.acs.requestprocessor.util;
+
+import java.util.Date;
+
+import org.commscope.tr069adapter.acs.common.dto.TR069DeviceDetails;
+import org.commscope.tr069adapter.acs.requestprocessor.entity.TR069DeviceEntity;
+
+public class TR069NBIUtility {
+
+ private TR069NBIUtility() {
+ super();
+ }
+
+ /**
+ * A utility method to convert the DTO to Domain object
+ *
+ * @param tr069DeviceDetails
+ * @return
+ */
+
+ public static TR069DeviceEntity convertToEntity(TR069DeviceDetails tr069DeviceDetails) {
+ TR069DeviceEntity tr069DeviceEntity = new TR069DeviceEntity();
+ tr069DeviceEntity.setDeviceId(tr069DeviceDetails.getDeviceId());
+ tr069DeviceEntity.setUserName(tr069DeviceDetails.getUsername());
+ tr069DeviceEntity.setPassword(tr069DeviceDetails.getPassword());
+ tr069DeviceEntity.setLastUpdatedTime(new Date());
+ tr069DeviceEntity.setConnStatus(true);
+ tr069DeviceEntity.setErrorMsg(null);
+
+ if (tr069DeviceDetails.getConnectionRequestURL() != null) {
+ tr069DeviceEntity.setConnectionReqURL(tr069DeviceDetails.getConnectionRequestURL());
+ }
+ if (tr069DeviceDetails.getSoftwareVersion() != null) {
+ tr069DeviceEntity.setSwVersion(tr069DeviceDetails.getSoftwareVersion());
+ }
+ if (tr069DeviceDetails.getHardwareVersion() != null) {
+ tr069DeviceEntity.setHwVersion(tr069DeviceDetails.getHardwareVersion());
+ }
+
+ return tr069DeviceEntity;
+ }
+
+ /**
+ * A utility method to convert the Domain object to DTO
+ *
+ * @param entity
+ * @return
+ */
+ public static TR069DeviceDetails convertToDTO(TR069DeviceEntity entity) {
+ TR069DeviceDetails tr069DeviceDetails = new TR069DeviceDetails();
+
+ tr069DeviceDetails.setDeviceId(entity.getDeviceId());
+ tr069DeviceDetails.setUsername(entity.getUserName());
+ tr069DeviceDetails.setPassword(entity.getPassword());
+ tr069DeviceDetails.setSoftwareVersion(entity.getSwVersion());
+ tr069DeviceDetails.setHardwareVersion(entity.getHwVersion());
+ tr069DeviceDetails.setConnectionRequestURL(entity.getConnectionReqURL());
+
+ return tr069DeviceDetails;
+ }
+
+}