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)
          Returns 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:

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 source cannot be created