Revision 423M

org.bridgedb
Class AbstractIDMapperCapabilities

java.lang.Object
  extended by org.bridgedb.AbstractIDMapperCapabilities
All Implemented Interfaces:
IDMapperCapabilities

public abstract class AbstractIDMapperCapabilities
extends java.lang.Object
implements IDMapperCapabilities

Simple implementation of IDMapperCapabilities, which assumes that the supported datasources are the same for target and source, and that the supported data sources and properties are static and known at creation time.


Constructor Summary
AbstractIDMapperCapabilities(java.util.Set<DataSource> supportedDataSources, boolean freeSearchSupported, java.util.Map<java.lang.String,java.lang.String> props)
           
 
Method Summary
 java.util.Set<java.lang.String> getKeys()
          
 java.lang.String getProperty(java.lang.String key)
          Return a value for a property, or null if this property is not defined.
 java.util.Set<DataSource> getSupportedSrcDataSources()
          
 java.util.Set<DataSource> getSupportedTgtDataSources()
          
 boolean isFreeSearchSupported()
          
 boolean isMappingSupported(DataSource src, DataSource tgt)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIDMapperCapabilities

public AbstractIDMapperCapabilities(java.util.Set<DataSource> supportedDataSources,
                                    boolean freeSearchSupported,
                                    java.util.Map<java.lang.String,java.lang.String> props)
Parameters:
supportedDataSources - Supported DataSources. IDMappers are usually symmetrical, so in the default implementation supportedDataSources is both target and source DataSources.
props - properties, may be null.
freeSearchSupported - if free search is supported or not
Method Detail

getKeys

public java.util.Set<java.lang.String> getKeys()

Specified by:
getKeys in interface IDMapperCapabilities
Returns:
the keys of all properties. Implementations may return an empty set but never null.

getProperty

public java.lang.String getProperty(java.lang.String key)
Return a value for a property, or null if this property is not defined. Implementations are free to choose a set of properties. Suggested properties:

Specified by:
getProperty in interface IDMapperCapabilities
Parameters:
key - key
Returns:
property string

getSupportedSrcDataSources

public java.util.Set<DataSource> getSupportedSrcDataSources()
                                                     throws IDMapperException

Specified by:
getSupportedSrcDataSources in interface IDMapperCapabilities
Returns:
supported source ID types
Throws:
IDMapperException - if supported DataSources could not be determined because of service unavailability.

getSupportedTgtDataSources

public java.util.Set<DataSource> getSupportedTgtDataSources()
                                                     throws IDMapperException

Specified by:
getSupportedTgtDataSources in interface IDMapperCapabilities
Returns:
supported target ID types
Throws:
IDMapperException - if supported DataSources could not be determined because of service unavailability.

isMappingSupported

public boolean isMappingSupported(DataSource src,
                                  DataSource tgt)
                           throws IDMapperException

Specified by:
isMappingSupported in interface IDMapperCapabilities
Parameters:
src - source data source
tgt - target data source
Returns:
true if mapping is supported from src to des
Throws:
IDMapperException - if service is unavailable

isFreeSearchSupported

public boolean isFreeSearchSupported()

Specified by:
isFreeSearchSupported in interface IDMapperCapabilities
Returns:
true if free text search is supported, false otherwise.

Generated July 29 2010