Revision 1042
Added by Jing Tao almost 22 years ago
src/edu/ucsb/nceas/metacat/MetacatReplication.java | ||
---|---|---|
811 | 811 |
doclist.append(util.getOption("replicationpath")); |
812 | 812 |
doclist.append("</server><updates>"); |
813 | 813 |
|
814 |
docsql.append("select docid, rev, doctype from xml_documents where "); |
|
815 |
docsql.append("server_location = 1"); |
|
814 |
docsql.append("select docid, rev, doctype from xml_documents "); |
|
815 |
if (!(util.getOption("hub")).equals("super")) |
|
816 |
{ |
|
817 |
docsql.append("where server_location = 1"); |
|
818 |
} |
|
816 | 819 |
|
817 | 820 |
//get any deleted documents |
818 | 821 |
StringBuffer delsql = new StringBuffer(); |
819 | 822 |
delsql.append("select distinct docid from "); |
820 | 823 |
delsql.append("xml_revisions where docid not in (select docid from "); |
821 |
delsql.append("xml_documents) and server_location = 1"); |
|
822 |
|
|
824 |
delsql.append("xml_documents) "); |
|
825 |
if (!(util.getOption("hub")).equals("super")) |
|
826 |
{ |
|
827 |
delsql.append("and server_location = 1"); |
|
828 |
} |
|
829 |
|
|
823 | 830 |
conn = MetacatReplication.getDBConnection("MetacatReplication." + |
824 | 831 |
"handleUpdateRequest"); |
825 | 832 |
PreparedStatement pstmt = conn.prepareStatement(docsql.toString()); |
Also available in: Unified diff
In handleUpdateRequest method, if a metacat was configured to be hub super, it can provide any documents in its database. If the metacat is notsuper, it only provide the documents list which home host is itself.