Class SampleLabelBureau

  extended by
All Implemented Interfaces:

public class SampleLabelBureau
extends java.lang.Object
implements LabelBureauInterface

This class implements a label bureau. The database for labels is provided by the underlying file system. The organisation is as follows:

The LabelBureau is attached to some directory D. For each service it handles, you have to create a subdirectory, according to the service name (its identifying URL). So for example, if you want to provide ratings as, you will have to create a D/ directory.

Uner this service directory, for each site you want to label, you have to create a sub-directory. In our example, if our rating service wants to label, you will have to create a D/ directory. This directory should reflect the space of the labeled server (ie having the same file hierarchy), and each file should be the label itself (as transmited).

In our example, if the LabelBureau wants to find the label by for, it will look for the file D/ .

So, we really use the underlying file system as a database for labels.

FIXME: the LabelBureau should be an interface, same stands for the LabelService and Label classes.

Field Summary
Fields inherited from interface
Constructor Summary
SampleLabelBureau( directory)
          Create a new LabelBureau.
Method Summary
 java.lang.String getIdentifier()
          Get this label bureau directory.
 LabelServiceInterface getLabelService(java.lang.String url)
          Lookup for the given service in this bureau.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SampleLabelBureau( directory)
Create a new LabelBureau. The configuration files from the label bureau (the place were it takes its labels from), is given by the provided directory.

directory - This bureau root directory.
See Also:
Method Detail


public java.lang.String getIdentifier()
Get this label bureau directory.

Specified by:
getIdentifier in interface LabelBureauInterface


public LabelServiceInterface getLabelService(java.lang.String url)
Lookup for the given service in this bureau.

Specified by:
getLabelService in interface LabelBureauInterface
name - The service name.
A LabelService instance, or null if none was found.