org.oclc.da.gdfr.registryprototype.exceptions
Class RegistrySystemException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.oclc.da.gdfr.registryprototype.exceptions.RegistrySystemException
- All Implemented Interfaces:
- java.io.Serializable
public class RegistrySystemException
- extends java.lang.RuntimeException
This exception class specifies system problems which must be fixed by the
support staff and not by the user. The exception condition is documented
in the methods that throw it, but does not need to be declared in the
signature of each method.
In this case, the user is presented with a simple
message, such as , while the exact problem is logged on the
server side. No additional information is provided since the proper
information about this error has already been logged on the server side and
the receiver of this error cannot correct the problem, can only report is
occurrence (which the system should already know about!).
- See Also:
RegistryException,
RegistryExceptionCodes,
Serialized Form
|
Method Summary |
void |
addMessage(int code,
java.lang.String[] args)
Add an additional message to the messages queue. |
int |
getErrorCode()
Return the exception type code. |
java.lang.String |
getMessage()
Return the exception messages as one string, each message separated
by new-line and 2 tabs. |
java.lang.String[] |
getMessages()
Return all the messages associated with this exception in an array. |
| Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RegistrySystemException
public RegistrySystemException()
- Publid default constructor. The
errorCode is set to
DAExceptionCodes.UNEXPECTED_SYSTEM_ERROR.
RegistrySystemException
public RegistrySystemException(int code,
java.lang.String[] args)
- Construct a new exception. The argument
code must be
declared in RegistryExceptionCodes.
- Parameters:
code - A code identifying the type of exception. I must match
one of the values in the list compiled by
RegistryExceptionCodes.args - The arguments for the message associated to code
in RegistryExceptionCodes.
Additional lines can be added to the message
by calling addMessage.
addMessage
public void addMessage(int code,
java.lang.String[] args)
- Add an additional message to the messages queue. This method is
helpful in cases where multiple fields are validated at once, and
hence more that one error may need to be reported, but only one
exception should be thrown.
The exception's error code is set to
RegistryExceptionCodes.MULTIPLE.
- Parameters:
code - A code identifying the type of exception. I must match
one of the values in the list compiled by
RegistryExceptionCodes.args - The arguments for the message associated to code
in RegistryExceptionCodes.
getErrorCode
public int getErrorCode()
- Return the exception type code.
- Returns:
- The type code of this exception.
getMessage
public java.lang.String getMessage()
- Return the exception messages as one string, each message separated
by new-line and 2 tabs.
- Overrides:
getMessage in class java.lang.Throwable
- Returns:
- The exception messages.
getMessages
public java.lang.String[] getMessages()
- Return all the messages associated with this exception in an array.
- Returns:
- All the messages associated with this exception .
Copyright © 2008 OCLC Online Computer Library Center, Inc.. All Rights Reserved.