if (dSource instanceof JNDIDataSourceEntry && getType().equals(CUSTOM_TYPE)) {
setJndiStatusError();
} else if (dSource instanceof JDBCDataSourceEntry && getType().equals(JNDI_TYPE)) {
setJdbcStatusError();
} else if (dSource instanceof JNDIDataSourceEntry && getType().equals(JNDI_TYPE)) {
JNDIDataSourceEntry jndiDS = (JNDIDataSourceEntry) dSource;
fillValues(jndiDS);
jndiDS.save();
} else if (dSource instanceof JDBCDataSourceEntry && getType().equals(CUSTOM_TYPE)) {
JDBCDataSourceEntry polyDS = (JDBCDataSourceEntry) dSource;
fillValues(polyDS);
polyDS.save();
}
}
}
// Create a DataSource
else {
if (getType().equals(JNDI_TYPE)) {
JNDIDataSourceEntry jndiDS = new JNDIDataSourceEntry();
fillValues(jndiDS);
jndiDS.save();
} else if (getType().equals(CUSTOM_TYPE)) {
JDBCDataSourceEntry polyDS = new JDBCDataSourceEntry();
fillValues(polyDS);
polyDS.save();