/** * {@inheritDoc} * * NB: This method does not perform any absolute/relative URI mapping. */ public SPObject findSPObject(long gNode) throws StringPoolException { if (gNode < NodePool.MIN_NODE) { throw new IllegalArgumentException("Attempt to resolve temporary gNode in BackupRestoreSession"); } return persistentStringPool.findSPObject(gNode); }
/** * {@inheritDoc} */ public SPObject findStringPoolObject(long gNode) throws StringPoolException { // Container for our SPObject SPObject spo = null; if (gNode >= NodePool.MIN_NODE) { if (logger.isDebugEnabled()) { logger.debug("!! Searching for persistent node from id: " + gNode); } // Check if we have a persistent Node and find it if we have spo = mapAbsolute(persistentStringPool.findSPObject(gNode)); } else { if (logger.isDebugEnabled()) { logger.debug("!! Searching for temporary node from id: " + gNode); } // We have a temporary node so check the temporary pool (Using the // inverted negative id) spo = temporaryStringPool.findSPObject(-gNode); } return spo; }
public Value globalize(long localNode) throws GlobalizeException { if (state == ROLLBACK || state == RELEASE) { throw new GlobalizeException(localNode, "Attempting to globalize outside transaction."); } // Validate "localNode" parameter if (localNode == NONE) { throw new IllegalArgumentException("NONE isn't a local node"); } // Look up the local node in the string pool SPObject spObject; try { if (localNode < 0) { spObject = temporaryStringPool.findSPObject(-localNode); } else { spObject = mapAbsolute(persistentStringPool.findSPObject(localNode)); } } catch (StringPoolException e) { throw new GlobalizeException(localNode, "String pool lookup failed", e); } // Generate and return the corresponding RDF node Value node = globalizeBlankNode(localNode, spObject); assert node != null; // Return the RDF node return node; }