xsmeral.semnet.crawler
Class HostManager.Mapper

java.lang.Object
  extended by xsmeral.semnet.crawler.HostManager.Mapper
All Implemented Interfaces:
HostMapper
Enclosing class:
HostManager

public static class HostManager.Mapper
extends Object
implements HostMapper

Mapper is responsible for mapping hosts to IDs.


Constructor Summary
HostManager.Mapper(RDBLayer db)
          Calls loadHosts(db).
 
Method Summary
 boolean containsHost(int id)
          Indicates whether this manager contains a host with the specified ID.
 boolean containsHost(String url)
          Indicates, whether this manager contains a host with the specified URL.
 int getHostId(String url)
          Returns ID of the host with the specified URL.
 String getHostName(int hostid)
          Returns host name for the specified ID.
 void loadHosts(RDBLayer db)
          Loads managed hosts from the specified DB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostManager.Mapper

public HostManager.Mapper(RDBLayer db)
Calls loadHosts(db). A mapper instance should be obtained using the HostManager. getMapper() method.

Method Detail

containsHost

public boolean containsHost(String url)
Description copied from interface: HostMapper
Indicates, whether this manager contains a host with the specified URL.

Specified by:
containsHost in interface HostMapper

containsHost

public boolean containsHost(int id)
Description copied from interface: HostMapper
Indicates whether this manager contains a host with the specified ID.

Specified by:
containsHost in interface HostMapper

getHostName

public String getHostName(int hostid)
Description copied from interface: HostMapper
Returns host name for the specified ID.

Specified by:
getHostName in interface HostMapper

getHostId

public int getHostId(String url)
Description copied from interface: HostMapper
Returns ID of the host with the specified URL.

Specified by:
getHostId in interface HostMapper

loadHosts

public final void loadHosts(RDBLayer db)
Loads managed hosts from the specified DB. It need not be called, since it is called in constructor.

Specified by:
loadHosts in interface HostMapper