|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataSourceFactoryEx
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.
CORDataSourceFactoryEx#SINGLETON
,
PocServiceHome.getDataSourceFactory(Boolean)
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 |
---|
static final java.util.Map<java.lang.String,java.lang.String[]> EMPTY_PARAMETERS
static final java.lang.String DEFAULT_MODE
Method Detail |
---|
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
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 clientConstants.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.Constants.VALUE_DOWNLOAD
) as a fallback.
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
DataSource
. May be
null
in which case the factory indicates that the
URI will not be processed.
java.io.IOException
- - if the data source cannot be created
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |