|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.basics.util.MessageUtil
public class MessageUtil
General utilities useful when dealing with messages.
| Field Summary | |
|---|---|
static java.lang.String |
FIELDERROR
A general code used for all field level errors. |
static java.lang.String |
INVALIDFORM
A general code used for all general update errors. |
static java.lang.String |
PROB_DELIMITER
The string used to delimit multiple field problems. |
| Constructor Summary | |
|---|---|
MessageUtil()
|
|
| Method Summary | |
|---|---|
static void |
appendError(ErrorInfoCollection eic,
java.lang.String errtext)
Convenience method to append a general error to the given collection. |
static java.lang.String |
appendError(java.lang.String errorText,
java.lang.String addText)
Appends addText to errorText separated by PROB_DELIMITER if errorText was not the empty String. |
static void |
appendFieldError(ErrorInfoCollection eic,
java.lang.String field,
java.lang.String errtext)
Convenience method to append a field error the given collection. |
static SandCollectionMessage |
completeCollection(SandQueryMessage sqm,
Messageable node)
A generalized query processing method that will return the entire collection of elements matching the query. |
static boolean |
containsID(SandCollectionMessage coll,
long id)
Return true if the given collection message contains an instance with the given id, false otherwise. |
static void |
defaultUnauthorizedFields(SandInstanceMessage sim,
AuthUser user,
AuthFilter filter,
Logger logger)
Set any unauthorized fields to their default values. |
boolean |
hasErrors(AggregateUpdate au)
Return true if the given AggregateUpdate contains errors. |
static java.lang.String |
infoAsString(ErrorInfo[] eis)
Return the ErrorInfoCollection contents as a string. |
static UIFormContext |
noteError(UIFormContext uifc,
AggregateUpdate au)
Note the errors from the given AggregateUpdate in the given UIFormContext and return it. |
static void |
verifyAuthUser(ErrorInfoCollection eic,
AuthUser user)
Verify that the username and password fields meet common usage assumptions. |
static ErrorInfoCollection |
verifyFieldsBase(SandInstanceMessage sim)
Verify that all the fields are valid according to the fieldsValid method of the given SandIntanceMessage. |
static ErrorInfoCollection |
verifyFieldsFull(SandInstanceMessage sim)
Verify that all the fields are valid according to the fieldsValid method of the given SandIntanceMessage, and the verifyAuthUser method here. |
static void |
verifyTransmission(SandTransmitMessage stm)
Throw if the transmission status is anything other than normal. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROB_DELIMITER
public static final java.lang.String FIELDERROR
public static final java.lang.String INVALIDFORM
| Constructor Detail |
|---|
public MessageUtil()
| Method Detail |
|---|
public static java.lang.String appendError(java.lang.String errorText,
java.lang.String addText)
public static java.lang.String infoAsString(ErrorInfo[] eis)
public static UIFormContext noteError(UIFormContext uifc,
AggregateUpdate au)
public boolean hasErrors(AggregateUpdate au)
public static ErrorInfoCollection verifyFieldsBase(SandInstanceMessage sim)
public static ErrorInfoCollection verifyFieldsFull(SandInstanceMessage sim)
public static void verifyAuthUser(ErrorInfoCollection eic,
AuthUser user)
This is intended to provide some default checking functionality and is not a universal solution implementation.
public static void defaultUnauthorizedFields(SandInstanceMessage sim,
AuthUser user,
AuthFilter filter,
Logger logger)
public static void appendError(ErrorInfoCollection eic,
java.lang.String errtext)
public static void appendFieldError(ErrorInfoCollection eic,
java.lang.String field,
java.lang.String errtext)
public static boolean containsID(SandCollectionMessage coll,
long id)
public static void verifyTransmission(SandTransmitMessage stm)
throws SandException
SandException
public static SandCollectionMessage completeCollection(SandQueryMessage sqm,
Messageable node)
throws SandException
SandException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||