use of io.hops.hopsworks.dela.dto.hopssite.RatingDTO in project hopsworks by logicalclocks.
the class HopssiteController method getDatasetAllRating.
// **************************************************RATING PUBLIC*****************************************************
public RatingDTO getDatasetAllRating(String publicDSId) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.RatingService.getDatasetAllRating(publicDSId), RatingDTO.class);
LOG.log(Settings.DELA_DEBUG, "hops-site:rating:get:all - {0}", client.getFullPath());
RatingDTO result = (RatingDTO) client.doGet();
LOG.log(Settings.DELA_DEBUG, "hops-site:rating:get:all - 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);
}
}
use of io.hops.hopsworks.dela.dto.hopssite.RatingDTO in project hopsworks by logicalclocks.
the class HopssiteController method getDatasetUserRating.
// **************************************************RATING CLUSTER****************************************************
public RatingDTO getDatasetUserRating(String publicCId, String publicDSId, String email) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.RatingService.getDatasetUserRating(publicCId, publicDSId), RatingDTO.class).setPayload(email);
LOG.log(Settings.DELA_DEBUG, "hops-site:rating:get:user - {0}", client.getFullPath());
RatingDTO result = (RatingDTO) client.doPost();
LOG.log(Settings.DELA_DEBUG, "hops-site:rating:get:user - 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);
}
}
use of io.hops.hopsworks.dela.dto.hopssite.RatingDTO in project hopsworks by logicalclocks.
the class RatingService method getDatasetAllRating.
private Response getDatasetAllRating() throws DelaException {
LOGGER.log(Settings.DELA_DEBUG, "hops-site:rating:get:all {0}", publicDSId);
RatingDTO rating = hopsSite.getDatasetAllRating(publicDSId);
LOGGER.log(Settings.DELA_DEBUG, "hops-site:rating:get:all - done {0}", publicDSId);
return noCacheResponse.getNoCacheResponseBuilder(Response.Status.OK).entity(rating).build();
}
use of io.hops.hopsworks.dela.dto.hopssite.RatingDTO in project hopsworks by logicalclocks.
the class RatingService method getDatasetUserRating.
private Response getDatasetUserRating(SecurityContext sc) throws DelaException {
LOGGER.log(Settings.DELA_DEBUG, "hops-site:rating:get:user {0}", publicDSId);
String publicCId = SettingsHelper.clusterId(settings);
Users user = jWTHelper.getUserPrincipal(sc);
RatingDTO rating = hopsSite.getDatasetUserRating(publicCId, publicDSId, user.getEmail());
LOGGER.log(Settings.DELA_DEBUG, "hops-site:rating:get:user - done {0}", publicDSId);
return noCacheResponse.getNoCacheResponseBuilder(Response.Status.OK).entity(rating).build();
}
Aggregations