org.eaglei.repository
Class Role

java.lang.Object
  extended by org.eaglei.repository.Role

public class Role
extends java.lang.Object

Role object model, reflects the :Role object in RDF database. This is a READ ONLY model. Named Graph usage: Role looks for statements in ALL graphs, although they should really only be found in the Repository Ontology graph, and possibly the NG_Internal graph. It requires inference for RDFS type propagation to pick up all the Roles since they are all subclasses of :Role in the repo ontology.

Version:
$Id: $
Author:
Larry Stone Started April 26, 2010

Method Summary
 boolean equals(java.lang.Object other)
          
static Role find(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI uri)
          Get the Role for given URI, lookup label.
static Role find(org.openrdf.model.URI uri, java.lang.String label)
          Alternate version of "find" for when the URI and label are already known, e.g.
static java.lang.Iterable<Role> findAll(javax.servlet.http.HttpServletRequest request)
          Get all known Roles - includes pseudo-Roles Anonymous and Authenticated that should NOT be directly assigned to Users.
 java.lang.String getLabel()
          Getter for the field label.
 org.openrdf.model.URI getURI()
          getURI
 java.lang.String toString()
          toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

find

public static Role find(javax.servlet.http.HttpServletRequest request,
                        org.openrdf.model.URI uri)
                 throws javax.servlet.ServletException
Get the Role for given URI, lookup label.

Parameters:
request - a HttpServletRequest object.
uri - URI of the role
Returns:
a Role object representing role.
Throws:
javax.servlet.ServletException - if any.

find

public static Role find(org.openrdf.model.URI uri,
                        java.lang.String label)
Alternate version of "find" for when the URI and label are already known, e.g. when processign results of user SPARQL query. This saves the overhead of another lookup when it isn't necessary.

Parameters:
uri - a URI object.
label - a String object.
Returns:
a Role object.

findAll

public static java.lang.Iterable<Role> findAll(javax.servlet.http.HttpServletRequest request)
                                        throws javax.servlet.ServletException
Get all known Roles - includes pseudo-Roles Anonymous and Authenticated that should NOT be directly assigned to Users. Make the query each time instead of relying on cache since some sneaky admin may *add* new roles by uploading statements to NG_Internal graph.

Parameters:
request - a HttpServletRequest object.
Returns:
all roles in a Iterable object.
Throws:
javax.servlet.ServletException - if any.

getURI

public org.openrdf.model.URI getURI()

getURI

Returns:
URI subject of the role, a URI object.

getLabel

public java.lang.String getLabel()

Getter for the field label.

Returns:
label of the role, a String object.

equals

public boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()

toString

Overrides:
toString in class java.lang.Object
Returns:
a String object.


Copyright © 2009-2010 Eagle-I. All Rights Reserved.