use of org.pentaho.platform.web.http.api.resources.JaxbList in project data-access by pentaho.
the class JDBCDatasourceResource method getConnectionIDs.
/**
* Get a list of JDBC datasource IDs.
*
* <p><b>Example Request:</b><br />
* GET pentaho/plugin/data-access/api/datasource/jdbc/connection
* </p>
*
* @return A list of JDBC datasource IDs.
*
* <p><b>Example Response:</b></p>
* <pre function="syntax.xml">
* {
* "Item": [
* {
* "@type": "xs:string",
* "$": "AgileBI"
* },
* {
* "@type": "xs:string",
* "$": "Audit"
* },
* {
* "@type": "xs:string",
* "$": "SampleData"
* },
* {
* "@type": "xs:string",
* "$": "TestDataSourceResource"
* },
* {
* "@type": "xs:string",
* "$": "baseball connection"
* },
* {
* "@type": "xs:string",
* "$": "baseball connection"
* },
* {
* "@type": "xs:string",
* "$": "live_logging_info"
* },
* {
* "@type": "xs:string",
* "$": "pentaho_operations_mart"
* }
* ]
* }
* </pre>
*/
@GET
@Path("/")
@Produces({ APPLICATION_JSON, APPLICATION_XML })
@StatusCodes({ @ResponseCode(code = 200, condition = "Successfully retrieved the list of JDBC datasource IDs"), @ResponseCode(code = 500, condition = "Internal error retrieving JDBC datasource IDs") })
public JaxbList<String> getConnectionIDs() {
List<String> connStrList = new ArrayList<String>();
try {
List<IDatabaseConnection> conns = service.getConnections();
for (IDatabaseConnection conn : conns) {
conn.setPassword(null);
connStrList.add(conn.getName());
}
} catch (ConnectionServiceException e) {
logger.error("Error " + e.getMessage());
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
}
JaxbList<String> connections = new JaxbList<String>(connStrList);
return connections;
}
use of org.pentaho.platform.web.http.api.resources.JaxbList in project data-access by pentaho.
the class DataSourcePublishIT method checkMetadata.
private void checkMetadata(WebResource webResource, String domainID, boolean hasAccess) {
final JaxbList metadataDatasourceIds = webResource.path(DATA_ACCESS_API_DATASOURCE_METADATA + "ids").get(JaxbList.class);
final List list = metadataDatasourceIds.getList();
if (hasAccess) {
assertTrue(list != null && list.contains(domainID));
} else if (list != null) {
assertFalse(list.contains(domainID));
}
}
use of org.pentaho.platform.web.http.api.resources.JaxbList in project data-access by pentaho.
the class DataSourcePublishIT method checkAnalysis.
private void checkAnalysis(WebResource webResource, String catalogID, boolean hasAccess) {
final JaxbList analysisDatasourceIds = webResource.path(DATA_ACCESS_API_DATASOURCE_ANALYSIS + "ids").get(JaxbList.class);
final List list = analysisDatasourceIds.getList();
if (hasAccess) {
assertTrue(list != null && list.contains(catalogID));
} else if (list != null) {
assertFalse(list.contains(catalogID));
}
}
use of org.pentaho.platform.web.http.api.resources.JaxbList in project data-access by pentaho.
the class DataSourcePublishIT method checkDSW.
private void checkDSW(WebResource webResource, String domainID, boolean hasAccess) {
final JaxbList dswIds = webResource.path(DATA_ACCESS_API_DATASOURCE_DSW + "ids").get(JaxbList.class);
final List list = dswIds.getList();
if (hasAccess) {
assertTrue(list != null && list.contains(domainID));
} else if (list != null) {
assertFalse(list.contains(domainID));
}
}
Aggregations