KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > reasoner > dig > DIGErrorResponseException


1 /*****************************************************************************
2  * Source code information
3  * -----------------------
4  * Original author Ian Dickinson, HP Labs Bristol
5  * Author email ian.dickinson@hp.com
6  * Package Jena 2
7  * Web http://sourceforge.net/projects/jena/
8  * Created 11-Sep-2003
9  * Filename $RCSfile: DIGErrorResponseException.java,v $
10  * Revision $Revision: 1.5 $
11  * Release status $State: Exp $
12  *
13  * Last modified on $Date: 2005/02/21 12:16:19 $
14  * by $Author: andy_seaborne $
15  *
16  * (c) Copyright 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
17  * [See end of file]
18  *****************************************************************************/

19
20 // Package
21
///////////////
22
package com.hp.hpl.jena.reasoner.dig;
23
24
25 // Imports
26
///////////////
27

28 /**
29  * <p>
30  * An exception that encapsulates an error response from the DIG server, including
31  * error number and message.
32  * </p>
33  *
34  * @author Ian Dickinson, HP Labs (<a HREF="mailto:Ian.Dickinson@hp.com">email</a>)
35  * @version Release @release@ ($Id: DIGErrorResponseException.java,v 1.5 2005/02/21 12:16:19 andy_seaborne Exp $)
36  */

37 public class DIGErrorResponseException
38     extends DIGReasonerException
39 {
40     // Constants
41
//////////////////////////////////
42

43     public static final int GENERAL_UNSPECIFIED_ERROR = 100;
44     public static final int UNKNOWN_REQUEST = 101;
45     public static final int MAFORMED_REQUEST = 102;
46     public static final int UNSUPPORTED_OPERATION = 103;
47     
48     public static final int CANNOT_CREATE_NEW_KB = 201;
49     public static final int MALFORMED_KB_URI = 202;
50     public static final int UNKNOWN_OR_STALE_KB_URI = 203;
51     public static final int KB_RELEASE_ERROR = 204;
52     public static final int MISSING_URI = 205;
53     
54     public static final int GENERAL_TELL_ERROR = 301;
55     public static final int UNSUPPORTED_TELL_OPERATION = 302;
56     public static final int UNKNOWN_TELL_OPERATION = 303;
57
58     public static final int GENERAL_ASK_ERROR = 401;
59     public static final int UNSUPPORTED_ASK_OPERATION = 402;
60     public static final int UNKNOWN_ASK_OPERATION = 403;
61     
62     
63     // Static variables
64
//////////////////////////////////
65

66     // Instance variables
67
//////////////////////////////////
68

69     /** The msg attribute from the DIG error message */
70     private String JavaDoc m_msgAttr;
71     
72     /** The DIG error code */
73     private int m_errorCode;
74     
75     
76     // Constructors
77
//////////////////////////////////
78

79     public DIGErrorResponseException( String JavaDoc msg, String JavaDoc msgAttr, int errorCode ) {
80         super( "DIG error: " + msg );
81         m_msgAttr = msgAttr;
82         m_errorCode = errorCode;
83     }
84     
85     
86     // External signature methods
87
//////////////////////////////////
88

89     /**
90      * <p>Answer the error code sent back by DIG. Well known error codes are listed
91      * as constants exported from this class.</p>
92      * @return The DIG error code; the value of the <code>code</code> attribute in
93      * the error response returned by the reasoner.
94      */

95     public int getErrorCode() {
96         return m_errorCode;
97     }
98     
99     
100     /**
101      * <p>Answer the error message sent back by DIG.</p>
102      * @return The DIG error message; the value of the <code>msg</code> attribute
103      * in the error response returned by the reasoner
104      */

105     public String JavaDoc getMessage() {
106         return m_msgAttr;
107     }
108     
109     
110     // Internal implementation methods
111
//////////////////////////////////
112

113     //==============================================================================
114
// Inner class definitions
115
//==============================================================================
116

117 }
118
119
120 /*
121  * (c) Copyright 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
122  * All rights reserved.
123  *
124  * Redistribution and use in source and binary forms, with or without
125  * modification, are permitted provided that the following conditions
126  * are met:
127  * 1. Redistributions of source code must retain the above copyright
128  * notice, this list of conditions and the following disclaimer.
129  * 2. Redistributions in binary form must reproduce the above copyright
130  * notice, this list of conditions and the following disclaimer in the
131  * documentation and/or other materials provided with the distribution.
132  * 3. The name of the author may not be used to endorse or promote products
133  * derived from this software without specific prior written permission.
134  *
135  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
136  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
137  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
138  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
139  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
140  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
144  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145  */

146
Popular Tags