|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
mysql.AbstractSql
mysql.UserSql
public class UserSql
A class that allows access to a database containing the different users on STELLA. It contains contact information for the automatic notification system as well as some default settings in terms of color
CREATE TABLE "user"
user | character varying(255) | not null
affil | character varying(255) |
pubkey | text |
email | character varying(255) |
farbe | character varying(255) |
notify | text |
passwd | character varying(255) |
Indexes:
"user_pkey" PRIMARY KEY, btree ("user")
Triggers:
_st1_logtrigger_8 AFTER INSERT OR DELETE OR UPDATE ON "user" FOR EACH ROW EXECUTE PROCEDURE _st1.logtrigger('_st1', '8', 'kvvvvvv')
In this setup, the columns have the following meanings:
ProposalSql PI. It is given in the
target-xml as the User element.KEY_AFFILALLOWED, currently Core, AIP, IAC,
International, and Engineering. It can be overriden in the target-xml file as
the Institution element.MyColor.#KEY_ALLOWEDNOTIFY, currently the values in the Notify
element in the target-xml file are supported. It can be overriden in the
target-xml file as the Institution element.
| Nested Class Summary | |
|---|---|
static class |
UserSql.AddUser
Adds a new user with the command line. |
private static class |
UserSql.SqlProfile
A user profile that is constructed from a database entry. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static EnumSet<DataPermission.Access> |
AFFILACCESS
The default action on affil-data. |
private EnumSet<UserProfile.Affil> |
affilallow
The set of allowed affiliations. |
private static String |
DEFAFFILALLOWED
The coma-separated list of allowed affiliations. |
private static String |
DEFAFFILFIELD
The key to the object name in the database. |
private static String |
DEFCOLORFIELD
The key to the object name in the database. |
private static String |
DEFEMAILFIELD
The key to the object name in the database. |
private static String |
DEFNOTIFYALLOWED
The coma-separated list of allowed notification triggers. |
private static String |
DEFNOTIFYFIELD
The key to the object name in the database. |
private static String |
DEFPASSWDFIELD
The key to the object name in the database. |
private static String |
DEFPUBKEYFIELD
The key to the object name in the database. |
private static String |
DEFTABLE
The default table name. |
private static String |
DEFUSERFIELD
The key to the object name in the database. |
static String |
KEY_AFFILALLOWED
The key to the allowed affiliations. |
static String |
KEY_AFFILFIELD
The key to the object name in the database. |
static String |
KEY_COLORFIELD
The key to the object name in the database. |
static String |
KEY_EMAILFIELD
The key to the object name in the database. |
static String |
KEY_NOTIFYALLOWED
The key to the allowed notify actions. |
static String |
KEY_NOTIFYFIELD
The key to the object name in the database. |
static String |
KEY_PASSWDFIELD
The key to the object name in the database. |
static String |
KEY_PUBKEYFIELD
The key to the object name in the database. |
static String |
KEY_USERFIELD
The key to the object name in the database. |
private EnumSet<UserProfile.Notifies> |
notifyallow
The set of allowed notifications. |
| Fields inherited from class mysql.AbstractSql |
|---|
KEY_TABLE |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
UserSql(Map<String,String> prop)
Constructs a new proposal sql. |
|
| Method Summary | |
|---|---|
PermissionCollection |
addUserPermissions(PermissionCollection permit,
String user)
Add to a PermissionCollection the permissions for the user of the
given name. |
boolean |
addUserProfile(String username,
List<UserProfile.Affil> aa,
javax.mail.Address email,
Collection<UserProfile.Notifies> notify)
Adds a new user to the table. |
boolean |
addUserProfile(String username,
List<UserProfile.Affil> aa,
javax.mail.Address email,
Collection<UserProfile.Notifies> notify,
boolean mail)
Adds a new user to the table. |
boolean |
addUserProfile(String username,
List<UserProfile.Affil> affil,
javax.mail.Address email,
Collection<UserProfile.Notifies> notify,
Color paint,
boolean mail)
Adds a new user to the table. |
private UserProfile |
fromNextRow(ResultSet single)
Returns the next user profile parsed from the result set. |
private static UserProfile |
fromNextRow(ResultSet single,
String f1,
String f2,
String f3,
String f4,
String f5,
String f6,
String f7)
Returns the next user profile parsed from the result set. |
static List<UserProfile> |
getAllUserProfiles()
Returns all user profiles found. |
static List<UserProfile> |
getAllUserProfiles(String table)
Returns all user profiles found. |
private int |
getMemberCount(UserProfile.Affil affil)
Returns the number of entries to the queried affiliation. |
UserProfile |
getUserProfile(String name)
Returns the user profile from the user name. |
void |
init()
Convert the properties of allowed affiliations and notifications into enum-sets. |
| Methods inherited from class mysql.AbstractSql |
|---|
getPassword, getTable, getUserName, isEntry |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_USERFIELD
public static final String KEY_AFFILFIELD
public static final String KEY_PUBKEYFIELD
public static final String KEY_EMAILFIELD
public static final String KEY_COLORFIELD
public static final String KEY_NOTIFYFIELD
public static final String KEY_PASSWDFIELD
public static final String KEY_AFFILALLOWED
public static final String KEY_NOTIFYALLOWED
private static final String DEFTABLE
private static final String DEFUSERFIELD
private static final String DEFAFFILFIELD
private static final String DEFPUBKEYFIELD
private static final String DEFEMAILFIELD
private static final String DEFCOLORFIELD
private static final String DEFNOTIFYFIELD
private static final String DEFPASSWDFIELD
private static final String DEFAFFILALLOWED
private static final String DEFNOTIFYALLOWED
private static final EnumSet<DataPermission.Access> AFFILACCESS
private EnumSet<UserProfile.Affil> affilallow
private EnumSet<UserProfile.Notifies> notifyallow
| Constructor Detail |
|---|
public UserSql(Map<String,String> prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class AbstractSql
public PermissionCollection addUserPermissions(PermissionCollection permit,
String user)
PermissionCollection the permissions for the user of the
given name. Uses a global permission on user's PI targets plus specific
permissions found in the permission table. Additionally adds the
group-specific affiliations.
SecurityException - if the permission collection is read-only.public UserProfile getUserProfile(String name)
private UserProfile fromNextRow(ResultSet single)
throws SQLException
SQLException
private static UserProfile fromNextRow(ResultSet single,
String f1,
String f2,
String f3,
String f4,
String f5,
String f6,
String f7)
throws SQLException
SQLExceptionpublic static List<UserProfile> getAllUserProfiles()
public static List<UserProfile> getAllUserProfiles(String table)
public boolean addUserProfile(String username,
List<UserProfile.Affil> aa,
javax.mail.Address email,
Collection<UserProfile.Notifies> notify)
IllegalArgumentException - If any of the input is not allowed. This applies to affil,
email and notify.
public boolean addUserProfile(String username,
List<UserProfile.Affil> aa,
javax.mail.Address email,
Collection<UserProfile.Notifies> notify,
boolean mail)
IllegalArgumentException - If any of the input is not allowed. This applies to affil,
email and notify.
public boolean addUserProfile(String username,
List<UserProfile.Affil> affil,
javax.mail.Address email,
Collection<UserProfile.Notifies> notify,
Color paint,
boolean mail)
IllegalArgumentException - If any of the input is not allowed. This applies to affil,
email and notify.private int getMemberCount(UserProfile.Affil affil)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||