97 |
97 |
|
98 |
98 |
private MetacatHandler handler;
|
99 |
99 |
private Hashtable<String, String[]> params;
|
100 |
|
Logger logMetacat = null;
|
|
100 |
private Logger logMetacat = null;
|
|
101 |
private Logger logCrud = null;
|
101 |
102 |
|
102 |
103 |
private String metacatUrl;
|
103 |
104 |
|
... | ... | |
122 |
123 |
public CrudService() {
|
123 |
124 |
//change crud service into a singleton. dont pass servlet data structures here
|
124 |
125 |
logMetacat = Logger.getLogger(CrudService.class);
|
|
126 |
logCrud = Logger.getLogger("DataOneLogger");
|
125 |
127 |
try
|
126 |
128 |
{
|
127 |
129 |
String server = PropertyService.getProperty("server.name");
|
... | ... | |
188 |
190 |
AuthToken token = new AuthToken(sessionid);
|
189 |
191 |
EventLog.getInstance().log(metacatUrl,
|
190 |
192 |
username, null, "authenticate");
|
|
193 |
logCrud.info("authenticate");
|
191 |
194 |
return token;
|
192 |
195 |
}
|
193 |
196 |
catch(Exception e)
|
... | ... | |
244 |
247 |
logMetacat.error("Could not generate missing system metadata: " + e.getMessage());
|
245 |
248 |
}
|
246 |
249 |
}
|
|
250 |
logCrud.info("generateMissingSystemMetadata");
|
247 |
251 |
}
|
248 |
252 |
|
249 |
253 |
/**
|
... | ... | |
314 |
318 |
logMetacat.debug("Returning from CrudService.create()");
|
315 |
319 |
EventLog.getInstance().log(metacatUrl,
|
316 |
320 |
username, localId, "create");
|
|
321 |
logCrud.info("create localId:" + localId + " guid:" + guid);
|
317 |
322 |
return guid;
|
318 |
323 |
}
|
319 |
324 |
|
... | ... | |
360 |
365 |
String username = sessionData.getUserName();
|
361 |
366 |
EventLog.getInstance().log(metacatUrl,
|
362 |
367 |
username, im.getLocalId(guid.getValue()), "update");
|
|
368 |
logCrud.info("update localId:" + im.getLocalId(guid.getValue()) + " guid:" + guid);
|
363 |
369 |
return guid;
|
364 |
370 |
}
|
365 |
371 |
catch(Exception e)
|
... | ... | |
401 |
407 |
String username = sessionData.getUserName();
|
402 |
408 |
EventLog.getInstance().log(metacatUrl,
|
403 |
409 |
username, im.getLocalId(id.getValue()), "setAccess");
|
|
410 |
logCrud.info("setAccess");
|
404 |
411 |
}
|
405 |
412 |
catch(Exception e)
|
406 |
413 |
{
|
... | ... | |
530 |
537 |
String username = sessionData.getUserName();
|
531 |
538 |
EventLog.getInstance().log(metacatUrl,
|
532 |
539 |
username, null, "read");
|
|
540 |
logCrud.info("listObjects");
|
533 |
541 |
return ol;
|
534 |
542 |
}
|
535 |
543 |
|
... | ... | |
560 |
568 |
public Identifier delete(AuthToken token, Identifier guid)
|
561 |
569 |
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
562 |
570 |
NotImplemented {
|
|
571 |
logCrud.info("delete");
|
563 |
572 |
throw new NotImplemented("1000", "This method not yet implemented.");
|
564 |
573 |
}
|
565 |
574 |
|
... | ... | |
569 |
578 |
public DescribeResponse describe(AuthToken token, Identifier guid)
|
570 |
579 |
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
571 |
580 |
NotImplemented {
|
|
581 |
logCrud.info("describe");
|
572 |
582 |
throw new NotImplemented("1000", "This method not yet implemented.");
|
573 |
583 |
}
|
574 |
584 |
|
... | ... | |
629 |
639 |
String username = sessionData.getUserName();
|
630 |
640 |
EventLog.getInstance().log(metacatUrl,
|
631 |
641 |
username, im.getLocalId(guid.getValue()), "read");
|
|
642 |
logCrud.info("get localId:" + localId + " guid:" + guid);
|
632 |
643 |
return objectStream;
|
633 |
644 |
|
634 |
645 |
} catch (McdbDocNotFoundException e) {
|
... | ... | |
642 |
653 |
public Checksum getChecksum(AuthToken token, Identifier guid)
|
643 |
654 |
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
644 |
655 |
InvalidRequest, NotImplemented {
|
|
656 |
logCrud.info("getChecksum");
|
645 |
657 |
throw new NotImplemented("1000", "This method not yet implemented.");
|
646 |
658 |
}
|
647 |
659 |
|
... | ... | |
651 |
663 |
public Checksum getChecksum(AuthToken token, Identifier guid,
|
652 |
664 |
String checksumAlgorithm) throws InvalidToken, ServiceFailure,
|
653 |
665 |
NotAuthorized, NotFound, InvalidRequest, NotImplemented {
|
|
666 |
logCrud.info("getChecksum");
|
654 |
667 |
throw new NotImplemented("1000", "This method not yet implemented.");
|
655 |
668 |
}
|
656 |
669 |
|
... | ... | |
749 |
762 |
}
|
750 |
763 |
|
751 |
764 |
log.setLogEntryList(logs);
|
|
765 |
logCrud.info("getLogRecords");
|
752 |
766 |
return log;
|
753 |
767 |
}
|
754 |
768 |
|
... | ... | |
828 |
842 |
String username = sessionData.getUserName();
|
829 |
843 |
EventLog.getInstance().log(metacatUrl,
|
830 |
844 |
username, im.getLocalId(guid.getValue()), "read");
|
|
845 |
logCrud.info("getSystemMetadata localId: " + localId + " guid:" + guid);
|
831 |
846 |
return sysmeta;
|
832 |
847 |
|
833 |
848 |
} catch (McdbDocNotFoundException e) {
|
... | ... | |
1207 |
1222 |
null, params, sessionData.getUserName(), sessionData.getGroupNames());
|
1208 |
1223 |
//String outputS = new String(output.toByteArray());
|
1209 |
1224 |
logMetacat.debug("CrudService.insertDocument - Metacat returned: " + result);
|
1210 |
|
// if (!(outputS.indexOf("<success>") > 0 && outputS.indexOf(localId) > 0)) {
|
1211 |
|
// throw new ServiceFailure(1190, outputS);
|
1212 |
|
// }
|
1213 |
1225 |
logMetacat.debug("Finsished inserting xml document with id " + localId);
|
1214 |
1226 |
return localId;
|
1215 |
1227 |
}
|
added a DataOneLogger for event notifications on the CN. The logger is called DataOneLogger and can be managed in the log4j.properties file