|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vladnput.VladError
public class VladError
Class representing a single validation error. It contains information about the requesting IP address, URL, and parameter (if applicable) that failed to validate, as well as a generic message and a list of detailed messages about the error. There is also a maximum number of times that this URL and parameter name combination should be logged and whether this error should be enforced or not. Errors that are not enforced will be logged. It the responsibility of the web application to reject requests that produce enforced errors. Detailed messages are helpful for the cases where a single type can validate multiple aspects. For instance, a string type might check that the string matches a regular expression as well as minimum and maximum length checks. If a value violates both the regular expression and the maximum length, then the detail messages can indicate that both constraints were violated while the generic message can indicate that there was a problem with the parameter without giving that level of detail. A user interface can present these two levels of detail or choose to ignore one or the other as deemed appropriate. This class is not thread-safe.
Constructor Summary | |
---|---|
VladError(java.lang.String url,
java.lang.String paramName,
java.lang.String paramValue,
java.lang.String message,
java.lang.String remoteAddr,
java.lang.Integer maxLog,
boolean enforce)
Constructs a new error. |
Method Summary | |
---|---|
void |
addDetail(java.lang.String msg)
Adds a detailed error message. |
java.util.List<java.lang.String> |
getDetails()
Gets the detailed messages. |
boolean |
getEnforce()
Returns true if the error should be enforced (causing the request to be rejected), false otherwise. |
java.lang.Integer |
getMaxLog()
Returns the maximum number of times this url and parameter name combination should be logged. |
java.lang.String |
getMessage()
Returns the generic error message |
java.lang.String |
getParamName()
Returns the name of the invalid parameter |
java.lang.String |
getParamValue()
Returns the value of the invalid parameter |
java.lang.String |
getRemoteAddr()
Returns the IP address of client that issued the invalid request |
java.lang.String |
getUrl()
Returns the URL of the invalid request |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VladError(java.lang.String url, java.lang.String paramName, java.lang.String paramValue, java.lang.String message, java.lang.String remoteAddr, java.lang.Integer maxLog, boolean enforce)
url
- The URL of the invalid requestparamName
- The invalid parameter name, or null if the URL itself was the problemparamValue
- The invalid parameter value, or null if the URL itself was the problemmessage
- Generic message about the errorremoteAddr
- The client IP address which issued the requestmaxLog
- The maximum number of times this url and parameter name combination should be logged, or null for no limitenforce
- Whether or not this error should be enforcedMethod Detail |
---|
public java.lang.String getUrl()
public java.lang.String getParamName()
public java.lang.String getParamValue()
public java.lang.String getMessage()
public java.lang.String getRemoteAddr()
public java.lang.Integer getMaxLog()
public boolean getEnforce()
public void addDetail(java.lang.String msg)
msg
- The messagepublic java.util.List<java.lang.String> getDetails()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |