Search in sources :

Example 6 with SuccessJSON

use of io.hops.hopsworks.dela.old_dto.SuccessJSON in project hopsworks by logicalclocks.

the class TransferDelaController method cancel.

public void cancel(String publicDSId) throws DelaException {
    if (!delaStateController.transferDelaAvailable()) {
        throw new DelaException(RESTCodes.DelaErrorCode.DELA_TRANSFER_NOT_AVAILABLE, Level.SEVERE, DelaException.Source.LOCAL);
    }
    try {
        ClientWrapper<SuccessJSON> rc = ClientWrapper.httpInstance(SuccessJSON.class).setTarget(settings.getDELA_TRANSFER_HTTP_ENDPOINT()).setPath("torrent/hops/stop").setPayload(new TorrentId(publicDSId));
        SuccessJSON result = rc.doPost();
    } catch (IllegalStateException ise) {
        throw new DelaException(RESTCodes.DelaErrorCode.COMMUNICATION_FAILURE, Level.SEVERE, DelaException.Source.DELA, null, ise.getMessage(), ise);
    }
}
Also used : TorrentId(io.hops.hopsworks.dela.old_dto.TorrentId) SuccessJSON(io.hops.hopsworks.dela.old_dto.SuccessJSON) DelaException(io.hops.hopsworks.exceptions.DelaException)

Aggregations

SuccessJSON (io.hops.hopsworks.dela.old_dto.SuccessJSON)6 DelaException (io.hops.hopsworks.exceptions.DelaException)5 TorrentId (io.hops.hopsworks.dela.old_dto.TorrentId)4 AllowedProjectRoles (io.hops.hopsworks.api.filter.AllowedProjectRoles)2 JWTRequired (io.hops.hopsworks.jwt.annotation.JWTRequired)2 Dataset (io.hops.hopsworks.persistence.entity.dataset.Dataset)2 Users (io.hops.hopsworks.persistence.entity.user.Users)2 Consumes (javax.ws.rs.Consumes)2 POST (javax.ws.rs.POST)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 Gson (com.google.gson.Gson)1 ServiceDiscoveryException (com.logicalclocks.servicediscoverclient.exceptions.ServiceDiscoveryException)1 AddressJSON (io.hops.hopsworks.common.dela.AddressJSON)1 ClusterAddressDTO (io.hops.hopsworks.dela.dto.common.ClusterAddressDTO)1 HopsTorrentAdvanceDownload (io.hops.hopsworks.dela.old_dto.HopsTorrentAdvanceDownload)1 HopsTorrentStartDownload (io.hops.hopsworks.dela.old_dto.HopsTorrentStartDownload)1 HopsTorrentUpload (io.hops.hopsworks.dela.old_dto.HopsTorrentUpload)1 KafkaEndpoint (io.hops.hopsworks.dela.old_dto.KafkaEndpoint)1 ServiceException (io.hops.hopsworks.exceptions.ServiceException)1