|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.security.voms.database.DBUser
A class representing the users in a VO. Essentially, a database wrapper class for the users table.
Field Summary | |
private int |
ca
The id of this users' CA. |
private java.lang.String |
certUri
Pointer to the user's certificate (optional). |
private java.lang.String |
cn
The common name of this user. |
private long |
createdBy
The id of the client who created this user. |
private long |
createdSerial
The number of the transaction that created this user. |
private java.lang.String |
dn
The distinguished name of this user. |
private static int |
DN
|
private long |
id
The internal id of this user. |
private static int |
ID
|
private static org.apache.log4j.Logger |
log
Logger. |
private java.lang.String |
mail
The email address of this user (optional). |
(package private) static Sequence |
seq
Sequence. |
Constructor Summary | |
private |
DBUser(long id)
Initialize a new DBUser from the given id. |
private |
DBUser(java.lang.String dn,
DBCA ca)
Initialize a new DBUser from the given DN. |
Method Summary | |
int |
countCapabilities()
Return the number of capabilities that this user has. |
int |
countGroups()
Return the number of groups that this user is a member of, including the VO group. |
int |
countRoles()
Return the number of role-group pairs that this user has. |
static DBUser |
createUser(java.lang.String dn,
java.lang.String cn,
DBCA ca,
java.lang.String certUri,
java.lang.String mail)
Creates a new user in the database. |
void |
deleteUser()
Deletes a user from the database. |
static java.util.List |
getAllUsernames()
|
User |
getAsUser()
Return this as a User. |
DBCA |
getCA()
Return the CA of this user. |
(package private) int |
getCAId()
Return the id of the CA of this user. |
java.lang.String[] |
getCapabilityNames()
Return the names of all capabilities that this user has. |
java.lang.String |
getCertUri()
Return the URI to the user's certificate. |
java.lang.String |
getCN()
Return the common name of this user. |
DBAdmin |
getCreatedBy()
Return the user who created this user. |
(package private) long |
getCreatedById()
Return the id of the user who last modified this user. |
long |
getCreatedSerial()
Return the serial number of the transaction that committed this user. |
java.lang.String |
getDN()
Return the distinguished name of this user. |
java.lang.String[] |
getGroupnames()
Return the names of all groups that this user is a member of, including the VO group, in an unspecified order. |
(package private) long |
getId()
Return the id of this user. |
(package private) static DBUser |
getInstance(long id)
|
static DBUser |
getInstance(java.lang.String name,
DBCA ca)
|
static DBUser |
getInstance(User user)
|
static DBUser |
getInstanceFromSecurityContext()
Returns the user object associated with the current client. |
java.lang.String |
getMail()
Return the email address of this user. |
QualifiedRole[] |
getRolenames()
Return the names of all role-group pairs that this user has. |
private void |
initialize(int from)
Query the database for the full user row. |
void |
setAttributes(java.lang.String cn,
java.lang.String mail,
java.lang.String certUri)
Set auxiliary attributes. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final org.apache.log4j.Logger log
private java.lang.String dn
private long id
private int ca
private java.lang.String certUri
private java.lang.String cn
private java.lang.String mail
private long createdBy
private long createdSerial
static final Sequence seq
private static final int DN
private static final int ID
Constructor Detail |
private DBUser(java.lang.String dn, DBCA ca) throws GeneralDatabaseException, NotInDatabase, ArgumentException
private DBUser(long id) throws GeneralDatabaseException, NotInDatabase
Method Detail |
private void initialize(int from) throws GeneralDatabaseException, NotInDatabase
GeneralDatabaseException
NotInDatabase
public static DBUser getInstance(java.lang.String name, DBCA ca) throws GeneralDatabaseException, NotInDatabase, ArgumentException
GeneralDatabaseException
NotInDatabase
ArgumentException
static DBUser getInstance(long id) throws GeneralDatabaseException, NotInDatabase
GeneralDatabaseException
NotInDatabase
public static DBUser getInstance(User user) throws GeneralDatabaseException, NotInDatabase, ArgumentException
GeneralDatabaseException
NotInDatabase
ArgumentException
public static DBUser getInstanceFromSecurityContext() throws GeneralDatabaseException, NotInDatabase, VOMSSecurityException
VOMSSecurityException
- if the client's credentials could not be determined or if the client is not a user in the database.
GeneralDatabaseException
NotInDatabase
long getId()
int getCAId()
getCA
instead of this method.
public java.lang.String getDN()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getCN()
public java.lang.String getMail()
public java.lang.String getCertUri()
long getCreatedById()
getCreatedBy
instead of this
method.
public long getCreatedSerial()
public DBCA getCA() throws GeneralDatabaseException, NotInDatabase
GeneralDatabaseException
NotInDatabase
public DBAdmin getCreatedBy() throws GeneralDatabaseException, NotInDatabase
NotInDatabase
- if the creator has been deleted from the database.
GeneralDatabaseException
public User getAsUser() throws GeneralDatabaseException, NotInDatabase
GeneralDatabaseException
NotInDatabase
public void setAttributes(java.lang.String cn, java.lang.String mail, java.lang.String certUri) throws GeneralDatabaseException
GeneralDatabaseException
public static DBUser createUser(java.lang.String dn, java.lang.String cn, DBCA ca, java.lang.String certUri, java.lang.String mail) throws GeneralDatabaseException, ArgumentException
GeneralDatabaseException
ArgumentException
public void deleteUser() throws GeneralDatabaseException, NotInDatabase
GeneralDatabaseException
NotInDatabase
public static java.util.List getAllUsernames() throws GeneralDatabaseException
GeneralDatabaseException
public int countGroups() throws GeneralDatabaseException
GeneralDatabaseException
public java.lang.String[] getGroupnames() throws GeneralDatabaseException
GeneralDatabaseException
public int countRoles() throws GeneralDatabaseException
GeneralDatabaseException
public QualifiedRole[] getRolenames() throws GeneralDatabaseException
GeneralDatabaseException
public int countCapabilities() throws GeneralDatabaseException
GeneralDatabaseException
public java.lang.String[] getCapabilityNames() throws GeneralDatabaseException
GeneralDatabaseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |