/** * Read policy from persistent storage under standard naming convention. This method may be called * optionally during initialization by a subclass after it is initialized enough to process * getContent() calls * * @param globalPrefix - used to find our policy file * @return XML for the current policy or null if no current policy * @throws MalformedContentNameStringException * @throws IOException */ public PolicyXML readPolicy(ContentName globalPrefix) throws MalformedContentNameStringException, IOException { if (Log.isLoggable(Log.FAC_REPO, Level.INFO)) Log.info( Log.FAC_REPO, "REPO: reading policy from network: {0}/{1}/{2}", REPO_NAMESPACE, globalPrefix, REPO_POLICY); ContentName policyName = BasicPolicy.getPolicyName(globalPrefix); // We can't use the regular repo handle for this because we need ndnd to communicate across the // faces NDNHandle readHandle; readHandle = NDNHandle.open(_km); PolicyObject policyObject = new PolicyObject(policyName, readHandle); try { return policyObject.policyInfo(); } catch (ContentNotReadyException cge) { } finally { readHandle.close(); } return null; }