Class 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 new CAPI 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 new CAPI object for the specified API from a set of properties, specifying the API name to assume.
      CAPI​(Descriptor descriptor)
      Constructs a new CAPI object, using the specified Descriptor.
    • Constructor Detail

      • CAPI

        public CAPI​(java.util.Map<java.lang.String,​java.lang.String> properties)
             throws java.lang.IllegalArgumentException,
                    MissingRequiredPropertyException,
                    InvalidPropertyValueException
        Constructs a new CAPI object for the specified API from a set of properties.
        Parameters:
        properties - the properties to create a CAPI object for, cannot be null.
        Throws:
        java.lang.IllegalArgumentException - if properties == 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 a CAPI 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 new CAPI object for the specified API from a set of properties, specifying the API name to assume.
        Parameters:
        properties - the properties to create a CAPI object for, cannot be null.
        apiName - the name of the API, cannot be null and must be a valid API name.
        Throws:
        java.lang.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.
      • CAPI

        public CAPI​(Descriptor descriptor)
             throws java.lang.IllegalArgumentException,
                    UnsupportedProtocolException
        Constructs a new CAPI object, using the specified Descriptor.
        Parameters:
        descriptor - the descriptor for the service(s), cannot be null.
        Throws:
        java.lang.IllegalArgumentException - if descriptor == 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 be null.
        Returns:
        the result, not null.
        Throws:
        java.lang.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.
        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 from XINSCallException, 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 be null.
        personLastName - the last name of the person. Cannot be null.
        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 from XINSCallException, 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 class AbstractCAPI
        Returns:
        the version as a String, e.g. "3.11-dev"; never null.