geosolutions-it / geoserver-manager

Java client library for GeoServer
MIT License
253 stars 192 forks source link

Insufficient handling of JNDI based database datastore #143

Open r0bb3n opened 9 years ago

r0bb3n commented 9 years ago

I use a Oracle NG (JNDI) datastore which does not have the config parameter database. Thus the retrieved RESTDataStore does not contain this connection parameter which leads to an IllegalArgumentException because of a not null check in the according constructor.

    public GSOracleNGDatastoreEncoder(RESTDataStore store) {
        super(store);

        // Check mandatory parameter validity
        ensureValidDatabase(store.getConnectionParameters().get("database")); // <- IllegalArgumentException !
    }

I think a separation of all JNDI and non-JNDI database datastores would be a better approach due to their differences (more or less available setters for optional/required parameters).

mbarto commented 9 years ago

I agree. If you already worked on it and would like to prepare a pull request, it would be much appreciated.