Project

General

Profile

« Previous | Next » 

Revision 5430

Added by berkley over 14 years ago

fix for null session bug

View differences:

src/edu/ucsb/nceas/metacat/dataone/CrudService.java
472 472
      int totalAfterQuery = 0;
473 473
      try
474 474
      {
475
          
475
          System.out.println("=========== Listing Objects =============");
476
          System.out.println("Current server time is: " + new Date());
477
          if(startTime != null)
478
          {
479
              System.out.println("query start time is " + startTime);
480
          }
481
          if(endTime != null)
482
          {
483
              System.out.println("query end time is " + endTime);
484
          }
476 485
          params.clear();
477 486
          params.put("returndoctype", new String[] {"http://dataone.org/service/types/SystemMetadata/0.1"});
478 487
          params.put("qformat", new String[] {"xml"});
......
671 680
          e.printStackTrace();
672 681
          throw new ServiceFailure("1580", "Error retrieving ObjectList: " + e.getMessage());
673 682
      }
674
      String username = sessionData.getUserName();
683
      String username = "public";
684
      if(sessionData != null)
685
      {
686
          username = sessionData.getUserName();
687
      }
675 688
      EventLog.getInstance().log(metacatUrl,
676 689
              username, null, "read");
677 690
      logCrud.info("listObjects");
......
813 826
            throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest, 
814 827
            NotImplemented 
815 828
    {
829
        System.out.println("=================== Getting log records ===================");
830
        System.out.println("Current server time is: " + new Date());
831
        if(fromDate != null)
832
        {
833
          System.out.println("query start time is " + fromDate);
834
        }
835
        if(toDate != null)
836
        {
837
          System.out.println("query end time is " + toDate);
838
        }
816 839
        Log log = new Log();
817 840
        Vector<LogEntry> logs = new Vector<LogEntry>();
818 841
        IdentifierManager im = IdentifierManager.getInstance();

Also available in: Unified diff