code: @Override
      public String addPolicy(String name, String document)
              throws PolicyIndexException {
  
          String docName = null;
          DbXmlManager.writeLock.lock();
          try {
  
              XmlDocument doc = makeDocument(name, document);
              docName = doc.getName();
              log.debug("Adding document: " + docName);
              m_dbXmlManager.container.putDocument(doc,
                                                 m_dbXmlManager.updateContext);
              setLastUpdate(System.currentTimeMillis());
          } catch (XmlException xe) {
              if (xe.getErrorCode() == XmlException.UNIQUE_ERROR) {
                  throw new PolicyIndexException("Document already exists: "
                                                 + docName);
              } else {
                  throw new PolicyIndexException("Error adding policy: "
                                                 + xe.getMessage(), xe);
              }
          } finally {
              DbXmlManager.writeLock.unlock();
          }
  
          return docName;
      }
docs: /*
  (non-Javadoc)
  @see
  org.fcrepo.server.security.xacml.pdp.data.PolicyDataManager#addPolicy
  (java.lang.String, java.lang.String)