|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.knowgate.dataobjs.DBPersist
com.knowgate.acl.ACLUser
Object mapping for k_users table registers
| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary | |
static short |
ClassId
|
| Fields inherited from class com.knowgate.dataobjs.DBPersist |
AllVals, sAuditCls, sAuditUsr, sTransactId |
| Constructor Summary | |
ACLUser()
Default constructor. |
|
ACLUser(JDCConnection oConn,
java.lang.String sUserGUID)
Constructs ACLUser and load attributes from k_users table |
|
ACLUser(java.lang.String sUserGUID)
Constructs ACLUser and set GUID |
|
| Method Summary | |
int |
addToACLGroups(JDCConnection oConn,
java.lang.String sGroupList)
Add User to Groups. |
int |
clearACLGroups(JDCConnection oConn)
Remove user from all security role groups |
static java.lang.String |
create(JDCConnection oConn,
java.lang.Object[] Values)
Deprecated. Use standard put/store methods instead. |
boolean |
delete(JDCConnection oConn)
Delete a register from database |
static boolean |
delete(JDCConnection oConn,
java.lang.String sUserGUID)
Delete User |
DBSubset |
getAddresses(JDCConnection oConn)
Get Addresses associated with user at k_x_addr_user table. |
static java.lang.String |
getEmailFromId(JDCConnection oConn,
java.lang.String sUserId)
Get User main e-mail from its GUID. |
DBSubset |
getGroups(JDCConnection oConn)
Get security role groups to witch this user belongs looking a k_x_group_user table. |
static java.lang.String |
getIdFromEmail(JDCConnection oConn,
java.lang.String sUserEMail)
Get User Unique Id. |
static java.lang.String |
getIdFromNick(java.sql.Connection oConn,
int iDomainId,
java.lang.String sUserNick)
Get User Unique Id. |
static java.lang.String |
getIdFromNick(JDCConnection oConn,
int iDomainId,
java.lang.String sUserNick)
Get User Unique Id. |
java.lang.String |
getMailFolder(JDCConnection oConn,
java.lang.String sFolderName)
Get GUID of user mail folder category |
java.lang.String |
getMailRoot(JDCConnection oConn)
Get GUID of user mail root category |
int |
getRolesForApplication(JDCConnection oConn,
int iIdApp,
java.lang.String sGuWorkArea)
Get roles of this user for a given application and workarea |
boolean |
isAdminForApplication(JDCConnection oConn,
int iIdApp)
Find out if this user has administrator role in his default workarea over given application |
boolean |
isAdminForApplication(JDCConnection oConn,
int iIdApp,
java.lang.String sGuWorkArea)
Find out if this user has administrator role over given application and workarea |
boolean |
isDomainAdmin(JDCConnection oConn)
Find out is this user has administrator. |
boolean |
isGuestForApplication(JDCConnection oConn,
int iIdApp)
Find out if this user has guest role in his default workarea over given application |
boolean |
isPowerUserForApplication(JDCConnection oConn,
int iIdApp)
Find out if this user has power user role in his default workarea over given application |
boolean |
isPowerUserForApplication(JDCConnection oConn,
int iIdApp,
java.lang.String sGuWorkArea)
Find out if this user has power user role over given application and workarea |
boolean |
isUserForApplication(JDCConnection oConn,
int iIdApp)
Find out if this user has plain user role in his default workarea over given application |
boolean |
isUserForApplication(JDCConnection oConn,
int iIdApp,
java.lang.String sGuWorkArea)
Find out if this user has plain user role over given application and workarea |
int |
removeFromACLGroup(JDCConnection oConn,
java.lang.String sIdGroup)
Remove User from Group. |
boolean |
store(JDCConnection oConn)
Store ACLUser |
| Methods inherited from class com.knowgate.dataobjs.DBPersist |
allcaps, allcaps, changelog, clear, clone, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDateFormated, getDateShort, getDecimal, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getItemMap, getItems, getShort, getString, getStringNull, getTable, getTable, getTableName, getTime, getTimeOfDay, getTimestamp, getUIdFromName, isEmpty, isNull, iterator, keySet, load, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, setAuditTransact, setAuditUser, size, toLowerCase, toUpperCase, toXML, toXML, toXML, values |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
| Field Detail |
public static final short ClassId
| Constructor Detail |
public ACLUser()
public ACLUser(java.lang.String sUserGUID)
throws java.sql.SQLException
Constructs ACLUser and set GUID
Does not load any fields from database.
sUserGUID - user Unique Identifier (gu_user field at k_users table)
java.sql.SQLException
public ACLUser(JDCConnection oConn,
java.lang.String sUserGUID)
throws java.sql.SQLException
Constructs ACLUser and load attributes from k_users table
oConn - Database ConnectionsUserGUID - user Unique Identifier (gu_user field at k_users table)
java.sql.SQLException| Method Detail |
public DBSubset getAddresses(JDCConnection oConn)
throws java.sql.SQLException
Get Addresses associated with user at k_x_addr_user table.
oConn - Database Connection
DBSubset with a 3 columns containing
Address Unique Identifier (gu_address), Address Ordinal Position (ix_address)
and Address Location Type (tp_location).
java.sql.SQLException{@link Address}
public DBSubset getGroups(JDCConnection oConn)
throws java.sql.SQLException
oConn - Database Connection
DBSubset with a 1 column containing each group unique identifier (gu_acl_group).
java.sql.SQLException
public int addToACLGroups(JDCConnection oConn,
java.lang.String sGroupList)
throws java.sql.SQLException
Add User to Groups.
Insert new registers at k_x_group_user table.
oConn - Database ConnectionsGroupList - A string of comma delimited ACLGroup GUIDs to with this ACLUser must be added.
java.sql.SQLException - May throw a primary key constraint violation is user already belongs to group.
public boolean isDomainAdmin(JDCConnection oConn)
throws java.sql.SQLException,
java.lang.IllegalStateException
Find out is this user has administrator.
A user may have administrator priviledges in two ways:
1.- It can belong to the group gu_admins from k_domains table.
2.- Its user identifier may be the one at gu_owner field of k_domains table.
The domain owner is a special kind of administrator user that cannot be deleted from domain.
oConn - Database Connection
java.lang.IllegalStateException - if id_domain or gu_user is not set
java.sql.SQLException
public boolean store(JDCConnection oConn)
throws java.sql.SQLException
Store ACLUser
If gu_user is not set then a new GUID is assigned.
store in class DBPersistoConn - Database Connection
java.sql.SQLException
public boolean delete(JDCConnection oConn)
throws java.sql.SQLException
DBPersistDelete a register from database
The deleted register will be the one matching this DBPersist primary key, as set at constructor or load() method.
delete in class DBPersistoConn - Database connection
java.sql.SQLException
public int clearACLGroups(JDCConnection oConn)
throws java.sql.SQLException
Remove user from all security role groups
oConn - Database Connection
java.sql.SQLException
public int removeFromACLGroup(JDCConnection oConn,
java.lang.String sIdGroup)
throws java.sql.SQLException
Remove User from Group.
remove register from k_x_group_user table.
oConn - Database ConnectionsIdGroup - Group Unique Identifier.
java.sql.SQLException
public java.lang.String getMailRoot(JDCConnection oConn)
throws java.sql.SQLException
Get GUID of user mail root category
The user mail root category is always named DOMAIN_nickname_mail at nm_category field of k_categories.
oConn - Database Connection
java.sql.SQLException
public java.lang.String getMailFolder(JDCConnection oConn,
java.lang.String sFolderName)
throws java.sql.SQLException
Get GUID of user mail folder category
The Inbox category is where messages downloaded from the mail server are cached by default. The user mail inbox category is always named DOMAIN_nickname_inbox at nm_category field of k_categories.
oConn - Database ConnectionsFolderName - One of { "inbox", "drafts", "deleted", "sent", "spam" }
java.sql.SQLException
java.lang.NullPointerException - if sFolderName is null or empty string
public int getRolesForApplication(JDCConnection oConn,
int iIdApp,
java.lang.String sGuWorkArea)
throws java.sql.SQLException
oConn - JDCConnectioniIdApp - int Id of application (from k_apps table)sGuWorkArea - String Guid of WorkArea (from k_workareas table)
java.sql.SQLException
public boolean isAdminForApplication(JDCConnection oConn,
int iIdApp,
java.lang.String sGuWorkArea)
throws java.sql.SQLException
oConn - JDCConnectioniIdApp - int Id of application (from k_apps table)sGuWorkArea - String Guid of WorkArea (from k_workareas table)
java.sql.SQLException
public boolean isPowerUserForApplication(JDCConnection oConn,
int iIdApp,
java.lang.String sGuWorkArea)
throws java.sql.SQLException
oConn - JDCConnectioniIdApp - int Id of application (from k_apps table)sGuWorkArea - String Guid of WorkArea (from k_workareas table)
java.sql.SQLException
public boolean isUserForApplication(JDCConnection oConn,
int iIdApp,
java.lang.String sGuWorkArea)
throws java.sql.SQLException
oConn - JDCConnectioniIdApp - int Id of application (from k_apps table)sGuWorkArea - String Guid of WorkArea (from k_workareas table)
java.sql.SQLException
public boolean isAdminForApplication(JDCConnection oConn,
int iIdApp)
throws java.sql.SQLException
oConn - JDCConnectioniIdApp - int Id of application (from k_apps table)
java.sql.SQLException
public boolean isPowerUserForApplication(JDCConnection oConn,
int iIdApp)
throws java.sql.SQLException
oConn - JDCConnectioniIdApp - int Id of application (from k_apps table)
java.sql.SQLException
public boolean isUserForApplication(JDCConnection oConn,
int iIdApp)
throws java.sql.SQLException
oConn - JDCConnectioniIdApp - int Id of application (from k_apps table)
java.sql.SQLException
public boolean isGuestForApplication(JDCConnection oConn,
int iIdApp)
throws java.sql.SQLException
oConn - JDCConnectioniIdApp - int Id of application (from k_apps table)
java.sql.SQLException
public static java.lang.String getIdFromEmail(JDCConnection oConn,
java.lang.String sUserEMail)
throws java.sql.SQLException
Get User Unique Id. from its main e-mail address.
This method calls k_get_user_from_email stored procedure.
oConn - Database ConnectionsUserEMail - User main e-mail (tx_main_email from k_users table)
java.sql.SQLException
public static java.lang.String getEmailFromId(JDCConnection oConn,
java.lang.String sUserId)
throws java.sql.SQLException
Get User main e-mail from its GUID.
oConn - Database ConnectionsUserId - User GUID (gu_user from k_users table)
java.sql.SQLException
public static java.lang.String getIdFromNick(java.sql.Connection oConn,
int iDomainId,
java.lang.String sUserNick)
throws java.sql.SQLException
Get User Unique Id. from its nickname.
This method executes a SQL query with a ResultSet
oConn - Database Connection
java.sql.SQLException
public static java.lang.String getIdFromNick(JDCConnection oConn,
int iDomainId,
java.lang.String sUserNick)
throws java.sql.SQLException
Get User Unique Id. from its nickname.
This method calls k_get_user_from_nick stored procedure.
oConn - Database Connection
java.sql.SQLException
public static boolean delete(JDCConnection oConn,
java.lang.String sUserGUID)
throws java.sql.SQLException,
java.io.IOException
Delete User
Categories owned by this user are also deleted, but other data and references for user are not checked.
oConn - Database ConnectionsUserGUID - User Unique Identifier
java.sql.SQLException
java.io.IOException
public static java.lang.String create(JDCConnection oConn,
java.lang.Object[] Values)
throws java.sql.SQLException,
java.lang.ClassCastException,
java.lang.NullPointerException
Shortcut for creating a new user
oConn - Database ConnectionValues - User fields, all required, must be in this order { (Integer)id_domain, (String)tx_nickname, (String)tx_pwd, (Short)bo_active, (Short)bo_searchable, (Short)bo_change_pwd, (String)tx_main_email, (String)tx_alt_email, (String)nm_user, (String)tx_surname1, (String)tx_surname2, (String)tx_challenge, (String)tx_reply, (String)nm_company, (String)de_title, (String)gu_workarea }java.sql.SQLException
java.lang.ClassCastException
java.lang.NullPointerException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||