Skip to content
Permalink
Browse files

adding some trace+debug logging to HttpGraphSubjects

  • Loading branch information...
cbeer committed May 16, 2013
1 parent 32c9622 commit 7b80be2f7bb64650c6990d372299b4e701cf291c
Showing with 11 additions and 3 deletions.
  1. +11 −3 fcrepo-http-commons/src/main/java/org/fcrepo/api/rdf/HttpGraphSubjects.java
@@ -48,26 +48,34 @@ public HttpGraphSubjects(Class relativeTo, UriInfo uris) {
public Resource getGraphSubject(Node node) throws RepositoryException {
URI result = nodesBuilder
.buildFromMap(getPathMap(node));
LOGGER.debug("Translated node {} into RDF subject {}", node, result);
return ResourceFactory.createResource(result.toString());
}

@Override
public Node getNodeFromGraphSubject(Session session, Resource subject)
throws RepositoryException {
if (!isFedoraGraphSubject(subject)) {
LOGGER.debug("RDF resource {} was not a URI resource with our expected basePath {}, aborting.", subject, basePath);
return null;
}

final String absPath = subject.getURI().substring(pathIx);

final Node node;
if (absPath.endsWith(FCR_CONTENT)) {
return session.getNode(absPath.replace(FedoraJcrTypes.FCR_CONTENT, JcrConstants.JCR_CONTENT));
node = session.getNode(absPath.replace(FedoraJcrTypes.FCR_CONTENT, JcrConstants.JCR_CONTENT));
LOGGER.trace("RDF resource {} is a fcr:content node, retrieving the corresponding JCR content node {}", subject, node);
} else if (session.nodeExists(absPath)) {
return session.getNode(absPath);
node = session.getNode(absPath);
LOGGER.trace("RDF resource {} maps to JCR node {}", subject, node);
} else {
return null;
node = null;
LOGGER.debug("RDF resource {} looks like a Fedora node, but when we checked was not in the repository", subject);
}

return node;

}

@Override

0 comments on commit 7b80be2

Please sign in to comment.
You can’t perform that action at this time.