org.xins.client
Class AbstractCAPICallRequest

java.lang.Object
  extended byorg.xins.client.AbstractCAPICallRequest
All Implemented Interfaces:
Serializable

public abstract class AbstractCAPICallRequest
extends Object
implements Serializable

Base class for generated CAPI function request classes.

This class should not be subclassed manually. It is only intended to be subclassed by classes generated by XINS.

Since:
XINS 1.2.0
Version:
$Revision: 1.36 $ $Date: 2006/08/28 09:12:30 $
Author:
Ernst de Haan
See Also:
Serialized Form

Constructor Summary
protected AbstractCAPICallRequest(String functionName)
          Creates a new AbstractCAPICallRequest.
 
Method Summary
protected  void add(Element element)
          Add a new Element to the data element.
abstract  UnacceptableRequestException checkParameters()
          Validates whether this request is considered acceptable.
 XINSCallConfig configuration()
          Retrieves the call configuration currently associated with this request.
 void configure(XINSCallConfig config)
          Assigns the specified call configuration to this request.
 String functionName()
          Gets the name of the function to call.
protected  Element getDataElement()
          Gets the data section.
protected  String getParameter(String parameterName)
          Gets the value of a parameter or null if this parameter is not set.
protected  void parameterValue(String name, String value)
          Sets the specified parameter to the specified value.
protected  void putDataSection(Element dataSection)
          Sets the data section.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCAPICallRequest

protected AbstractCAPICallRequest(String functionName)
                           throws IllegalArgumentException
Creates a new AbstractCAPICallRequest.

Parameters:
functionName - the name of the function used with this request.
Throws:
IllegalArgumentException - if functionName == null.
Method Detail

parameterValue

protected final void parameterValue(String name,
                                    String value)
                             throws IllegalArgumentException
Sets the specified parameter to the specified value.

Parameters:
name - the name of the parameter to set, cannot be null.
value - the character string representation of the value of the parameter, can be null.
Throws:
IllegalArgumentException - if name == null.

configure

public final void configure(XINSCallConfig config)
Assigns the specified call configuration to this request.

Parameters:
config - the call configuration to apply when executing this request, or null if no specific call configuration should be associated with this request.

configuration

public final XINSCallConfig configuration()
Retrieves the call configuration currently associated with this request.

Returns:
the call configuration currently associated with this request, which will be applied when executing this request, or null if no specific call configuration is associated with this request.

getParameter

protected final String getParameter(String parameterName)
Gets the value of a parameter or null if this parameter is not set.

Parameters:
parameterName - The name of the parameter, can be null.
Returns:
The value of a parameter or null if this parameter is not set.

putDataSection

protected final void putDataSection(Element dataSection)
Sets the data section. If the value is null any previous data section set is removed. If a previous value was entered, the value will be overridden by this new value.

Parameters:
dataSection - The data section.

functionName

public final String functionName()
Gets the name of the function to call.

Returns:
The name of the function to call, never null.
Since:
XINS 1.4.0

add

protected void add(Element element)
Add a new Element to the data element. Any previous value was entered with the method putDataSection(org.xins.common.xml.Element), will be removed.

Parameters:
element - the new element to add to the result, cannot be null.
Since:
XINS 1.3.0

getDataElement

protected Element getDataElement()
Gets the data section.

Returns:
The data section or null if there is no data section.

checkParameters

public abstract UnacceptableRequestException checkParameters()
Validates whether this request is considered acceptable. If any constraints are violated, then an UnacceptableRequestException is returned.

This method is called automatically when this request is executed, so it typically does not need to be called manually in advance.

Returns:
an UnacceptableRequestException instance if this request is considered unacceptable, otherwise null.


See http://www.xins.org/.