KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > core > IVerificationResult


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.update.core;
12
13 /**
14  * Verification result. An object implementing this interface represents
15  * a token passed between the update framework and the verifier and verification
16  * listener. The verifier uses the token to capture the result of the file
17  * verification. It is then passed to the verification listener
18  * to optionally present this information to the user (in an
19  * implementation-specific way). The verification listener in turn
20  * uses this token to capture the desired response.
21  * <p>
22  * Clients may implement this interface.
23  * </p>
24  * <p>
25  * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to
26  * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
27  * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
28  * (repeatedly) as the API evolves.
29  * </p>
30  * @since 2.0
31  */

32 public interface IVerificationResult {
33
34     /**
35      * Indicates the file type is recognized but the file is not signed
36      *
37      * @see #TYPE_ENTRY_UNRECOGNIZED
38      * @since 2.0
39      */

40     public static final int TYPE_ENTRY_NOT_SIGNED = 1;
41
42     /**
43      * Indicates the file has been modified since it was signed
44      *
45      * @since 2.0
46      */

47     public static final int TYPE_ENTRY_CORRUPTED = 2;
48
49     /**
50      * Indicates the file is signed by a known signer
51      *
52      * @since 2.0
53      */

54     public static final int TYPE_ENTRY_SIGNED_RECOGNIZED = 3;
55
56     /**
57      * Indicates the file is signed but the signer is not known
58      *
59      * @since 2.0
60      */

61     public static final int TYPE_ENTRY_SIGNED_UNRECOGNIZED = 5;
62
63     /**
64      * Error occurred during verification
65      *
66      * @since 2.0
67      */

68     public static final int UNKNOWN_ERROR = 6;
69
70     /**
71      * Verification was cancelled
72      *
73      * @since 2.0
74      */

75     public static final int VERIFICATION_CANCELLED = 7;
76
77     /**
78      * Could not perform verification due to unrecognized file
79      *
80      * @see #TYPE_ENTRY_NOT_SIGNED
81      * @since 2.0
82      */

83     public static final int TYPE_ENTRY_UNRECOGNIZED = 8;
84
85     /**
86      * Returns the content reference that is the target of the verification.
87      *
88      * @return content reference
89      * @since 2.0
90      */

91     public ContentReference getContentReference();
92
93     /**
94      * Returns the feature the referenced file is part of.
95      *
96      * @return feature
97      * @since 2.0
98      */

99     public IFeature getFeature();
100
101     /**
102      * Returns the verification code.
103      *
104      * @return verification code, as defined in this interface.
105      * @since 2.0
106      */

107     public int getVerificationCode();
108
109     /**
110      * Returns any exception caught during verification
111      *
112      * @return exception, or <code>null</code>.
113      * @since 2.0
114      */

115     public Exception JavaDoc getVerificationException();
116
117     /**
118      * Returns display text describing the result of the verification.
119      *
120      * @return result text, or <code>null</code>.
121      * @since 2.0
122      */

123     public String JavaDoc getText();
124
125     /**
126      * Returns text describing the signer
127      *
128      * @return signer information, or <code>null</code>.
129      * @since 2.0
130      */

131     public String JavaDoc getSignerInfo();
132
133     /**
134      * Returns text describing the authority that verified/ certified
135      * the signer
136      *
137      * @return verifier information, or <code>null</code>.
138      * @since 2.0
139      */

140     public String JavaDoc getVerifierInfo();
141
142     /**
143      * Indicates whether the referenced file is part of the overall feature
144      * definition, or one of its component plug-in or non-plug-in entries.
145      *
146      * @return <code>true</code> if reference is a feature file,
147      * <code>false</code> if reference is a plug-in or non-plug-in file
148      * @since 2.0
149      */

150     public boolean isFeatureVerification();
151     
152     /**
153      * Indicates whether the signer and verifier info have already been accepted by the user
154      * during a previous verification of one of the file of the feature.
155      *
156      * @return <code>true</code> if the result has already been accepted, <code>false</code>
157      * if the result has not yet been accepted by the user
158      * @since 2.0
159      */

160     public boolean alreadySeen();
161 }
162
Popular Tags