Skip to content

Commit

Permalink
Changed the code to get the system metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
taojing2002 committed Jun 25, 2024
1 parent e1e354f commit 186e739
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.dataone.service.exceptions.NotImplemented;
import org.dataone.service.exceptions.ServiceFailure;
import org.dataone.service.types.v1.Identifier;
import org.dataone.service.types.v2.SystemMetadata;
import org.dataone.service.types.v1.SystemMetadata;

public class IndexVisibilityDelegateImpl implements IndexVisibilityDelegate {

Expand All @@ -25,10 +25,8 @@ public IndexVisibilityDelegateImpl() {
public boolean isDocumentVisible(Identifier pid) {
boolean visible = false;
try {

//SystemMetadata systemMetadata = HazelcastClientFactory.getSystemMetadataMap().get(pid);
String relativeObjPath = null; //we don't know the path
SystemMetadata systemMetadata = ObjectManager.getInstance().getSystemMetadata(pid.getValue(), relativeObjPath);
SystemMetadata systemMetadata = ObjectManager.getInstance()
.getSystemMetadata(pid.getValue());
// TODO: Is pid Identifier a SID?
if (systemMetadata == null) {
return true;
Expand Down Expand Up @@ -63,9 +61,7 @@ public boolean isDocumentVisible(Identifier pid) {
public boolean documentExists(Identifier pid) {
boolean exists = false;
try {
//SystemMetadata systemMetadata = HazelcastClientFactory.getSystemMetadataMap().get(pid);
String relativeObjPath = null; //we don't know the path
SystemMetadata systemMetadata = ObjectManager.getInstance().getSystemMetadata(pid.getValue(), relativeObjPath);
SystemMetadata systemMetadata = ObjectManager.getInstance().getSystemMetadata(pid.getValue());
if (systemMetadata != null) {
exists = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dataone/cn/indexer/solrhttp/SolrDoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.List;

import org.apache.commons.io.IOUtils;
import org.dataone.service.types.v2.SystemMetadata;
import org.dataone.service.types.v1.SystemMetadata;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Expand Down

0 comments on commit 186e739

Please sign in to comment.