19 package org.sleuthkit.autopsy.url.analytics.domaincategorization;
 
   21 import java.sql.SQLException;
 
   22 import java.util.logging.Level;
 
   23 import org.apache.commons.lang3.StringUtils;
 
   24 import org.openide.util.lookup.ServiceProvider;
 
   35 @ServiceProvider(service = DomainCategorizer.class)
 
   48         this.dataModel = dataModel;
 
   57         this(WebCategoriesDataModel.getInstance());
 
   62         if (!dataModel.isInitialized()) {
 
   65         String hostToUse = (StringUtils.isBlank(host)) ? domain : host;
 
   66         if (StringUtils.isBlank(hostToUse)) {
 
   70         hostToUse = hostToUse.toLowerCase();
 
   73             return dataModel.getMatchingRecord(hostToUse);
 
   74         } 
catch (SQLException ex) {
 
   75             logger.log(Level.WARNING, 
"There was an error while retrieving data for: " + hostToUse, ex);
 
   83             dataModel.initialize();
 
   84         } 
catch (SQLException ex) {
 
   85             throw new DomainCategorizerException(
"Unable to initialize.", ex);
 
   90     public void close() throws SQLException {
 
final WebCategoriesDataModel dataModel
 
DomainCategory getCategory(String domain, String host)
 
synchronized static Logger getLogger(String name)