Package org.bridgedb.mapping
Interface MappingListener
-
- All Known Implementing Classes:
SQLIdMapper,SQLListener
public interface MappingListenerThis interface is used to load Data into the System using Xrefs and DataSources.- Author:
- Christian
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcloseInput()Closes the input, flushing any links into storage.voidinsertLink(String sourceId, String targetId, int mappingSet, boolean symetric)Inserts a mapping into the system.intregisterMappingSet(DataSource source, DataSource target, boolean symetric)Loads all the meta data for a Mapping Set.
-
-
-
Method Detail
-
registerMappingSet
int registerMappingSet(DataSource source, DataSource target, boolean symetric) throws BridgeDBException
Loads all the meta data for a Mapping Set.- Parameters:
source- The SysCode of DataSource part of the source xref/urltarget- The SysCode of DataSource part of the target xref/urlsymetric- Flag to say if mapping should be loaded one way of both ways. Creates two mapping sets this one and the inverse with one number higher.- Returns:
- Id of the forward mappingSet.
- Throws:
BridgeDBException- If something goes wrong. Always thrown by the URI based version as it requires extra parameters to register a mapping Set.
-
insertLink
void insertLink(String sourceId, String targetId, int mappingSet, boolean symetric) throws BridgeDBException
Inserts a mapping into the system.Implementatins may buffer the inserts, so closeInput must be called after the last insert or inserts may be lost.
No checking can be done that the DataSource part of the Xrefs match the declaration.
For speed, the implemented methods is also not required to check that the MappingsSet exists nor that the mapping Set's semantic setting matches that in the insert call.
- Parameters:
sourceId- ID of the source xreftargetId- ID of the target xrefmappingSet- The ID of the mapping set to be inserted into.symetric- If true the inverse mapping will be inserted into the mapping set one number higher.- Throws:
BridgeDBException
-
closeInput
void closeInput() throws BridgeDBExceptionCloses the input, flushing any links into storage.May also update any cashed counts ext.
This method and URLListener method are intended to be duplicates of each other.
- Throws:
BridgeDBException
-
-