1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com
.google
.appengine
.api
.conversion
;
6 import java
.util
.concurrent
.Future
;
9 * A service which provides document conversion feature for applications.
12 * @deprecated This API will be decommissioned in November 2012 and all calls
13 * to it will return an error.
16 public interface ConversionService
{
17 /** Maximum bytes size of one conversion to be converted. */
18 public static final int CONVERSION_MAX_SIZE_BYTES
= 2 * 1024 * 1024;
20 /** Maximum number of conversions allowed in one request. */
21 public static final int CONVERSION_MAX_NUM_PER_REQUEST
= 10;
26 * @param conversion the Conversion instance to run
27 * @return the ConversionResult instance
28 * @throws ConversionServiceException if the conversion fails with the reason
29 * specified in {@link ConversionErrorCode}
30 * @throws IllegalArgumentException if the input conversion is invalid
32 public ConversionResult
convert(Conversion conversion
);
35 * Executes multiple conversions in one request to the conversion backend.
37 * @param conversions a collection of Conversion instances to run
38 * @return a collection of ConversionResult instances, one per Conversion
40 * @throws ConversionServiceException if the conversion fails with the reason
41 * specified in {@link ConversionErrorCode}
42 * @throws IllegalArgumentException if the input conversions are invalid
44 public List
<ConversionResult
> convert(List
<Conversion
> conversions
);
47 * Runs a conversion asynchronously.
49 * @param conversion the Conversion instance to run
50 * @return a future containing the ConversionResult instance;
51 * {@link Future#get} may throw {@link ConversionServiceException} if
52 * the conversion fails with the reason specified in
53 * {@link ConversionErrorCode}
54 * @throws IllegalArgumentException if the input conversion is invalid
56 public Future
<ConversionResult
> convertAsync(Conversion conversion
);
59 * Executes multiple conversions in one request to the conversion backend
62 * @param conversions a collection of Conversion instances to run
63 * @return a future containing a collection of ConversionResult instances,
64 * one per Conversion in the same order; {@link Future#get} may throw
65 * {@link ConversionServiceException} if the conversion fails with
66 * the reason specified in {@link ConversionErrorCode}
67 * @throws IllegalArgumentException if the input conversions are invalid
69 public Future
<List
<ConversionResult
>> convertAsync(List
<Conversion
> conversions
);