| java.lang.Object com.knowgate.dataobjs.DBPersist com.knowgate.acl.ACLUser
ACLUser | final public class ACLUser extends DBPersist (Code) | | Object mapping for k_users table registers
author: Sergio Montoro Ten version: 3.0 |
Field Summary | |
final public static short | ClassId |
Method Summary | |
public int | addToACLGroups(JDCConnection oConn, String sGroupList) | public int | clearACLGroups(JDCConnection oConn) | public static String | create(JDCConnection oConn, Object[] Values) Shortcut for creating a new user
Parameters: oConn - Database Connection Parameters: Values - 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 } Values up to and including tx_surname1 must be NOT NULL, values from tx_surname2 are required but may be null. | public boolean | delete(JDCConnection oConn) | public static boolean | delete(JDCConnection oConn, String sUserGUID) | public DBSubset | getAddresses(JDCConnection oConn) | public static String | getEmailFromId(JDCConnection oConn, String sUserId) | public DBSubset | getGroups(JDCConnection oConn) | public static String | getIdFromEmail(JDCConnection oConn, String sUserEMail) Get User Unique Id. | public static String | getIdFromNick(Connection oConn, int iDomainId, String sUserNick) Get User Unique Id. | public static String | getIdFromNick(JDCConnection oConn, int iDomainId, String sUserNick) Get User Unique Id. | public String | getMailFolder(JDCConnection oConn, String sFolderName) Get GUID of user mail folder category
The Inbox category is where messages downloaded from the mail server are cached by default. | public 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.
If there is no category named DOMAIN_nickname_mail but the
user has his gu_category field set at k_users table then this method tries
to create a new mail root category. | public int | getRolesForApplication(JDCConnection oConn, int iIdApp, String sGuWorkArea) | public boolean | isAdminForApplication(JDCConnection oConn, int iIdApp, String sGuWorkArea) | public boolean | isAdminForApplication(JDCConnection oConn, int iIdApp) | public boolean | isDomainAdmin(JDCConnection oConn) | public boolean | isGuestForApplication(JDCConnection oConn, int iIdApp) | public boolean | isPowerUserForApplication(JDCConnection oConn, int iIdApp, String sGuWorkArea) | public boolean | isPowerUserForApplication(JDCConnection oConn, int iIdApp) | public boolean | isUserForApplication(JDCConnection oConn, int iIdApp, String sGuWorkArea) | public boolean | isUserForApplication(JDCConnection oConn, int iIdApp) | public int | removeFromACLGroup(JDCConnection oConn, String sIdGroup) | public boolean | store(JDCConnection oConn) |
ClassId | final public static short ClassId(Code) | | |
ACLUser | public ACLUser()(Code) | | Default constructor.
|
ACLUser | public ACLUser(String sUserGUID) throws SQLException(Code) | | Constructs ACLUser and set GUID
Does not load any fields from database.
Parameters: sUserGUID - user Unique Identifier (gu_user field at k_users table) throws: SQLException - |
ACLUser | public ACLUser(JDCConnection oConn, String sUserGUID) throws SQLException(Code) | | Constructs ACLUser and load attributes from k_users table
Parameters: oConn - Database Connection Parameters: sUserGUID - user Unique Identifier (gu_user field at k_users table) throws: SQLException - |
addToACLGroups | public int addToACLGroups(JDCConnection oConn, String sGroupList) throws SQLException(Code) | | Add User to Groups.
Insert new registers at k_x_group_user table.
Parameters: oConn - Database Connection Parameters: sGroupList - A string of comma delimited ACLGroup GUIDs to with this ACLUser must be added. throws: SQLException - May throw a primary key constraint violation is user already belongs to group. |
clearACLGroups | public int clearACLGroups(JDCConnection oConn) throws SQLException(Code) | | Remove user from all security role groups
Parameters: oConn - Database Connection Count of groups from witch user was removed. throws: SQLException - |
create | public static String create(JDCConnection oConn, Object[] Values) throws SQLException, ClassCastException, NullPointerException(Code) | | Shortcut for creating a new user
Parameters: oConn - Database Connection Parameters: Values - 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 } Values up to and including tx_surname1 must be NOT NULL, values from tx_surname2 are required but may be null. New User Unique Identifier throws: SQLException - throws: ClassCastException - throws: NullPointerException - |
delete | public static boolean delete(JDCConnection oConn, String sUserGUID) throws SQLException, IOException(Code) | | Delete User
Categories owned by this user are also deleted, but other data and references for user are not checked.
Parameters: oConn - Database Connection Parameters: sUserGUID - User Unique Identifier throws: SQLException - throws: IOException - |
getAddresses | public DBSubset getAddresses(JDCConnection oConn) throws SQLException(Code) | | Get Addresses associated with user at k_x_addr_user table.
Parameters: oConn - Database Connection A DBSubset with a 3 columns containingAddress Unique Identifier (gu_address), Address Ordinal Position (ix_address)and Address Location Type (tp_location). throws: SQLException - See Also: Address |
getEmailFromId | public static String getEmailFromId(JDCConnection oConn, String sUserId) throws SQLException(Code) | | Get User main e-mail from its GUID.
Parameters: oConn - Database Connection Parameters: sUserId - User GUID (gu_user from k_users table) User tx_main_email or null if no user was found with such GUID. throws: SQLException - |
getGroups | public DBSubset getGroups(JDCConnection oConn) throws SQLException(Code) | | Get security role groups to witch this user belongs looking a k_x_group_user table.
Parameters: oConn - Database Connection A DBSubset with a 1 column containing each group unique identifier (gu_acl_group). throws: SQLException - |
getIdFromEmail | public static String getIdFromEmail(JDCConnection oConn, String sUserEMail) throws SQLException(Code) | | Get User Unique Id. from its main e-mail address.
This method calls k_get_user_from_email stored procedure.
Parameters: oConn - Database Connection Parameters: sUserEMail - User main e-mail (tx_main_email from k_users table) User Unique Id. or null if no user was found with such e-mail. throws: SQLException - |
getIdFromNick | public static String getIdFromNick(Connection oConn, int iDomainId, String sUserNick) throws SQLException(Code) | | Get User Unique Id. from its nickname.
This method executes a SQL query with a ResultSet
Parameters: oConn - Database Connection Parameters: sUserEMail - User nickname (tx_nickname from k_users table) User Unique Id. or null if no user was found with such e-mail. throws: SQLException - |
getIdFromNick | public static String getIdFromNick(JDCConnection oConn, int iDomainId, String sUserNick) throws SQLException(Code) | | Get User Unique Id. from its nickname.
This method calls k_get_user_from_nick stored procedure.
Parameters: oConn - Database Connection Parameters: sUserEMail - User nickname (tx_nickname from k_users table) User Unique Id. or null if no user was found with such e-mail. throws: SQLException - since: 3.0 |
getMailFolder | public String getMailFolder(JDCConnection oConn, String sFolderName) throws SQLException(Code) | | 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.
If there is no category named DOMAIN_nickname_inbox but the
user has a mail root category then this method tries to create a new mail
inbox category under mail root.
Parameters: oConn - Database Connection Parameters: sFolderName - One of { "inbox", "drafts", "deleted", "sent", "spam" } a gu_category value from k_categories or null if this userdoes not have a mail inbox category and a new one could not be created throws: SQLException - throws: NullPointerException - if sFolderName is null or empty string |
getMailRoot | public String getMailRoot(JDCConnection oConn) throws SQLException(Code) | | 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.
If there is no category named DOMAIN_nickname_mail but the
user has his gu_category field set at k_users table then this method tries
to create a new mail root category.
Parameters: oConn - Database Connection a gu_category value from k_categories or null if this userdoes not have a mail root category and a new one could not be created throws: SQLException - |
getRolesForApplication | public int getRolesForApplication(JDCConnection oConn, int iIdApp, String sGuWorkArea) throws SQLException(Code) | | Get roles of this user for a given application and workarea
Parameters: oConn - JDCConnection Parameters: iIdApp - int Id of application (from k_apps table) Parameters: sGuWorkArea - String Guid of WorkArea (from k_workareas table) int Any bitwise OR combination of { ACL.ROLE_ADMIN || ACL.ROLE_POWERUSER || ACL.ROLE_USER || ACL.ROLE_GUEST } throws: SQLException - since: 3.0 |
isAdminForApplication | public boolean isAdminForApplication(JDCConnection oConn, int iIdApp, String sGuWorkArea) throws SQLException(Code) | | Find out if this user has administrator role over given application and workarea
Parameters: oConn - JDCConnection Parameters: iIdApp - int Id of application (from k_apps table) Parameters: sGuWorkArea - String Guid of WorkArea (from k_workareas table) boolean throws: SQLException - since: 3.0 |
isAdminForApplication | public boolean isAdminForApplication(JDCConnection oConn, int iIdApp) throws SQLException(Code) | | Find out if this user has administrator role in his default workarea over given application
Parameters: oConn - JDCConnection Parameters: iIdApp - int Id of application (from k_apps table) Parameters: sGuWorkArea - String Guid of WorkArea (from k_workareas table) boolean throws: SQLException - since: 3.0 |
isDomainAdmin | public boolean isDomainAdmin(JDCConnection oConn) throws SQLException, IllegalStateException(Code) | | 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.
Parameters: oConn - Database Connection true is user has adminsitrator priviledges, false otherwise. throws: IllegalStateException - if id_domain or gu_user is not set throws: SQLException - |
isGuestForApplication | public boolean isGuestForApplication(JDCConnection oConn, int iIdApp) throws SQLException(Code) | | Find out if this user has guest role in his default workarea over given application
Parameters: oConn - JDCConnection Parameters: iIdApp - int Id of application (from k_apps table) Parameters: sGuWorkArea - String Guid of WorkArea (from k_workareas table) boolean throws: SQLException - since: 3.0 |
isPowerUserForApplication | public boolean isPowerUserForApplication(JDCConnection oConn, int iIdApp, String sGuWorkArea) throws SQLException(Code) | | Find out if this user has power user role over given application and workarea
Parameters: oConn - JDCConnection Parameters: iIdApp - int Id of application (from k_apps table) Parameters: sGuWorkArea - String Guid of WorkArea (from k_workareas table) boolean throws: SQLException - since: 3.0 |
isPowerUserForApplication | public boolean isPowerUserForApplication(JDCConnection oConn, int iIdApp) throws SQLException(Code) | | Find out if this user has power user role in his default workarea over given application
Parameters: oConn - JDCConnection Parameters: iIdApp - int Id of application (from k_apps table) Parameters: sGuWorkArea - String Guid of WorkArea (from k_workareas table) boolean throws: SQLException - since: 3.0 |
isUserForApplication | public boolean isUserForApplication(JDCConnection oConn, int iIdApp, String sGuWorkArea) throws SQLException(Code) | | Find out if this user has plain user role over given application and workarea
Parameters: oConn - JDCConnection Parameters: iIdApp - int Id of application (from k_apps table) Parameters: sGuWorkArea - String Guid of WorkArea (from k_workareas table) boolean throws: SQLException - since: 3.0 |
isUserForApplication | public boolean isUserForApplication(JDCConnection oConn, int iIdApp) throws SQLException(Code) | | Find out if this user has plain user role in his default workarea over given application
Parameters: oConn - JDCConnection Parameters: iIdApp - int Id of application (from k_apps table) Parameters: sGuWorkArea - String Guid of WorkArea (from k_workareas table) boolean throws: SQLException - since: 3.0 |
removeFromACLGroup | public int removeFromACLGroup(JDCConnection oConn, String sIdGroup) throws SQLException(Code) | | Remove User from Group.
remove register from k_x_group_user table.
Parameters: oConn - Database Connection Parameters: sIdGroup - Group Unique Identifier. throws: SQLException - |
store | public boolean store(JDCConnection oConn) throws SQLException(Code) | | Store ACLUser
If gu_user is not set then a new GUID is assigned.
If dt_last_update is not set then current system date is assigned.
If len_quota is not set then zero is assigned.
If max_quota is not set then 100Mb assigned.
Syntax for tx_main_email and tx_alt_email is verified if these fields are not null
Parameters: oConn - Database Connection throws: SQLException - |
Methods inherited from com.knowgate.dataobjs.DBPersist | public void allcaps(boolean bAllValuesUpperCase)(Code)(Java Doc) public boolean allcaps()(Code)(Java Doc) protected HashMap changelog(DBPersist oOldInstance)(Code)(Java Doc) public void clear()(Code)(Java Doc) public void clone(DBPersist oSource)(Code)(Java Doc) public boolean containsKey(Object oKey) throws NullPointerException(Code)(Java Doc) public boolean containsValue(Object oKey)(Code)(Java Doc) public boolean delete(JDCConnection oConn) throws SQLException(Code)(Java Doc) public Set entrySet()(Code)(Java Doc) public boolean exists(JDCConnection oConn) throws SQLException(Code)(Java Doc) public Object get(String sKey)(Code)(Java Doc) public Object get(Object oKey) throws NullPointerException(Code)(Java Doc) public String getAuditClassName()(Code)(Java Doc) public Date getCreationDate(JDCConnection oConn) throws SQLException(Code)(Java Doc) public java.util.Date getDate(String sKey) throws ClassCastException(Code)(Java Doc) public String getDateFormated(String sKey, String sFormat) throws ClassCastException(Code)(Java Doc) public String getDateShort(String sKey) throws ClassCastException(Code)(Java Doc) public String getDateTime(String sKey)(Code)(Java Doc) public String getDateTime24(String sKey)(Code)(Java Doc) public BigDecimal getDecimal(String sKey) throws ClassCastException, NumberFormatException(Code)(Java Doc) public String getDecimalFormated(String sKey, String sPattern) throws ClassCastException, NumberFormatException, NullPointerException, IllegalArgumentException(Code)(Java Doc) public double getDouble(String sKey) throws NullPointerException, NumberFormatException(Code)(Java Doc) public String getDoubleFormated(String sKey, String sPattern) throws ClassCastException, NumberFormatException, NullPointerException, IllegalArgumentException(Code)(Java Doc) public float getFloat(String sKey) throws NullPointerException, NumberFormatException(Code)(Java Doc) public String getFloatFormated(String sKey, String sPattern) throws ClassCastException, NumberFormatException, NullPointerException, IllegalArgumentException(Code)(Java Doc) public int getInt(String sKey) throws NullPointerException, NumberFormatException(Code)(Java Doc) public Integer getInteger(String sKey) throws NumberFormatException(Code)(Java Doc) public int getIntervalPart(String sKey, String sPart) throws NullPointerException, NumberFormatException, IllegalArgumentException(Code)(Java Doc) public HashMap getItemMap()(Code)(Java Doc) public Set getItems()(Code)(Java Doc) public Money getMoney(String sKey) throws NumberFormatException(Code)(Java Doc) public java.sql.Date getSQLDate(String sKey) throws ClassCastException(Code)(Java Doc) public Time getSQLTime(String sKey) throws ClassCastException(Code)(Java Doc) public short getShort(String sKey) throws java.lang.NullPointerException(Code)(Java Doc) public String getString(String sKey) throws NullPointerException(Code)(Java Doc) public String getStringNull(String sKey, String sDefault)(Code)(Java Doc) public DBTable getTable()(Code)(Java Doc) public DBTable getTable(JDCConnection oConn) throws SQLException, IllegalStateException(Code)(Java Doc) public String getTableName()(Code)(Java Doc) public String getTime(String sKey) throws ClassCastException(Code)(Java Doc) public Time getTimeOfDay(String sKey)(Code)(Java Doc) public Timestamp getTimestamp(String sKey)(Code)(Java Doc) protected static String getUIdFromName(JDCConnection oConn, Integer iDomainId, String sInstanceNm, String sStoredProc) throws SQLException(Code)(Java Doc) public boolean isEmpty()(Code)(Java Doc) public boolean isNull(String sKey)(Code)(Java Doc) public Iterator iterator()(Code)(Java Doc) public Set keySet()(Code)(Java Doc) public boolean load(JDCConnection oConn, Object[] PKVals) throws SQLException(Code)(Java Doc) public boolean load(JDCConnection oConn, String sKey) throws SQLException(Code)(Java Doc) public void parseXML(String sXMLFilePath) throws SAXException, SAXNotRecognizedException, SAXNotSupportedException, SAXParseException, IOException, ClassNotFoundException, IllegalAccessException, InstantiationException(Code)(Java Doc) public void put(String sKey, String sVal) throws NullPointerException(Code)(Java Doc) public void put(String sKey, Object oObj) throws NullPointerException(Code)(Java Doc) public Object put(Object sKey, Object oObj) throws NullPointerException(Code)(Java Doc) public void put(String sKey, int iVal)(Code)(Java Doc) public void put(String sKey, short iVal)(Code)(Java Doc) public void put(String sKey, Date dtVal)(Code)(Java Doc) public void put(String sKey, Time tmVal)(Code)(Java Doc) public void put(String sKey, String sDate, SimpleDateFormat oPattern) throws ParseException(Code)(Java Doc) public void put(String sKey, double dVal)(Code)(Java Doc) public void put(String sKey, BigDecimal oDecVal)(Code)(Java Doc) public void put(String sKey, String sDecVal, DecimalFormat oPattern) throws ParseException(Code)(Java Doc) public void put(String sKey, float fVal)(Code)(Java Doc) public void put(String sKey, Money mVal)(Code)(Java Doc) public void put(String sKey, File oFile) throws FileNotFoundException(Code)(Java Doc) public void put(String sKey, byte[] aBytes)(Code)(Java Doc) public void put(String sKey, char[] aChars)(Code)(Java Doc) public void put(String sKey, String sData, int iSQLType) throws FileNotFoundException, IllegalArgumentException, NullPointerException(Code)(Java Doc) public void putAll(Properties oPropsCollection) throws FileNotFoundException(Code)(Java Doc) public void putAll(Map oMap)(Code)(Java Doc) public void remove(String sKey)(Code)(Java Doc) public Object remove(Object oKey)(Code)(Java Doc) public void replace(String sKey, Object oObj)(Code)(Java Doc) public void replace(String sKey, int iVal)(Code)(Java Doc) public void replace(String sKey, short iVal)(Code)(Java Doc) public void replace(String sKey, float fVal)(Code)(Java Doc) public void setAuditTransact(String sAuditTransact)(Code)(Java Doc) public void setAuditUser(String sAuditUser)(Code)(Java Doc) public int size()(Code)(Java Doc) public boolean store(JDCConnection oConn) throws SQLException(Code)(Java Doc) public void toLowerCase(String sKey)(Code)(Java Doc) public void toUpperCase(String sKey)(Code)(Java Doc) protected String toXML(String sIdent, String sDelim, HashMap oAttrs) throws IllegalStateException(Code)(Java Doc) public String toXML(String sIdent, String sDelim) throws IllegalStateException(Code)(Java Doc) public String toXML(String sIdent)(Code)(Java Doc) public String toXML()(Code)(Java Doc) public Collection values()(Code)(Java Doc)
|
|
|