Class ConstraintViolatedException
- java.lang.Object
- 
- java.lang.Throwable
- 
- java.lang.Exception
- 
- com.redwood.scheduler.infrastructure.exception.BaseSchedulerException
- 
- com.redwood.scheduler.infrastructure.exception.SchedulerException
- 
- com.redwood.scheduler.api.constraint.ConstraintViolatedException
 
 
 
 
 
- 
- All Implemented Interfaces:
- ExceptionRelatesToAPIObject,- ExceptionData,- Serializable
 
 public class ConstraintViolatedException extends SchedulerException implements ExceptionRelatesToAPIObject Exception when a constraint is violated. Is used in the context of a job and in the context of a table. This should result in different error messages (when used in the context of a table the message should also include which row in the table violates the constraint).- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedConstraintViolatedException(String newErrorCode, String messageFormat, Throwable cause, SchedulerEntity causeObject, String fieldName, Object[] exceptionDataEN, Object[] exceptionData)ConstraintViolatedException(Throwable cause, String parameterName, String message, SchedulerEntity entity)Constraint violated in the context of the given constraint entity.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRelatedField()If the cause of the exception is caused by a specific field then it returns the name of the fieldStringgetRelatedObjectType()What is the object type of the object that caused the exceptionLonggetRelatedUid()What is the UniqueId of the object that caused the exceptionStringgetTranslation()Get a translation for the exception.- 
Methods inherited from class com.redwood.scheduler.infrastructure.exception.BaseSchedulerExceptionbestException, getDefaultMessageFormat, getErrorCode, getExceptionData, getLocalizedMessage, getLocalizedMessage, getMessage, isSystemLoggable, skipException, toString
 - 
Methods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
- 
 
- 
- 
- 
Constructor Detail- 
ConstraintViolatedExceptionprotected ConstraintViolatedException(String newErrorCode, String messageFormat, Throwable cause, SchedulerEntity causeObject, String fieldName, Object[] exceptionDataEN, Object[] exceptionData) 
 - 
ConstraintViolatedExceptionpublic ConstraintViolatedException(Throwable cause, String parameterName, String message, SchedulerEntity entity) Constraint violated in the context of the given constraint entity.- Parameters:
- cause- The originating exception, null if this is the originating exception
- parameterName- The name of the parameter that failed to validate.
- message- The message to pass to the user.
- entity- The entity for which the constraint failed.
 
 
- 
 - 
Method Detail- 
getTranslationpublic String getTranslation() Description copied from interface:ExceptionDataGet a translation for the exception.- Specified by:
- getTranslationin interface- ExceptionData
- Overrides:
- getTranslationin class- BaseSchedulerException
- Returns:
- a translatable description of this exception.
 
 - 
getRelatedFieldpublic final String getRelatedField() Description copied from interface:ExceptionRelatesToAPIObjectIf the cause of the exception is caused by a specific field then it returns the name of the field- Specified by:
- getRelatedFieldin interface- ExceptionRelatesToAPIObject
- Returns:
- the name of the field that caused the exception, otherwise it returns null.
 
 - 
getRelatedObjectTypepublic final String getRelatedObjectType() Description copied from interface:ExceptionRelatesToAPIObjectWhat is the object type of the object that caused the exception- Specified by:
- getRelatedObjectTypein interface- ExceptionRelatesToAPIObject
- Returns:
- the object type of the object that caused the excpetion
 
 - 
getRelatedUidpublic final Long getRelatedUid() Description copied from interface:ExceptionRelatesToAPIObjectWhat is the UniqueId of the object that caused the exception- Specified by:
- getRelatedUidin interface- ExceptionRelatesToAPIObject
- Returns:
- the UniqueId of the object that caused the exception
 
 
- 
 
-