- Timestamp:
- 04/26/12 13:25:34 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OAIProvider/trunk/src/main/java/eu/clarin/oai/provider/RecordList.java
r1910 r1911 1 1 package eu.clarin.oai.provider; 2 2 3 import java.util.Date; 4 import java.util.List; 5 6 import javax.xml.stream.XMLStreamException; 7 import javax.xml.stream.XMLStreamWriter; 3 8 4 9 /** … … 6 11 * <em>ListRecords</em> and <em>ListIdentifiers</em> verb. This can also be a 7 12 * partial list if the repository wants do flow-control. 13 * 14 * A <code>RecordList</code> object maintains a cursor pointing to its 15 * current record. Initially the cursor is positioned before the first row. 16 * The next method moves the cursor to the next row, and because it returns 17 * <code>false</code> when there are no more records in the 18 * <code>RecordList</code> object, it can be used in a while loop to iterate through the 19 * result set. 8 20 */ 9 21 public interface RecordList { 10 22 11 23 /** 12 * Release resources as this record list instance is about to be discared.13 */14 public void close();15 16 /**17 * Returns <code>true</code> if the list has more records. (In other18 * words, returns <code>true</code> if <code>nextRecord</code> would19 * return an element rather than throwing an exception.)20 *21 * @return <code>true</code> if the list has more records22 */23 public boolean hasNextRecord();24 25 /**26 * Gets the next record in the list. RecordList implementations must set27 * the appropriate values to the passed Record instance.28 *29 * @param record30 * a Record instance to gather the record data31 * @see Record32 * @throws NoSuchElementException - iteration has no more results.33 */34 public void nextRecord(Record record);35 36 /**37 * Return <code>true</code>, if no more partial result lists are38 * available for this request. In other words, this method should return39 * <code>true</code> either if this list contains all appropriate records40 * for the request or if this result list is the last partial list for the41 * request. This is needed for flow-control.42 *43 * @return <code>true</code> if no more results are available in44 * subsequent requests, <code>false</code> otherwise45 */46 public boolean isListComplete();47 48 /**49 24 * Get the size of the complete result list. 50 25 * 51 * @return the size of the complete result list or <code>-1</code>, if 52 * therepository cannot calculate the total size.26 * @return the size of the complete result list or <code>-1</code>, if the 27 * repository cannot calculate the total size. 53 28 * @see #getSize() 54 29 */ 55 30 public int getTotalSize(); 56 31 32 33 /** 34 * Return <code>true</code>, if no more partial result lists are available 35 * for this request. In other words, this method should return 36 * <code>true</code> either if this list contains all appropriate records 37 * for the request or if this result list is the last partial list for the 38 * request. This is needed for flow-control. 39 * 40 * @return <code>true</code> if no more results are available in subsequent 41 * requests, <code>false</code> otherwise 42 */ 43 public boolean isListComplete(); 44 45 46 /** 47 * Release resources as this record list instance is about to be discarded. 48 */ 49 public void close(); 50 51 52 /** 53 * Returns <code>true</code> if the list has more records. (In other words, 54 * returns <code>true</code> if <code>nextRecord</code> would return an 55 * element rather than throwing an exception.) 56 * 57 * @return <code>true</code> if the list has more records 58 */ 59 public boolean next(); 60 61 62 /** 63 * Get the localId of the record. The returned object must be compatible 64 * with repository's implementation of <code>parseLocalId</code> and 65 * <code>unparseLocalId</code>. 66 * 67 * @returns the local Id object of the record 68 */ 69 public Object getLocalId(); 70 71 /** 72 * Get the last changed timestamp of the item. 73 * 74 * @return the last changed timestamp of the item 75 */ 76 public Date getDatestamp(); 77 78 /** 79 * set deletion state of the record. 80 * 81 * @return <code>true</code> of the record is deleted, <code>false</code> 82 * otherwise 83 * @see Repository#getDeletedNotion() 84 */ 85 public boolean isDeleted(); 86 87 /** 88 * Get the sets to which this record belongs to. 89 * 90 * @return the list of sets to which the records belongs to or 91 * <code>null</code> if it does not belong to any sets or the 92 * repository does not support set 93 */ 94 public List<String> getSetSpecs(); 95 96 97 public void writeRecord(XMLStreamWriter writer) throws XMLStreamException; 98 99 // /** 100 // * Gets the next record in the list. RecordList implementations must set 101 // * the appropriate values to the passed Record instance. 102 // * 103 // * @param record 104 // * a Record instance to gather the record data 105 // * @see Record 106 // * @throws NoSuchElementException - iteration has no more results. 107 // */ 108 // public void nextRecord(Record record); 109 // 110 // /** 111 // * Return <code>true</code>, if no more partial result lists are 112 // * available for this request. In other words, this method should return 113 // * <code>true</code> either if this list contains all appropriate records 114 // * for the request or if this result list is the last partial list for the 115 // * request. This is needed for flow-control. 116 // * 117 // * @return <code>true</code> if no more results are available in 118 // * subsequent requests, <code>false</code> otherwise 119 // */ 120 // public boolean isListComplete(); 121 // 122 57 123 } // class RecordList
Note: See TracChangeset
for help on using the changeset viewer.