Search in sources :

Example 1 with VersionsSupplier

use of org.talend.dataprep.api.service.version.VersionsSupplier in project data-prep by Talend.

the class VersionServiceAPI method allVersions.

/**
 * Returns all the versions of the different services (api, dataset, preparation and transformation) and the global
 * application version.
 *
 * @return an array of service versions
 */
@RequestMapping(value = "/api/version", method = GET)
@ApiOperation(value = "Get the version of all services (including underlying low level services)", produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
@PublicAPI
public BuildDetails allVersions() {
    List<Version> versions = new ArrayList<>();
    for (VersionsSupplier versionsSupplier : versionsSuppliers) {
        versions.addAll(versionsSupplier.getVersions());
    }
    CollectionUtils.filter(versions, PredicateUtils.notNullPredicate());
    return new BuildDetails(applicationVersion, versions.toArray(new Version[versions.size()]));
}
Also used : BuildDetails(org.talend.dataprep.info.BuildDetails) Version(org.talend.dataprep.info.Version) ArrayList(java.util.ArrayList) VersionsSupplier(org.talend.dataprep.api.service.version.VersionsSupplier) Timed(org.talend.dataprep.metrics.Timed) ApiOperation(io.swagger.annotations.ApiOperation) PublicAPI(org.talend.dataprep.security.PublicAPI) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 ArrayList (java.util.ArrayList)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 VersionsSupplier (org.talend.dataprep.api.service.version.VersionsSupplier)1 BuildDetails (org.talend.dataprep.info.BuildDetails)1 Version (org.talend.dataprep.info.Version)1 Timed (org.talend.dataprep.metrics.Timed)1 PublicAPI (org.talend.dataprep.security.PublicAPI)1