Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | package org.mozilla.gecko.background.healthreport.upload; |
michael@0 | 6 | |
michael@0 | 7 | import java.util.Collection; |
michael@0 | 8 | |
michael@0 | 9 | public interface SubmissionClient { |
michael@0 | 10 | public interface Delegate { |
michael@0 | 11 | /** |
michael@0 | 12 | * Called in the event of a temporary failure; we should try again soon. |
michael@0 | 13 | * |
michael@0 | 14 | * @param localTime milliseconds since the epoch. |
michael@0 | 15 | * @param id if known; may be null. |
michael@0 | 16 | * @param reason for failure. |
michael@0 | 17 | * @param e if there was an exception; may be null. |
michael@0 | 18 | */ |
michael@0 | 19 | public void onSoftFailure(long localTime, String id, String reason, Exception e); |
michael@0 | 20 | |
michael@0 | 21 | /** |
michael@0 | 22 | * Called in the event of a failure; we should try again, but not today. |
michael@0 | 23 | * |
michael@0 | 24 | * @param localTime milliseconds since the epoch. |
michael@0 | 25 | * @param id if known; may be null. |
michael@0 | 26 | * @param reason for failure. |
michael@0 | 27 | * @param e if there was an exception; may be null. |
michael@0 | 28 | */ |
michael@0 | 29 | public void onHardFailure(long localTime, String id, String reason, Exception e); |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * Success! |
michael@0 | 33 | * |
michael@0 | 34 | * @param localTime milliseconds since the epoch. |
michael@0 | 35 | * @param id is always known; not null. |
michael@0 | 36 | */ |
michael@0 | 37 | public void onSuccess(long localTime, String id); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | public void upload(long localTime, String id, Collection<String> oldIds, Delegate delegate); |
michael@0 | 41 | public void delete(long localTime, String id, Delegate delegate); |
michael@0 | 42 | } |