|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eaglei.repository.User
public class User
User object model, reflects the user's properties in the both RDBMS and RDF database. Also manages the RDF descriptions of users. Named Graph Usage: 1. Almost all statements about a repo User are in the graph named "repo:NG_Users". 2. Ony the :hasPrincipalName statement is on the NG_Internal graph sicne it should not be exposed; there is no reason to let login names leak and it's good security practice to keep them hidden, since that just makes dictionary attacks so much easier.
AuthUser, ImportExport| Method Summary | |
|---|---|
void |
addRole(javax.servlet.http.HttpServletRequest request,
Role r)
addRole - add a role |
void |
addRole(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI ru)
addRole - add a role |
void |
addRoleAsAdministrator(javax.servlet.http.HttpServletRequest request,
Role r)
addRoleAsAdministrator - add a role WITHOUT access control checks |
void |
checkImplicitRoles(javax.servlet.http.HttpServletRequest request)
Ensure this user has the implicit Anonymous and Authenticated roles. |
static User |
create(javax.servlet.http.HttpServletRequest request,
java.lang.String username)
Create new user instance for given username. |
static User |
createAsAdministrator(javax.servlet.http.HttpServletRequest request,
java.lang.String username)
Create new user instance for given username. |
static void |
doExportUsers(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.openrdf.rio.RDFFormat format,
java.util.Set<java.lang.String> includes,
java.util.Set<java.lang.String> excludes)
Export description of user accounts to serialized RDF quads. |
static void |
doImportUsers(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.openrdf.repository.RepositoryConnection content,
java.util.Set<java.lang.String> includes,
java.util.Set<java.lang.String> excludes,
ImportExport.DuplicateArg duplicate,
boolean transform)
Import description of user accounts from serialized RDF quads. |
boolean |
equals(java.lang.Object o)
|
protected void |
finalize()
finalize - flag error if GC'ing a dirty instance, its changes are lost. |
static User |
find(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI uri)
Find a user record by URI; Returns null if NOT found.. |
static java.lang.Iterable<User> |
findAll(javax.servlet.http.HttpServletRequest request)
Get all known Users from RDF DB - may not match auth'n DB. |
static User |
findByUsername(javax.servlet.http.HttpServletRequest request,
java.lang.String pname)
find a record by username, i.e. |
java.lang.String |
getFirstName()
Getter for the field firstName. |
java.lang.String |
getLastName()
Getter for the field lastName. |
java.lang.String |
getMbox()
Getter for the field mbox. |
java.lang.String |
getPersonalName()
Get personal name, if available, as "firstname lastname". |
java.lang.String |
getTitle()
Computes the most informative "label" for a user, to present in UI. |
org.openrdf.model.URI |
getURI()
Getter for the field uri. |
static org.openrdf.query.Dataset |
getUserDataset()
|
java.lang.String |
getUsername()
Getter for the field username. |
int |
hashCode()
|
boolean |
hasRoleP(Role r)
has role predicate - the P suffix is a Lisp thing |
boolean |
hasRoleP(org.openrdf.model.URI ru)
hasRoleP |
boolean |
isSuperuser()
isSuperuser |
void |
removeRole(javax.servlet.http.HttpServletRequest request,
Role r)
removeRole |
void |
removeRole(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI ru)
removeRole |
void |
setFirstName(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
Change value of first name. |
void |
setIsSuperuser(boolean su)
setIsSuperuser |
void |
setLastName(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
Setter for the field lastName. |
void |
setMbox(javax.servlet.http.HttpServletRequest request,
java.lang.String mbox)
Setter for the field mbox. |
boolean |
setRoles(javax.servlet.http.HttpServletRequest request,
Role[] newRoles)
setRoles |
java.lang.String |
toString()
toString |
void |
update(javax.servlet.http.HttpServletRequest request)
update - Commits any changes to RDF database *and* RDBMS. |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static org.openrdf.query.Dataset getUserDataset()
public static User findByUsername(javax.servlet.http.HttpServletRequest request,
java.lang.String pname)
throws javax.servlet.ServletException
request - a HttpServletRequest object.pname - principal name (from user account RDBMS).
javax.servlet.ServletException - if any.
public static User find(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI uri)
throws javax.servlet.ServletException
request - a HttpServletRequest object.uri - the URI of a person object
javax.servlet.ServletException - if any.
public static java.lang.Iterable<User> findAll(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
Get all known Users from RDF DB - may not match auth'n DB.
XXX TODO should add start and count for pagination
request - a HttpServletRequest object.
Iterable object.
javax.servlet.ServletException - if any.public org.openrdf.model.URI getURI()
Getter for the field uri.
URI object.public java.lang.String getUsername()
Getter for the field username.
String object.public java.lang.String getFirstName()
Getter for the field firstName.
String object or null if not set.public java.lang.String getLastName()
Getter for the field lastName.
String object or null if not set.public java.lang.String getMbox()
Getter for the field mbox.
String object or null if not set.public java.lang.String getTitle()
String object.public java.lang.String getPersonalName()
Get personal name, if available, as "firstname lastname".
public boolean hasRoleP(Role r)
r - role as a Role object.
public boolean hasRoleP(org.openrdf.model.URI ru)
hasRoleP
ru - role as a URI object.
public boolean isSuperuser()
isSuperuser
- convenience method to test for superuser (administrator) role
public void setIsSuperuser(boolean su)
setIsSuperuser
- change local value of Superuser bit WITHOUT updating the RDF description, ONLY for cached local User object.
su - a boolean, true if this User has Superuser (Admin) role.
public void checkImplicitRoles(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
Ensure this user has the implicit Anonymous and Authenticated roles.
request - a HttpServletRequest object.
javax.servlet.ServletException - if any.
public static User create(javax.servlet.http.HttpServletRequest request,
java.lang.String username)
throws javax.servlet.ServletException
Create new user instance for given username. Returns User object with URI and username set; nothing else. Fails if there is an existing user with the same principal. Requires Administrator role.
request - a HttpServletRequest object.username - principal name, a String object.
User object.
javax.servlet.ServletException - if any.
public static User createAsAdministrator(javax.servlet.http.HttpServletRequest request,
java.lang.String username)
throws javax.servlet.ServletException
Create new user instance for given username. Returns User object with URI and username set; nothing else. Fails if there is an existing user with the same principal. Skip access test -- THIS IS VERY DANGEROUS, only for bootstrapping the authentication.
request - a HttpServletRequest object.username - principal name, a String object.
User object.
javax.servlet.ServletException - if any.
public void setFirstName(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
throws javax.servlet.ServletException
request - a HttpServletRequest object.name - first name a String object.
javax.servlet.ServletException - if any.
public void setLastName(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
throws javax.servlet.ServletException
Setter for the field lastName.
request - a HttpServletRequest object.name - a String object.
javax.servlet.ServletException - if any.
public void setMbox(javax.servlet.http.HttpServletRequest request,
java.lang.String mbox)
throws javax.servlet.ServletException
Setter for the field mbox.
request - a HttpServletRequest object.mbox - a String object.
javax.servlet.ServletException - if any.
public void addRole(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI ru)
throws javax.servlet.ServletException
addRole - add a role
request - a HttpServletRequest object.ru - Role to add, as a URI object.
javax.servlet.ServletException - if any.
public void addRole(javax.servlet.http.HttpServletRequest request,
Role r)
throws javax.servlet.ServletException
addRole - add a role
request - a HttpServletRequest object.r - role to add as a Role object.
javax.servlet.ServletException - if any.
public void addRoleAsAdministrator(javax.servlet.http.HttpServletRequest request,
Role r)
throws javax.servlet.ServletException
addRoleAsAdministrator - add a role WITHOUT access control checks
request - a HttpServletRequest object.r - role to add as a Role object.
javax.servlet.ServletException - if any.
public void removeRole(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI ru)
throws javax.servlet.ServletException
removeRole
request - a HttpServletRequest object.ru - role to remove as a URI object.
javax.servlet.ServletException - if any.
public void removeRole(javax.servlet.http.HttpServletRequest request,
Role r)
throws javax.servlet.ServletException
removeRole
request - a HttpServletRequest object.r - role to remove as a Role object.
javax.servlet.ServletException - if any.
public boolean setRoles(javax.servlet.http.HttpServletRequest request,
Role[] newRoles)
throws javax.servlet.ServletException
setRoles
make the user's set of roles equal to contents of this array
request - a HttpServletRequest object.role - array of Role objects which should be the new role set
javax.servlet.ServletException - if any.
public void update(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
update - Commits any changes to RDF database *and* RDBMS. Also recomputes rdfs:label, passes superuser bit into RDBMS. Does *not* need to check access again here because the only operatiosn taht set "dirty" are already access-protected..
request - a HttpServletRequest object.
javax.servlet.ServletException - if any.
protected void finalize()
throws java.lang.Throwable
finalize - flag error if GC'ing a dirty instance, its changes are lost.
finalize in class java.lang.Objectjava.lang.Throwablepublic java.lang.String toString()
toString
toString in class java.lang.ObjectString object.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
public static void doImportUsers(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.openrdf.repository.RepositoryConnection content,
java.util.Set<java.lang.String> includes,
java.util.Set<java.lang.String> excludes,
ImportExport.DuplicateArg duplicate,
boolean transform)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletException
java.io.IOException
public static void doExportUsers(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.openrdf.rio.RDFFormat format,
java.util.Set<java.lang.String> includes,
java.util.Set<java.lang.String> excludes)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||