Revision 38584
Added by Alessia Bardi almost 9 years ago
MongoPublisherStore.java | ||
---|---|---|
127 | 127 |
* then you have to specify it in the configuration file of the OAI Publisher: <br> |
128 | 128 |
* <INDEX name="deleted"> |
129 | 129 |
* </p> |
130 |
* |
|
130 |
*
|
|
131 | 131 |
* {@inheritDoc} |
132 |
* |
|
132 |
*
|
|
133 | 133 |
* @see eu.dnetlib.data.information.oai.publisher.store.PublisherStore#ensureIndices() |
134 | 134 |
*/ |
135 | 135 |
@Override |
... | ... | |
166 | 166 |
* <p> |
167 | 167 |
* The creation is performed on the background |
168 | 168 |
* </p> |
169 |
* |
|
169 |
*
|
|
170 | 170 |
* @param fieldNames |
171 | 171 |
* List of fields to be included in the compound index |
172 | 172 |
* @theStore MongoPublisherStore where to create the index |
... | ... | |
246 | 246 |
* http://www.openarchives.org/OAI/openarchivesprotocol.html#DeletedRecords: if a repository does keep track of deletions then the |
247 | 247 |
* datestamp of the deleted record must be the date and time that it was deleted. |
248 | 248 |
* </p> |
249 |
* |
|
249 |
*
|
|
250 | 250 |
* @param feedDate |
251 | 251 |
* @param source |
252 | 252 |
*/ |
... | ... | |
322 | 322 |
|
323 | 323 |
/** |
324 | 324 |
* Feed the record to the store. |
325 |
* |
|
325 |
*
|
|
326 | 326 |
* @return true if the record is new, false otherwise |
327 | 327 |
*/ |
328 | 328 |
private boolean feedRecord(final String record, final String source, final Date feedDate) { |
... | ... | |
405 | 405 |
* @param record |
406 | 406 |
* @throws IOException |
407 | 407 |
*/ |
408 |
public Binary createCompressRecord(final String record) throws IOException {
|
|
408 |
public Binary createCompressRecord(final String record) throws IOException { |
|
409 | 409 |
ByteArrayOutputStream os = new ByteArrayOutputStream(); |
410 | 410 |
ZipOutputStream zos = new ZipOutputStream(os); |
411 | 411 |
ZipEntry entry = new ZipEntry(OAIConfigurationReader.BODY_FIELD); |
... | ... | |
415 | 415 |
zos.flush(); |
416 | 416 |
zos.close(); |
417 | 417 |
return new Binary(os.toByteArray()); |
418 |
|
|
419 | 418 |
} |
420 | 419 |
|
421 |
|
|
422 |
|
|
423 |
|
|
424 |
|
|
425 | 420 |
private void feedNew(final String oaiID, final String record, final Multimap<String, String> recordProperties, final Date feedDate) { |
426 | 421 |
log.debug("New record received. Assigned oai id: " + oaiID); |
427 | 422 |
DBObject obj = this.createBasicObject(oaiID, record, recordProperties); |
Also available in: Unified diff
code style only