Interface MappingListener

  • All Known Implementing Classes:
    SQLIdMapper, SQLListener

    public interface MappingListener
    This interface is used to load Data into the System using Xrefs and DataSources.
    Author:
    Christian
    • 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/url
        target - The SysCode of DataSource part of the target xref/url
        symetric - 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 xref
        targetId - ID of the target xref
        mappingSet - 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 - - if something goes wrong
      • closeInput

        void closeInput()
                 throws BridgeDBException
        Closes 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 - - if something goes wrong