    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.jigsaw.pics.DataBaseBureau

    java.lang.Object
       |
       +----w3c.jigsaw.pics.DataBaseBureau

public class DataBaseBureau
extends Object
implements LabelBureauInterface

This class implements a label bureau. The database for labels is provided by a real database. The organisation is as follows:

The LabelBureau is attached to some directory D.db, the db extension is used to make difference between SampleLabelBureau and DataBaseBureau. For each DataBaseBureau, you have to create a properties file, D.db/dbs.props and D.db/dbd.props containing information about the services database and the bureaux database .

the properties in dbs.props must be:

- w3c.jigsaw.pics.DataBase.dbname : the real name of the database.
- w3c.jigsaw.pics.DataBase.dburl : the jdbc database url.
- w3c.jigsaw.pics.DataBase.jdbcdriver : the jdbc driver used.
- w3c.jigsaw.pics.DataBase.username : the user name.
- w3c.jigsaw.pics.DataBase.passwd : the password relative to the user name.
- w3c.jigsaw.pics.DataBase.servicefield : the field name relative to the service.
- w3c.jigsaw.pics.DataBase.urlfield : the field name relative to the url.
- w3c.jigsaw.pics.DataBase.labelfield : the field name containing the label relative to the url.
- w3c.jigsaw.pics.DataBase.genericfield : the field name containing the generic flag of the label.

the properties in dbs.props must be:

- w3c.jigsaw.pics.DataBase.dbname : the real name of the database.
- w3c.jigsaw.pics.DataBase.dburl : the jdbc database url.
- w3c.jigsaw.pics.DataBase.jdbcdriver : the jdbc driver used.
- w3c.jigsaw.pics.DataBase.username : the user name.
- w3c.jigsaw.pics.DataBase.passwd : the password relative to the user name.
- w3c.jigsaw.pics.DataBase.servicefield : the field name relative to the service.
- w3c.jigsaw.pics.DataBase.bureaufield : the field name relative to the bureau.

If a database doesn't exists, you have to create it and you must have some jdbc drivers to access it.

##

DB_BUREAU_FIELD_P
  The property key relative to the name of the bureau field.
DB_NAME_P
  The property key relative to the name of the database.
DB_SERVICE_FIELD_P
  The property key relative to the name of the service field.

##

DataBaseBureau(File)
  Create a new DataBaseBureau.

##

createService(String)
  Create a new service in this bureau.
getIdentifier()
  Get this label bureau directory.
getLabelService(String)
  Lookup for the given service in this bureau.
getLabelServicesNames()
  Get the list of all services available in this bureau.
isAService(String)
  Test the service existence
removeService(String)
  Remove a service from this bureau

##

DB_NAME_P

     public static final String DB_NAME_P

  The property key relative to the name of the database.

DB_SERVICE_FIELD_P

     public static final String DB_SERVICE_FIELD_P

  The property key relative to the name of the service field.

DB_BUREAU_FIELD_P

     public static final String DB_BUREAU_FIELD_P

  The property key relative to the name of the bureau field.

##

DataBaseBureau

     public DataBaseBureau(File directory)

  Create a new DataBaseBureau. The configuration file from the label bureau (the place were it takes information about the services database), is given by the provided directory.

  Parameters:
    directory - This bureau root directory.
  See Also:
    DataBaseService

##

getIdentifier

     public String getIdentifier()

  Get this label bureau directory.

createService

     public boolean createService(String service)

  Create a new service in this bureau.

  Parameters:
    service - The service url
  Returns:
    True if the service is create

removeService

     public boolean removeService(String service)

  Remove a service from this bureau

  Parameters:
    service - The service url
  Returns:
    True if removed

isAService

     public boolean isAService(String service)

  Test the service existence

  Parameters:
    service - The service url
  Returns:
    True if the given service exists in this bureau

getLabelServicesNames

     public String[] getLabelServicesNames()

  Get the list of all services available in this bureau.

  Returns:
    String[] The services list.

getLabelService

     public LabelServiceInterface getLabelService(String url)

  Lookup for the given service in this bureau.

  Parameters:
    name - The service name.
  Returns:
    A dataBaseService instance, or null if none was found.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index