Java Doc for ACL.java in  » Groupware » hipergate » com » knowgate » acl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Groupware » hipergate » com.knowgate.acl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.knowgate.acl.ACL

ACL
final public class ACL (Code)

Top Level User Authentication and Access Control List Functions.


author:
   Sergio Montoro Ten
version:
   3.0


Field Summary
final public static  shortACCOUNT_CANCELLED
    
final public static  shortACCOUNT_DEACTIVATED
    
final public static  shortCAPTCHA_MISMATCH
    
final public static  shortCAPTCHA_TIMEOUT
    
final public static  shortDOMAIN_NOT_FOUND
    
final public static  shortINTERNAL_ERROR
    
final public static  shortINVALID_PASSWORD
    
final public static  shortPASSWORD_EXPIRED
    
final public static  intPERMISSION_ADD
    
final public static  intPERMISSION_DELETE
    
final public static  intPERMISSION_FULL_CONTROL
    
final public static  intPERMISSION_GRANT
    
final public static  intPERMISSION_LIST
    
final public static  intPERMISSION_MODERATE
    
final public static  intPERMISSION_MODIFY
    
final public static  intPERMISSION_READ
    
final public static  intPERMISSION_SEND
    
final public static  intPWD_CLEAR_TEXT
    
final public static  intPWD_DTIP_RC4
    
final public static  intROLE_ADMIN
    
final public static  intROLE_GUEST
    
final public static  intROLE_NONE
    
final public static  intROLE_POWERUSER
    
final public static  intROLE_USER
    
final public static  shortSESSION_EXPIRED
    
final public static  shortUSER_NOT_FOUND
    
final public static  shortWORKAREA_NOT_FOUND
    
final public static  shortWORKAREA_NOT_SET
    

Constructor Summary
public  ACL()
    

Method Summary
public static  StringRC4EnDeCrypt(String sTxt)
    
public static  StringRC4EnDeCrypt(String sTxt, String sKey)
    
public static  shortautenticate(JDCConnection oConn, String sUserId, String sAuthStr, int iFlags)
    
public static  shortautenticate(JDCConnection oConn, String sUserId, String sAuthStr, int iFlags, long lTimestamp, long lTimeout, String sPlainCaptcha, String sTimeCaptchaMD5)
    
public static  Stringencript(String sStr, int iFlags)
    
public static  StringgetErrorMessage(short iErrCode)
    
public static  StringgetLocalizedMaskName(int iACLMask, String sLanguage)
    
public static  StringgetRC4key()
    
public static  StringgetUserIdFromNick(JDCConnection oConn, String sNickName, int iDomain)
    
public static  voidsetRC4key(String sKey)
    

Field Detail
ACCOUNT_CANCELLED
final public static short ACCOUNT_CANCELLED(Code)



ACCOUNT_DEACTIVATED
final public static short ACCOUNT_DEACTIVATED(Code)



CAPTCHA_MISMATCH
final public static short CAPTCHA_MISMATCH(Code)



CAPTCHA_TIMEOUT
final public static short CAPTCHA_TIMEOUT(Code)



DOMAIN_NOT_FOUND
final public static short DOMAIN_NOT_FOUND(Code)



INTERNAL_ERROR
final public static short INTERNAL_ERROR(Code)



INVALID_PASSWORD
final public static short INVALID_PASSWORD(Code)



PASSWORD_EXPIRED
final public static short PASSWORD_EXPIRED(Code)



PERMISSION_ADD
final public static int PERMISSION_ADD(Code)



PERMISSION_DELETE
final public static int PERMISSION_DELETE(Code)



PERMISSION_FULL_CONTROL
final public static int PERMISSION_FULL_CONTROL(Code)



PERMISSION_GRANT
final public static int PERMISSION_GRANT(Code)



PERMISSION_LIST
final public static int PERMISSION_LIST(Code)



PERMISSION_MODERATE
final public static int PERMISSION_MODERATE(Code)



PERMISSION_MODIFY
final public static int PERMISSION_MODIFY(Code)



PERMISSION_READ
final public static int PERMISSION_READ(Code)



PERMISSION_SEND
final public static int PERMISSION_SEND(Code)



PWD_CLEAR_TEXT
final public static int PWD_CLEAR_TEXT(Code)



PWD_DTIP_RC4
final public static int PWD_DTIP_RC4(Code)



ROLE_ADMIN
final public static int ROLE_ADMIN(Code)



ROLE_GUEST
final public static int ROLE_GUEST(Code)



ROLE_NONE
final public static int ROLE_NONE(Code)



ROLE_POWERUSER
final public static int ROLE_POWERUSER(Code)



ROLE_USER
final public static int ROLE_USER(Code)



SESSION_EXPIRED
final public static short SESSION_EXPIRED(Code)



USER_NOT_FOUND
final public static short USER_NOT_FOUND(Code)



WORKAREA_NOT_FOUND
final public static short WORKAREA_NOT_FOUND(Code)



WORKAREA_NOT_SET
final public static short WORKAREA_NOT_SET(Code)




Constructor Detail
ACL
public ACL()(Code)
Default Constructor




Method Detail
RC4EnDeCrypt
public static String RC4EnDeCrypt(String sTxt) throws NullPointerException(Code)

Encrypt text using RC4 algorithm and a default encryption key


Parameters:
  sTxt - Text to be encrypted String Encrypted text
throws:
  NullPointerException - if sTxt is null
See Also:    http://www.4guysfromrolla.com/webtech/010100-1.shtml



RC4EnDeCrypt
public static String RC4EnDeCrypt(String sTxt, String sKey)(Code)

Encrypt text using RC4 algorithm


Parameters:
  sTxt - Text to be encrypted
Parameters:
  sKey - Encryption key
See Also:    http://www.4guysfromrolla.com/webtech/010100-1.shtml



autenticate
public static short autenticate(JDCConnection oConn, String sUserId, String sAuthStr, int iFlags) throws SQLException, UnsupportedOperationException(Code)

Checks whether or not password is valid for given user.

This method calls k_sp_autenticate stored procedure witch looks up tx_pwd field at k_users table and see if it is the same as sAuthStr parameter.


Parameters:
  oConn - Opened Database Connection
Parameters:
  sUserId - User nickname
Parameters:
  sAuthStr - Authentication String (password)
Parameters:
  iFlags - Authentication String Flags
  • ACL.PWD_CLEAR_TEXT Authentication String is passed as clear text (no encryption)
  • ACL.PWD_DTIP_RC4 Authentication String is given encrypted using RC4 algorithm
  • ACL.USER_NOT_FOUND sUserId not found at gu_user field from k_users table
  • ACL.INVALID_PASSWORD sAuthStr parameter does not match tx_pwd field from k_users for sUserId
  • ACL.PASSWORD_EXPIRED Password has expired (dt_pwd_expires field value is before current date)
  • ACL.ACCOUNT_DEACTIVATED User account as been deactivated (field bo_active from k_users table set to zero)
  • ACL.ACCOUNT_CANCELLED User account as been cancelled (field dt_cancel from k_users table set to date before now)
  • ACL.INTERNAL_ERROR Internal error while trying to autenticate user

throws:
  SQLException -
throws:
  UnsupportedOperationException - If k_sp_autenticate stored procedure is not found



autenticate
public static short autenticate(JDCConnection oConn, String sUserId, String sAuthStr, int iFlags, long lTimestamp, long lTimeout, String sPlainCaptcha, String sTimeCaptchaMD5) throws SQLException, UnsupportedOperationException(Code)

Checks password and captcha for a given user

This method


Parameters:
  oConn - Opened Database Connection
Parameters:
  sUserId - User nickname
Parameters:
  sAuthStr - Authentication String (password)
Parameters:
  iFlags - Authentication String Flags
Parameters:
  lTimestamp - Timestamp (in miliseconds) when sPlainCaptcha was generated
Parameters:
  lTimemout - Number of miliseconds after which sPlainCaptcha expires
Parameters:
  sPlainCaptcha - Captcha plain text
Parameters:
  sTimeCaptchaMD5 - Precomputed MD5 hash for String sPlainCaptcha+lTimestamp This method returns the same values as autenticate(JDCConnection,String,String,int) and also
  • ACL.CAPTCHA_MISMATCH The computed MD5 hash for sPlainCaptcha+lTimestamp does not match sTimeCaptchaMD5
  • ACL.CAPTCHA_TIMEOUT lTimestamp+lTimeout is before current datetime

throws:
  SQLException -
throws:
  UnsupportedOperationException - If k_sp_autenticate stored procedure is not found
since:
   2.2



encript
public static String encript(String sStr, int iFlags) throws IllegalArgumentException, NullPointerException(Code)

Encrypt String


Parameters:
  sStr - String to be encrypted
Parameters:
  iFlags - Encryption flags
  • ACL.PWD_CLEAR_TEXT Do not encrypt sStr (return as it is given)
  • ACL.PWD_DTIP_RC4 Encrypt using RC4 algorithm
Encrypted string
throws:
  NullPointerException - if sStr is null
throws:
  IllegalArgumentException - if iFlags!=PWD_CLEAR_TEXT AND iFlags!=PWD_DTIP_RC4



getErrorMessage
public static String getErrorMessage(short iErrCode)(Code)



getLocalizedMaskName
public static String getLocalizedMaskName(int iACLMask, String sLanguage) throws IllegalArgumentException(Code)

Gets permissions mask descriptive name for given language


Parameters:
  iACLMask - Permissions Mask, any combination of ACL.PERMISSION_ constants
Parameters:
  sLanguage - Language for localized string {"en", "es"}



getRC4key
public static String getRC4key()(Code)
Get RC4 default key for encryption



getUserIdFromNick
public static String getUserIdFromNick(JDCConnection oConn, String sNickName, int iDomain) throws SQLException(Code)

Get user unique id given its nickname.

Calls k_get_user_from_nick stored procedure and gets gu_user field from tx_nickname field


Parameters:
  oConn - Database Connection
Parameters:
  sNickName - User nickname (tx_nickname from k_users table)
Parameters:
  iDomain - Domain Identifier (id_domain from k_users table) User Unique Identifier (gu_user from k_users table)
throws:
  SQLException -



setRC4key
public static void setRC4key(String sKey)(Code)
Set RC4 default key for encryption
Parameters:
  sKey -



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.