org.dvb.spi.ict
Interface InteractionChannelTransportProvider

All Superinterfaces:
Provider, SystemBoundProvider

public interface InteractionChannelTransportProvider
extends SystemBoundProvider

This interface will be implemented by system providers of resource transport via the interaction channel. It will be used by the GEM implementation when accessing resources identified by references (URIs) encountered within the interaction channel protocol descriptor. In addition, this provider may be accessed indirectly from DVB-J applications via the java.io.File and org.dvb.dsmcc.DSMCCObject classes.


Method Summary
 ResourceTransportObject createResourceTransportObject(java.lang.String uri)
          Create new resource access object in preparation for downloading and using the contents of a network resource via the interaction channel.
 boolean exists(java.lang.String uri)
          Return a flag indicating whether the specified resource exists.
 boolean existsSupported()
          Return a flag indicating whether this provider supports existence checks using the exists() method on the provider implementation.
 java.lang.String[] getSupportedURISchemes()
          Return the list of URI schemes supported by this provider.
 void prefetch(java.lang.String uri, int priority)
          Provides a hint to the provider that the resource identified by the specified URI will probably be accessed in the near future, so that if available resources permit and the provider supports prefetching it can take whatever steps are appropriate to speed up the time required to load the file when the subsequent request to load the file is made via the normal call to ResourceTransportObject.synchronousLoad() or ResourceTransportObject.asynchronousLoad().
 boolean prefetchSupported()
          Return a flag indicating whether this provider supports prefetch.
 
Methods inherited from interface org.dvb.spi.Provider
getName, getServiceProviderInterfaces, getVersion, providerRegistered, providerUnregistered
 

Method Detail

getSupportedURISchemes

java.lang.String[] getSupportedURISchemes()
Return the list of URI schemes supported by this provider. This method will be called by the GEM implementation exactly once immediately subsequent to registration of the provider. The GEM implementation will only call createResourceTransport on this provider for URI schemes that are returned by this method. In the case where multiple providers return the same URI scheme, the provider that will be used will be the one that most recently registered.

Note that if http or https are contained in the returned list they will be ignored. In other words, the service provider cannot override the GEM implementation's internal implementation of the HTTP and HTTPS protocols.

Returns:
String[] - list of supported URI schemes, each of which must consist of alphabetic characters only (no trailing ":")

createResourceTransportObject

ResourceTransportObject createResourceTransportObject(java.lang.String uri)
Create new resource access object in preparation for downloading and using the contents of a network resource via the interaction channel.

Parameters:
uri - URI identifying the resource to be accessed, the URI scheme of which is guaranteed to be one of those returned from getSupportedURISchemes
Returns:
ResourceTransportObject - the object used to track download of the resource

prefetchSupported

boolean prefetchSupported()
Return a flag indicating whether this provider supports prefetch. Note that a return value of true does not guarantee that a call to prefetch() for a particular resource will have any effect. It is merely an indication of whether the provider supports prefetch hints in general.

Returns:
boolean - Flag indicating whether this provider supports prefetch hints via the prefetch() method

prefetch

void prefetch(java.lang.String uri,
              int priority)
Provides a hint to the provider that the resource identified by the specified URI will probably be accessed in the near future, so that if available resources permit and the provider supports prefetching it can take whatever steps are appropriate to speed up the time required to load the file when the subsequent request to load the file is made via the normal call to ResourceTransportObject.synchronousLoad() or ResourceTransportObject.asynchronousLoad(). This could include anything from retrieving directory information to actually downloading the file to memory or local physical file system, if space is available.

Parameters:
uri - URI identifying the resource to be accessed, the URI scheme of which is guaranteed to be one of those returned from getSupportedURISchemes
priority - hint to the provider about the relative priority of this resources with respect to other resources prefetch hints for this provider (higher = more important).
Throws:
java.lang.UnsupportedOperationException - if this provider does not support prefetching (i.e. if prefetchSupported() returns false)

existsSupported

boolean existsSupported()
Return a flag indicating whether this provider supports existence checks using the exists() method on the provider implementation. This is intended as a short circuit by which the GEM implementation may avoid the overhead of creating a ResourceTransportObject instance in cases where the provider is capable of determining the existence of a resource without actually trying to load it (e.g. broadcast transport mechanisms where there may be cached directory lookup information for the resources). The goal is to optimize the performance of the logical file system search path.

Returns:
boolean - Flag indicating whether fast existence checks are supported via the exists() method

exists

boolean exists(java.lang.String uri)
Return a flag indicating whether the specified resource exists. The expectation is that this method will provide a more efficient indication of existence than creating a ResourceTransportObject and initiating a download, for service provider implementations that support caching of directory lookup information.

Parameters:
uri - URI identifying the resource whose existence to check, the URI scheme of which is guaranteed to be one of those returned from getSupportedURISchemes()
Returns:
boolean - Flag indicating whether the specified resource exists. Note that there is no guarantee that the resource will subsequently be loaded successfully, since the return value will be determined just from the directory information. It is possible that the resource will be found not to exist during the process of downloading it.
Throws:
java.lang.UnsupportedOperationException - if this provider does not support optimized existence checks (i.e. if existsSupported() returns false)