+

Search Tips   |   Advanced Search

 PREV CLASS   NEXT CLASS
Tree 
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

com.ibm.portal.resolver.data
Interface DataSourceFactoryEx

All Superinterfaces:
DataSourceFactory
All Known Subinterfaces:
CachedDataSourceFactory<T>
public interface DataSourceFactoryEx
extends DataSourceFactory

Data source factory that allows to instantiate DataSource objects. If the data source represents data and not just meta information, it needs to implement one of the strongly typed interfaces ByteDataSource, CharDataSource, XmlDataSource or MultipartDataSource. Clients of the DataSourceFactoryEx will determine the type of the returned data source via introspection.

A data source factory is registered in the plugin.xml of the providing extension as a serviceHandler

.
 <extension
  point="com.ibm.content.operations.registry.locationServiceHandler">
  <serviceHandler
  class="YOUR_IMPLEMENTATION_CLASS"
  locationTypeId="LOCATION_TYPE_ID"
  id="com.ibm.portal.resolver.data.DataSourceFactoryEx" />
  </extension>
 

Implementations of DataSourceFactoryEx must be threadsafe, there will only be one instance per location type that is accessed by multiple threads in parallel. The returned DataSource objects however do not need to be thread safe.

Since:
6.1.0
See Also:
CORDataSourceFactoryEx#SINGLETON, PocServiceHome.getDataSourceFactory(Boolean)
Note:
This interface is designed to be implemented by clients.

Field Summary
static java.lang.String DEFAULT_MODE
          Default value for the mode that data sources are requested with using the data source factory
static java.util.Map<java.lang.String,java.lang.String[]> EMPTY_PARAMETERS
          The empty parameters map, unmodifiable
 
Method Summary
 DataSource newSource(java.net.URI uri, java.lang.String mode, java.util.Map<java.lang.String,java.lang.String[]> params, Context ctx)
          Return a DataSource for the URI, context and parameters.
 

Field Detail

EMPTY_PARAMETERS

static final java.util.Map<java.lang.String,java.lang.String[]> EMPTY_PARAMETERS
The empty parameters map, unmodifiable

Since:
8.0

DEFAULT_MODE

static final java.lang.String DEFAULT_MODE
Default value for the mode that data sources are requested with using the data source factory

Since:
8.0
See Also:
Constant Field Values
Method Detail

newSource

DataSource newSource(java.net.URI uri,
                     java.lang.String mode,
                     java.util.Map<java.lang.String,java.lang.String[]> params,
                     Context ctx)
                     throws java.io.IOException
Returns a DataSource for the URI, context and parameters. The mode parameter tells how the caller wants to make use of the returned data source:
  • Constants.VALUE_DOWNLOAD: the caller requires both the metadata and the actual data, e.g. in order to serve the DataSource as a response for a REST request to a client
  • Constants.VALUE_LOOKUP: the caller only requires access to the metadata and will not try to access the data. In this case the factory can choose to return a special version of the data source that only returns metainformation for performance reasons (since access to the actual data may be costly). Refer to EarlyBindingDataSource as a convenient superclass for such special data sources.
  • In the future there might be suport for more mode constants, however it will always be valid to return the full data source (the one that would be returned for Constants.VALUE_DOWNLOAD) as a fallback.

Parameters:
uri - URI of the addressed resource. Must not be null and must be a URI with valid scheme (non-null) information.
mode - mode constant, may be null
params - parameters map (String -> String[]). This map is potentially unmodifiable but not null
ctx - Content Operations Registry (COR) context, not null
Returns:
an implementation of a DataSource. May be null in which case the factory indicates that the URI will not be processed.
Throws:
java.io.IOException - - if the data soure cannot be created
 PREV CLASS   NEXT CLASS
Tree 
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD