|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
com.buildforge.services.common.ServiceException
com.buildforge.services.common.api.APIException
public class APIException
Internationalized exceptions for the API layer.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.buildforge.services.common.ServiceException |
---|
ServiceException.WrappedServiceException |
Field Summary |
---|
Fields inherited from class com.buildforge.services.common.ServiceException |
---|
CLASS |
Constructor Summary | |
---|---|
APIException(MessageDBO msg)
Construct a new APIException from a pre-built message. |
|
APIException(MessageDBO msg,
java.lang.Throwable cause)
Construct a new APIException from a pre-built message. |
|
APIException(java.lang.String id)
Construct a new APIException. |
|
APIException(java.lang.String id,
int arg)
Construct a new APIException. |
|
APIException(java.lang.String id,
int arg0,
int arg1)
Construct a new APIException. |
|
APIException(java.lang.String id,
int arg0,
java.lang.String arg1)
Construct a new APIException. |
|
APIException(java.lang.String id,
int arg,
java.lang.Throwable cause)
Construct a new APIException. |
|
APIException(java.lang.String id,
java.lang.String arg)
Construct a new APIException. |
|
APIException(java.lang.String id,
java.lang.String[] args)
Construct a new APIException. |
|
APIException(java.lang.String id,
java.lang.String[] args,
java.lang.Throwable cause)
Construct a new APIException |
|
APIException(java.lang.String id,
java.lang.String arg0,
int arg1)
Construct a new APIException. |
|
APIException(java.lang.String id,
java.lang.String arg0,
java.lang.String arg1)
Construct a new APIException. |
|
APIException(java.lang.String id,
java.lang.String arg,
java.lang.Throwable cause)
Construct a new APIException. |
|
APIException(java.lang.String id,
java.lang.Throwable cause)
Construct a new APIException. |
Method Summary | |
---|---|
static APIException |
badEnum(java.lang.Class<? extends java.lang.Enum<?>> cls,
java.lang.String value)
Convenience method for creating an APIException that reports an attempt to use an invalid value for an enumerated constant. |
static APIException |
badIndex(int index)
Index out of bounds. |
static APIException |
collision(java.lang.String dbo,
java.lang.String field,
int value)
Convenience method for collisions on numeric fields. |
static APIException |
collision(java.lang.String dbo,
java.lang.String field,
java.lang.String value)
Returns a new exception indicating that a create or rename failed because there was some form of data collision. |
static APIException |
dead(java.lang.String dbo)
Convenience method for creating an APIException that reports the attempt to manipulate an object that the client has not yet determined to be live. |
static APIException |
invalid(java.lang.String dbo,
java.lang.String field)
Convenience method for creating an APIException that reports the attempt to make a request that omits or gives an invalid value for a specific, required field. |
static APIException |
live(java.lang.String dbo)
Convenience method for creating an APIException that reports the attempt to create an object that is already known to the client to be a live object. |
static APIException |
malformed(java.lang.String dbo,
int expected,
int got)
Convenience method for creating an APIException that reports the receipt of a malformed DBO from the wire protocol. |
static APIException |
missing(java.lang.String key)
Missing required parameter. |
static APIException |
needLevel(int level)
Access denied. |
static APIException |
needPerm(Permission perm)
Permission denied. |
static APIException |
needRoot()
Permission denied. |
static APIException |
needSystem()
Permission denied. |
static APIException |
noRows(java.lang.String dbo,
java.lang.String id)
Convenience method for creating an APIException that reports the attempt to update an object for which no matching rows could be found in the database. |
Methods inherited from class com.buildforge.services.common.ServiceException |
---|
getMessage, getMessageKey, getMessageObject, wrap |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public APIException(MessageDBO msg)
msg
- the internationalized error message
java.lang.NullPointerException
- if msg is nullpublic APIException(MessageDBO msg, java.lang.Throwable cause)
msg
- the internationalized error messagecause
- an exception that caused this exception to occur
java.lang.NullPointerException
- if msg is nullpublic APIException(java.lang.String id)
id
- a unique error id for a translatable messagepublic APIException(java.lang.String id, java.lang.String[] args)
id
- a unique error id for a translatable messageargs
- arguments for the translationpublic APIException(java.lang.String id, java.lang.String arg0, int arg1)
public APIException(java.lang.String id, int arg0, java.lang.String arg1)
public APIException(java.lang.String id, java.lang.String arg0, java.lang.String arg1)
id
- a unique error id for a translatable messagearg
- a single argument for the translationpublic APIException(java.lang.String id, int arg0, int arg1)
id
- a unique error id for a translatable messagearg
- a single argument for the translationpublic APIException(java.lang.String id, int arg)
id
- a unique error id for a translatable messagearg
- a single argument for the translationpublic APIException(java.lang.String id, java.lang.String arg)
id
- a unique error id for a translatable messagearg
- a single argument for the translationpublic APIException(java.lang.String id, java.lang.Throwable cause)
id
- a unique error id for a translatable messagecause
- the exception to use when initializing the causepublic APIException(java.lang.String id, java.lang.String[] args, java.lang.Throwable cause)
id
- a unique error id for a translatable messageargs
- arguments for the translationcause
- the exception to use when initializing the causepublic APIException(java.lang.String id, int arg, java.lang.Throwable cause)
id
- a unique error id for a translatable messagearg
- a single argument for the translationcause
- the exception to use when initializing the causepublic APIException(java.lang.String id, java.lang.String arg, java.lang.Throwable cause)
id
- a unique error id for a translatable messagearg
- a single argument for the translationcause
- the exception to use when initializing the causeMethod Detail |
---|
public static APIException badEnum(java.lang.Class<? extends java.lang.Enum<?>> cls, java.lang.String value)
cls
- the enumeration classvalue
- the value that was used (may be null)
public static APIException invalid(java.lang.String dbo, java.lang.String field)
If en_US.ini contains:
Cron=Schedule Entry ID=Identifier GenericInvalid=A valid %s %s must be specified.then the exception generated by calling
invalid
("Cron", "ID")
will render its message as
"A valid Schedule Entry Identifier must be specified."
in the en_US locale.
dbo
- the type of object that was not valid (indirect)field
- the type of identifying object field that was
invalid (indirect)
public static APIException malformed(java.lang.String dbo, int expected, int got)
dbo
- the type of database object causing the problem (indirect)expected
- the number of data fields that were expectedgot
- the number of data fields that were actually received
public static APIException dead(java.lang.String dbo)
dbo
- the type of database object causing the problem (indirect)
public static APIException live(java.lang.String dbo)
dbo
- the type of database object causing the problem (indirect)
public static APIException noRows(java.lang.String dbo, java.lang.String id)
dbo
- the type of database object causing the problem (indirect)id
- the identifier used for the lookup
public static APIException collision(java.lang.String dbo, java.lang.String field, java.lang.String value)
dbo
- the type of database object causing the problem (indirect)field
- the type of identifying object field that was
invalid (indirect)value
- the value that is already in use
public static APIException collision(java.lang.String dbo, java.lang.String field, int value)
exists
(
dbo, field, String.valueOf(value) )
.
dbo
- the type of database object causing the problem (indirect)field
- the type of identifying object field that was
invalid (indirect)value
- the value that is already in use
public static APIException missing(java.lang.String key)
public static APIException needRoot()
public static APIException needSystem()
public static APIException needPerm(Permission perm)
public static APIException needLevel(int level)
public static APIException badIndex(int index)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |