Sun GlassFish Mobility Platform 1.1 Developer's Guide for Client Applications

The Client Class

Table 5–1 lists the constructors and methods belonging to the Client class. This class provides the entry point to the JerseyME API. Although the class contains a constructor, use the create method to create an instance of this class.

Table 5–1 Class com.sun.jerseyme.api.client.Client

Method 

Description 

Client()

No-argument constructor. 

public void clearCache()

Clears the cache, removing all local resources. 

public static Client create()

Returns an instance of this class. 

public WebResource resource(java.lang.String uri)

Returns a web resource (an instance of the WebResource class) given a URI.

public void setCachePolicy(long elapsedTime)

Sets the elapsed time, in milliseconds, after which a resource must be refreshed in the cache. If the argument is zero, resources are refreshed every time. If a resource cannot be refreshed, it will be returned from the cache, even if stale. 

public static void setLogging(boolean b)

Enables or disables logging in the API.