Search in sources :

Example 31 with ClientWrapper

use of io.hops.hopsworks.common.util.ClientWrapper in project hopsworks by logicalclocks.

the class HopssiteController method details.

public SearchServiceDTO.ItemDetails details(String publicDSId) throws DelaException {
    checkHopssiteReady();
    try {
        ClientWrapper client = getClient(HopsSite.DatasetService.details(publicDSId), String.class);
        LOG.log(Settings.DELA_DEBUG, "hops-site:dataset - {0}", client.getFullPath());
        String auxResult = (String) client.doGet();
        SearchServiceDTO.ItemDetails result = new Gson().fromJson(auxResult, SearchServiceDTO.ItemDetails.class);
        LOG.log(Settings.DELA_DEBUG, "hops-site:dataset:done - {0}", client.getFullPath());
        return result;
    } catch (IllegalStateException ise) {
        throw new DelaException(RESTCodes.DelaErrorCode.COMMUNICATION_FAILURE, Level.SEVERE, DelaException.Source.HOPS_SITE, null, ise.getMessage(), ise);
    }
}
Also used : Gson(com.google.gson.Gson) DelaException(io.hops.hopsworks.exceptions.DelaException) ClientWrapper(io.hops.hopsworks.common.util.ClientWrapper) SearchServiceDTO(io.hops.hopsworks.dela.dto.hopssite.SearchServiceDTO)

Aggregations

ClientWrapper (io.hops.hopsworks.common.util.ClientWrapper)31 DelaException (io.hops.hopsworks.exceptions.DelaException)31 Gson (com.google.gson.Gson)3 UserDTO (io.hops.hopsworks.dela.dto.common.UserDTO)3 ClusterServiceDTO (io.hops.hopsworks.dela.dto.hopssite.ClusterServiceDTO)2 HopsSiteDatasetDTO (io.hops.hopsworks.dela.dto.hopssite.HopsSiteDatasetDTO)2 RatingDTO (io.hops.hopsworks.dela.dto.hopssite.RatingDTO)2 SearchServiceDTO (io.hops.hopsworks.dela.dto.hopssite.SearchServiceDTO)2 FilePreviewDTO (io.hops.hopsworks.common.dataset.FilePreviewDTO)1 DatasetDTO (io.hops.hopsworks.dela.dto.hopssite.DatasetDTO)1 List (java.util.List)1