Java Doc for SecurityManager.java in  » J2EE » Jaffa » org » jaffa » security » 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 » J2EE » Jaffa » org.jaffa.security 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jaffa.security.SecurityManager

SecurityManager
public class SecurityManager (Code)
Security Manager is the main interface to the BusinessFunction and Component Security Architecture. It provide a mechanism for setting the security context for a thread of execution, and then provide a guard for securing code in that thread. The access to the guarded code is derived from a role based security policy file.




Method Summary
static  voidbindToThread(SecurityContext ctx)
    
public static  booleancheckComponentAccess(String componentName)
     See if the current thread has access to the named component.
static  booleancheckComponentAccess(String componentName, SecurityContext ctx)
    
public static  booleancheckFunctionAccess(String functionName)
     See if the current thread has access to the named business function.
static  booleancheckFunctionAccess(String functionName, SecurityContext ctx)
    
static  SecurityContextgetCurrentContext()
    
public static  PrincipalgetPrincipal()
     Get the Security Prinipal Object for the Current User.
public static  ObjectrunFunction(String functionName, PrivilegedAction action)
    
public static  ObjectrunFunction(String functionName, PrivilegedExceptionAction action)
     Run the guarded business function, only if the current thread has access.
public static  ObjectrunWithContext(HttpServletRequest ctx, Object obj, String method, Object[] args)
     Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. In this case the security context is derived from a HttpServletRequest.
Parameters:
  ctx - Web Server Request Context to use
Parameters:
  obj - The object contains the method to execute under the thread security context
Parameters:
  method - The name of the method to execute in the specified object
Parameters:
  args - An Object array of argument to pass to the method.
public static  ObjectrunWithContext(HttpServletRequest ctx, Object obj, String method, Object[] args, Class[] sig)
     Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. In this case the security context is derived from a HttpServletRequest. Returns any Object that the method being invoked can return
Parameters:
  sig - This is an array of classes that represent the signature to the supplied method.
public static  ObjectrunWithContext(HttpServletRequest ctx, Object obj, Method method, Object[] args)
     Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters.
public static  ObjectrunWithContext(EJBContext ctx, Object obj, String method, Object[] args)
     Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. In this case the security context is derived from an EJBContext.
Parameters:
  ctx - Web Server Request Context to use
Parameters:
  obj - The object contains the method to execute under the thread security context
Parameters:
  method - The name of the method to execute in the specified object
Parameters:
  args - An Object array of argument to pass to the method.
public static  ObjectrunWithContext(EJBContext ctx, Object obj, String method, Object[] args, Class[] sig)
     Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. In this case the security context is derived from an EJBContext. Returns any Object that the method being invoked can return
Parameters:
  sig - This is an array of classes that represent the signature to the supplied method.
public static  ObjectrunWithContext(EJBContext ctx, Object obj, Method method, Object[] args)
     Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters.
static  voidunbindFromThread()
    



Method Detail
bindToThread
static void bindToThread(SecurityContext ctx)(Code)
Add this context to the current thread



checkComponentAccess
public static boolean checkComponentAccess(String componentName)(Code)
See if the current thread has access to the named component. This can be used by a Component Manager to preempt a security violation
Parameters:
  componentName - Name of component to check true, if the current thread has access to this component, otherwise false is returned



checkComponentAccess
static boolean checkComponentAccess(String componentName, SecurityContext ctx) throws SecurityException(Code)
See if the give context has access to a component Use by the tag libraries, doesn't require the context to be bound to the thread



checkFunctionAccess
public static boolean checkFunctionAccess(String functionName)(Code)
See if the current thread has access to the named business function.
Parameters:
  functionName - Name of business function to check true, if the current thread has access to this business function, otherwise false is returned



checkFunctionAccess
static boolean checkFunctionAccess(String functionName, SecurityContext ctx) throws SecurityException(Code)
See if the give context has access to a function Use by the tag libraries, doesn't require the context to be bound to the thread



getCurrentContext
static SecurityContext getCurrentContext()(Code)
Return the current security context for this thread



getPrincipal
public static Principal getPrincipal()(Code)
Get the Security Prinipal Object for the Current User. If this is called 'outsite' or the Jaffa framework it will return null. Typically jaffa security is backed by either Web Container or EJB Container security, and this will return Principle as created by the Web/EJB container that is associated to the thread of execution calling this method

In a typical web environment SecurityManager.getPrincipal().getName() will return you the username used to log on.

The security principal associated to the current thread




runFunction
public static Object runFunction(String functionName, PrivilegedAction action) throws AccessControlException(Code)
Run the guarded business function, only if the current thread has access
Parameters:
  functionName - Name of the business function being guarded
Parameters:
  action - An action object which will be executed, this should contain the guarded code
throws:
  AccessControlException - This is thrown if the user doesn't have authorization for this function Returns back the object that the guarded code returned



runFunction
public static Object runFunction(String functionName, PrivilegedExceptionAction action) throws PrivilegedActionException, AccessControlException(Code)
Run the guarded business function, only if the current thread has access. This guarded function may throw a PrivilegedActionException which will contain the real exception Returns back the object that the guarded code returned
Parameters:
  functionName - Name of the business function being guarded
Parameters:
  action - An action object which will be executed, this should contain the guarded code
throws:
  PrivilegedActionException - This is the wrapped exception the the guarded code threw
throws:
  AccessControlException - This is thrown if the user doesn't have authorization for this function



runWithContext
public static Object runWithContext(HttpServletRequest ctx, Object obj, String method, Object[] args) throws Exception(Code)
Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. In this case the security context is derived from a HttpServletRequest.
Parameters:
  ctx - Web Server Request Context to use
Parameters:
  obj - The object contains the method to execute under the thread security context
Parameters:
  method - The name of the method to execute in the specified object
Parameters:
  args - An Object array of argument to pass to the method. If there are no parameters for the method null can be passed
throws:
  Exception - Returns any Exception that the method being invoked may return Returns any Object that the method being invoked can return



runWithContext
public static Object runWithContext(HttpServletRequest ctx, Object obj, String method, Object[] args, Class[] sig) throws Exception(Code)
Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. In this case the security context is derived from a HttpServletRequest. Returns any Object that the method being invoked can return
Parameters:
  sig - This is an array of classes that represent the signature to the supplied method. This will be used for introspection forthe supplied method on the given object
Parameters:
  ctx - Web Server Request Context to use
Parameters:
  obj - The object contains the method to execute under the thread security context
Parameters:
  method - The name of the method to execute in the specified object
Parameters:
  args - An Object array of argument to pass to the method. If there are no parameters for the method null can be passed
throws:
  Exception - Returns any Exception that the method being invoked may return



runWithContext
public static Object runWithContext(HttpServletRequest ctx, Object obj, Method method, Object[] args) throws Exception(Code)
Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. The signature of the method is introspected used the classes associated to the objects in the parameter array If these classes are not able to specified the methods signiture, use the variation of this method that allows the class[] singature to be supplied. In this case the security context is derived from a HttpServletRequest. Returns any Object that the method being invoked can returnthe supplied method on the given object
Parameters:
  ctx - Web Server Request Context to use
Parameters:
  obj - The object contains the method to execute under the thread security context
Parameters:
  method - The name of the method to execute in the specified object
Parameters:
  args - An Object array of argument to pass to the method. If there are no parameters for the method null can be passed
throws:
  Exception - Returns any Exception that the method being invoked may return



runWithContext
public static Object runWithContext(EJBContext ctx, Object obj, String method, Object[] args) throws Exception(Code)
Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. In this case the security context is derived from an EJBContext.
Parameters:
  ctx - Web Server Request Context to use
Parameters:
  obj - The object contains the method to execute under the thread security context
Parameters:
  method - The name of the method to execute in the specified object
Parameters:
  args - An Object array of argument to pass to the method. If there are no parameters for the method null can be passed
throws:
  Exception - Returns any Exception that the method being invoked may return Returns any Object that the method being invoked can return



runWithContext
public static Object runWithContext(EJBContext ctx, Object obj, String method, Object[] args, Class[] sig) throws Exception(Code)
Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. In this case the security context is derived from an EJBContext. Returns any Object that the method being invoked can return
Parameters:
  sig - This is an array of classes that represent the signature to the supplied method. This will be used for introspection forthe supplied method on the given object
Parameters:
  ctx - Web Server Request Context to use
Parameters:
  obj - The object contains the method to execute under the thread security context
Parameters:
  method - The name of the method to execute in the specified object
Parameters:
  args - An Object array of argument to pass to the method. If there are no parameters for the method null can be passed
throws:
  Exception - Returns any Exception that the method being invoked may return



runWithContext
public static Object runWithContext(EJBContext ctx, Object obj, Method method, Object[] args) throws Exception(Code)
Bind a security context to a thread and contine executing the thread by running the supplied method against the specified object with the supplied paramters. The signature of the method is introspected used the classes associated to the objects in the parameter array If these classes are not able to specified the methods signiture, use the variation of this method that allows the class[] singature to be supplied. In this case the security context is derived from an EJBContext. Returns any Object that the method being invoked can returnthe supplied method on the given object
Parameters:
  ctx - Web Server Request Context to use
Parameters:
  obj - The object contains the method to execute under the thread security context
Parameters:
  method - The name of the method to execute in the specified object
Parameters:
  args - An Object array of argument to pass to the method. If there are no parameters for the method null can be passed
throws:
  Exception - Returns any Exception that the method being invoked may return



unbindFromThread
static void unbindFromThread()(Code)
Remove the current context from the current thread



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.