|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eaglei.repository.model.ImmutableObjectModel
org.eaglei.repository.model.WritableObjectModel
org.eaglei.repository.model.User
public final 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| Field Summary | |
|---|---|
static org.openrdf.query.impl.DatasetImpl |
USER_DATASET
dataset that includes relevant graphs - internal and user |
static org.openrdf.model.URI |
USER_GRAPH
Named graph where we create User objects. |
| 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 |
boolean |
authenticate(java.lang.String pw)
compare password (or credientals) without revealing anythign |
void |
commit(javax.servlet.http.HttpServletRequest request)
Commits any changes to RDF database *and* RDBMS. |
static void |
commitMultiple(javax.servlet.http.HttpServletRequest request,
java.util.Collection<User> users)
Runs commit() on a batch of users at once for greater efficiency in imports. |
static User |
create(javax.servlet.http.HttpServletRequest request,
java.lang.String username,
java.lang.String password)
Create new user instance for given username. |
static User |
create(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI uri,
java.lang.String username,
java.lang.String password)
Create new user instance for given username AND URI. |
static User |
createAsAdministrator(javax.servlet.http.HttpServletRequest request,
java.lang.String username,
java.lang.String password)
Create new user instance for given username. |
void |
disable()
Remove ability to login with credentials |
boolean |
equals(java.lang.Object o)
Equality is defined as EITHER URI or uesrname equal -since some instances may not have a URI at first but always(?) have a username |
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.util.List<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. |
org.openrdf.model.URI |
getAuthType()
Get the URI identifying the kind of authorization behind this user, needed for export and import. |
java.lang.String |
getFirstName()
Getter for the field firstName. |
java.lang.String |
getLabel()
Computes the most informative "label" for a user, to present in UI. |
java.lang.String |
getLastName()
Getter for the field lastName. |
java.lang.String |
getMbox()
Getter for the field mbox. |
java.lang.String |
getPassword()
Getter for password. |
java.lang.String |
getPersonalName()
Get personal name, if available, as "firstname lastname". |
org.openrdf.model.URI |
getURI()
Getter for the field uri. |
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 |
isLoginable()
does this user have credentials to be able to login. |
boolean |
isSuperuser()
isSuperuser |
void |
recreate(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI newURI,
java.lang.String newUsername,
java.lang.String pw)
Create a new user graph to replace the existing user, for import. |
void |
reinstate(java.lang.String pw)
Restore ability to login with credentials |
void |
removeRole(javax.servlet.http.HttpServletRequest request,
Role r)
removeRole |
void |
removeRole(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI ru)
removeRole |
void |
setAuthType(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI uri)
Ignores request but arg is there for uniformity. |
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. |
void |
setPassword(javax.servlet.http.HttpServletRequest request,
java.lang.String pw)
Ignores request but arg is there for uniformity. |
boolean |
setProperty(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI property,
java.lang.String value)
Set a random property on the user (for RDF import). |
boolean |
setRoles(javax.servlet.http.HttpServletRequest request,
Role[] newRoles)
setRoles |
java.lang.String |
toString()
toString |
| Methods inherited from class org.eaglei.repository.model.WritableObjectModel |
|---|
decacheInstance, isDirty, setDirty, update |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.openrdf.model.URI USER_GRAPH
public static final org.openrdf.query.impl.DatasetImpl USER_DATASET
| Method Detail |
|---|
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.util.List<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 static User create(javax.servlet.http.HttpServletRequest request,
java.lang.String username,
java.lang.String password)
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.password - the password or null if not login-able
org.eaglei.repository.User object.
javax.servlet.ServletException - if any.
public static User createAsAdministrator(javax.servlet.http.HttpServletRequest request,
java.lang.String username,
java.lang.String password)
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.password - the password or null if not login-able
org.eaglei.repository.User object.
javax.servlet.ServletException - if any.
public static User create(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI uri,
java.lang.String username,
java.lang.String password)
throws javax.servlet.ServletException
Create new user instance for given username AND URI. 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.password - the password or null if not login-able
org.eaglei.repository.User object.
javax.servlet.ServletException - if any.public org.openrdf.model.URI getURI()
Getter for the field uri.
getURI in class ImmutableObjectModelURI 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 getLabel()
getLabel in class ImmutableObjectModelString object.public java.lang.String getPersonalName()
Get personal name, if available, as "firstname lastname".
public boolean hasRoleP(Role r)
r - role as a org.eaglei.repository.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 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 boolean setProperty(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI property,
java.lang.String value)
throws javax.servlet.ServletException
javax.servlet.ServletException
public void recreate(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI newURI,
java.lang.String newUsername,
java.lang.String pw)
throws javax.servlet.ServletException
javax.servlet.ServletException
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 org.eaglei.repository.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 org.eaglei.repository.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 org.eaglei.repository.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 commit(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
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..
commit in class WritableObjectModelrequest - a HttpServletRequest object.
javax.servlet.ServletException - if any.
public static void commitMultiple(javax.servlet.http.HttpServletRequest request,
java.util.Collection<User> users)
throws javax.servlet.ServletException
javax.servlet.ServletException
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.Objectpublic boolean isLoginable()
public boolean authenticate(java.lang.String pw)
public java.lang.String getPassword()
public void setPassword(javax.servlet.http.HttpServletRequest request,
java.lang.String pw)
public void disable()
public void reinstate(java.lang.String pw)
public org.openrdf.model.URI getAuthType()
public void setAuthType(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI uri)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||