uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

getProperties() method

Description

This method acquires all the feature maps related to the client.

Syntax

public Map<String,Object> getProperties()

Parameter

None.

Return value

The method returns the feature map. The method does not return null.

Notes

An example of using the getProperties() method is as follows:

// Set up the client
ClientConfig cc = new DefaultClientConfig();
 
// Set the property read timeout value
cc.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, 10000);
 
// Generate the Client object by using client settings
Client client = Client.create(cc);
 
// Generate an HTTP request
ClientRequest cRequest= ClientRequest.create().build(new URI ("http://example.com/example"), "GET");
try{
 //Receive the HTTP response as the ClientResponse object
 ClientResponse cResponse = client.handle(cRequest);
} catch(ClientHandlerException e){
 // Execute the appropriate processing
}

In this example, initially a changeable property map is acquired with the getProperties method and the read timeout value is set to 10,000 milliseconds. A client instance is created by using these client settings with the create(ClientConfig cc) method of the Client class. Then, the ClientRequest object is created, the HTTP communication is performed by using the handle method of the Client class, and the HTTP response is received as the ClientResponse object. If the read timeout occurs before an HTTP response is completely read, an error (KDJJ18888-E) occurs and the ClientHandlerException exception that wraps the SocketTimeoutException exception is thrown.