use of io.hops.hopsworks.common.util.ClientWrapper in project hopsworks by logicalclocks.
the class HopssiteController method addComment.
public void addComment(String publicCId, String publicDSId, CommentDTO.Publish comment) throws DelaException {
checkHopssiteReady();
try {
ClientWrapper client = getClient(HopsSite.CommentService.addComment(publicCId, publicDSId), String.class);
LOG.log(Settings.DELA_DEBUG, "hops-site:comment:add {0}", client.getFullPath());
client.setPayload(comment);
client.doPost();
LOG.log(Settings.DELA_DEBUG, "hops-site:comment:add - 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 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.common.util.ClientWrapper in project hopsworks by logicalclocks.
the class HopssiteController method ping.
public void ping(ClusterServiceDTO.Ping ping) throws DelaException {
checkHopssiteReady();
String publicCId = SettingsHelper.clusterId(settings);
try {
ClientWrapper client = getClient(HopsSite.ClusterService.ping(publicCId), String.class);
client.setPayload(ping);
LOG.log(Settings.DELA_DEBUG, "hops-site:cluster - {0}", client.getFullPath());
String result = (String) client.doPut();
LOG.log(Settings.DELA_DEBUG, "hops-site:cluster -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 getUserId.
public Integer getUserId(String email) throws DelaException {
checkHopssiteReady();
String publicCId = SettingsHelper.clusterId(settings);
try {
ClientWrapper client = getClient(HopsSite.UserService.getUser(publicCId, email), UserDTO.Complete.class);
LOG.log(Settings.DELA_DEBUG, "hops-site:user - {0}", client.getFullPath());
UserDTO.Complete result = (UserDTO.Complete) client.doGet();
LOG.log(Settings.DELA_DEBUG, "hops-site:user - done {0}", client.getFullPath());
return result.getUserId();
} 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 complete.
public void complete(String publicDSId) throws DelaException {
checkHopssiteReady();
String publicCId = SettingsHelper.clusterId(settings);
try {
ClientWrapper client = getClient(HopsSite.DatasetService.complete(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);
}
}
Aggregations