|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xins.client.AbstractCAPI
Base class for generated Client-side Application Programming Interface (CAPI) classes.
This class should not be derived from manually. This class is only
intended to be used as a superclass of CAPI
classes generated
by the XINS framework.
The constructors of this class are considered internal to XINS and should not be used directly. The behavior of the constructors may be changed in later releases of XINS or they may even be removed.
Constructor Summary | |
protected |
AbstractCAPI(Descriptor descriptor)
Creates a new AbstractCAPI object, using the specified
service descriptor. |
protected |
AbstractCAPI(Descriptor descriptor,
XINSCallConfig callConfig)
Creates a new AbstractCAPI object, using the specified
XINSServiceCaller . |
protected |
AbstractCAPI(PropertyReader properties,
String apiName)
Creates a new AbstractCAPI object based on the specified
set of properties and the specified name. |
Method Summary | |
protected XINSCallResult |
callImpl(AbstractCAPICallRequest request)
Executes the specified call request. |
protected AbstractCAPIErrorCodeException |
createErrorCodeException(XINSCallRequest request,
TargetDescriptor target,
long duration,
XINSCallResultData resultData)
Creates an AbstractCAPIErrorCodeException for the specified
error code. |
String |
getAPIName()
Determines the name of the API. |
protected String |
getAPINameImpl()
Retrieves the name of the API (implementation method). |
APISpec |
getAPISpecification()
Get the specification of the API. |
protected XINSServiceCaller |
getCaller()
Returns the XINS service caller to use. |
XINSCallConfig |
getXINSCallConfig()
Retrieves the call configuration currently associated with this CAPI object. |
abstract String |
getXINSVersion()
Returns the version of XINS used to build this CAPI class. |
void |
setXINSCallConfig(XINSCallConfig config)
Assigns the specified call configuration to this CAPI object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected AbstractCAPI(Descriptor descriptor, XINSCallConfig callConfig) throws IllegalArgumentException, UnsupportedProtocolException
AbstractCAPI
object, using the specified
XINSServiceCaller
.
This constructor is considered internal to XINS. Do not use it directly.
descriptor
- the descriptor for the service(s), cannot be null
.callConfig
- fallback configuration for the calls, or null
if a
default should be used.
IllegalArgumentException
- if descriptor == null
.
UnsupportedProtocolException
- if any of the target descriptors in descriptor
specifies
an unsupported protocol.protected AbstractCAPI(Descriptor descriptor) throws IllegalArgumentException, UnsupportedProtocolException
AbstractCAPI
object, using the specified
service descriptor.
A default XINS call configuration will be used.
This constructor is considered internal to XINS. Do not use it directly.
descriptor
- the descriptor for the service(s), cannot be null
.
IllegalArgumentException
- if descriptor == null
.
UnsupportedProtocolException
- if any of the target descriptors in descriptor
specifies
an unsupported protocol (since XINS 1.1.0).protected AbstractCAPI(PropertyReader properties, String apiName) throws IllegalArgumentException, MissingRequiredPropertyException, InvalidPropertyValueException
AbstractCAPI
object based on the specified
set of properties and the specified name.
A default XINS call configuration will be used.
This constructor is considered internal to XINS. Do not use it directly.
properties
- the properties to read from, cannot be null
.apiName
- the name of the API, cannot be null
and must be a valid
API name.
IllegalArgumentException
- if properties == null || apiName == null
or if
apiName
is not considered to be a valid API name.
MissingRequiredPropertyException
- if a required property is missing in the specified properties set.
InvalidPropertyValueException
- if one of the properties in the specified properties set is used to
create a CAPI
instance but its value is considered
invalid.Method Detail |
public final String getAPIName()
"<unknown>"
) if the name cannot be determined;
never null
.protected String getAPINameImpl()
The implementation of this method in class AbstractCAPI
returns null
.
null
if unknown.public final APISpec getAPISpecification() throws InvalidSpecificationException
APISpec
specification object.
InvalidSpecificationException
- if the specification cannot be found or is invalid.public final void setXINSCallConfig(XINSCallConfig config)
config
- the call configuration to apply when executing a call with this CAPI
object, or null
if no specific call configuration should be
associated with CAPI object; note that the call configuration can be
overridden by the request, see
AbstractCAPICallRequest.configure(XINSCallConfig)
.public final XINSCallConfig getXINSCallConfig()
null
if no specific call configuration is associated
with this cAPI object; note that the call configuration can be
overridden by the request, see
AbstractCAPICallRequest.configuration()
.protected XINSServiceCaller getCaller()
This method is considered internal to XINS. It should not be called directly, nor overridden.
This method is expected to be marked final
in XINS
2.0. This is not done yet to remain fully compatible with XINS 1.x.
XINSServiceCaller
to use, never null
.public abstract String getXINSVersion()
String
, cannot be null
.protected final XINSCallResult callImpl(AbstractCAPICallRequest request) throws IllegalArgumentException, UnacceptableRequestException, GenericCallException, HTTPCallException, XINSCallException
This method is provided for CAPI subclasses.
request
- the call request to execute, cannot be null
.
null
.
IllegalArgumentException
- if request == null
.
UnacceptableRequestException
- if the request is considered to be unacceptable; this is determined
by calling
request.
checkParameters()
.
GenericCallException
- if the first call attempt failed due to a generic reason and all the
other call attempts (if any) failed as well.
HTTPCallException
- if the first call attempt failed due to an HTTP-related reason and
all the other call attempts (if any) failed as well.
XINSCallException
- if the first call attempt failed due to a XINS-related reason and
all the other call attempts (if any) failed as well.protected AbstractCAPIErrorCodeException createErrorCodeException(XINSCallRequest request, TargetDescriptor target, long duration, XINSCallResultData resultData) throws IllegalArgumentException, UnacceptableErrorCodeXINSCallException
AbstractCAPIErrorCodeException
for the specified
error code. If the specified error code is not recognized, then
null
is returned.
request
- the original request, should not be null
.target
- descriptor for the target that was attempted to be called, should not
be null
.duration
- the call duration in milliseconds, should be >= 0.resultData
- the result data, should not be null
and should have an
error code set.
AbstractCAPIErrorCodeException
instance, otherwise
null
.
IllegalArgumentException
- if request == null
|| target == null
|| duration < 0
|| resultData == null
|| resultData.getErrorCode() == null
.
UnacceptableErrorCodeXINSCallException
- if the specified error code is recognized but is considered
unacceptable for the function specified in the request.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |