Revision 2663
Added by sgarg over 18 years ago
MetacatReplication.java | ||
---|---|---|
38 | 38 |
import javax.servlet.*; |
39 | 39 |
import javax.servlet.http.*; |
40 | 40 |
|
41 |
import org.apache.log4j.Logger; |
|
41 | 42 |
import org.xml.sax.*; |
42 | 43 |
|
43 | 44 |
public class MetacatReplication extends HttpServlet implements Runnable |
... | ... | |
55 | 56 |
private static final String TIMEREPLICATIONINTERVAl = "timedreplicationinterval"; |
56 | 57 |
private static final String FIRSTTIME = "firsttimedreplication"; |
57 | 58 |
private static final int TIMEINTERVALLIMIT = 7200000; |
58 |
|
|
59 |
private static Logger logMetacat = Logger.getLogger(MetacatReplication.class); |
|
60 |
|
|
59 | 61 |
/** |
60 | 62 |
* Initialize the servlet by creating appropriate database connections |
61 | 63 |
*/ |
... | ... | |
70 | 72 |
try |
71 | 73 |
{ |
72 | 74 |
timedReplicationIsOn = (new Boolean(util.getOption(TIMEREPLICATION ).trim())).booleanValue(); |
73 |
MetaCatUtil.debugMessage("The timed replication on is"+timedReplicationIsOn, 30);
|
|
75 |
logMetacat.info("The timed replication on is"+timedReplicationIsOn);
|
|
74 | 76 |
timeInterval = (new Long(util.getOption(TIMEREPLICATIONINTERVAl).trim())).longValue(); |
75 |
MetaCatUtil.debugMessage("The timed replication time Inerval is "+ timeInterval, 20);
|
|
77 |
logMetacat.warn("The timed replication time Inerval is "+ timeInterval);
|
|
76 | 78 |
String firstTimeStr = util.getOption(FIRSTTIME); |
77 |
MetaCatUtil.debugMessage("first replication time form property is "+firstTimeStr, 20);
|
|
79 |
logMetacat.warn("first replication time form property is "+firstTimeStr);
|
|
78 | 80 |
firstTime = ReplicationHandler.combinateCurrentDateAndGivenTime(firstTimeStr); |
79 |
MetaCatUtil.debugMessage("After combine current time, the real first time is "
|
|
80 |
+firstTime.toString()+" minisec", 20);
|
|
81 |
logMetacat.warn("After combine current time, the real first time is "
|
|
82 |
+firstTime.toString()+" minisec"); |
|
81 | 83 |
// set up time replication if it is on |
82 | 84 |
if (timedReplicationIsOn) |
83 | 85 |
{ |
... | ... | |
90 | 92 |
{ |
91 | 93 |
// the timed replication in Metacat.properties file has problem |
92 | 94 |
// so timed replication is setting to false; |
93 |
MetaCatUtil.debugMessage("Couldn't set up timed replication "+
|
|
95 |
logMetacat.error("Couldn't set up timed replication "+
|
|
94 | 96 |
" in Metacat replication servlet init because " + |
95 |
e.getMessage(), 20);
|
|
97 |
e.getMessage()); |
|
96 | 98 |
MetacatReplication.replErrorLog("Couldn't set up timed replication "+ |
97 | 99 |
" in Metacat replication servlet init because " + |
98 | 100 |
e.getMessage()); |
... | ... | |
176 | 178 |
if (params.containsKey("sessionid")) |
177 | 179 |
{ |
178 | 180 |
sess_id = ((String[]) params.get("sessionid"))[0]; |
179 |
MetaCatUtil.debugMessage("in has sessionid "+ sess_id, 40);
|
|
181 |
logMetacat.info("in has sessionid "+ sess_id);
|
|
180 | 182 |
if (sessionHash.containsKey(sess_id)) |
181 | 183 |
{ |
182 |
MetaCatUtil.debugMessage("find the id " + sess_id + " in hash table", 40);
|
|
184 |
logMetacat.info("find the id " + sess_id + " in hash table");
|
|
183 | 185 |
sess = (HttpSession) sessionHash.get(sess_id); |
184 | 186 |
} |
185 | 187 |
} |
186 | 188 |
username = (String) sess.getAttribute("username"); |
187 |
MetaCatUtil.debugMessage("The user name from session is: "+ username, 20);
|
|
189 |
logMetacat.warn("The user name from session is: "+ username);
|
|
188 | 190 |
groupnames = (String[]) sess.getAttribute("groupnames"); |
189 | 191 |
if (!MetaCatUtil.isAdministrator(username, groupnames)) |
190 | 192 |
{ |
... | ... | |
194 | 196 |
"\" is not authorized for this action."); |
195 | 197 |
out.print("</error>"); |
196 | 198 |
out.close(); |
197 |
MetaCatUtil.debugMessage("The user \"" + username +
|
|
198 |
"\" is not authorized for this action: " +action, 30);
|
|
199 |
logMetacat.warn("The user \"" + username +
|
|
200 |
"\" is not authorized for this action: " +action); |
|
199 | 201 |
replErrorLog("The user \"" + username + |
200 | 202 |
"\" is not authorized for this action: " +action); |
201 | 203 |
return; |
... | ... | |
249 | 251 |
} else { |
250 | 252 |
timeInterval = TIMEINTERVALLIMIT ; |
251 | 253 |
} |
252 |
MetaCatUtil.debugMessage("New rate is: " + timeInterval + " mini seconds.", 30);
|
|
254 |
logMetacat.info("New rate is: " + timeInterval + " mini seconds.");
|
|
253 | 255 |
if ( params.containsKey("firsttime")) |
254 | 256 |
{ |
255 | 257 |
firstTimeStr = ((String[])params.get("firsttime"))[0]; |
256 | 258 |
try |
257 | 259 |
{ |
258 | 260 |
firstTime = ReplicationHandler.combinateCurrentDateAndGivenTime(firstTimeStr); |
259 |
MetaCatUtil.debugMessage("The first time setting is "+firstTime.toString(), 30);
|
|
261 |
logMetacat.info("The first time setting is "+firstTime.toString());
|
|
260 | 262 |
} |
261 | 263 |
catch (Exception e) |
262 | 264 |
{ |
263 | 265 |
throw new ServletException(e.getMessage()); |
264 | 266 |
} |
265 |
MetaCatUtil.debugMessage("After combine current time, the real first time is "
|
|
266 |
+firstTime.toString()+" minisec", 20);
|
|
267 |
logMetacat.warn("After combine current time, the real first time is "
|
|
268 |
+firstTime.toString()+" minisec"); |
|
267 | 269 |
} |
268 | 270 |
else |
269 | 271 |
{ |
270 | 272 |
MetacatReplication.replErrorLog("You should specify the first time " + |
271 | 273 |
"to start a time replication"); |
272 |
MetaCatUtil.debugMessage("You should specify the first time " +
|
|
273 |
"to start a time replication", 30);
|
|
274 |
logMetacat.warn("You should specify the first time " +
|
|
275 |
"to start a time replication"); |
|
274 | 276 |
return; |
275 | 277 |
} |
276 | 278 |
|
... | ... | |
497 | 499 |
}//try |
498 | 500 |
catch (SQLException ee) |
499 | 501 |
{ |
500 |
MetaCatUtil.debugMessage("Error in " +
|
|
502 |
logMetacat.error("Error in " +
|
|
501 | 503 |
"MetacatReplication.handleServerControlRequest to close pstmt " |
502 |
+ ee.getMessage(), 30);
|
|
504 |
+ ee.getMessage()); |
|
503 | 505 |
}//catch |
504 | 506 |
finally |
505 | 507 |
{ |
... | ... | |
592 | 594 |
//override = true; //we are now overriding the default action |
593 | 595 |
} |
594 | 596 |
MetacatReplication.replLog("force replication request from " + server); |
595 |
MetaCatUtil.debugMessage("Force replication request from: "+ server, 34);
|
|
596 |
MetaCatUtil.debugMessage("Force replication docid: "+docid, 34);
|
|
597 |
MetaCatUtil.debugMessage("Force replication action: "+dbaction, 34);
|
|
597 |
logMetacat.info("Force replication request from: "+ server);
|
|
598 |
logMetacat.info("Force replication docid: "+docid);
|
|
599 |
logMetacat.info("Force replication action: "+dbaction);
|
|
598 | 600 |
// sending back read request to remote server |
599 | 601 |
URL u = new URL("https://" + server + "?server=" |
600 | 602 |
+util.getLocalReplicationServerName() |
... | ... | |
620 | 622 |
String homeServer=(String)docinfoHash.get("home_server"); |
621 | 623 |
String createdDate = (String)docinfoHash.get("date_created"); |
622 | 624 |
String updatedDate = (String)docinfoHash.get("date_updated"); |
623 |
MetaCatUtil.debugMessage("homeServer: "+homeServer, 34);
|
|
625 |
logMetacat.info("homeServer: "+homeServer);
|
|
624 | 626 |
// Get Document type |
625 | 627 |
String docType = (String)docinfoHash.get("doctype"); |
626 |
MetaCatUtil.debugMessage("docType: "+docType, 34);
|
|
628 |
logMetacat.info("docType: "+docType);
|
|
627 | 629 |
String parserBase = null; |
628 | 630 |
// this for eml2 and we need user eml2 parser |
629 | 631 |
if (docType != null && |
630 | 632 |
(docType.trim()).equals(DocumentImpl.EML2_0_0NAMESPACE)) |
631 | 633 |
{ |
632 |
MetaCatUtil.debugMessage("This is an eml200 document!", 30);
|
|
634 |
logMetacat.warn("This is an eml200 document!");
|
|
633 | 635 |
parserBase = DocumentImpl.EML200; |
634 | 636 |
} |
635 | 637 |
else if (docType != null && (docType.trim()).equals(DocumentImpl.EML2_0_1NAMESPACE)) |
636 | 638 |
{ |
637 |
MetaCatUtil.debugMessage("This is an eml2.0.1 document!", 30);
|
|
639 |
logMetacat.warn("This is an eml2.0.1 document!");
|
|
638 | 640 |
parserBase = DocumentImpl.EML200; |
639 | 641 |
} |
640 | 642 |
else if (docType != null && (docType.trim()).equals(DocumentImpl.EML2_1_0NAMESPACE)) |
641 | 643 |
{ |
642 |
MetaCatUtil.debugMessage("This is an eml2.1.0 document!", 30);
|
|
644 |
logMetacat.warn("This is an eml2.1.0 document!");
|
|
643 | 645 |
parserBase = DocumentImpl.EML210; |
644 | 646 |
} |
645 |
MetaCatUtil.debugMessage("The parserBase is: "+parserBase, 30);
|
|
647 |
logMetacat.warn("The parserBase is: "+parserBase);
|
|
646 | 648 |
|
647 | 649 |
// Get DBConnection from pool |
648 | 650 |
dbConn=DBConnectionPool. |
... | ... | |
663 | 665 |
" failed to added to DB with " + |
664 | 666 |
"action " + dbaction + " because "+ |
665 | 667 |
e.getMessage()); |
666 |
MetaCatUtil.debugMessage("ERROR in MetacatReplication.handleForceReplicate" +
|
|
667 |
"Request(): " + e.getMessage(), 30);
|
|
668 |
logMetacat.error("ERROR in MetacatReplication.handleForceReplicate" +
|
|
669 |
"Request(): " + e.getMessage()); |
|
668 | 670 |
|
669 | 671 |
}//catch |
670 | 672 |
finally |
... | ... | |
687 | 689 |
{ |
688 | 690 |
MetacatReplication.replLog("force replication delete request from " + server); |
689 | 691 |
MetacatReplication.replLog("force replication delete docid " + docid); |
690 |
MetaCatUtil.debugMessage("Force replication delete request from: "+ server, 34);
|
|
691 |
MetaCatUtil.debugMessage("Force replication delete docid: "+docid, 34);
|
|
692 |
logMetacat.info("Force replication delete request from: "+ server);
|
|
693 |
logMetacat.info("Force replication delete docid: "+docid);
|
|
692 | 694 |
DocumentImpl.delete(docid, null, null, server); |
693 | 695 |
MetacatReplication.replLog("document " + docid + " was successfully deleted "); |
694 |
MetaCatUtil.debugMessage("document " + docid + " was successfully deleted ", 34);
|
|
696 |
logMetacat.info("document " + docid + " was successfully deleted ");
|
|
695 | 697 |
} |
696 | 698 |
catch(Exception e) |
697 | 699 |
{ |
698 | 700 |
MetacatReplication.replErrorLog("document " + docid + |
699 | 701 |
" failed to delete because "+ |
700 | 702 |
e.getMessage()); |
701 |
MetaCatUtil.debugMessage("ERROR in MetacatReplication.handleForceDeleteReplicate" +
|
|
702 |
"Request(): " + e.getMessage(), 30);
|
|
703 |
logMetacat.error("ERROR in MetacatReplication.handleForceDeleteReplicate" +
|
|
704 |
"Request(): " + e.getMessage()); |
|
703 | 705 |
|
704 | 706 |
}//catch |
705 | 707 |
|
... | ... | |
726 | 728 |
// Make sure there is a docid and server |
727 | 729 |
if (docid==null || server==null || server.equals("")) |
728 | 730 |
{ |
729 |
MetaCatUtil.debugMessage("Didn't specify docid or server for replication" |
|
730 |
, 20); |
|
731 |
logMetacat.error("Didn't specify docid or server for replication"); |
|
731 | 732 |
return; |
732 | 733 |
} |
733 | 734 |
|
... | ... | |
751 | 752 |
} |
752 | 753 |
|
753 | 754 |
MetacatReplication.replLog("force replication request from " + server); |
754 |
MetaCatUtil.debugMessage("Force replication request from: "+ server, 34);
|
|
755 |
MetaCatUtil.debugMessage("Force replication docid: "+docid, 34);
|
|
756 |
MetaCatUtil.debugMessage("Force replication action: "+dbaction, 34);
|
|
755 |
logMetacat.info("Force replication request from: "+ server);
|
|
756 |
logMetacat.info("Force replication docid: "+docid);
|
|
757 |
logMetacat.info("Force replication action: "+dbaction);
|
|
757 | 758 |
// get the document info from server |
758 | 759 |
URL docinfourl = new URL("https://" + server + |
759 | 760 |
"?server="+util.getLocalReplicationServerName() |
... | ... | |
777 | 778 |
String createdDate = (String)docinfoHash.get("date_created"); |
778 | 779 |
|
779 | 780 |
String updatedDate = (String)docinfoHash.get("date_updated"); |
780 |
MetaCatUtil.debugMessage("docHomeServer of datafile: "+docHomeServer, 34);
|
|
781 |
logMetacat.info("docHomeServer of datafile: "+docHomeServer);
|
|
781 | 782 |
|
782 | 783 |
|
783 | 784 |
|
... | ... | |
818 | 819 |
" failed to added to DB with " + |
819 | 820 |
"action " + dbaction + " because "+ |
820 | 821 |
e.getMessage()); |
821 |
MetaCatUtil.debugMessage
|
|
822 |
logMetacat.error
|
|
822 | 823 |
("ERROR in MetacatReplication.handleForceDataFileReplicate" + |
823 |
"Request(): " + e.getMessage(), 30);
|
|
824 |
"Request(): " + e.getMessage()); |
|
824 | 825 |
} |
825 | 826 |
} |
826 | 827 |
/** |
... | ... | |
942 | 943 |
//check if the doicd is null |
943 | 944 |
if (docId==null) |
944 | 945 |
{ |
945 |
util.debugMessage("Didn't specify docid for replication", 20);
|
|
946 |
logMetacat.error("Didn't specify docid for replication");
|
|
946 | 947 |
return; |
947 | 948 |
} |
948 | 949 |
|
... | ... | |
960 | 961 |
{ |
961 | 962 |
//response.setContentType("text/xml"); |
962 | 963 |
//outPut.println("<error>Couldn't pass the trust test</error>"); |
963 |
MetaCatUtil.debugMessage("Couldn't pass the trust test", 20);
|
|
964 |
logMetacat.error("Couldn't pass the trust test");
|
|
964 | 965 |
return; |
965 | 966 |
} |
966 | 967 |
}//try |
... | ... | |
1080 | 1081 |
} |
1081 | 1082 |
catch(Exception e) |
1082 | 1083 |
{ |
1083 |
MetaCatUtil.debugMessage("error getting document from MetacatReplication."
|
|
1084 |
+"handlGetDocumentRequest " + e.getMessage(), 30);
|
|
1084 |
logMetacat.error("error getting document from MetacatReplication."
|
|
1085 |
+"handlGetDocumentRequest " + e.getMessage()); |
|
1085 | 1086 |
//e.printStackTrace(System.out); |
1086 | 1087 |
response.setContentType("text/xml"); |
1087 | 1088 |
out.println("<error>"+e.getMessage()+"</error>"); |
... | ... | |
1191 | 1192 |
docsql.append(serverLocation); |
1192 | 1193 |
revisionSql.append(serverLocation); |
1193 | 1194 |
} |
1194 |
MetaCatUtil.debugMessage("Doc sql: "+docsql.toString(), 30);
|
|
1195 |
logMetacat.info("Doc sql: "+docsql.toString());
|
|
1195 | 1196 |
|
1196 | 1197 |
// Get any deleted documents |
1197 | 1198 |
delsql.append("select distinct docid from "); |
... | ... | |
1203 | 1204 |
{ |
1204 | 1205 |
delsql.append("and server_location = 1"); |
1205 | 1206 |
} |
1206 |
MetaCatUtil.debugMessage("Deleted sql: "+delsql.toString(), 30);
|
|
1207 |
logMetacat.info("Deleted sql: "+delsql.toString());
|
|
1207 | 1208 |
|
1208 | 1209 |
|
1209 | 1210 |
|
... | ... | |
1322 | 1323 |
doclist.append(prepareRevisionDoc(dbConn,revisionSql.toString(),replicateData)); |
1323 | 1324 |
|
1324 | 1325 |
doclist.append("</updates></replication>"); |
1325 |
MetaCatUtil.debugMessage("doclist: " + doclist.toString(), 40);
|
|
1326 |
logMetacat.info("doclist: " + doclist.toString());
|
|
1326 | 1327 |
pstmt.close(); |
1327 | 1328 |
//conn.close(); |
1328 | 1329 |
response.setContentType("text/xml"); |
... | ... | |
1331 | 1332 |
} |
1332 | 1333 |
catch(Exception e) |
1333 | 1334 |
{ |
1334 |
MetaCatUtil.debugMessage("error in MetacatReplication." +
|
|
1335 |
"handleupdaterequest: " + e.getMessage(), 30);
|
|
1335 |
logMetacat.error("error in MetacatReplication." +
|
|
1336 |
"handleupdaterequest: " + e.getMessage()); |
|
1336 | 1337 |
//e.printStackTrace(System.out); |
1337 | 1338 |
response.setContentType("text/xml"); |
1338 | 1339 |
out.println("<error>"+e.getMessage()+"</error>"); |
... | ... | |
1345 | 1346 |
}//try |
1346 | 1347 |
catch (SQLException ee) |
1347 | 1348 |
{ |
1348 |
MetaCatUtil.debugMessage("Error in MetacatReplication." +
|
|
1349 |
"handleUpdaterequest to close pstmt: "+ee.getMessage(), 30);
|
|
1349 |
logMetacat.error("Error in MetacatReplication." +
|
|
1350 |
"handleUpdaterequest to close pstmt: "+ee.getMessage()); |
|
1350 | 1351 |
}//catch |
1351 | 1352 |
finally |
1352 | 1353 |
{ |
... | ... | |
1363 | 1364 |
private String prepareRevisionDoc(DBConnection dbConn, String revSql, |
1364 | 1365 |
boolean replicateData) throws Exception |
1365 | 1366 |
{ |
1366 |
MetaCatUtil.debugMessage("The revision document sql is "+ revSql, 20);
|
|
1367 |
logMetacat.warn("The revision document sql is "+ revSql);
|
|
1367 | 1368 |
StringBuffer revDocList = new StringBuffer(); |
1368 | 1369 |
PreparedStatement pstmt = dbConn.prepareStatement(revSql); |
1369 | 1370 |
//usage count should increas 1 |
... | ... | |
1470 | 1471 |
catch(Exception e) |
1471 | 1472 |
{ |
1472 | 1473 |
|
1473 |
MetaCatUtil.debugMessage("error in MetacatReplication.handleGetCatalogRequest:"+
|
|
1474 |
e.getMessage(), 30);
|
|
1474 |
logMetacat.error("error in MetacatReplication.handleGetCatalogRequest:"+
|
|
1475 |
e.getMessage()); |
|
1475 | 1476 |
e.printStackTrace(System.out); |
1476 | 1477 |
if(printFlag) |
1477 | 1478 |
{ |
... | ... | |
1486 | 1487 |
}//try |
1487 | 1488 |
catch (SQLException ee) |
1488 | 1489 |
{ |
1489 |
MetaCatUtil. |
|
1490 |
debugMessage("Error in MetacatReplication.handleGetCatalogRequest: " |
|
1491 |
+ee.getMessage(), 30); |
|
1490 |
logMetacat.error("Error in MetacatReplication.handleGetCatalogRequest: " |
|
1491 |
+ee.getMessage()); |
|
1492 | 1492 |
}//catch |
1493 | 1493 |
finally |
1494 | 1494 |
{ |
... | ... | |
1524 | 1524 |
{ |
1525 | 1525 |
try |
1526 | 1526 |
{ |
1527 |
MetaCatUtil.debugMessage("thread started for docid: " +
|
|
1528 |
(String)fileLocks.elementAt(0), 45);
|
|
1527 |
logMetacat.info("thread started for docid: " +
|
|
1528 |
(String)fileLocks.elementAt(0)); |
|
1529 | 1529 |
|
1530 | 1530 |
Thread.sleep(30000); //the lock will expire in 30 seconds |
1531 |
MetaCatUtil.debugMessage("thread for docid: " +
|
|
1531 |
logMetacat.info("thread for docid: " +
|
|
1532 | 1532 |
(String)fileLocks.elementAt(fileLocks.size() - 1) + |
1533 |
" exiting.", 45);
|
|
1533 |
" exiting."); |
|
1534 | 1534 |
|
1535 | 1535 |
fileLocks.remove(fileLocks.size() - 1); |
1536 | 1536 |
//fileLocks is treated as a FIFO queue. If there are more than one lock |
... | ... | |
1538 | 1538 |
} |
1539 | 1539 |
catch(Exception e) |
1540 | 1540 |
{ |
1541 |
MetaCatUtil.debugMessage("error in file lock thread from " +
|
|
1542 |
"MetacatReplication.run: " + e.getMessage(), 30);
|
|
1541 |
logMetacat.error("error in file lock thread from " +
|
|
1542 |
"MetacatReplication.run: " + e.getMessage()); |
|
1543 | 1543 |
} |
1544 | 1544 |
} |
1545 | 1545 |
|
... | ... | |
1589 | 1589 |
}//try |
1590 | 1590 |
catch (SQLException ee) |
1591 | 1591 |
{ |
1592 |
MetaCatUtil.debugMessage("Error in MetacactReplication.getserver: "+
|
|
1593 |
ee.getMessage(), 30);
|
|
1592 |
logMetacat.error("Error in MetacactReplication.getserver: "+
|
|
1593 |
ee.getMessage()); |
|
1594 | 1594 |
}//catch |
1595 | 1595 |
finally |
1596 | 1596 |
{ |
... | ... | |
1646 | 1646 |
}//try |
1647 | 1647 |
catch(Exception ee) |
1648 | 1648 |
{ |
1649 |
MetaCatUtil.debugMessage("Error in MetacatReplicatio.getServerCode: "
|
|
1650 |
+ee.getMessage(), 30);
|
|
1649 |
logMetacat.error("Error in MetacatReplicatio.getServerCode: "
|
|
1650 |
+ee.getMessage()); |
|
1651 | 1651 |
|
1652 | 1652 |
}//catch |
1653 | 1653 |
finally |
... | ... | |
1737 | 1737 |
} |
1738 | 1738 |
catch (Exception ee) |
1739 | 1739 |
{ |
1740 |
MetaCatUtil.debugMessage("Eror irn rplicationHandler.getHomeServer() "+
|
|
1741 |
"to close pstmt: "+ee.getMessage(), 30);
|
|
1740 |
logMetacat.error("Eror irn rplicationHandler.getHomeServer() "+
|
|
1741 |
"to close pstmt: "+ee.getMessage()); |
|
1742 | 1742 |
} |
1743 | 1743 |
finally |
1744 | 1744 |
{ |
... | ... | |
1809 | 1809 |
} |
1810 | 1810 |
catch(Exception ee) |
1811 | 1811 |
{ |
1812 |
MetaCatUtil.debugMessage("Erorr in Replication.getServerLocation "+
|
|
1813 |
"to close pstmt"+ee.getMessage(), 30);
|
|
1812 |
logMetacat.error("Erorr in Replication.getServerLocation "+
|
|
1813 |
"to close pstmt"+ee.getMessage()); |
|
1814 | 1814 |
} |
1815 | 1815 |
finally |
1816 | 1816 |
{ |
... | ... | |
1832 | 1832 |
{ |
1833 | 1833 |
char istreamChar; |
1834 | 1834 |
int istreamInt; |
1835 |
MetaCatUtil.debugMessage("Before open the stream"+u.toString(), 50);
|
|
1835 |
logMetacat.info("Before open the stream"+u.toString());
|
|
1836 | 1836 |
InputStream input = u.openStream(); |
1837 |
MetaCatUtil.debugMessage("Afetr open the stream"+u.toString(), 50);
|
|
1837 |
logMetacat.info("Afetr open the stream"+u.toString());
|
|
1838 | 1838 |
InputStreamReader istream = new InputStreamReader(input); |
1839 | 1839 |
StringBuffer serverResponse = new StringBuffer(); |
1840 | 1840 |
while((istreamInt = istream.read()) != -1) |
... | ... | |
1953 | 1953 |
}//try |
1954 | 1954 |
catch(Exception ee) |
1955 | 1955 |
{ |
1956 |
MetaCatUtil.debugMessage("Error in MetacatReplication.replToServer: "
|
|
1957 |
+ee.getMessage(), 30);
|
|
1956 |
logMetacat.error("Error in MetacatReplication.replToServer: "
|
|
1957 |
+ee.getMessage()); |
|
1958 | 1958 |
}//catch |
1959 | 1959 |
finally |
1960 | 1960 |
{ |
Also available in: Unified diff
Replacing MetaCatUtil.debugMessage or MetaCatUtil.logMetacat call with logMetacat (private Logger object) call