mobile/android/base/sync/CredentialException.java

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 package org.mozilla.gecko.sync;
     7 import android.content.SyncResult;
     9 /**
    10  * There was a problem with the Sync account's credentials: bad username,
    11  * missing password, malformed sync key, etc.
    12  */
    13 public abstract class CredentialException extends SyncException {
    14   private static final long serialVersionUID = 833010553314100538L;
    16   public CredentialException() {
    17     super();
    18   }
    20   public CredentialException(final Throwable e) {
    21     super(e);
    22   }
    24   public void updateStats(GlobalSession globalSession, SyncResult syncResult) {
    25     syncResult.stats.numAuthExceptions += 1;
    26   }
    28   /**
    29    * No credentials at all.
    30    */
    31   public static class MissingAllCredentialsException extends CredentialException {
    32     private static final long serialVersionUID = 3763937096217604611L;
    34     public MissingAllCredentialsException() {
    35       super();
    36     }
    38     public MissingAllCredentialsException(final Throwable e) {
    39       super(e);
    40     }
    41   }
    43   /**
    44    * Some credential is missing.
    45    */
    46   public static class MissingCredentialException extends CredentialException {
    47     private static final long serialVersionUID = -7543031216547596248L;
    49     public final String missingCredential;
    51     public MissingCredentialException(final String missingCredential) {
    52       this.missingCredential = missingCredential;
    53     }
    54   }
    55 }

mercurial