use of org.opencastproject.distribution.api.DistributionException in project opencast by opencast.
the class StreamingDistributionServiceRemoteImpl method distribute.
@Override
public Job distribute(String channelId, final MediaPackage mediaPackage, Set<String> elementIds) throws DistributionException, MediaPackageException {
logger.info(format("Distributing %s elements to %s@%s", elementIds.size(), channelId, distributionChannel));
final HttpPost req = post(param(PARAM_CHANNEL_ID, channelId), param(PARAM_MEDIAPACKAGE, MediaPackageParser.getAsXml(mediaPackage)), param(PARAM_ELEMENT_IDS, gson.toJson(elementIds)));
for (Job job : join(runRequest(req, jobFromHttpResponse))) {
return job;
}
throw new DistributionException(format("Unable to distribute '%s' elements of " + "mediapackage '%s' using a remote destribution service proxy", elementIds.size(), mediaPackage.getIdentifier().toString()));
}
use of org.opencastproject.distribution.api.DistributionException in project opencast by opencast.
the class AwsS3DistributionServiceRemoteImpl method restore.
@Override
public Job restore(String channelId, MediaPackage mediaPackage, String elementId, String fileName) throws DistributionException {
logger.info(format("Restoring %s from %s@%s", elementId, channelId, distributionChannel));
final HttpPost req = post("/restore", param(PARAM_MEDIAPACKAGE, MediaPackageParser.getAsXml(mediaPackage)), param(PARAM_ELEMENT_ID, elementId), param(PARAM_CHANNEL_ID, channelId), param(PARAM_FILENAME, fileName));
for (Job job : join(runRequest(req, jobFromHttpResponse))) {
return job;
}
throw new DistributionException(format("Unable to restore element '%s' of " + "mediapackage '%s' using a remote destribution service proxy", elementId, mediaPackage.getIdentifier().toString()));
}
use of org.opencastproject.distribution.api.DistributionException in project opencast by opencast.
the class DownloadDistributionServiceRemoteImpl method distribute.
@Override
public Job distribute(String channelId, final MediaPackage mediaPackage, Set<String> elementIds, boolean checkAvailability, boolean preserveReference) throws DistributionException {
logger.info(format("Distributing %s elements to %s@%s", elementIds.size(), channelId, distributionChannel));
final HttpPost req = post(param(PARAM_CHANNEL_ID, channelId), param(PARAM_MEDIAPACKAGE, MediaPackageParser.getAsXml(mediaPackage)), param(PARAM_ELEMENT_ID, gson.toJson(elementIds)), param(PARAM_CHECK_AVAILABILITY, Boolean.toString(checkAvailability)), param(PARAM_PRESERVE_REFERENCE, Boolean.toString(preserveReference)));
for (Job job : join(runRequest(req, jobFromHttpResponse))) {
return job;
}
throw new DistributionException(format("Unable to distribute '%s' elements of " + "mediapackage '%s' using a remote destribution service proxy", elementIds.size(), mediaPackage.getIdentifier().toString()));
}
use of org.opencastproject.distribution.api.DistributionException in project opencast by opencast.
the class DownloadDistributionServiceRemoteImpl method retract.
@Override
public Job retract(String channelId, MediaPackage mediaPackage, Set<String> elementIds) throws DistributionException {
logger.info(format("Retracting %s elements from %s@%s", elementIds.size(), channelId, distributionChannel));
final HttpPost req = post("/retract", param(PARAM_MEDIAPACKAGE, MediaPackageParser.getAsXml(mediaPackage)), param(PARAM_ELEMENT_ID, gson.toJson(elementIds)), param(PARAM_CHANNEL_ID, channelId));
for (Job job : join(runRequest(req, jobFromHttpResponse))) {
return job;
}
throw new DistributionException(format("Unable to retract '%s' elements of " + "mediapackage '%s' using a remote destribution service proxy", elementIds.size(), mediaPackage.getIdentifier().toString()));
}
use of org.opencastproject.distribution.api.DistributionException in project opencast by opencast.
the class AwsS3DistributionServiceRemoteImpl method distribute.
@Override
public Job distribute(String channelId, final MediaPackage mediaPackage, Set<String> elementIds, boolean checkAvailability) throws DistributionException {
logger.info(format("Distributing %s elements to %s@%s", elementIds.size(), channelId, distributionChannel));
final HttpPost req = post(param(PARAM_CHANNEL_ID, channelId), param(PARAM_MEDIAPACKAGE, MediaPackageParser.getAsXml(mediaPackage)), param(PARAM_ELEMENT_ID, gson.toJson(elementIds)), param(PARAM_CHECK_AVAILABILITY, Boolean.toString(checkAvailability)));
for (Job job : join(runRequest(req, jobFromHttpResponse))) {
return job;
}
throw new DistributionException(format("Unable to distribute '%s' elements of " + "mediapackage '%s' using a remote destribution service proxy", elementIds.size(), mediaPackage.getIdentifier().toString()));
}
Aggregations