Package com.mycompany.myproject.capi
Class CAPI
- java.lang.Object
-
- org.xins.client.AbstractCAPI
-
- com.mycompany.myproject.capi.CAPI
-
public final class CAPI extends AbstractCAPI
Stub for the myproject API.
-
-
Constructor Summary
Constructors Constructor Description CAPI(java.util.Map<java.lang.String,java.lang.String> properties)
Constructs a newCAPI
object for the specified API from a set of properties.CAPI(java.util.Map<java.lang.String,java.lang.String> properties, java.lang.String apiName)
Constructs a newCAPI
object for the specified API from a set of properties, specifying the API name to assume.CAPI(Descriptor descriptor)
Constructs a newCAPI
object, using the specifiedDescriptor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MyFunctionResult
callMyFunction(MyFunctionRequest request)
Calls the MyFunction function using the specified request object.MyFunctionResult
callMyFunction(Gender.Item gender, java.lang.String personLastName)
Calls the MyFunction function with the specified parameters.java.lang.String
getXINSVersion()
Returns the version of XINS used to generate this CAPI class.-
Methods inherited from class org.xins.client.AbstractCAPI
getAPIName, getAPISpecification, getXINSCallConfig, setXINSCallConfig
-
-
-
-
Constructor Detail
-
CAPI
public CAPI(java.util.Map<java.lang.String,java.lang.String> properties) throws java.lang.IllegalArgumentException, MissingRequiredPropertyException, InvalidPropertyValueException
Constructs a newCAPI
object for the specified API from a set of properties.- Parameters:
properties
- the properties to create aCAPI
object for, cannot benull
.- Throws:
java.lang.IllegalArgumentException
- ifproperties == null
.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 aCAPI
instance but its value is considered invalid.
-
CAPI
public CAPI(java.util.Map<java.lang.String,java.lang.String> properties, java.lang.String apiName) throws java.lang.IllegalArgumentException, MissingRequiredPropertyException, InvalidPropertyValueException
Constructs a newCAPI
object for the specified API from a set of properties, specifying the API name to assume.- Parameters:
properties
- the properties to create aCAPI
object for, cannot benull
.apiName
- the name of the API, cannot benull
and must be a valid API name.- Throws:
java.lang.IllegalArgumentException
- ifproperties == null || apiName == null
or ifapiName
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 aCAPI
instance but its value is considered invalid.
-
CAPI
public CAPI(Descriptor descriptor) throws java.lang.IllegalArgumentException, UnsupportedProtocolException
Constructs a newCAPI
object, using the specifiedDescriptor
.- Parameters:
descriptor
- the descriptor for the service(s), cannot benull
.- Throws:
java.lang.IllegalArgumentException
- ifdescriptor == null
.UnsupportedProtocolException
- if any of the target descriptors specifies an unsupported protocol (since XINS 1.1.0).
-
-
Method Detail
-
callMyFunction
public MyFunctionResult callMyFunction(MyFunctionRequest request) throws java.lang.IllegalArgumentException, UnacceptableRequestException, GenericCallException, HTTPCallException, NoVowelException, XINSCallException
Calls the MyFunction function using the specified request object.Description: A simple function that return a "hello" message to the person.
Generated from function specification version 1.8.
- Parameters:
request
- the request, cannot benull
.- Returns:
- the result, not
null
. - Throws:
java.lang.IllegalArgumentException
- ifrequest == null
.UnacceptableRequestException
- if the request is considered to be unacceptable; this is determined by callingrequest.
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.NoVowelException
- if the first call attempt failed due to the error code NoVowel being returned by the other end; and all the other call attempts (if any) failed as well; note that this exception is derived fromXINSCallException
, so if that one is caught, then this one is also caught.XINSCallException
- if the first call attempt failed due to a XINS-related reason and all the other call attempts (if any) failed as well.
-
callMyFunction
public MyFunctionResult callMyFunction(Gender.Item gender, java.lang.String personLastName) throws GenericCallException, HTTPCallException, NoVowelException, XINSCallException
Calls the MyFunction function with the specified parameters.Description: A simple function that return a "hello" message to the person.
Generated from function specification version 1.8.
- Parameters:
gender
- the gender of the person. Cannot benull
.personLastName
- the last name of the person. Cannot benull
.- Returns:
- the result, not
null
. - Throws:
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.NoVowelException
- if the first call attempt failed due to the error code NoVowel being returned by the other end; and all the other call attempts (if any) failed as well; note that this exception is derived fromXINSCallException
, so if that one is caught, then this one is also caught.XINSCallException
- if the first call attempt failed due to a XINS-related reason and all the other call attempts (if any) failed as well.
-
getXINSVersion
public java.lang.String getXINSVersion()
Returns the version of XINS used to generate this CAPI class.- Specified by:
getXINSVersion
in classAbstractCAPI
- Returns:
- the version as a
String
, e.g."3.11-dev"
; nevernull
.
-
-