com.ibm.portal.resolver.service
Interface PocServiceHome

All Superinterfaces:
CacheFactory, ContentHandlerURIParserFactory, PocURIFactory, PooledTransformerFactory
All Known Subinterfaces:
CorPocServiceHome, PortalPocServiceHome, PortletPocServiceHome

public interface PocServiceHome
extends PooledTransformerFactory, PocURIFactory, ContentHandlerURIParserFactory, CacheFactory

Basic, request independent lookup functionality for POC. The interface extends from PocURIFactory for convenience purposes in case a client does only have access to the home interface but not an instance of a PocService. For performance reasons the PocURIFactory of the PocService should be used in favor of PocURIFactory on PocServiceHome wherever possible. However if a PocService is not used anyway, it is faster to use PocURIFactory on PocServiceHome instead of requesting a PocService for the only purpose of accessing the PocURIFactory interface.

Since:
6.1

Nested Class Summary
static class PocServiceHome.FilterType
           
 
Field Summary
static java.lang.Boolean CACHED
          Represents the cached version of the data source factory
static java.lang.Boolean UNCACHED
          Represents the uncached version of the data source factory
 
Method Summary
<T extends DataSink>
T
convert(java.lang.Class<T> dstClass, DataSink src)
          Converts a data sink into a wrapper of the desired type.
<T extends DataSource>
T
convert(java.lang.Class<T> dstClass, DataSource src)
          Converts a data source into a wrapper of the desired type.
 java.net.URI createDigestURI(Addressable addr)
          Creates a shortened URI that targets the Addressable object
 java.net.URI createDigestURI(java.net.URI uri, java.util.Map<java.lang.String,java.lang.String[]> params)
          Creates a shortened URI that targets the given URI and parameters
 java.net.URI createURI(java.lang.String uri)
          Use PocService.createURI(String) instead if possible
 java.net.URI createURI(java.lang.String scheme, java.lang.String schemeSpecificPart)
          Use PocService.createURI(String, String) instead if possible
 java.net.URI createURI(java.net.URI uri)
          Use PocService.createURI(URI) instead if possible
 Context getContext()
          Returns a request independent COR context.
 DataSinkFactoryEx getDataSinkFactory()
          Deprecated. use getDataSinkFactory(String) instead
 DataSinkFactoryEx getDataSinkFactory(java.lang.String httpMethod)
          Returns a DataSinkFactoryEx that does a COR lookup to find the actual DataSinkFactoryEx for the given HTTP method.
 DataSourceFactoryEx getDataSourceFactory(java.lang.Boolean bCached)
          Returns a DataSourceFactoryEx that does a COR lookup to find the actual DataSourceFactoryEx.
 FileTypeMap getFileTypeMap()
          Returns the FileTypeMap that maps the suffixes of filenames to mime types.
 PooledTemplates getIdentityTemplates()
          Return the systemwide identity templates object that can be used to produce pooled identity transformers.
 InvalidationEventListener getInvalidationEventListener()
          Returns an EventListener that can be used to invalidate URI related cache entries in the caching infrastructure.
 LookupService getLookupService()
          Returns the default lookup service that can be used to discover the service endpoints for services associated with POC URIs.
 ObjectPoolFactory getObjectPoolFactory()
          Returns the object pool factory that is recommended to implement pooled data sources.
 ResolutionService getResolutionService()
          Returns a ResolutionService that does a COR lookup to find the actual ResolutionService.
 javax.servlet.Filter newFilter(PocServiceHome.FilterType type)
          Creates a Filter.
 
Methods inherited from interface com.ibm.portal.resolver.xml.PooledTransformerFactory
newPooledTemplates, newPooledTemplates, newPooledTemplates
 
Methods inherited from interface com.ibm.portal.resolver.xml.ContentHandlerURIParserFactory
createContentHandlerURIParser
 
Methods inherited from interface com.ibm.portal.resolver.cache.CacheFactory
getCachedDataSourceFactory, getCachedDataSourceFactory
 

Field Detail

CACHED

static final java.lang.Boolean CACHED
Represents the cached version of the data source factory

Since:
8.0.0.1

UNCACHED

static final java.lang.Boolean UNCACHED
Represents the uncached version of the data source factory

Since:
8.0.0.1
Method Detail

convert

<T extends DataSink> T convert(java.lang.Class<T> dstClass,
                               DataSink src)
                           throws java.io.IOException
Converts a data sink into a wrapper of the desired type. If the conversion was successful, the result is a wrapper that is to be used instead of the DataSink. In particular the wrapper has to be disposed by calling Disposable.dispose() and this disposal will also dispose the wrapped DataSink, it must not be disposed in addition to the wrapper. If the conversion was not successful, the original DataSink still needs to be disposed. This is also true in case of an exception.

Parameters:
dstClass - the class object of the target data sink interface, not null
src - the data sink
Returns:
the conversion result or null if the conversion was not successful
Throws:
java.io.IOException
Since:
8.5

convert

<T extends DataSource> T convert(java.lang.Class<T> dstClass,
                                 DataSource src)
                             throws java.io.IOException
Converts a data source into a wrapper of the desired type. If the conversion was successful, the result is a wrapper that is to be used instead of the DataSource. In particular the wrapper has to be disposed by calling Disposable.dispose() and this disposal will also dispose the wrapped DataSource, it must not be disposed in addition to the wrapper. If the conversion was not successful, the original DataSource still needs to be disposed. This is also true in case of an exception.

Parameters:
dstClass - the class object of the target data source interface, not null
src - the data source
Returns:
the conversion result or null if the conversion was not successful
Throws:
java.io.IOException
Since:
8.0.0.1

createDigestURI

java.net.URI createDigestURI(Addressable addr)
                             throws java.io.IOException,
                                    java.net.URISyntaxException
Creates a shortened URI that targets the Addressable object

Parameters:
addr - the target object
Returns:
the shortened URI
Throws:
java.io.IOException
java.net.URISyntaxException
Since:
8.0

createDigestURI

java.net.URI createDigestURI(java.net.URI uri,
                             java.util.Map<java.lang.String,java.lang.String[]> params)
                             throws java.io.IOException,
                                    java.net.URISyntaxException
Creates a shortened URI that targets the given URI and parameters

Parameters:
uri - the target URI
params - the target parameters
Returns:
the shortened URI
Throws:
java.io.IOException
java.net.URISyntaxException

createURI

java.net.URI createURI(java.lang.String uri)
                       throws java.net.URISyntaxException,
                              java.io.IOException
Use PocService.createURI(String) instead if possible

Specified by:
createURI in interface PocURIFactory
Parameters:
uri - the URI string, not null. The uri must define both valid, non-null and non-empty schema and schema specific parts
Returns:
the equivalent URI, not null
Throws:
java.net.URISyntaxException
java.io.IOException
Since:
7.0

createURI

java.net.URI createURI(java.lang.String scheme,
                       java.lang.String schemeSpecificPart)
                       throws java.net.URISyntaxException
Use PocService.createURI(String, String) instead if possible

Specified by:
createURI in interface PocURIFactory
Parameters:
scheme - scheme, not null
schemeSpecificPart - scheme specific part, not null
Returns:
the URI, not null
Throws:
java.net.URISyntaxException
Since:
7.0

createURI

java.net.URI createURI(java.net.URI uri)
Use PocService.createURI(URI) instead if possible

Specified by:
createURI in interface PocURIFactory
Parameters:
uri - the original URI, not null. The uri must define both valid, non-null and non-empty schema and schema specific parts
Returns:
the equivalent URI, not null
Since:
7.0

getContext

Context getContext()
Returns a request independent COR context. This context must not be stored in static variables but should always be fetched from the home interface if required. This context does not contain any request dependent information and can therefore not be used to access portal services. It can however be used to access the registry, i.e. ContentIntrospector, ContentTypeRegistry and ContentLocationRegistry. Use PocService.getContext() to get a context that may be used to access portal services.

Returns:
the context, not null
Since:
7.0

getDataSinkFactory

@Deprecated
DataSinkFactoryEx getDataSinkFactory()
Deprecated. use getDataSinkFactory(String) instead

Returns a DataSinkFactoryEx that does a COR lookup to find the actual DataSinkFactoryEx.

Returns:
the DataSinkFactoryEx, not null
Since:
6.1.0

getDataSinkFactory

DataSinkFactoryEx getDataSinkFactory(java.lang.String httpMethod)
Returns a DataSinkFactoryEx that does a COR lookup to find the actual DataSinkFactoryEx for the given HTTP method.

Parameters:
httpMethod - the method, not null, e.g. "POST"
Returns:
the DataSinkFactoryEx, or null if no factory could be located for the method
Since:
8.5

getDataSourceFactory

DataSourceFactoryEx getDataSourceFactory(java.lang.Boolean bCached)
Returns a DataSourceFactoryEx that does a COR lookup to find the actual DataSourceFactoryEx.

Parameters:
bCached - if true a version will be returned that may cache DataSource objects, if false then there will be no cache involved, null refers to the system default
Returns:
the DataSourceFactoryEx, not null
Since:
6.1.0
See Also:
CACHED, UNCACHED

getFileTypeMap

FileTypeMap getFileTypeMap()
Returns the FileTypeMap that maps the suffixes of filenames to mime types. This is useful when implementing the DataSource.getContentType() method on top of existing resources.

Returns:
the file type map, not null
Since:
6.1.0.3

getIdentityTemplates

PooledTemplates getIdentityTemplates()
Return the systemwide identity templates object that can be used to produce pooled identity transformers.

Returns:
a templates object that returns poolable identity templates

getInvalidationEventListener

InvalidationEventListener getInvalidationEventListener()
Returns an EventListener that can be used to invalidate URI related cache entries in the caching infrastructure.

Returns:
the listener that can be used to invalidate all register caches
Since:
7.0

getLookupService

LookupService getLookupService()
Returns the default lookup service that can be used to discover the service endpoints for services associated with POC URIs. The implementation of this service will first try to locate a LookupService via the COR APIs. If this process fails, it will use a default implementation as a fallback. In order to access only the fallback implementation use an extension point lookup using the information in LookupService.

Returns:
default lookup service, not null
Since:
6.1.0

getObjectPoolFactory

ObjectPoolFactory getObjectPoolFactory()
Returns the object pool factory that is recommended to implement pooled data sources.

Returns:
and instance of a object pool factory, not null
Since:
6.0.1.1

getResolutionService

ResolutionService getResolutionService()
Returns a ResolutionService that does a COR lookup to find the actual ResolutionService.

Returns:
the ResolutionService, not null
Since:
6.1.0

newFilter

javax.servlet.Filter newFilter(PocServiceHome.FilterType type)
Creates a Filter. This filter is already initialized, i.e. callers should not call Filter.init(javax.servlet.FilterConfig) again. When the filter is no longer used, callers should call Filter.destroy().

Parameters:
type - type of the filter
Returns:
a new filter instance, not null