Project

General

Profile

« Previous | Next » 

Revision 9071

Added by Jing Tao almost 10 years ago

The MN.listobjects and CN.listobjects methods will call the one in the D1NodeService class.

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
922 922
    public ObjectList listObjects(Session session, Date startTime, Date endTime, ObjectFormatIdentifier objectFormatId, Identifier identifier, Boolean replicaStatus, Integer start,
923 923
            Integer count) throws NotAuthorized, InvalidRequest, NotImplemented, ServiceFailure, InvalidToken {
924 924

  
925
        ObjectList objectList = null;
926

  
927
        try {
928
        	// safeguard against large requests
929
            if (count == null || count > MAXIMUM_DB_RECORD_COUNT) {
930
            	count = MAXIMUM_DB_RECORD_COUNT;
931
            }
932
            objectList = IdentifierManager.getInstance().querySystemMetadata(startTime, endTime, objectFormatId, replicaStatus, start, count);
933
        } catch (Exception e) {
934
            throw new ServiceFailure("1580", "Error querying system metadata: " + e.getMessage());
935
        }
936

  
937
        return objectList;
925
        return super.listObjects(session, startTime, endTime, objectFormatId, identifier, replicaStatus, start, count);
938 926
    }
939 927

  
940 928
    /**
src/edu/ucsb/nceas/metacat/dataone/CNodeService.java
1869 1869
      throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented,
1870 1870
      ServiceFailure {
1871 1871
      
1872
      ObjectList objectList = null;
1873
        try {
1874
        	if (count == null || count > MAXIMUM_DB_RECORD_COUNT) {
1875
            	count = MAXIMUM_DB_RECORD_COUNT;
1876
            }
1877
            objectList = IdentifierManager.getInstance().querySystemMetadata(startTime, endTime, formatid, replicaStatus, start, count);
1878
        } catch (Exception e) {
1879
            throw new ServiceFailure("1580", "Error querying system metadata: " + e.getMessage());
1880
        }
1881

  
1882
        return objectList;
1872
      return super.listObjects(session, startTime, endTime, formatid, identifier, replicaStatus, start, count);
1883 1873
  }
1884 1874

  
1885 1875
  
src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
61 61
import org.dataone.service.types.v1.DescribeResponse;
62 62
import org.dataone.service.types.v1.Group;
63 63
import org.dataone.service.types.v1.Identifier;
64
import org.dataone.service.types.v1.ObjectFormatIdentifier;
65
import org.dataone.service.types.v1.ObjectList;
64 66
import org.dataone.service.types.v2.Log;
65 67
import org.dataone.service.types.v2.Node;
66 68
import org.dataone.service.types.v1.Event;
......
1426 1428
          
1427 1429
	    }  
1428 1430
  }
1431
  
1432
  /**
1433
   * Retrieve the list of objects present on the MN that match the calling parameters
1434
   * 
1435
   * @param session - the Session object containing the credentials for the Subject
1436
   * @param startTime - Specifies the beginning of the time range from which 
1437
   *                    to return object (>=)
1438
   * @param endTime - Specifies the beginning of the time range from which 
1439
   *                  to return object (>=)
1440
   * @param objectFormat - Restrict results to the specified object format
1441
   * @param replicaStatus - Indicates if replicated objects should be returned in the list
1442
   * @param start - The zero-based index of the first value, relative to the 
1443
   *                first record of the resultset that matches the parameters.
1444
   * @param count - The maximum number of entries that should be returned in 
1445
   *                the response. The Member Node may return less entries 
1446
   *                than specified in this value.
1447
   * 
1448
   * @return objectList - the list of objects matching the criteria
1449
   * 
1450
   * @throws InvalidToken
1451
   * @throws ServiceFailure
1452
   * @throws NotAuthorized
1453
   * @throws InvalidRequest
1454
   * @throws NotImplemented
1455
   */
1456
  public ObjectList listObjects(Session session, Date startTime, Date endTime, ObjectFormatIdentifier objectFormatId, Identifier identifier, Boolean replicaStatus, Integer start,
1457
          Integer count) throws NotAuthorized, InvalidRequest, NotImplemented, ServiceFailure, InvalidToken {
1429 1458

  
1459
      ObjectList objectList = null;
1460

  
1461
      try {
1462
          // safeguard against large requests
1463
          if (count == null || count > MAXIMUM_DB_RECORD_COUNT) {
1464
              count = MAXIMUM_DB_RECORD_COUNT;
1465
          }
1466
          objectList = IdentifierManager.getInstance().querySystemMetadata(startTime, endTime, objectFormatId, replicaStatus, start, count);
1467
      } catch (Exception e) {
1468
          throw new ServiceFailure("1580", "Error querying system metadata: " + e.getMessage());
1469
      }
1470

  
1471
      return objectList;
1472
  }
1473

  
1430 1474
  /**
1431 1475
   * Update a systemMetadata document
1432 1476
   * 

Also available in: Unified diff