Project

General

Profile

« Previous | Next » 

Revision 9249

Added by Jing Tao almost 9 years ago

Use the NodeReference object to replace the replicaStatus to restrict the listObjects method.

View differences:

SyncAccessPolicy.java
52 52
import org.dataone.service.types.v1.AccessPolicy;
53 53
import org.dataone.service.types.v1.AccessRule;
54 54
import org.dataone.service.types.v1.Identifier;
55
import org.dataone.service.types.v1.NodeReference;
55 56
import org.dataone.service.types.v1.ObjectFormatIdentifier;
56 57
import org.dataone.service.types.v1.ObjectInfo;
57 58
import org.dataone.service.types.v1.ObjectList;
......
316 317
			Date startTime = null;
317 318
			Date endTime = null;
318 319
			ObjectFormatIdentifier objectFormatId = null;
319
			Boolean replicaStatus = false; // return only pids for which this mn
320
											// is
320
			//Boolean replicaStatus = false; // return only pids for which this mn
321
			NodeReference thisMN = new NodeReference();
322
			try {
323
			    String currentNodeId = PropertyService.getInstance().getProperty("dataone.nodeId"); // return only pids for which this mn
324
			    thisMN.setValue(currentNodeId);
325
			} catch (Exception e) {
326
			    logMetacat.error("SyncAccessPolicy.run - can't get the node id of this member node from the metacat property file since :"+e.getMessage());
327
			    return;
328
			}
329
							// is
321 330
			ObjectList objsToSync = null;
322 331
			Integer count = 0;
323 332
			Integer start = 0;
......
350 359
			    
351 360
				objsToSync = IdentifierManager.getInstance()
352 361
						.querySystemMetadata(startTime, endTime,
353
								objectFormatId, replicaStatus, start, count, id, isSid);
362
								objectFormatId, thisMN, start, count, id, isSid);
354 363

  
355 364
				logMetacat.debug("syncTask total # of guids: "
356 365
						+ objsToSync.getTotal() + ", count for this page: "
......
383 392
					objsToSync = IdentifierManager
384 393
							.getInstance()
385 394
							.querySystemMetadata(startTime, endTime,
386
									objectFormatId, replicaStatus, start, count, id, isSid);
395
									objectFormatId, thisMN, start, count, id, isSid);
387 396
				} catch (Exception e) {
388 397
					logMetacat.error("Error syncing ids");
389 398
					syncError = true;

Also available in: Unified diff