de.topicmapslab.majortom.importer.model
Interface IHandler

All Known Implementing Classes:
FileWriterMapHandler, PostgresMapHandler

public interface IHandler

Author:
Hannes Niederhausen

Method Summary
 void addAssociation(Association assoc)
          Adds the given association to the database.
 void addIdentifier(long topicId, java.lang.String ref, int type)
          adds an identifier
 void addName(Name name)
          Adds a name to the topic map
 void addOccurrence(Occurrence occurrence)
          Adds an occurrence
 void addType(long currTopicId, com.semagia.mio.IRef arg0)
          Adds a type to the topic with the given id
 void commit()
          Commits the last statements
 void end()
          Closes the connection
 long getTopic(com.semagia.mio.IRef ref)
          Returns the topic id for the given identifier.
 long getTopicMapId(java.lang.String locator)
          Returns the id of the topic map for the given locator.
 void start()
          Handler for start event prepareing the connection
 

Method Detail

commit

void commit()
            throws com.semagia.mio.MIOException
Commits the last statements

Throws:
com.semagia.mio.MIOException

start

void start()
           throws com.semagia.mio.MIOException
Handler for start event prepareing the connection

Throws:
com.semagia.mio.MIOException

end

void end()
         throws com.semagia.mio.MIOException
Closes the connection

Throws:
com.semagia.mio.MIOException

getTopicMapId

long getTopicMapId(java.lang.String locator)
                   throws com.semagia.mio.MIOException
Returns the id of the topic map for the given locator. If it does not exist it will be created.

Parameters:
locator - locator of the tm
Returns:
the id of the tm
Throws:
com.semagia.mio.MIOException

addAssociation

void addAssociation(Association assoc)
                    throws com.semagia.mio.MIOException
Adds the given association to the database.

Parameters:
assoc -
Throws:
com.semagia.mio.MIOException

addName

void addName(Name name)
             throws com.semagia.mio.MIOException
Adds a name to the topic map

Parameters:
name -
Throws:
com.semagia.mio.MIOException

addOccurrence

void addOccurrence(Occurrence occurrence)
                   throws com.semagia.mio.MIOException
Adds an occurrence

Parameters:
occurrence -
Throws:
com.semagia.mio.MIOException

getTopic

long getTopic(com.semagia.mio.IRef ref)
              throws com.semagia.mio.MIOException
Returns the topic id for the given identifier. It it isn't in the db, it will be created.

Parameters:
ref - the identifier of the topic
Returns:
the id of the topic
Throws:
com.semagia.mio.MIOException

addIdentifier

void addIdentifier(long topicId,
                   java.lang.String ref,
                   int type)
                   throws com.semagia.mio.MIOException
adds an identifier

Parameters:
topicId - id of the topic
ref - the uri
type - the type of identifier
Throws:
com.semagia.mio.MIOException

addType

void addType(long currTopicId,
             com.semagia.mio.IRef arg0)
             throws com.semagia.mio.MIOException
Adds a type to the topic with the given id

Parameters:
currTopicId - the current topic id
arg0 - the reference of the typing topic
Throws:
com.semagia.mio.MIOException