| 1 | An object that can create DataSources and related objects to a DataSource, like crawlers and other stuff. The Factory is one important thing in an OSGI package. |
| 2 | |
| 3 | {{{ |
| 4 | #!java |
| 5 | |
| 6 | /** |
| 7 | * An object that can create DataSources and related objects to a DataSource, like crawlers and other stuff. |
| 8 | * The Factory is one important thing in an OSGI package. |
| 9 | * Each Factory represents one kind of DataSource object, and will only create objects regarding to this |
| 10 | * kind of DataSource. |
| 11 | */ |
| 12 | public interface DataFactory { |
| 13 | |
| 14 | /** |
| 15 | * get some Information that can be displayed to a user when the user wants to register new DataSources. |
| 16 | * usually, you would return a label, an Icon ????, a description. etc |
| 17 | * TODO: we could also split this in several methods, easier to do. |
| 18 | * TODO: when we return an RDFMap, mutlilingual information is already there!!! (which may be very cool) |
| 19 | */ |
| 20 | public Properties getInformation(); |
| 21 | |
| 22 | |
| 23 | /** |
| 24 | * create a new, emtpy and unconfigured, DataSource instance of the DataSource class represented. |
| 25 | */ |
| 26 | public DataSource createDataSource(); |
| 27 | |
| 28 | /** |
| 29 | * create a DataCrawler for this data source instance. The instance has to be configured already |
| 30 | */ |
| 31 | public DataCrawler createDataCrawler(DataSource source); |
| 32 | |
| 33 | /** |
| 34 | * create a DataAccessor for this data source instance. The instance has to be configured already, |
| 35 | * and you should primarily use its getDataObject() function. The DataCrawler may use its own |
| 36 | * methods to create a DataAccessor |
| 37 | */ |
| 38 | public DataAccessor createDataAccessor(DataSource source); |
| 39 | |
| 40 | /** |
| 41 | * create a HierachicalAccess for this data source instance. There are cases when no hierarchical |
| 42 | * access is supported. then, this method returns null. |
| 43 | * @return a HierachicalAccess or null, when HierachicalAccess not supported by this kind of DataSource |
| 44 | */ |
| 45 | public HierachicalAccess createHierachicalAccess(DataSource source); |
| 46 | |
| 47 | /** |
| 48 | * create a DataOpener for this data source instance. There are cases when DataObjects |
| 49 | * of this DataSource cannot be opened. then, this method returns null. Then you may |
| 50 | * get an opener from somewhere else. |
| 51 | * @return a HierachicalAccess or null, when data cannot be opened by the DAtaAccessor |
| 52 | */ |
| 53 | public DataOpener createDataOpener(DataSource source); |
| 54 | |
| 55 | |
| 56 | } |
| 57 | |
| 58 | |
| 59 | }}} |