com.hyperion.css
Class CSSException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.hyperion.css.CSSException
All Implemented Interfaces:
CSSAppExceptionIF, java.io.Serializable
Direct Known Subclasses:
CSSAuthenticationException, CSSCommunicationException, CSSConfigurationException, CSSIllegalArgumentException, CSSInvalidGroupException, CSSInvalidIdentityException, CSSInvalidUserException, CSSNoProviderException, CSSOperationNotSupportedException, CSSTokenNotAcceptedException, CSSTokenNotAvailableException

public class CSSException
extends java.lang.Exception
implements CSSAppExceptionIF

This is a customized application exception class that is able to chain/link exceptions and the associated error codes.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.hyperion.css.CSSAppExceptionIF
AUTHENTICATION_EXCEPTION, COMMUNICATION_EXCEPTION, CONFIGURATION_EXCEPTION, DIRECTORY_UNTRUSTED_EXCEPTION, GENERAL_EXCEPTION, ILLEGAL_ARGUMENT_EXCEPTION, INVALID_GROUP_EXCEPTION, INVALID_IDENTITY_EXCEPTION, INVALID_USER_EXCEPTION, NO_PROVIDER_EXCEPTION, OPERATION_NOT_SUPPORTED_EXCEPTION, SECURITY_AGENT_NOT_CONFIGURED, TOKEN_CANNOT_BE_DECRYPTED, TOKEN_CANNOT_BE_ENCRYPTED, TOKEN_NOT_ACCEPTED_EXCEPTION, TOKEN_NOT_AVAILABLE_EXCEPTION, USER_NOT_FOUND_EXCEPTION
 
Constructor Summary
CSSException()
          Creates a new exception with null as its message.
CSSException(java.lang.String explanation)
          Constructor that accepts the message detailing the exception.
CSSException(java.lang.String explanation, long errorCode)
          Constructor that accepts a message and an errorCode detailing information about this exception.
CSSException(java.lang.String explanation, java.lang.Throwable rootException)
          Creates a new exception with a message and a cause.
CSSException(java.lang.Throwable rootException)
          Creates a new exception with the cause.
 
Method Summary
 long getErrorCode()
          The error code.
 java.lang.String getMessage(long errorCodeArg)
          Gets the message based on the errorCode.
 java.lang.String getProvider()
           Returns the provider name where this exception originated.
 java.lang.Throwable getRootCause()
          Obtain the root exception, if any.
 void printStackTrace()
          This would print the stack trace for this Throwable object on the error stream.
 void printStackTrace(java.io.PrintStream pS)
          This would print the stack trace for this Throwable object on the output stream.
 void printStackTrace(java.io.PrintWriter pW)
          This would print the stack trace for this Throwable object on the output writer.
 void setErrorCode(long errorCode)
          Sets the error code.
 void setLocale(java.util.Locale locale)
          Sets the locale for exception messages.
 void setRootCause(java.lang.Throwable exception)
          Sets the cause for this exception.
 java.lang.String toString()
          Returns the string representation.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CSSException

public CSSException(java.lang.String explanation)

Constructor that accepts the message detailing the exception.

Parameters:
explanation - String that states the reason for the exception.

CSSException

public CSSException(java.lang.String explanation,
                    long errorCode)

Constructor that accepts a message and an errorCode detailing information about this exception.

Parameters:
explanation - String that states the reason for the exception.
errorCode - Specifies the type of error and is associated with an exception class.

CSSException

public CSSException(java.lang.Throwable rootException)

Creates a new exception with the cause.

Parameters:
rootException - The exception that caused this exception.

CSSException

public CSSException(java.lang.String explanation,
                    java.lang.Throwable rootException)

Creates a new exception with a message and a cause.

Parameters:
explanation - String that states the reason for the exception.
rootException - The exception that caused this exception.

CSSException

public CSSException()

Creates a new exception with null as its message.

Method Detail

getMessage

public java.lang.String getMessage(long errorCodeArg)

Gets the message based on the errorCode. The locale has to be set through CSSAppExceptionIF.setLocale(Locale) to get the message in a particular locale. If the locale is not set, the default locale is picked up.


setRootCause

public void setRootCause(java.lang.Throwable exception)

Sets the cause for this exception.


getRootCause

public java.lang.Throwable getRootCause()

Obtain the root exception, if any.

Returns:
the root exception, or null if there is no root exception

printStackTrace

public void printStackTrace()

This would print the stack trace for this Throwable object on the error stream. The error stream is specified by the value of System.err.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream pS)

This would print the stack trace for this Throwable object on the output stream. The output stream is specified by the value of pS.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
pS - - the output stream

printStackTrace

public void printStackTrace(java.io.PrintWriter pW)

This would print the stack trace for this Throwable object on the output writer. The output writer is specified by the value of pW.

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
pW - - the output writer

toString

public java.lang.String toString()

Returns the string representation.

Specified by:
toString in interface CSSAppExceptionIF
Overrides:
toString in class java.lang.Throwable
Returns:
String

getErrorCode

public long getErrorCode()

The error code.

Specified by:
getErrorCode in interface CSSAppExceptionIF
Returns:
long - the error code

setErrorCode

public void setErrorCode(long errorCode)

Sets the error code.

Specified by:
setErrorCode in interface CSSAppExceptionIF
Parameters:
errorCode - Specifies the type of error and is associated with an exception class.

getProvider

public java.lang.String getProvider()

Returns the provider name where this exception originated.

Returns:
String - the name of the provider
Since:
CSS v2.5

setLocale

public void setLocale(java.util.Locale locale)
Description copied from interface: CSSAppExceptionIF

Sets the locale for exception messages. You must set the locale before invoking the getMessage(long).

Specified by:
setLocale in interface CSSAppExceptionIF
Parameters:
locale - The name of the geographical or cultural locale object defined in java.util.Locale.
See Also:
CSSAppExceptionIF.setLocale(Locale)

Copyright 2004 Hyperion Solutions Corporation. All rights reserved.