Revision 5324
Added by berkley almost 15 years ago
src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java | ||
---|---|---|
40 | 40 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
41 | 41 |
import edu.ucsb.nceas.metacat.shared.HandlerException; |
42 | 42 |
import edu.ucsb.nceas.metacat.util.MetacatUtil; |
43 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
|
43 | 44 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
44 | 45 |
|
45 | 46 |
import java.sql.*; |
... | ... | |
405 | 406 |
} |
406 | 407 |
} |
407 | 408 |
|
409 |
//process guid |
|
410 |
logReplication.debug("Processing guid information from docinfoHash: " + docinfoHash.toString()); |
|
411 |
String guid = docinfoHash.get("guid"); |
|
412 |
IdentifierManager idman = IdentifierManager.getInstance(); |
|
413 |
if(guid != null && !idman.identifierExists(guid)) |
|
414 |
{ //if the guid was passed in, put it in the identifiers table |
|
415 |
logReplication.debug("Creating guid/docid mapping for docid " + |
|
416 |
docinfoHash.get("docid") + " and guid: " + guid); |
|
417 |
idman.createMapping(guid, docinfoHash.get("docid")); |
|
418 |
} |
|
419 |
else |
|
420 |
{ |
|
421 |
logReplication.debug("No guid information was included with the replicated document"); |
|
422 |
} |
|
423 |
|
|
408 | 424 |
logReplication.info("ReplicationHandler.handleSingleXMLDocument - Successfully replicated doc " + accNumber); |
409 | 425 |
if (tableName.equals(DocumentImpl.DOCUMENTTABLE)) |
410 | 426 |
{ |
src/edu/ucsb/nceas/metacat/replication/ReplicationService.java | ||
---|---|---|
529 | 529 |
// Get home server of this docid |
530 | 530 |
String homeServer = (String) docinfoHash.get("home_server"); |
531 | 531 |
String guid = (String) docinfoHash.get("guid"); |
532 |
logReplication.debug("GUID: " + guid); |
|
532 |
|
|
533 |
logReplication.debug("Processing guid " + guid + |
|
534 |
" information from handleForceReplicationRequest: " + |
|
535 |
docinfoHash.toString()); |
|
536 |
IdentifierManager idman = IdentifierManager.getInstance(); |
|
537 |
if(guid != null && !idman.identifierExists(guid)) |
|
538 |
{ //if the guid was passed in, put it in the identifiers table |
|
539 |
logReplication.debug("Creating guid/docid mapping for docid " + |
|
540 |
docinfoHash.get("docid") + " and guid: " + guid); |
|
541 |
idman.createMapping(guid, docinfoHash.get("docid")); |
|
542 |
} |
|
543 |
else |
|
544 |
{ |
|
545 |
logReplication.debug("No guid information was included with the replicated document"); |
|
546 |
} |
|
547 |
|
|
533 | 548 |
String createdDate = (String) docinfoHash.get("date_created"); |
534 | 549 |
String updatedDate = (String) docinfoHash.get("date_updated"); |
535 | 550 |
logReplication.info("ReplicationService.handleForceReplicateRequest - homeServer: " + homeServer); |
Also available in: Unified diff
replication of guids now works. tested this for both forced replication and update/insert/delete triggered replication