KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > connection > CVSAuthenticationException


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.core.connection;
12
13
14 import org.eclipse.core.resources.IResource;
15 import org.eclipse.core.runtime.IStatus;
16 import org.eclipse.osgi.util.NLS;
17 import org.eclipse.team.internal.ccvs.core.*;
18
19 public class CVSAuthenticationException extends CVSException {
20
21     private static final long serialVersionUID = 1L;
22     
23     private int retryStatus = 0;
24
25     /**
26      * Code indicating that authentication can be retried after
27      * prompting the user for corrected authentication information
28      */

29     public static final int RETRY = 1;
30     
31     /**
32      * Code indicating that authentication should not be reattempted.
33      */

34     public static final int NO_RETRY = 2;
35     
36     /**
37      * Creates a new <code>CVSAuthenticationException</code>
38      *
39      * @param status the status result describing this exception.
40      */

41     private CVSAuthenticationException(IStatus status) {
42         super(status);
43     }
44     
45     /**
46      * Creates a new <code>CVSAuthenticationException</code>
47      *
48      * @param detail a message that describes the exception in detail.
49      * @param code indicates whether authentication can be retried or not
50      */

51     public CVSAuthenticationException(String JavaDoc detail, int retryStatus) {
52         this(new CVSStatus(IStatus.ERROR, CVSStatus.AUTHENTICATION_FAILURE,NLS.bind(CVSMessages.CVSAuthenticationException_detail, (new Object JavaDoc[] { detail })), (IResource) null)); //
53
this.retryStatus = retryStatus;
54     }
55     
56     /**
57      * Creates a new <code>CVSAuthenticationException</code>
58      *
59      * @param detail a message that describes the exception in detail.
60      * @param code indicates whether authentication can be retried or not
61      * @param the location of the CVS server
62      */

63     public CVSAuthenticationException(String JavaDoc detail, int retryStatus, ICVSRepositoryLocation cvsLocation) {
64         this(new CVSStatus(IStatus.ERROR, CVSStatus.AUTHENTICATION_FAILURE,NLS.bind(CVSMessages.CVSAuthenticationException_detail, (new Object JavaDoc[] { detail })),cvsLocation)); //
65
this.retryStatus = retryStatus;
66     }
67     
68     /**
69      * Creates a new <code>CVSAuthenticationException</code>
70      *
71      * @param detail a message that describes the exception in detail.
72      * @param code indicates whether authentication can be retried or not
73      * @param the location of the CVS server
74      * @param the exception
75      */

76     public CVSAuthenticationException(String JavaDoc detail, int retryStatus,ICVSRepositoryLocation cvsLocation, Exception JavaDoc e) {
77         this(new CVSStatus(IStatus.ERROR, CVSStatus.AUTHENTICATION_FAILURE , NLS.bind(CVSMessages.CVSAuthenticationException_detail, (new Object JavaDoc[] { detail })), e, cvsLocation)); //
78
this.retryStatus = retryStatus;
79     }
80
81     public int getRetryStatus() {
82         return retryStatus;
83     }
84 }
85
Popular Tags