コード例 #1
0
 @Override
 public SecuredPrefixMapping setNsPrefixes(final PrefixMapping other)
     throws UpdateDeniedException, AuthenticationRequiredException {
   checkUpdate();
   holder.getBaseItem().setNsPrefixes(other);
   return holder.getSecuredItem();
 }
コード例 #2
0
 @Override
 public SecuredPrefixMapping removeNsPrefix(final String prefix)
     throws UpdateDeniedException, AuthenticationRequiredException {
   checkUpdate();
   holder.getBaseItem().removeNsPrefix(prefix);
   return holder.getSecuredItem();
 }
コード例 #3
0
ファイル: SecuredSeqImpl.java プロジェクト: hmottestad/jena
 @Override
 public SecuredSeq add(final int index, final RDFNode o)
     throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException {
   checkUpdate();
   final Literal l = holder.getBaseItem().getModel().createTypedLiteral(o);
   checkCreate(index, l);
   holder.getBaseItem().add(index, o);
   return holder.getSecuredItem();
 }
コード例 #4
0
ファイル: SecuredSeqImpl.java プロジェクト: hmottestad/jena
 @Override
 public SecuredSeq remove(final int index)
     throws UpdateDeniedException, DeleteDeniedException, AuthenticationRequiredException {
   checkUpdate();
   final RDFNode rdfNode = holder.getBaseItem().getObject(index);
   if (rdfNode != null) {
     checkDelete(
         new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), rdfNode.asNode()));
     holder.getBaseItem().remove(index);
   }
   return holder.getSecuredItem();
 }
コード例 #5
0
ファイル: SecuredSeqImpl.java プロジェクト: hmottestad/jena
 @Override
 public SecuredSeq set(final int index, final RDFNode o)
     throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException {
   checkUpdate();
   final Triple t2 = new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), o.asNode());
   final RDFNode rdfNode = holder.getBaseItem().getObject(index);
   if (rdfNode != null) {
     final Triple t1 =
         new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), rdfNode.asNode());
     checkUpdate(t1, t2);
   } else {
     checkCreate(t2);
   }
   holder.getBaseItem().set(index, o);
   return holder.getSecuredItem();
 }
コード例 #6
0
  @Override
  public SecuredPrefixMapping withDefaultMappings(final PrefixMapping map)
      throws UpdateDeniedException, AuthenticationRequiredException {
    // mapping only updates if there are map entries to add. Since this gets
    // called
    // when we are doing deep triple checks while writing we need to attempt
    // the
    // update only if there are new updates to add.

    PrefixMapping m = holder.getBaseItem();
    PrefixMappingImpl pm = new PrefixMappingImpl();
    for (Entry<String, String> e : map.getNsPrefixMap().entrySet()) {
      if (m.getNsPrefixURI(e.getKey()) == null && m.getNsURIPrefix(e.getValue()) == null) {
        pm.setNsPrefix(e.getKey(), e.getValue());
      }
    }
    if (!pm.getNsPrefixMap().isEmpty()) {
      checkUpdate();
      holder.getBaseItem().withDefaultMappings(pm);
    }
    return holder.getSecuredItem();
  }
コード例 #7
0
 @Override
 public SecuredPrefixMapping lock() throws UpdateDeniedException, AuthenticationRequiredException {
   checkUpdate();
   holder.getBaseItem().lock();
   return holder.getSecuredItem();
 }