RawDataManager
Class RawDataManagerWindsurfMySQL

java.lang.Object
  extended by RawDataManager.RawDataManager
      extended by RawDataManager.RawDataManagerMySQL
          extended by RawDataManager.RawDataManagerWindsurfMySQL

public class RawDataManagerWindsurfMySQL
extends RawDataManagerMySQL

Implements a Raw Data Manager for Windsurf on a MySQL DB.


Field Summary
 
Fields inherited from class RawDataManager.RawDataManagerMySQL
conn, table
 
Constructor Summary
RawDataManagerWindsurfMySQL(java.lang.String usr, java.lang.String pwd, java.lang.String db, java.lang.String table)
          Basic constructor for a local database.
RawDataManagerWindsurfMySQL(java.lang.String host, java.lang.String port, java.lang.String usr, java.lang.String pwd, java.lang.String db, java.lang.String table)
          Basic constructor for a remote database.
 
Method Summary
 boolean contains(java.lang.String url)
          Checks whether an image with a given URL exists in the DB.
 Document.ImageID findID(java.lang.String url)
          Retrieves the image ID given the image URL; if such image does not exists, inserts it in the DB and returns the ID of the new image.
 
Methods inherited from class RawDataManager.RawDataManagerMySQL
closeConnection, createConnection, findURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawDataManagerWindsurfMySQL

public RawDataManagerWindsurfMySQL(java.lang.String usr,
                                   java.lang.String pwd,
                                   java.lang.String db,
                                   java.lang.String table)
Basic constructor for a local database.

Parameters:
usr - Username for the DB connection.
pwd - Password for the DB connection.
db - Name of the image database.
table - Name of the features table.

RawDataManagerWindsurfMySQL

public RawDataManagerWindsurfMySQL(java.lang.String host,
                                   java.lang.String port,
                                   java.lang.String usr,
                                   java.lang.String pwd,
                                   java.lang.String db,
                                   java.lang.String table)
Basic constructor for a remote database.

Parameters:
host - Host name for the DB connection.
port - Port name for the DB connection.
usr - Username for the DB connection.
pwd - Password for the DB connection.
db - Name of the features database.
table - Name of the features table.
Method Detail

contains

public boolean contains(java.lang.String url)
Checks whether an image with a given URL exists in the DB.

Specified by:
contains in class RawDataManager
Parameters:
url - URL of the image to be searched.
Returns:
true if the image is contained in the DB, false otherwise.

findID

public Document.ImageID findID(java.lang.String url)
Retrieves the image ID given the image URL; if such image does not exists, inserts it in the DB and returns the ID of the new image.

Specified by:
findID in class RawDataManager
Parameters:
url - Image URL.
Returns:
The ID of the given image if the image is contained in the DB, the newly assigned ID, otherwise.