01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.rewriter.services;
06:
07: import com.sun.portal.rewriter.util.ModuleException;
08: import com.sun.portal.rewriter.util.StringHelper;
09:
10: /**
11: * This exception thrown when DataService implemntor is not able to do its job.
12: * This can happen due to DataService not being able to connect to the IDSAME
13: * Server or user not having the required security credentials
14: *
15: * @version 1.0 12/15/2001
16: * @author Raja Nagendra Kumar, Nagendra.Raja@sun.com
17: */
18: public class DataServiceException extends RuntimeException implements
19: ModuleException {
20: public static final int UNKNOWN_EXCEPTION = 5000;
21: public static final int AUTHORIZATION_FAILED = 5001;
22:
23: private final Throwable cause;
24: private final int localeID;
25:
26: public DataServiceException(final String aMessage,
27: final int aLocaleID) {
28: this (aMessage, null, aLocaleID);
29: }//constructor
30:
31: public DataServiceException(final String aMessage,
32: final Throwable aCause) {
33: this (aMessage, aCause, UNKNOWN_EXCEPTION);
34: }//constructor
35:
36: public DataServiceException(final String aMessage,
37: final Throwable aCause, final int aLocaleID) {
38: super (aMessage);
39: cause = aCause;
40: localeID = aLocaleID;
41: }//constructor
42:
43: /**
44: * would return null if this is the original source and not the chained
45: * exception
46: */
47: public Throwable getCause() {
48: return cause;
49: }//getCause()
50:
51: public int getLocaleID() {
52: return localeID;
53: }//getLocaleID()
54:
55: public String toString() {
56: return "Start of DataServiceException: " + "\nMessage: "
57: + getMessage() + "\nCause: "
58: + StringHelper.exceptionStack2String(getCause())
59: + "\nEnd of DataServiceException\n";
60: }//toString()
61: }//class DataServiceException
|