Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.NonLiteral


    Iterator<Triple> permissionTriples =
        systemGraph.filter(role, PERMISSION.hasPermission, null);

    while (permissionTriples.hasNext()) {

      NonLiteral permission = (NonLiteral) permissionTriples.next().getObject();

      Iterator<Triple> javaPermissionTriples =
          systemGraph.filter(permission, PERMISSION.javaPermissionEntry, null);

      while (javaPermissionTriples.hasNext()) {

        Triple t = javaPermissionTriples.next();
        Literal permEntry = (Literal) t.getObject();

        permInfoList.add(new PermissionInfo(permEntry.getLexicalForm()));
      }
    }

    Iterator<Triple> roleTriples =
        systemGraph.filter(role, SIOC.has_function, null);

    while (roleTriples.hasNext()) {
      NonLiteral anotherRole = (NonLiteral) roleTriples.next().getObject();
      this.lookForPermissions(anotherRole, permInfoList);
    }
  }
View Full Code Here


    Lock readLock = systemGraph.getLock().readLock();
    readLock.lock();
    try {
      Iterator<Triple> triples = systemGraph.filter(null, DC.title,
          new PlainLiteralImpl(title));
      NonLiteral role = null;
      while (triples.hasNext()) {
        role = triples.next().getSubject();
        if (systemGraph.filter(role, RDF.type, PERMISSION.Role).hasNext()) {
          return role;
        }
View Full Code Here

  public void deleteRole(String title) {
    if (title == null) {
      return;
    }

    NonLiteral role = getRoleByTitle(title);
    if (role == null) {
      return;
    }
    if (isBaseRole(role)) {
      return;
View Full Code Here

    LockableMGraph systemGraph = getSystemGraph();
    Lock writeLock = systemGraph.getLock().writeLock();
    writeLock.lock();
    try {
      for (String permissionEntry : permissionEntries) {
        NonLiteral permission = getPermissionOfAJavaPermEntry(permissionEntry);
        systemGraph.remove(new TripleImpl(role, PERMISSION.hasPermission,
            permission));
      }
    } finally {
      writeLock.unlock();
View Full Code Here

      Iterator<Triple> triples = systemGraph.filter(null, FOAF.mbox,
          new UriRef("mailto:" + email));
      if (!triples.hasNext()) {
        return null;
      }
      NonLiteral user = triples.next().getSubject();
      triples = systemGraph.filter(user, PLATFORM.userName, null);
      if (!triples.hasNext()) {
        throw new UserHasNoNameException("User with email address" + email
            + " does not have a name");
      }
View Full Code Here

    AccessController.checkPermission(new SecurityPermission("getPolicy"));
    if (name == null) {
      throw new IllegalArgumentException("userName may not be null");
    }
    NonLiteral user = getUserByUserName(name);
    if (user == null) {
      throw new UserNotExistsException(name);
    }
    LockableMGraph systemGraph = getSystemGraph();
    GraphNode userGraphNode = new GraphNode(user, systemGraph);
View Full Code Here

    for (String roleTitle : assignedRoles) {
      // skip empty strings
      if ((roleTitle == null) || (roleTitle.trim().length() == 0)) {
        continue;
      }
      NonLiteral role = getRoleByTitle(roleTitle);
      if (role == null) {
        throw new RoleUnavailableException(roleTitle);
      }
      systemGraph.add(new TripleImpl(user, SIOC.has_function, role));
    }
View Full Code Here

  public void deleteUser(String name) {
    if (name == null) {
      return;
    }

    NonLiteral user = getUserByUserName(name);
    if (user != null) {
      deleteTriplesOfASubject(user);
    }
  }
View Full Code Here

  }

  @Override
  public GraphNode getUserInSystemGraph(final String name) {
    LockableMGraph systemGraph = getSystemGraph();
    NonLiteral user = getUserByUserName(name);
    if (user != null) {
      return new GraphNode(user, systemGraph);
    } else {
      return null;
    }
View Full Code Here

        resultNode = new GraphNode(triples.next().getSubject(), contentGraph);
      } finally {
        readLock.unlock();
      }     
    } else {
      NonLiteral user = AccessController.doPrivileged(
          new PrivilegedAction<NonLiteral>() {

            @Override
            public NonLiteral run() {
              return getUserByUserName(name);
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.NonLiteral

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.