Java Doc for Group.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » auth » authorize » 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 » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.auth.authorize 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ecyrd.jspwiki.auth.authorize.Group

Group
public class Group (Code)

Groups are a specialized type of ad-hoc role used by the wiki system. Unlike externally-provided roles (such as those provided by an LDAP server or web container), JSPWiki groups can be created dynamically by wiki users, without requiring special container privileges or administrator intervention. They are designed to provide a lightweight role-based access control system that complements existing role systems.

Group names are case-insensitive, and have a few naming restrictions, which are enforced by the GroupManager :

  • Groups cannot have the same name as a built-in Role (e.g., "Admin", "Authenticated" etc.)
  • Groups cannot have the same name as an existing user

Note: prior to JSPWiki 2.4.19, Group was an interface; it is now a concrete, final class.

Groups are related to GroupPrincipal s. A GroupPrincipal, when injected into the Principal set of a WikiSession's Subject, means that the user is a member of a Group of the same name -- it is, in essence, an "authorization token." GroupPrincipals, unlike Groups, are thread-safe, lightweight and immutable. That's why we use them in Subjects rather than the Groups themselves.


author:
   Janne Jalkanen
author:
   Andrew Jaquith
since:
   2.3


Field Summary
final static  String[]RESTRICTED_GROUPNAMES
    

Constructor Summary
protected  Group(String name, String wiki)
     Protected constructor to prevent direct instantiation except by other package members.

Method Summary
public synchronized  booleanadd(Principal user)
     Adds a Principal to the group.
public synchronized  voidclear()
     Clears all Principals from the group list.
public  booleanequals(Object o)
     Two DefaultGroups are equal if they contain identical member Principals and have the same name.
public synchronized  DategetCreated()
     Returns the creation date.
final public synchronized  StringgetCreator()
     Returns the creator of this Group.
public synchronized  DategetLastModified()
     Returns the last-modified date.
final public synchronized  StringgetModifier()
     Returns the name of the user who last modified this group.
public  StringgetName()
     The name of the group.
public  PrincipalgetPrincipal()
     Returns the GroupPrincipal that represents this Group.
public  StringgetWiki()
     Returns the wiki name.
public  inthashCode()
     The hashcode is calculated as a XOR sum over all members of the Group.
public  booleanisMember(Principal principal)
     Returns true if a Principal is a member of the group. Specifically, the Principal's getName() method must return the same value as one of the Principals in the group member list.
public  Principal[]members()
     Returns the members of the group as an array of Principal objects.
public synchronized  booleanremove(Principal user)
     Removes a Principal from the group.
public synchronized  voidsetCreated(Date date)
     Sets the created date.
final public synchronized  voidsetCreator(String creator)
     Sets the creator of this Group.
public synchronized  voidsetLastModified(Date date)
    
final public synchronized  voidsetModifier(String modifier)
     Sets the name of the user who last modified this group.
public  StringtoString()
     Returns a string representation of the Group.

Field Detail
RESTRICTED_GROUPNAMES
final static String[] RESTRICTED_GROUPNAMES(Code)




Constructor Detail
Group
protected Group(String name, String wiki)(Code)
Protected constructor to prevent direct instantiation except by other package members. Callers should use GroupManager.parseGroup(StringStringboolean) or GroupManager.parseGroup(com.ecyrd.jspwiki.WikiContextboolean) . instead.
Parameters:
  name - the name of the group
Parameters:
  wiki - the wiki the group belongs to




Method Detail
add
public synchronized boolean add(Principal user)(Code)
Adds a Principal to the group.
Parameters:
  user - the principal to add true if the operation was successful



clear
public synchronized void clear()(Code)
Clears all Principals from the group list.



equals
public boolean equals(Object o)(Code)
Two DefaultGroups are equal if they contain identical member Principals and have the same name.
Parameters:
  o - the object to compare the comparison



getCreated
public synchronized Date getCreated()(Code)
Returns the creation date. the creation date



getCreator
final public synchronized String getCreator()(Code)
Returns the creator of this Group. the creator



getLastModified
public synchronized Date getLastModified()(Code)
Returns the last-modified date. the date and time of last modification



getModifier
final public synchronized String getModifier()(Code)
Returns the name of the user who last modified this group. the modifier



getName
public String getName()(Code)
The name of the group. This is set in the class constructor. the name of the Group



getPrincipal
public Principal getPrincipal()(Code)
Returns the GroupPrincipal that represents this Group. the group principal



getWiki
public String getWiki()(Code)
Returns the wiki name. the wiki name



hashCode
public int hashCode()(Code)
The hashcode is calculated as a XOR sum over all members of the Group. the hash code



isMember
public boolean isMember(Principal principal)(Code)
Returns true if a Principal is a member of the group. Specifically, the Principal's getName() method must return the same value as one of the Principals in the group member list. The Principal's type does not need to match.
Parameters:
  principal - the principal about whom membeship status is sought the result of the operation



members
public Principal[] members()(Code)
Returns the members of the group as an array of Principal objects. the members



remove
public synchronized boolean remove(Principal user)(Code)
Removes a Principal from the group.
Parameters:
  user - the principal to remove true if the operation was successful



setCreated
public synchronized void setCreated(Date date)(Code)
Sets the created date.
Parameters:
  date - the creation date



setCreator
final public synchronized void setCreator(String creator)(Code)
Sets the creator of this Group.
Parameters:
  creator - the creator



setLastModified
public synchronized void setLastModified(Date date)(Code)
Sets the last-modified date
Parameters:
  date - the last-modified date



setModifier
final public synchronized void setModifier(String modifier)(Code)
Sets the name of the user who last modified this group.
Parameters:
  modifier - the modifier



toString
public String toString()(Code)
Returns a string representation of the Group. the string
See Also:   java.lang.Object.toString



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.