com.starbase.starteam
Class ServerException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--com.starbase.starteam.ServerException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CommandAbortedException, ForeignPasswordException, ItemNotFoundException, LogonException, ServerUnavailableException

public class ServerException
extends java.lang.RuntimeException

The ServerException class is a client side exception that is thrown when an error on the server is encountered.

See Also:
ForeignPasswordException, Serialized Form

Method Summary
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
static ServerException forError(Server server, java.lang.String className, java.lang.String errorSource, int errorCode, java.lang.String errorMessage, boolean logged, double loggedTime, int logEntry, java.util.Hashtable auxiliaryData)
           
 java.lang.Object getAuxData(java.lang.String key)
          Returns the auxilary data for a given gey.
 java.lang.String[] getAuxKeys()
          Returns an array of String keys to auxilary exception data that can be passed to getAuxData().
 java.lang.String getClassName()
          Returns the server's class name for this exception.
 int getErrorCode()
          The exception's error code.
 java.lang.String getErrorMessage()
          The error message to be presented to the user.
 java.lang.String getErrorSource()
          The server's error source for the exception.
 int getLogEntry()
          The server log entry number for the error.
 java.lang.String getMessage()
          Returns this exeptions error message.
 java.lang.String getNonLocalizedMessage()
          The "default" (English) version of the error message.
 OLEDate getTimeLogged()
          The time at which the server logged the error.
 int hashCode()
          returns a unique hash for all instances of this type
 boolean isLogged()
          Returns true if the error has been logged by the server.
 void setErrorMessage(java.lang.String errorMessage)
          Replace the message string.
 java.lang.String toString()
          Returns a string representation of this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getClassName

public java.lang.String getClassName()
Returns the server's class name for this exception.

Returns:
the server's class name for this exception.

getErrorSource

public java.lang.String getErrorSource()
The server's error source for the exception.

Returns:
the error source for this exception.

getErrorMessage

public java.lang.String getErrorMessage()
The error message to be presented to the user. When sent from newer servers this message will be appropriate for the client's locale.

Returns:
the error message
See Also:
SupportedFeatures.isServerLocalized()

getNonLocalizedMessage

public java.lang.String getNonLocalizedMessage()
The "default" (English) version of the error message.

Returns:
the error message
See Also:
SupportedFeatures.isServerLocalized()

getErrorCode

public int getErrorCode()
The exception's error code. It is only unique with respect top a given getClassName().

Returns:
the error code
See Also:
ServerException.getClassName()

isLogged

public boolean isLogged()
Returns true if the error has been logged by the server.

Returns:
true if the error was logged by the server.

getTimeLogged

public OLEDate getTimeLogged()
The time at which the server logged the error. The OLEDate double value will be 0.0 if the exception is not logged.

Returns:
the server time at which the error was logged

getLogEntry

public int getLogEntry()
The server log entry number for the error. -1 if not logged.

Returns:
the server log entry number for the error.

getAuxKeys

public java.lang.String[] getAuxKeys()
Returns an array of String keys to auxilary exception data that can be passed to getAuxData().

Returns:
an array of String keys to any auxiliary data. Will not return null.
See Also:
ServerException.getAuxData(String)

getAuxData

public java.lang.Object getAuxData(java.lang.String key)
Returns the auxilary data for a given gey.

Parameters:
key - a key to auxiliary data
Returns:
auxiliary data for the specified key or null if the key was not found.
See Also:
ServerException.getAuxKeys()

getMessage

public java.lang.String getMessage()
Returns this exeptions error message. If the exception is not logged then only the error message is returned. If it is logged then all fields are included. This is intended to be a useful message to present to an end user.

Overrides:
getMessage in class java.lang.Throwable
Returns:
a human-readable message for this exception.

toString

public java.lang.String toString()
Returns a string representation of this exception.

Overrides:
toString in class java.lang.Throwable
Returns:
a string representation of this exception.

setErrorMessage

public void setErrorMessage(java.lang.String errorMessage)
Replace the message string.


forError

public static ServerException forError(Server server,
                                       java.lang.String className,
                                       java.lang.String errorSource,
                                       int errorCode,
                                       java.lang.String errorMessage,
                                       boolean logged,
                                       double loggedTime,
                                       int logEntry,
                                       java.util.Hashtable auxiliaryData)

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.