|
|||||||||
| 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
public final class ACLUser
Object mapping for k_users table registers
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| 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 Does not load any fields from database. |
|
| Method Summary | |
|---|---|
int |
addToACLGroups(JDCConnection oConn,
java.lang.String sGroupList)
Add User to Groups. |
boolean |
checkChallengeReply(JDCConnection oConn,
java.lang.String sReply)
Check whether the given reply matches the challenge question anwser Comparison is case insensitive and ignores white spaces and accents |
int |
clearACLGroups(JDCConnection oConn)
Remove user from all security role groups |
static java.lang.String |
create(JDCConnection oConn,
java.lang.Object[] Values)
Shortcut for creating a new user |
boolean |
delete(JDCConnection oConn)
Delete a register from database The deleted register will be the one matching this DBPersist primary key, as set at constructor or load() method. |
static boolean |
delete(JDCConnection oConn,
java.lang.String sUserGUID)
Delete User Categories owned by this user are also deleted, but other data and references for user are not checked. |
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. |
java.lang.String |
getFullName()
Get full name |
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(java.sql.Connection oConn,
java.lang.String sUserEMail)
Get User Unique Id. from its main e-mail address. |
static java.lang.String |
getIdFromEmail(JDCConnection oConn,
java.lang.String sUserEMail)
Get User Unique Id. from its main e-mail address. |
static java.lang.String |
getIdFromNick(java.sql.Connection oConn,
int iDomainId,
java.lang.String sUserNick)
Get User Unique Id. from its nickname. |
static java.lang.String |
getIdFromNick(JDCConnection oConn,
int iDomainId,
java.lang.String sUserNick)
Get User Unique Id. from its nickname. |
java.lang.String |
getMailFolder(JDCConnection oConn,
java.lang.String sFolderName)
Get GUID of user mail folder category The Inbox category is where messages downloaded from the mail server are cached by default. |
java.lang.String[] |
getMailFolderNames(JDCConnection oConn)
Get name of all user mail folders |
java.lang.String[] |
getMailFolders(JDCConnection oConn)
Get GUID of all user mail folders |
java.lang.String |
getMailRoot(JDCConnection oConn)
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. |
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. |
static boolean |
resetPassword(JDCConnection oConn,
java.lang.String sUserId,
java.lang.String sNewPwd)
Update tx_pwd password column at k_users table for given user Password expiration is not modified |
static boolean |
resetPassword(JDCConnection oConn,
java.lang.String sUserId,
java.lang.String sNewPwd,
java.util.Date dtExpire)
Update tx_pwd password column at k_users table for given user |
static boolean |
resetPassword(JDCConnection oConn,
java.lang.String sUserId,
java.lang.String sNewPwd,
java.util.Date dtExpire,
DistributedCachePeer oCache)
Update tx_pwd password column at k_users table for given user and remove it from memory cache if it was previously cached. |
static boolean |
resetPassword(JDCConnection oConn,
java.lang.String sUserId,
java.lang.String sNewPwd,
DistributedCachePeer oCache)
Update tx_pwd password column at k_users table for given user and remove it from memory cache if it was previously cached. |
boolean |
store(JDCConnection oConn)
Store ACLUser If gu_user is not set then a new GUID is assigned. |
| Methods inherited from class com.knowgate.dataobjs.DBPersist |
|---|
allcaps, allcaps, changelog, clear, clone, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getIntervalPart, getItemMap, getItems, getMoney, getShort, getSQLDate, getSQLTime, 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, put, putAll, putAll, remove, remove, replace, replace, replace, replace, replace, replace, replace, setAuditTransact, setAuditUser, size, toLowerCase, toUpperCase, toXML, 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 java.lang.String getFullName()
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.SQLExceptionAddress}
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 if 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 java.lang.String[] getMailFolders(JDCConnection oConn)
throws java.sql.SQLException
Get GUID of all user mail folders
java.sql.SQLException
public java.lang.String[] getMailFolderNames(JDCConnection oConn)
throws java.sql.SQLException
Get name of all user mail folders
java.sql.SQLException
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)sGuWorkArea - String Guid of WorkArea (from k_workareas 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)sGuWorkArea - String Guid of WorkArea (from k_workareas 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)sGuWorkArea - String Guid of WorkArea (from k_workareas 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)sGuWorkArea - String Guid of WorkArea (from k_workareas table)
java.sql.SQLException
public boolean checkChallengeReply(JDCConnection oConn,
java.lang.String sReply)
public static java.lang.String getIdFromEmail(java.sql.Connection 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 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 ConnectionsUserEMail - User nickname (tx_nickname from k_users table)
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 ConnectioniDomainId - Domain Numeric Unique IdentifiersUserNick - User nickname (tx_nickname from k_users table)
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, (String)tx_comments, (Date)dt_pwd_expires }java.sql.SQLException
java.lang.ClassCastException
java.lang.NullPointerException
public static boolean resetPassword(JDCConnection oConn,
java.lang.String sUserId,
java.lang.String sNewPwd,
java.util.Date dtExpire)
throws java.sql.SQLException,
java.lang.NullPointerException
oConn - JDCConnectionsUserId - String User GUIDsNewPwd - String New password (up to 50 characters)dtExpire - Date of expiration of new password or null if password never expires
SQLxception
java.lang.NullPointerException
java.sql.SQLException
public static boolean resetPassword(JDCConnection oConn,
java.lang.String sUserId,
java.lang.String sNewPwd)
throws java.sql.SQLException,
java.lang.NullPointerException
oConn - JDCConnectionsUserId - String User GUIDsNewPwd - String New password (up to 50 characters)
SQLxception
java.lang.NullPointerException
java.sql.SQLException
public static boolean resetPassword(JDCConnection oConn,
java.lang.String sUserId,
java.lang.String sNewPwd,
DistributedCachePeer oCache)
throws java.sql.SQLException,
java.lang.NullPointerException,
java.rmi.RemoteException
oConn - JDCConnectionsUserId - String User GUIDsNewPwd - String New password (up to 50 characters)oCache - DistributedCachePeer
SQLxception
java.lang.NullPointerException
java.sql.SQLException
java.rmi.RemoteException
public static boolean resetPassword(JDCConnection oConn,
java.lang.String sUserId,
java.lang.String sNewPwd,
java.util.Date dtExpire,
DistributedCachePeer oCache)
throws java.sql.SQLException,
java.lang.NullPointerException,
java.rmi.RemoteException
oConn - JDCConnectionsUserId - String User GUIDsNewPwd - String New password (up to 50 characters)dtExpire - Date of expiration of new password or null if password never expiresoCache - DistributedCachePeer
SQLxception
java.lang.NullPointerException
java.sql.SQLException
java.rmi.RemoteException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||