| 1 | The ApertureSimpleDataCrawler is responsible for a simple access to structured data sources. |
| 2 | |
| 3 | Instances of this interface would be classes like FileDataSource, IMAPDataSource, OutlookDataSource |
| 4 | |
| 5 | |
| 6 | {{{ |
| 7 | |
| 8 | public interface SimpleDataCrawler { |
| 9 | |
| 10 | |
| 11 | /** |
| 12 | * init the datasource passing variables like name, base path, passwords, server hostname, etc |
| 13 | */ |
| 14 | public void init(Map parameters); |
| 15 | |
| 16 | /** |
| 17 | * open the passed data object so that it can be viewed / edited by the user. for a file, |
| 18 | * this would mean that the operating system opens the file, for an address book entry |
| 19 | * the address book application would have to start |
| 20 | */ |
| 21 | public void openObject(String uri); |
| 22 | |
| 23 | /** |
| 24 | * get the root uri of this datasource |
| 25 | */ |
| 26 | public String getRootUri(); |
| 27 | |
| 28 | /** |
| 29 | * get the detailed data of one object, including plaintext and metadata |
| 30 | * this is costly. |
| 31 | * This may (internally) make heavy reuse of Extractors |
| 32 | */ |
| 33 | public Map getDataOfObject(String uri); |
| 34 | |
| 35 | /** |
| 36 | * List sub-folders, Iterator contains folder uris as Strings. |
| 37 | * this may also return the uris of objects, if the objects can contain sub-objects. |
| 38 | * (IMAP-attachments)-but this is bad as detection of sub-objects of emails is costly. |
| 39 | * the first call of this method would be with the getRootUri() |
| 40 | */ |
| 41 | public Iterator listSubFolders(String uri); |
| 42 | |
| 43 | /** |
| 44 | * List objects inside the passed folder, Iterator contains folder uris of objects as Strings. |
| 45 | * the first call of this method would be with the getRootUri() |
| 46 | */ |
| 47 | public Iterator listSubObjects(String uri); |
| 48 | |
| 49 | /** |
| 50 | * get a map of metadata about the passed object, |
| 51 | * enough so that changes can be detected. |
| 52 | * if one value in this map has changed compared to the previously returned map (in the last scan) |
| 53 | * than getDataOfObject is called to get the current data. |
| 54 | */ |
| 55 | public Map getChangeDataOfObject(String uri); |
| 56 | |
| 57 | } |
| 58 | |
| 59 | }}} |