Hitachi

uCosminexus Service Platform Reference Guide


3.10.1 HTTP adapter definition file

Organization of this subsection

(1) Format

[adphttp.protocol.encoding-type=Encoding format]
[adphttp.protocol.connect-timeout=Connection timeout time]
[adphttp.protocol.read-timeout=Reading timeout time]
[adphttp.protocol.chunked-encoding-size=Chunk size]
[adphttp.protocol.https-server-authentication={true|false}]
[adphttp.protocol.https-hostname-verification={true|false}]
 
[adphttp.file.read-lock.retry.count=Lock retry count in case of failure in shared lock acquisition]
[adphttp.file.read-lock.retry.interval=Lock retry interval in case of failure in shared lock acquisition]
 
[adphttp.data-size-limit.body-message=Maximum size of HTTP response body]
[adphttp.data-size-limit.file=Maximum size for file]
 
[adphttp.response-code.normal=Status code treated as normal processing]
[adphttp.response-code.fault=Status code treated as faulty processing]
 
[adphttp.auto-delete-incomplete-file={true|false}]
 
[adphttp.request.switchover.json-transfer.mode={true|false}]
[adphttp.response.switchover.json-transfer.mode={true|false}]
 
[adphttp.oauth.authentication={true|false}]

(2) Function

Sets up the operating information of HTTP adapter.

Create HTTP adapter definition file with file name as "cscadphttp.properties".

The contents that you have specified in HTTP adapter definition file become effective when HTTP adapter starts.

(3) File storage location

<Service platform installation directory>\CSC\custom-adapter\HTTP\config\templates\cscadphttp.properties
Important note

The file saved here is a template file. After copying this template file to any directory, edit the file and then create definition file.

(4) Specifiable properties

(a) Properties related to protocol operation specification

adphttp.protocol.encoding-type=Encoding format ~((gzip))

Specify the encoding format for the HTTP body to be sent and received. "gzip" is the only encoding format that you can specify. This format is not case-sensitive. Encoding format is not defined by default.

  • gzip

    HTTP body is automatically encoded.

Specify this property only when sending or receiving HTTP body in gzip format. When you do not want to send or receive HTTP body in gzip format, comment out or delete this property.

adphttp.protocol.connect-timeout=Connection timeout time ~<Number>((0 or between1 and 2147483647))<<60000>>

Specify connection timeout time in milliseconds. Connection does not timeout if you have specified 0 in the value.

adphttp.protocol.read-timeout=Read timeout time ~<Number>((0 or between 1 and 2147483647))<<300000>>

Specify read timeout time in milliseconds. Connection does not timeout if you have specified 0 in the value.

adphttp.protocol.chunked-encoding-size=Chunk size ~<Number>((0 or between 1 and 2147483647))<<0>>

Specify the value to be set for java.net.HttpURLConnection#setChunkedStreamingMode(Integer). Note, however, that whether a chunk with the specified size is sent depends on the JDK operation. If you do not want to send chunks, specify 0 or comment out this property.

Specify the chunk size as "4096" and increase or decrease it as and when required. When you specify any value for chunk size, consider the following points according to the environment to be used:

  • If you specify an extremely small value for chunk size (like a single digit number), chunk might not be sent.

  • If the chunk size is too small, overhead accompanying the chunk encoding becomes large.

  • If the chunk size is too big, memory becomes insufficient and an error occurs.

adphttp.protocol.https-server-authentication={true|false} <<true>>

Specify if server is to be validated during HTTPS communication. This property is not case sensitive.

  • true

    Validates server during HTTPS communication.

  • false

    Does not validate server during HTTPS communication.

adphttp.protocol.https-hostname-verification={true|false} ~<<true>>

Specify whether to verify the host during HTTPS communication. This property is not case sensitive.

  • true

    Verifies host name during HTTPS communication.

  • false

    Does not verify host name during HTTPS communication.

(b) Properties related to exclusive file access acquisition

adphttp.file.read-lock.retry.count=Lock retry count in case of failure in shared lock acquisition ~<Number>((0-1024))<<0>>

Specify the count of lock retries when there is a failure in acquiring shared lock for common folder.

adphttp.file.read-lock.retry.interval=Lock retry interval count in case of failure in shared lock acquisition~<Number>((1-1024))<<1>>

Specify the interval between lock retries when there is a failure in acquiring shared lock for common folder.

(c) Properties related to data size control

adphttp.data-size-limit.body-message=Maximum size of HTTP response body ~<Number>((Between -1 and 2147483647))<<-1>>

Specify the maximum size of data to be allowed when setting up HTTP response in response message (body), in bytes unit. If you specify -1, data size is not restricted.

adphttp.data-size-limit.file=Maximum size for file ~<Number>(Between -1 and 2147483647))<<-1>>

Specify the maximum size of data to be allowed when writing HTTP response to file, in bytes unit. If you have specified-1 in the value, data size is not restricted.

(d) Properties related to response code

adphttp.response-code.normal=Status code treated as normal processing ~<3-digit status code><<200>>

Specify a 3-digit status code, which is to be treated as normal process. When HTTP response of the specified status code is returned to HTTP adapter, status code is processed in a response message.

Status code is treated as normal process, fault process and system exception according to the judgment criteria. For details on the judgment criteria, see the description for setting normal process or fault process in status code, under "2.14.4 Relationship between HTTP responses and response messages" in "Service Platform Overview".

Specify multiple status codes in regular expression. The following snippet shows a setting example when a 200-series status code is treated as normal process.

adphttp.response-code.normal=2[0-9][0-9]

If a status code, which is not set to normal process or fault process, is passed to HTTP adapter the status code will become a system exception. If the key and value are omitted or if the value is omitted, operation is performed with the default value.

adphttp.response-code.fault=Status code treated as faulty processing ~<3-digit status code>

Specify a 3-digit status code which is to be treated as faulty processing. When the HTTP response of the status code specified here is returned to HTTP adapter, the status code is processed in a fault message. If you do not specify any value, the status code is not set.

Status code is treated as normal process, fault process and system exception according to the judgment criteria. For details on the judgment criteria, see the description for setting normal process or fault process in status code, under "2.14.4 Relationship between HTTP responses and response messages" in "Service Platform Overview".

Specify multiple status codes in regular expression. The following snippet shows a setting example, in which, all the status codes except the status codes specified in adphttp.response-code.normal property, are considered as fault response.

adphttp.response-code.fault=[1-9][0-9][0-9]

If a status code, which is not set to normal process or fault process, is passed to HTTP adapter the status code will become a system exception.

(e) Properties related to extension function

adphttp.auto-delete-incomplete-file={true|false} ~<<true>>

Specify whether to automatically delete the received files, in incomplete files are generated in common folder or work folder due to errors like network fault, I/O error or exceeded data size limit. This property is not case-sensitive.

  • true

    Automatically deletes received incomplete files.

  • false

    Does not automatically delete received incomplete files.

Select true, when you want to avoid storage consumption due to received incomplete files and select false, when you prefer to save (hold) the state when a fault occurs.

When the received incomplete files are not automatically deleted, to make sure that the free space in storage is not exhausted, you must manually delete the unwanted files as and when required. For details on how to delete, see "5.4.20 Deleting the work folder" and "5.4.22 Deleting files in the common folder" in "Service Platform Setup and Operation Guide".

(f) Properties related to JSON-XML transformation

adphttp.request.switchover.json-transfer.mode={true|false} ~ <<false>>

Specify whether to perform JSON-XML transformation during request processing of the HTTP adapter.

  • true

    JSON-XML transformation is performed during request processing of the HTTP adapter.

  • false

    JSON-XML transformation is not performed during request processing of the HTTP adapter.

adphttp.response.switchover.json-transfer.mode={true|false} ~ <<false>>

Specify whether to perform JSON-XML transformation during response processing of the HTTP adapter.

  • true

    JSON-XML transformation is performed during response processing of the HTTP adapter.

  • false

    JSON-XML transformation is not performed during response processing of the HTTP adapter.

(g) Properties related to OAuth 2.0 authentication

adphttp.oauth.authentication={true|false} ~ <<false>>

Specify whether to use the OAuth 2.0 authentication flow during execution of the HTTP adapter.

  • true

    The OAuth 2.0 authentication flow is used during execution of the HTTP adapter.

  • false

    The OAuth 2.0 authentication flow is not used during execution of the HTTP adapter.

Note

If you use the OAuth 2.0 authentication flow without specifying true, authentication information becomes invalid. If authentication information is invalid, an HTTP request might cause an error response or an access token might not be stored in the response message (header).

(5) Example of coding

An example of description is as follows:

adphttp.protocol.encoding-type=gzip
adphttp.protocol.connect-timeout=60000
adphttp.protocol.read-timeout=300000
adphttp.protocol.chunked-encoding-size=0
adphttp.protocol.https-server-authentication=true
adphttp.protocol.https-hostname-verification=true
adphttp.file.read-lock.retry.count=0
adphttp.file.read-lock.retry.interval=1
adphttp.data-size-limit.body-message=-1
adphttp.data-size-limit.file=-1
adphttp.response-code.normal=200
adphttp.response-code.fault=500
adphttp.auto-delete-incomplete-file=true
adphttp.request.switchover.json-transfer.mode=true
adphttp.response.switchover.json-transfer.mode=true

(6) Notes

Save property file character code to UTF-8. If you use a character code apart from UTF-8, the setting values may not be interpreted correctly.