String datastoreName = "resttestpostgis";
String description = "description";
String dsNamespace = "http://www.geo-solutions.it";
GSPostGISDatastoreEncoder datastoreEncoder = new GSPostGISDatastoreEncoder(datastoreName);
datastoreEncoder.setDescription(description);
datastoreEncoder.setNamespace(dsNamespace);
String pgHost = System.getProperty("pgHost", "localhost");
int pgPort = Integer.parseInt(System.getProperty("pgPort", "5432"));
String pgDatabase = System.getProperty("pgDatabase", "test");
String pgSchema = System.getProperty("pgSchema", "public");
String pgUser = System.getProperty("pgUser", "utest");
String pgPassword = System.getProperty("pgPassword", "ptest");
datastoreEncoder.setHost(pgHost);
datastoreEncoder.setPort(pgPort);
datastoreEncoder.setDatabase(pgDatabase);
datastoreEncoder.setSchema(pgSchema);
datastoreEncoder.setUser(pgUser);
datastoreEncoder.setPassword(pgPassword);
datastoreEncoder.setExposePrimaryKeys(exposePrimaryKeys);
datastoreEncoder.setValidateConnections(validateConnections);
datastoreEncoder.setPrimaryKeyMetadataTable(primaryKeyMetadataTable);
return datastoreEncoder;
}