use of io.hops.hopsworks.common.util.ClientWrapper in project hopsworks by logicalclocks.
the class HopssiteController method addDatasetIssue.
public boolean addDatasetIssue(DatasetIssueDTO datasetIssue) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.DatasetService.datasetIssue(), String.class);
client.setPayload(datasetIssue);
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 deleteRating.
public boolean deleteRating(Integer ratingId) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.RatingService.rating() + "/" + ratingId, String.class);
String res = (String) client.doDelete();
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 publish.
// ****************************************************TRACKER********************************************************
public String publish(String datasetName, String description, Collection<String> categories, long size, String userEmail) throws DelaException {
checkHopssiteReady();
String publicCId = SettingsHelper.clusterId(settings);
try {
DatasetDTO.Proto msg = new DatasetDTO.Proto(datasetName, description, categories, size, userEmail);
ClientWrapper client = getClient(HopsSite.DatasetService.publish(publicCId), String.class);
LOG.log(Settings.DELA_DEBUG, "hops-site:dataset - {0}", client.getFullPath());
client.setPayload(msg);
LOG.log(Settings.DELA_DEBUG, "hops-site:dataset - done {0}", client.getFullPath());
String result = (String) client.doPost();
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 cancel.
public void cancel(String publicDSId) throws DelaException {
checkHopssiteReady();
String publicCId = SettingsHelper.clusterId(settings);
try {
ClientWrapper client = getClient(HopsSite.DatasetService.remove(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 updateComment.
public void updateComment(String publicCId, String publicDSId, Integer commentId, CommentDTO.Publish comment) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.CommentService.updateComment(publicCId, publicDSId, commentId), String.class);
LOG.log(Settings.DELA_DEBUG, "hops-site:comment:udpate {0}", client.getFullPath());
client.setPayload(comment);
client.doPut();
LOG.log(Settings.DELA_DEBUG, "hops-site:comment:udpate - done {0}", client.getFullPath());
} catch (IllegalStateException ise) {
throw new DelaException(RESTCodes.DelaErrorCode.COMMUNICATION_FAILURE, Level.SEVERE, DelaException.Source.HOPS_SITE, null, ise.getMessage(), ise);
}
}
Aggregations