* ============LICENSE_END=========================================================
*/
-package org.openecomp.appc.adapter.netconf.internal;
+package org.onap.appc.adapter.netconf.internal;
-import javax.sql.rowset.CachedRowSet;
-
-import org.openecomp.appc.adapter.netconf.ConnectionDetails;
-import org.openecomp.appc.adapter.netconf.NetconfConnectionDetails;
-import org.openecomp.appc.adapter.netconf.NetconfDataAccessService;
-import org.openecomp.appc.adapter.netconf.exception.DataAccessException;
-import org.openecomp.appc.adapter.netconf.util.Constants;
-import org.openecomp.appc.exceptions.APPCException;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-import org.openecomp.sdnc.sli.resource.dblib.DbLibService;
+import org.onap.appc.adapter.netconf.ConnectionDetails;
+import org.onap.appc.adapter.netconf.NetconfConnectionDetails;
+import org.onap.appc.adapter.netconf.NetconfDataAccessService;
+import org.onap.appc.adapter.netconf.exception.DataAccessException;
+import org.onap.appc.adapter.netconf.util.Constants;
+import org.onap.ccsdk.sli.core.dblib.DbLibService;
+import javax.sql.rowset.CachedRowSet;
import java.sql.SQLException;
import java.util.ArrayList;
-
public class NetconfDataAccessServiceImpl implements NetconfDataAccessService {
private static EELFLogger logger = EELFManager.getInstance().getLogger(NetconfDataAccessServiceImpl.class);
argList.add(xmlID);
try {
-
final CachedRowSet data = dbLibService.getData(queryString, argList, schema);
if (data.first()) {
fileContent = data.getString(Constants.FILE_CONTENT_TABLE_FIELD_NAME);
}
-
- } catch (Throwable e) {
+ } catch (Exception e) {
logger.error("Error Accessing Database " + e);
throw new DataAccessException(e);
}
DataAccessException {
boolean recordFound = false;
- String queryString = "select " + Constants.USER_NAME_TABLE_FIELD_NAME + "," + Constants.PASSWORD_TABLE_FIELD_NAME + "," + Constants.PORT_NUMBER_TABLE_FIELD_NAME + " " +
+ String queryString = "select " + Constants.USER_NAME_TABLE_FIELD_NAME + "," +
+ Constants.PASSWORD_TABLE_FIELD_NAME + "," + Constants.PORT_NUMBER_TABLE_FIELD_NAME + " " +
"from " + Constants.DEVICE_AUTHENTICATION_TABLE_NAME + " " +
"where " + Constants.VNF_TYPE_TABLE_FIELD_NAME + " = ?";
argList.add(vnfType);
try {
-
final CachedRowSet data = dbLibService.getData(queryString, argList, schema);
if (data.first()) {
connectionDetails.setUsername(data.getString(Constants.USER_NAME_TABLE_FIELD_NAME));
connectionDetails.setPort(data.getInt(Constants.PORT_NUMBER_TABLE_FIELD_NAME));
recordFound = true;
}
-
} catch (SQLException e) {
logger.error("Error Accessing Database " + e);
throw new DataAccessException(e);
}
@Override
- public boolean retrieveNetconfConnectionDetails(String vnfType, NetconfConnectionDetails connectionDetails) throws
- DataAccessException
- {
+ public boolean retrieveNetconfConnectionDetails(String vnfType, NetconfConnectionDetails connectionDetails)
+ throws DataAccessException {
ConnectionDetails connDetails = new ConnectionDetails();
if(this.retrieveConnectionDetails(vnfType, connDetails))
{
}
@Override
- public boolean logDeviceInteraction(String instanceId, String requestId, String creationDate, String logText) throws
- DataAccessException {
-
+ public boolean logDeviceInteraction(String instanceId, String requestId, String creationDate, String logText)
+ throws DataAccessException {
String queryString = "INSERT INTO "+ Constants.DEVICE_INTERFACE_LOG_TABLE_NAME+"("+
Constants.SERVICE_INSTANCE_ID_FIELD_NAME+","+
Constants.REQUEST_ID_FIELD_NAME+","+
argList.add(logText);
try {
-
dbLibService.writeData(queryString, argList, schema);
-
} catch (SQLException e) {
logger.error("Logging Device interaction failed - "+ queryString);
throw new DataAccessException(e);