use of org.pentaho.ui.database.event.DefaultDatabaseConnectionList in project data-access by pentaho.
the class DatabaseConnectionListReaderWriter method readFrom.
@Override
public IDatabaseConnectionList readFrom(Class<IDatabaseConnectionList> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException {
JSONDeserializer<DefaultDatabaseConnectionList> jsonD = new JSONDeserializer<DefaultDatabaseConnectionList>();
jsonD.use("databaseType", DatabaseType.class);
return jsonD.deserialize(new InputStreamReader(entityStream), DefaultDatabaseConnectionList.class);
}
use of org.pentaho.ui.database.event.DefaultDatabaseConnectionList in project data-access by pentaho.
the class ConnectionService method getConnections.
/**
* Returns the list of database connections
*
* @return List of database connections
*
* @throws ConnectionServiceException
*/
@GET
@Path("/list")
@Produces({ APPLICATION_JSON })
@Facet(name = "Unsupported")
public IDatabaseConnectionList getConnections() throws ConnectionServiceException {
IDatabaseConnectionList databaseConnections = new DefaultDatabaseConnectionList();
List<IDatabaseConnection> conns = connectionService.getConnections(true);
databaseConnections.setDatabaseConnections(conns);
return databaseConnections;
}
Aggregations