KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > indexing > IndexedStoreException


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.core.internal.indexing;
12
13 import org.eclipse.core.internal.resources.CompatibilityMessages;
14
15
16 public class IndexedStoreException extends StoreException {
17
18     public static final int GenericError = 0;
19     public static final int EntryKeyLengthError = 1;
20     public static final int EntryNotRemoved = 2;
21     public static final int EntryValueLengthError = 3;
22     public static final int EntryValueNotUpdated = 4;
23     public static final int IndexNodeNotRetrieved = 5;
24     public static final int IndexNodeNotStored = 6;
25     public static final int IndexNodeNotSplit = 7;
26     public static final int IndexNodeNotCreated = 8;
27     public static final int IndexExists = 9;
28     public static final int IndexNotCreated = 10;
29     public static final int IndexNotFound = 11;
30     public static final int IndexNotRemoved = 12;
31     public static final int ObjectExists = 13;
32     public static final int ObjectNotAcquired = 14;
33     public static final int ObjectNotCreated = 15;
34     public static final int ObjectNotFound = 16;
35     public static final int ObjectNotReleased = 17;
36     public static final int ObjectNotRemoved = 18;
37     public static final int ObjectNotUpdated = 19;
38     public static final int ObjectNotStored = 20;
39     public static final int ObjectTypeError = 21;
40     public static final int StoreEmpty = 22;
41     public static final int StoreFormatError = 23;
42     public static final int StoreNotCreated = 24;
43     public static final int StoreNotOpen = 25;
44     public static final int StoreNotClosed = 26;
45     public static final int StoreNotFlushed = 27;
46     public static final int StoreNotOpened = 28;
47     public static final int StoreNotReadWrite = 29;
48     public static final int ContextNotAvailable = 30;
49     public static final int ObjectIDInvalid = 31;
50     public static final int MetadataRequestError = 32;
51     public static final int EntryRemoved = 33;
52     public static final int StoreNotConverted = 34;
53     public static final int StoreIsOpen = 35;
54     public static final int StoreNotCommitted = 36;
55     public static final int StoreNotRolledBack = 37;
56
57     public static String JavaDoc[] messages = new String JavaDoc[40];
58
59     /**
60      * All serializable objects should have a stable serialVersionUID
61      */

62     private static final long serialVersionUID = 1L;
63
64     static {
65         initializeMessages();
66     }
67
68     public int id = GenericError;
69
70     /**
71      * IndexedStoreException constructor comment.
72      */

73     public IndexedStoreException(int id) {
74         super(messages[id]);
75         this.id = id;
76     }
77
78     /**
79      * IndexedStoreException constructor comment.
80      */

81     public IndexedStoreException(int id, Throwable JavaDoc e) {
82         super(messages[id], e);
83         this.id = id;
84     }
85
86     /**
87      * Initializes the messages at class load time.
88      */

89     private static void initializeMessages() {
90         messages[GenericError] = CompatibilityMessages.indexedStore_genericError;
91         messages[EntryKeyLengthError] = CompatibilityMessages.indexedStore_entryKeyLengthError;
92         messages[EntryNotRemoved] = CompatibilityMessages.indexedStore_entryNotRemoved;
93         messages[EntryValueLengthError] = CompatibilityMessages.indexedStore_entryValueLengthError;
94         messages[EntryValueNotUpdated] = CompatibilityMessages.indexedStore_entryValueNotUpdated;
95         messages[IndexNodeNotRetrieved] = CompatibilityMessages.indexedStore_indexNodeNotRetrieved;
96         messages[IndexNodeNotStored] = CompatibilityMessages.indexedStore_indexNodeNotStored;
97         messages[IndexNodeNotSplit] = CompatibilityMessages.indexedStore_indexNodeNotSplit;
98         messages[IndexNodeNotCreated] = CompatibilityMessages.indexedStore_indexNodeNotCreated;
99         messages[IndexExists] = CompatibilityMessages.indexedStore_indexExists;
100         messages[IndexNotCreated] = CompatibilityMessages.indexedStore_indexNotCreated;
101         messages[IndexNotFound] = CompatibilityMessages.indexedStore_indexNotFound;
102         messages[IndexNotRemoved] = CompatibilityMessages.indexedStore_indexNotRemoved;
103         messages[ObjectExists] = CompatibilityMessages.indexedStore_objectExists;
104         messages[ObjectNotAcquired] = CompatibilityMessages.indexedStore_objectNotAcquired;
105         messages[ObjectNotCreated] = CompatibilityMessages.indexedStore_objectNotCreated;
106         messages[ObjectNotFound] = CompatibilityMessages.indexedStore_objectNotFound;
107         messages[ObjectNotReleased] = CompatibilityMessages.indexedStore_objectNotReleased;
108         messages[ObjectNotRemoved] = CompatibilityMessages.indexedStore_objectNotRemoved;
109         messages[ObjectNotUpdated] = CompatibilityMessages.indexedStore_objectNotUpdated;
110         messages[ObjectNotStored] = CompatibilityMessages.indexedStore_objectNotStored;
111         messages[ObjectTypeError] = CompatibilityMessages.indexedStore_objectTypeError;
112         messages[StoreEmpty] = CompatibilityMessages.indexedStore_storeEmpty;
113         messages[StoreFormatError] = CompatibilityMessages.indexedStore_storeFormatError;
114         messages[StoreNotCreated] = CompatibilityMessages.indexedStore_storeNotCreated;
115         messages[StoreNotOpen] = CompatibilityMessages.indexedStore_storeNotOpen;
116         messages[StoreNotClosed] = CompatibilityMessages.indexedStore_storeNotClosed;
117         messages[StoreNotFlushed] = CompatibilityMessages.indexedStore_storeNotFlushed;
118         messages[StoreNotOpened] = CompatibilityMessages.indexedStore_storeNotOpened;
119         messages[StoreNotReadWrite] = CompatibilityMessages.indexedStore_storeNotReadWrite;
120         messages[ContextNotAvailable] = CompatibilityMessages.indexedStore_contextNotAvailable;
121         messages[ObjectIDInvalid] = CompatibilityMessages.indexedStore_objectIDInvalid;
122         messages[MetadataRequestError] = CompatibilityMessages.indexedStore_metadataRequestError;
123         messages[EntryRemoved] = CompatibilityMessages.indexedStore_entryRemoved;
124         messages[StoreNotConverted] = CompatibilityMessages.indexedStore_storeNotConverted;
125         messages[StoreIsOpen] = CompatibilityMessages.indexedStore_storeIsOpen;
126         messages[StoreNotCommitted] = CompatibilityMessages.indexedStore_storeNotCommitted;
127         messages[StoreNotRolledBack] = CompatibilityMessages.indexedStore_storeNotRolledBack;
128     }
129
130     /**
131      * Creates a printable representation of this exception.
132      */

133     public String JavaDoc toString() {
134         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc(50);
135         buffer.append("IndexedStoreException:"); //$NON-NLS-1$
136
buffer.append(getMessage());
137         if (wrappedException != null) {
138             buffer.append("\n"); //$NON-NLS-1$
139
buffer.append(wrappedException.toString());
140         }
141         return buffer.toString();
142     }
143 }
144
Popular Tags