use of io.hops.hopsworks.common.util.ClientWrapper in project hopsworks by logicalclocks.
the class HopssiteController method reportComment.
public void reportComment(String publicCId, String publicDSId, Integer commentId, CommentIssueDTO commentIssue) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.CommentService.reportComment(publicCId, publicDSId, commentId), String.class);
client.setPayload(commentIssue);
LOG.log(Settings.DELA_DEBUG, "hops-site:comment:report {0}", client.getFullPath());
client.doPost();
LOG.log(Settings.DELA_DEBUG, "hops-site:comment:report - done {0}", client.getFullPath());
} 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.common.util.ClientWrapper 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.common.util.ClientWrapper in project hopsworks by logicalclocks.
the class HopssiteController method addCategory.
public boolean addCategory(DatasetDTO dataset) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.DatasetService.datasetCategory(), String.class);
client.setPayload(dataset);
String res = (String) client.doPost();
return "OK".equals(res);
} 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.common.util.ClientWrapper in project hopsworks by logicalclocks.
the class HopssiteController method download.
public void download(String publicDSId) throws DelaException {
checkHopssiteReady();
String publicCId = SettingsHelper.clusterId(settings);
try {
ClientWrapper client = getClient(HopsSite.DatasetService.download(publicCId, publicDSId), String.class);
LOG.log(Settings.DELA_DEBUG, "hops-site:dataset - {0}", client.getFullPath());
client.doPost();
LOG.log(Settings.DELA_DEBUG, "hops-site:dataset - done {0}", client.getFullPath());
} 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.common.util.ClientWrapper in project hopsworks by logicalclocks.
the class HopssiteController method addPopularDatasets.
public boolean addPopularDatasets(PopularDatasetJSON popularDatasetsJson) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.DatasetService.datasetPopular(), String.class);
client.setPayload(popularDatasetsJson);
String res = (String) client.doPost();
return "OK".equals(res);
} catch (IllegalStateException ise) {
throw new DelaException(RESTCodes.DelaErrorCode.COMMUNICATION_FAILURE, Level.SEVERE, DelaException.Source.HOPS_SITE, null, ise.getMessage(), ise);
}
}
Aggregations