|
soap tutorial | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectadriani.jws.template.wrappers.Wrapper
adriani.jws.template.wrappers.WrapperOut
public abstract class WrapperOut
WrapperOut - general class wrapping the root ADBBean
element containing a general
output result. This class should be the general parent class for all output wrappers.
This class can wrap an actual array of Wrapper
objects, a single Wrapper
object
or none other wrapper (if the SOAP response does not contain any nested structure).
In this way if the WSDL specifications changed the whole architecture
should not change: to change from an array-oriented response to a simple plain response just change the
implementation the validate()
method.
Field Summary | |
---|---|
protected java.lang.StringBuffer |
details
The text message describing the status of the response. |
protected static java.lang.String |
leadingName
Beginning of each logging message produced by this class. |
protected java.lang.StringBuffer |
message
The text message describing the status of the response. |
static java.lang.StringBuffer |
MESSAGE_NOK
Static reference values for the MESSAGE field. |
static java.lang.StringBuffer |
MESSAGE_OK
Static reference values for the MESSAGE field. |
static java.lang.StringBuffer |
MESSAGE_UNSET
Static reference values for the MESSAGE field. |
static java.lang.StringBuffer |
MESSAGE_WRONG
Static reference values for the MESSAGE field. |
static java.lang.StringBuffer |
NO_DETAILS
Static reference values for the VERBOSE field. |
protected Wrapper[] |
records
The array of the "inner wrappers" stored as CLASS FIELD before validation. |
protected int |
status
The integer code describing the status of the response. |
static int |
STATUS_OK
Static reference value for the STATUS field. |
static int |
STATUS_UNSET
Static reference value for the STATUS field. |
static int |
STATUS_WRONG
Static reference value for the STATUS field. |
Fields inherited from class adriani.jws.template.wrappers.Wrapper |
---|
element, logger, NO_NUMBER, NOT_AVAILABLE, NOT_BIG_INTEGER, UNDEFINED |
Constructor Summary | |
---|---|
WrapperOut()
Stateless constructor, loading the default values into this wrapper. |
|
WrapperOut(Wrapper[] array)
Stateful constructor, creating an WrapperSearch set with the input array. |
Method Summary | |
---|---|
abstract void |
forceMessage(java.lang.String message)
Set a string message in the inner ADBBean element, without checking for validation and
overwriting the previous value of the message class attribute (if any). |
abstract void |
forceStatus(int value)
Set an integer value in the wrapped ADBBean element, without checking for validation and ignoring the value of the status class attribute. |
java.lang.StringBuffer |
getDetails()
Return the detailed text message wrapped by this class. |
java.lang.StringBuffer |
getMessage()
Return the value of the text message wrapped by this class. |
Wrapper[] |
getRecords()
Return the array of Wrapper records wrapped by this class. |
int |
getStatus()
Return the value of the status flag wrapped by this class. |
void |
reset()
Cleans the inner wrapper (or the inner array of wrappers), by resetting all fields to their minimal value. |
void |
setDefaults()
Load all the STATIC default values (defined in this class) into the corresponding class attributes. |
void |
setDetails(java.lang.StringBuffer value)
Set the detailed text message wrapped by this class. |
void |
setMessage(java.lang.StringBuffer value)
Set the value of the text message wrapped by this class. |
void |
setRecords(Wrapper[] value)
Set the array of Wrapper records wrapped by this class. |
void |
setStatus(int value)
Set the value of the status flag wrapped by this class. |
abstract boolean |
validate()
Validation is performed by the Eclipse's ADBBean objects (e.g. |
Methods inherited from class adriani.jws.template.wrappers.Wrapper |
---|
compareSB, getElement |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Wrapper[] records
protected int status
protected java.lang.StringBuffer message
protected java.lang.StringBuffer details
public static int STATUS_OK
public static int STATUS_WRONG
public static int STATUS_UNSET
public static java.lang.StringBuffer MESSAGE_OK
public static java.lang.StringBuffer MESSAGE_NOK
public static java.lang.StringBuffer MESSAGE_WRONG
public static java.lang.StringBuffer MESSAGE_UNSET
public static java.lang.StringBuffer NO_DETAILS
protected static java.lang.String leadingName
Constructor Detail |
---|
public WrapperOut()
ADBBean
element is instantiated, because we delegate
this task to the validate()
method, in order to grant loose coupling.
setDefaults()
public WrapperOut(Wrapper[] array)
WrapperSearch
set with the input array.
array
- the array of WrapperSearch[]
Method Detail |
---|
public abstract boolean validate() throws WrapperFault
ADBBean
objects (e.g. TownType.setTownType() etc.)
If the validation process is succesfull, the resulting ADBBean
object is stored as
class field to save computation time, since after validation we expect that the method
getElement()
should be invoked.ADBBean
Java classes
should be used only within this method and in the forceMessage()
method, not elsewhere.
validate
in class Wrapper
true
if all the mandatory ADBBean
objects have been set correctly
WrapperFault
public void setDefaults()
records
array of Wrapper
objects
as expected by the default empty response.Wrapper
object, this
method should create an array with just one record.
setDefaults
in class Wrapper
Wrapper
,
forceMessage(String message)
public abstract void forceStatus(int value)
status
class attribute. This method is used when validation fails and it's
necessary to set the response status in the status field of the wrapped ADBBean element.
value
- the response status valuepublic abstract void forceMessage(java.lang.String message)
ADBBean
element, without checking for validation and
overwriting the previous value of the message
class attribute (if any).
This method is used when validation fails and it's necessary to communicate the error in a message field
of the wrapped ADBBean
element (usually the message field).ADBBean
structure in the validate()
method.
message
- the error message that must be set in the proper message field of the responsepublic void reset()
ADBBean
elements.
public int getStatus()
1
for a good valid SOAP response, 0
elsewhere.
Subclasses can change this definitions by overriding the static STATUS_XXX
fields.
public java.lang.StringBuffer getMessage()
MESSAGE_XXX
fields.
public java.lang.StringBuffer getDetails()
message
text.
public Wrapper[] getRecords()
Wrapper
records wrapped by this class.Wrapper
object, this should be stored
into the records[0]
element.
Wrapper
records (the wrapper's class field)public void setStatus(int value)
1
for a good valid SOAP response, 0
elsewhere.
Subclasses can change this definitions by overriding the static STATUS_XXX
fields.
value
- the integer status flag (will be stored as class field)public void setMessage(java.lang.StringBuffer value)
MESSAGE_XXX
fields.
value
- the text status message (will be stored as class field)public void setDetails(java.lang.StringBuffer value)
message
text.
value
- the detailed text status message (the wrapper's class field)public void setRecords(Wrapper[] value)
Wrapper
records wrapped by this class.Wrapper
object, this should be stored
into the records[0]
element.
value
- the array of Wrapper
records ((will be stored as class field)
|
Build 18/09/2012 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |