class DataSetService extends BaseDataSetService {

    @RequestMapping(value = "/datasets/{id}/metadata", method = RequestMethod.GET)
    @ApiOperation(value = "Get metadata information of a data set by id",
            notes = "Get metadata information of a data set by id. Not valid or non existing data set id returns empty content.")
    @Timed
    @ResponseBody
    public DataSet getMetadata(@PathVariable(value = "id") @ApiParam(name = "id",
            value = "Id of the data set metadata") String dataSetId) {
        if (dataSetId == null) {
            HttpResponseContext.status(HttpStatus.NO_CONTENT);
            return null;
        }

        LOG.debug("get dataset metadata for {}", dataSetId);

        DataSetMetadata metadata;
        securityProxy.asTechnicalUserForDataSet();
        try {
            metadata = dataSetMetadataRepository.get(dataSetId);
        } finally {
            securityProxy.releaseIdentity();
        }
        if (metadata == null) {
            throw new TDPException(DataSetErrorCodes.DATASET_DOES_NOT_EXIST, build().put("id", dataSetId));
        }

        if (!metadata.getLifecycle().schemaAnalyzed()) {
            LOG.warn("Schema analyzed is not finished for #{}", dataSetId);
        }

        DataSet dataSet = new DataSet();
        dataSet.setMetadata(conversionService.convert(metadata, UserDataSetMetadata.class));
        LOG.debug("found dataset {} for #{}", dataSet.getMetadata().getName(), dataSetId);
        return dataSet;
    }

}