com.noelios.restlet.local
Class LocalClientHelper

java.lang.Object
  extended by org.restlet.util.Helper<T>
      extended by com.noelios.restlet.ConnectorHelper<Client>
          extended by com.noelios.restlet.ClientHelper
              extended by com.noelios.restlet.local.LocalClientHelper
Direct Known Subclasses:
ClapClientHelper, EntityClientHelper

public class LocalClientHelper
extends ClientHelper

Connector to the local resources accessible via file system, class loaders and similar mechanisms. Here is the list of parameters that are supported:

Parameter name Value type Default value Description
timeToLive int 600 Time to live for a representation before it expires (in seconds). If you set the value to '0', the representation will never expire.
defaultLanguage String When no metadata service is available (simple client connector with no parent application), falls back on this default language. To indicate that no default language should be set, "*" or "" can be used.

Author:
Jerome Louvel, Thierry Boileau
See Also:
LocalReference

Constructor Summary
LocalClientHelper(Client client)
          Constructor.
 
Method Summary
 java.lang.String getDefaultLanguage()
          Returns the default language.
 MetadataService getMetadataService(Request request)
          Returns the metadata service associated to a request.
 int getTimeToLive()
          Returns the time to live for a file representation before it expires (in seconds).
 void updateMetadata(MetadataService metadataService, java.lang.String entryName, Variant variant)
          Updates some variant metadata based on a given entry name with extensions.
 
Methods inherited from class com.noelios.restlet.ClientHelper
getConnectTimeout
 
Methods inherited from class com.noelios.restlet.ConnectorHelper
getProtocols, start, stop, update
 
Methods inherited from class org.restlet.util.Helper
getAttributes, getContext, getHelped, getHelpedParameters, getLogger, handle, setHelped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalClientHelper

public LocalClientHelper(Client client)
Constructor. Note that the common list of metadata associations based on extensions is added, see the addCommonExtensions() method.

Parameters:
client - The client to help.
Method Detail

getDefaultLanguage

public java.lang.String getDefaultLanguage()
Returns the default language. When no metadata service is available (simple client connector with no parent application), falls back on this default language.

Returns:
The default language.

getMetadataService

public MetadataService getMetadataService(Request request)
Returns the metadata service associated to a request.

Parameters:
request - The request to lookup.
Returns:
The metadata service associated to a request.

getTimeToLive

public int getTimeToLive()
Returns the time to live for a file representation before it expires (in seconds).

Returns:
The time to live for a file representation before it expires (in seconds).

updateMetadata

public void updateMetadata(MetadataService metadataService,
                           java.lang.String entryName,
                           Variant variant)
Updates some variant metadata based on a given entry name with extensions.

Parameters:
metadataService - The parent metadata service.
entryName - The entry name with extensions.
variant - The variant to update.


Copyright © 2005-2008 Noelios Technologies.