mobile/android/base/background/healthreport/upload/SubmissionClient.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/background/healthreport/upload/SubmissionClient.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +package org.mozilla.gecko.background.healthreport.upload;
     1.9 +
    1.10 +import java.util.Collection;
    1.11 +
    1.12 +public interface SubmissionClient {
    1.13 +  public interface Delegate {
    1.14 +    /**
    1.15 +     * Called in the event of a temporary failure; we should try again soon.
    1.16 +     *
    1.17 +     * @param localTime milliseconds since the epoch.
    1.18 +     * @param id if known; may be null.
    1.19 +     * @param reason for failure.
    1.20 +     * @param e if there was an exception; may be null.
    1.21 +     */
    1.22 +    public void onSoftFailure(long localTime, String id, String reason, Exception e);
    1.23 +
    1.24 +    /**
    1.25 +     * Called in the event of a failure; we should try again, but not today.
    1.26 +     *
    1.27 +     * @param localTime milliseconds since the epoch.
    1.28 +     * @param id if known; may be null.
    1.29 +     * @param reason for failure.
    1.30 +     * @param e if there was an exception; may be null.
    1.31 +     */
    1.32 +    public void onHardFailure(long localTime, String id, String reason, Exception e);
    1.33 +
    1.34 +    /**
    1.35 +     * Success!
    1.36 +     *
    1.37 +     * @param localTime milliseconds since the epoch.
    1.38 +     * @param id is always known; not null.
    1.39 +     */
    1.40 +    public void onSuccess(long localTime, String id);
    1.41 +  }
    1.42 +
    1.43 +  public void upload(long localTime, String id, Collection<String> oldIds, Delegate delegate);
    1.44 +  public void delete(long localTime, String id, Delegate delegate);
    1.45 +}

mercurial