com.novell.application.console.snapin
Class SnapinException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.novell.application.console.snapin.SnapinException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NotAContainerException, ObjectNotFoundException, SPIException

public class SnapinException
extends java.lang.Exception

SnapinException's can be thrown from snapins in certain methods to report exceptions or errors to ConsoleOne. The snapin exception can have severity, help information and reporting information. If the report flag is set, the caller (usually ConsoleOne) will put up a message box with the message associated with the exception as the body. The icon will be a warning icon if the severity is SEVERITY_WARN, or an error icon otherwise. If help is set for the exception, the details button will appear in the message box, linking the user to help. If the severity is SEVERITY_FATAL, ConsoleOne will terminate after reporting the error. An example of when to throw a SnapinException is in the NamespaceSnapin.getChildren() method if the children cannot be read because the connection to the backend could not be established.


Field Summary
static int SEVERITY_ERROR
          Possible value for the severity parameter.
static int SEVERITY_FATAL
          Possible value for the severity parameter.
static int SEVERITY_SEVERE
          Possible value for the severity parameter.
static int SEVERITY_WARN
          Possible value for the severity parameter.
 
Constructor Summary
SnapinException()
          Creates a SnapinException object with no detailed message.
SnapinException(java.lang.String message)
          Creates a SnapinException object with a detailed message.
SnapinException(java.lang.String message, boolean reportFlag)
          Creates a SnapinException object with a detailed message and sets the reporting flag.
SnapinException(java.lang.String message, boolean reportFlag, int severity, java.lang.String helpSetName, java.lang.String helpID)
          Creates a SnapinException object with a detailed message and sets the reporting flag, severity, help set name and help ID.
SnapinException(java.lang.String message, boolean reportFlag, java.lang.String helpSetName)
          Creates a SnapinException object with a detailed message and sets the reporting flag and help set name.
SnapinException(java.lang.String message, boolean reportFlag, java.lang.String helpSetName, java.lang.String helpID)
          Creates a SnapinException object with a detailed message and sets the reporting flag, help set name and help ID.
 
Method Summary
 java.lang.String getHelpID()
          Returns the help ID associated with this exception.
 java.lang.String getHelpSetName()
          Returns the help set name associated with this exception.
 boolean getReportFlag()
          Returns true if the report flag is turned on for this exception.
 int getSeverity()
          Returns the severity of this exception.
 void setHelpID(java.lang.String helpID)
          Sets the help ID associated with this exception.
 void setHelpSetName(java.lang.String helpSetName)
          Sets the help set name associated with this exception.
 void setReportFlag(boolean reportFlag)
          Enable or disable reporting for this exception.
 void setSeverity(int severity)
          Assigns a severity to this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEVERITY_ERROR

public static final int SEVERITY_ERROR
Possible value for the severity parameter. This severity will cause an error icon to be displayed in the message box when the error is reported. This is the default severity for snapin exceptions.

SEVERITY_WARN

public static final int SEVERITY_WARN
Possible value for the severity parameter. This severity will cause a warning icon to be displayed in the message box when the error is reported.

SEVERITY_SEVERE

public static final int SEVERITY_SEVERE
Possible value for the severity parameter. This severity will cause an error icon to be displayed in the message box when the error is reported. The message box will also give the user the ability to terminate ConsoleOne or continue running.

SEVERITY_FATAL

public static final int SEVERITY_FATAL
Possible value for the severity parameter. This severity will cause an error icon to be displayed in the message box when the error is reported. ConsoleOne will terminate after the error message box is displayed.
Constructor Detail

SnapinException

public SnapinException()
Creates a SnapinException object with no detailed message.

SnapinException

public SnapinException(java.lang.String message)
Creates a SnapinException object with a detailed message. This defaults to turning the reporting flag on.
Parameters:
message - The detailed message included with a SnapinException.

SnapinException

public SnapinException(java.lang.String message,
                       boolean reportFlag)
Creates a SnapinException object with a detailed message and sets the reporting flag.
Parameters:
message - The detailed message included with a SnapinException.
reportFlag - Pass true if ConsoleOne is to report the error, false otherwise.

SnapinException

public SnapinException(java.lang.String message,
                       boolean reportFlag,
                       java.lang.String helpSetName)
Creates a SnapinException object with a detailed message and sets the reporting flag and help set name.
Parameters:
message - The detailed message included with a SnapinException.
reportFlag - Pass true if ConsoleOne is to report the error, false otherwise.
helpSetName - Help set name to give the user further details on handling this exception.

SnapinException

public SnapinException(java.lang.String message,
                       boolean reportFlag,
                       java.lang.String helpSetName,
                       java.lang.String helpID)
Creates a SnapinException object with a detailed message and sets the reporting flag, help set name and help ID.
Parameters:
message - The detailed message included with a SnapinException.
reportFlag - Pass true if ConsoleOne is to report the error, false otherwise.
helpSetName - Help set name to give the user further details on handling this exception.
helpID - Help ID associated with this exception.

SnapinException

public SnapinException(java.lang.String message,
                       boolean reportFlag,
                       int severity,
                       java.lang.String helpSetName,
                       java.lang.String helpID)
Creates a SnapinException object with a detailed message and sets the reporting flag, severity, help set name and help ID.
Parameters:
message - The detailed message included with a SnapinException.
reportFlag - Pass true if ConsoleOne is to report the error, false otherwise.
severity - Severity of this exception. See the SEVERITY_XXX variables for possible values.
helpSetName - Help set name to give the user further details on handling this exception.
helpID - Help ID associated with this exception.
Method Detail

getSeverity

public int getSeverity()
Returns the severity of this exception.
Returns:
Exception severity, for example, SnapinException.SEVERITY_ERROR.

getHelpSetName

public java.lang.String getHelpSetName()
Returns the help set name associated with this exception.
Returns:
Help set name

getHelpID

public java.lang.String getHelpID()
Returns the help ID associated with this exception.
Returns:
Help ID

setSeverity

public void setSeverity(int severity)
Assigns a severity to this exception. Can also be set in the constructor. This is used for such things as the icon displayed in the message box when the exception is reported. If the severity is SEVERITY_FATAL ConsoleOne will terminate after the error is reported. Possible values are SEVERITY_ERROR, SEVERITY_WARN, SEVERITY_SEVERE and SEVERITY_FATAL.
Parameters:
severity - Severity of this exceptions.

setHelpSetName

public void setHelpSetName(java.lang.String helpSetName)
Sets the help set name associated with this exception. The help set name is used to determine which help to display when the user selects the details button in the message box when the exception is reported. If this is not set, the details button will not appear.
Parameters:
helpSetName - Help set name to associate with this exception

setHelpID

public void setHelpID(java.lang.String helpID)
Sets the help ID associated with this exception. The help ID is used to determine which help to display when the user selects the details button in the message box when the exception is reported.
Parameters:
helpID - Help ID to associate with this exception

setReportFlag

public void setReportFlag(boolean reportFlag)
Enable or disable reporting for this exception. If reporting is turned on, the routine that catches this exception should report it. To report, use Shell.handleSnapinException(), passing the exception. This will report the exception as well as handle it if necessary, such as exiting if the severity is SEVERITY_FATAL.
Parameters:
reportFlag - Pass true to turn on reporting, false to turn it off.

getReportFlag

public boolean getReportFlag()
Returns true if the report flag is turned on for this exception.
Returns:
The report


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
ConsoleOne is a registered trademark of Novell Inc.
Generated December 9 2003 1727.