Java Doc for FileSystemGroupStore.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » groups » filesystem » 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 » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal.groups.filesystem 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jasig.portal.groups.filesystem.FileSystemGroupStore

FileSystemGroupStore
public class FileSystemGroupStore implements IEntityGroupStore,IEntityStore,IEntitySearcher(Code)
This class is an IEntityGroupStore that uses the native file system for its back end. It also implements IEntityStore and a no-op IEntitySearcher. You can substitute a functional entity searcher by adding it to the group service element for this component in the configuration document, compositeGroupServices.xml.

A groups file system looks like this:


-- groups root
 -- org.jasig.portal.ChannelDefinition
 -- channel definition file
 -- channel definition file
...
 -- org.jasig.portal.security.IPerson
 -- person directory
 -- person file
 -- person file
...
 -- person directory
etc.

The groups root is a file system directory declared in the group service configuration document, where it is an attribute of the filesystem group service element. This directory has sub-directories, each named for the underlying entity type that groups in that sub-directory contain. If a service only contains groups of IPersons, the groups root would have 1 sub-directory named org.jasig.portal.security.IPerson.

A directory named for a type may contain both sub-directories and files. The sub-directories represent groups that can contain other groups. The files represent groups that can contain entity as well as group members. The files contain keys, one to a line, and look like this:


# this is a comment
# another comment

key1 Key One
key2
group:org$jasig$portal$security$IPerson/someDirectory/someFile
key3
 # comment

Blank lines and lines that start with the COMMENT String (here #) are ignored. The first token on a non-ignored line is assumed to be a group member key. If the key starts with the GROUP_PREFIX (here :group), it is treated as a local group key. Otherwise, it is assumed to be an entity key. The rest of the tokens on the line are ignored.

The file above contains 3 entity keys, key1, key2, and key3, and 1 group key, org$jasig$portal$security$IPerson/someDirectory/someFile. It represents a group with 3 entity members and 1 group member. The local key of a group is its file path starting at the type name, with the FileSystemGroupStore.SUBSTITUTE_PERIOD character substituted for the real period character.

The store is not implemented as a singleton, so you can have multiple concurrent instances pointing to different groups root directories.


author:
   Dan Ellentuck
version:
   $Revision: 36529 $



Field Summary
protected static  charBACK_SLASH
    
protected static  StringCOMMENT
    
protected static  charFORWARD_SLASH
    
protected static  StringGROUP_PREFIX
    
protected static  charPERIOD
    
protected static  charSUBSTITUTE_PERIOD
    
protected  charbadSeparator
    
protected  chargoodSeparator
    
protected  booleanuseSubstitutePeriod
    

Constructor Summary
public  FileSystemGroupStore()
     FileSystemGroupStore constructor.
public  FileSystemGroupStore(GroupServiceConfiguration cfg)
     FileSystemGroupStore constructor.

Method Summary
protected  GroupHoldercacheGet(String key)
    
protected  voidcachePut(String key, Object val)
    
protected  StringconformSeparatorChars(String s)
    
public  booleancontains(IEntityGroup group, IGroupMember member)
     Answers if group contains member.
public  booleancontainsGroupNamed(IEntityGroup group, String name)
     Answers if group contains a member group named name.
public  voiddelete(org.jasig.portal.groups.IEntityGroup group)
     Delete this IEntityGroup from the data store.
public  IEntityGroupfind(String key)
     Returns an instance of the IEntityGroup from the data store.
protected  IteratorfindContainingGroups(IEntity ent)
     Returns an Iterator over the Collection of IEntityGroups that the IEntity belongs to.
protected  IteratorfindContainingGroups(IEntityGroup group)
     Returns an Iterator over the Collection of IEntityGroups that the IGroupMember belongs to.
public  IteratorfindContainingGroups(IGroupMember gm)
     Returns an Iterator over the Collection of IEntityGroups that the IGroupMember belongs to.
public  java.util.IteratorfindEntitiesForGroup(IEntityGroup group)
     Returns an Iterator over the Collection of IEntities that are members of this IEntityGroup.
public  org.jasig.portal.groups.ILockableEntityGroupfindLockable(String key)
     Returns an instance of the ILockableEntityGroup from the data store.
public  java.lang.String[]findMemberGroupKeys(IEntityGroup group)
     Returns a String[] containing the keys of IEntityGroups that are members of this IEntityGroup.
public  java.util.IteratorfindMemberGroups(IEntityGroup group)
     Returns an Iterator over the Collection of IEntityGroups that are members of this IEntityGroup.
public  SetgetAllDirectoriesBelow(File dir)
     Recursive search of directories underneath dir for files that match filter.
public  File[]getAllFilesBelow(File dir)
     Recursive search of directories underneath dir for files that match filter.
protected  chargetBadSeparator()
     Returns the filesystem separator character NOT in use.
protected  java.util.MapgetCache()
    
protected  ClassgetDefaultEntityType()
     Returns a Class representing the default entity type.
protected  CollectiongetEntitiesFromFile(File idFile)
    
Parameters:
  idFile - java.io.File - a file of ids.
protected  CollectiongetEntityIdsFromFile(File idFile)
    
Parameters:
  idFile - java.io.File - a file of ids.
protected  ClassgetEntityType(File f)
    
protected  FilegetFile(IEntityGroup group)
    
Parameters:
  group - IEntityGroup.
protected  StringgetFilePathFromKey(String key)
    
protected  FilegetFileRoot(Class type)
     Returns a File that is the root for groups of the given type.
protected  chargetGoodSeparator()
     Returns the filesystem separator character in use.
protected  CollectiongetGroupIdsFromFile(File idFile)
    
Parameters:
  idFile - java.io.File - a file of ids.
public  java.lang.StringgetGroupsRootPath()
    
protected  CollectiongetIdsFromFile(File idFile, boolean groupIds)
    
Parameters:
  idFile - java.io.File - a file of ids.
protected  StringgetKeyFromFile(File f)
    
protected  voidinitialize(GroupServiceConfiguration cfg)
    
public  IEntityGroupnewInstance(Class entityType)
    
public  IEntitynewInstance(String key)
    
public  IEntitynewInstance(String key, Class type)
    
public  EntityIdentifier[]searchForEntities(String query, int method, Class type)
    
public  EntityIdentifier[]searchForGroups(String query, int searchMethod, Class leafType)
     Returns an EntityIdentifier[] of groups of the given leaf type whose names match the query string according to the search method.
Parameters:
  query - String the string used to match group names.
Parameters:
  searchMethod - see org.jasig.portal.groups.IGroupConstants.
Parameters:
  leafType - the leaf type of the groups we are searching for.
protected  voidsetCache(java.util.Map newCache)
    
protected  voidsetGroupsRootPath(java.lang.String newGroupsRootPath)
    
public  voidupdate(org.jasig.portal.groups.IEntityGroup group)
     Adds or updates the IEntityGroup AND ITS MEMBERSHIPS to the data store, as appropriate.
public  voidupdateMembers(org.jasig.portal.groups.IEntityGroup group)
     Commits the group memberships of the IEntityGroup to the data store.

Field Detail
BACK_SLASH
protected static char BACK_SLASH(Code)



COMMENT
protected static String COMMENT(Code)



FORWARD_SLASH
protected static char FORWARD_SLASH(Code)



GROUP_PREFIX
protected static String GROUP_PREFIX(Code)



PERIOD
protected static char PERIOD(Code)



SUBSTITUTE_PERIOD
protected static char SUBSTITUTE_PERIOD(Code)



badSeparator
protected char badSeparator(Code)



goodSeparator
protected char goodSeparator(Code)



useSubstitutePeriod
protected boolean useSubstitutePeriod(Code)




Constructor Detail
FileSystemGroupStore
public FileSystemGroupStore()(Code)
FileSystemGroupStore constructor.



FileSystemGroupStore
public FileSystemGroupStore(GroupServiceConfiguration cfg)(Code)
FileSystemGroupStore constructor.




Method Detail
cacheGet
protected GroupHolder cacheGet(String key)(Code)
GroupHolder



cachePut
protected void cachePut(String key, Object val)(Code)



conformSeparatorChars
protected String conformSeparatorChars(String s)(Code)



contains
public boolean contains(IEntityGroup group, IGroupMember member) throws GroupsException(Code)
Answers if group contains member. boolean
Parameters:
  group - org.jasig.portal.groups.IEntityGroup
Parameters:
  member - org.jasig.portal.groups.IGroupMember



containsGroupNamed
public boolean containsGroupNamed(IEntityGroup group, String name) throws GroupsException(Code)
Answers if group contains a member group named name. boolean
Parameters:
  group - org.jasig.portal.groups.IEntityGroup
Parameters:
  name - java.lang.String



delete
public void delete(org.jasig.portal.groups.IEntityGroup group) throws GroupsException(Code)
Delete this IEntityGroup from the data store. We assume that groups will be deleted via the file system, not the group service.
Parameters:
  group - org.jasig.portal.groups.IEntityGroup



find
public IEntityGroup find(String key) throws GroupsException(Code)
Returns an instance of the IEntityGroup from the data store. org.jasig.portal.groups.IEntityGroup
Parameters:
  key - java.lang.String



findContainingGroups
protected Iterator findContainingGroups(IEntity ent) throws GroupsException(Code)
Returns an Iterator over the Collection of IEntityGroups that the IEntity belongs to. java.util.Iterator
Parameters:
  ent - org.jasig.portal.groups.IEntityGroup



findContainingGroups
protected Iterator findContainingGroups(IEntityGroup group) throws GroupsException(Code)
Returns an Iterator over the Collection of IEntityGroups that the IGroupMember belongs to. java.util.Iterator
Parameters:
  group - org.jasig.portal.groups.IEntityGroup



findContainingGroups
public Iterator findContainingGroups(IGroupMember gm) throws GroupsException(Code)
Returns an Iterator over the Collection of IEntityGroups that the IGroupMember belongs to. java.util.Iterator
Parameters:
  gm - org.jasig.portal.groups.IEntityGroup



findEntitiesForGroup
public java.util.Iterator findEntitiesForGroup(IEntityGroup group) throws GroupsException(Code)
Returns an Iterator over the Collection of IEntities that are members of this IEntityGroup. java.util.Iterator
Parameters:
  group - org.jasig.portal.groups.IEntityGroup



findLockable
public org.jasig.portal.groups.ILockableEntityGroup findLockable(String key) throws GroupsException(Code)
Returns an instance of the ILockableEntityGroup from the data store. org.jasig.portal.groups.IEntityGroup
Parameters:
  key - java.lang.String



findMemberGroupKeys
public java.lang.String[] findMemberGroupKeys(IEntityGroup group) throws GroupsException(Code)
Returns a String[] containing the keys of IEntityGroups that are members of this IEntityGroup. In a composite group system, a group may contain a member group from a different service. This is called a foreign membership, and is only possible in an internally-managed service. A group store in such a service can return the key of a foreign member group, but not the group itself, which can only be returned by its local store. String[]
Parameters:
  group - org.jasig.portal.groups.IEntityGroup



findMemberGroups
public java.util.Iterator findMemberGroups(IEntityGroup group) throws GroupsException(Code)
Returns an Iterator over the Collection of IEntityGroups that are members of this IEntityGroup. java.util.Iterator
Parameters:
  group - org.jasig.portal.groups.IEntityGroup



getAllDirectoriesBelow
public Set getAllDirectoriesBelow(File dir)(Code)
Recursive search of directories underneath dir for files that match filter. java.util.Set



getAllFilesBelow
public File[] getAllFilesBelow(File dir)(Code)
Recursive search of directories underneath dir for files that match filter.



getBadSeparator
protected char getBadSeparator()(Code)
Returns the filesystem separator character NOT in use. char



getCache
protected java.util.Map getCache()(Code)
java.util.Map



getDefaultEntityType
protected Class getDefaultEntityType()(Code)
Returns a Class representing the default entity type. Class



getEntitiesFromFile
protected Collection getEntitiesFromFile(File idFile) throws GroupsException(Code)

Parameters:
  idFile - java.io.File - a file of ids. entities Collection.



getEntityIdsFromFile
protected Collection getEntityIdsFromFile(File idFile) throws IOException, FileNotFoundException(Code)

Parameters:
  idFile - java.io.File - a file of ids. String[] ids.



getEntityType
protected Class getEntityType(File f)(Code)

Parameters:
  f - File java.lang.ClassThe Class is the first node of the full path name.



getFile
protected File getFile(IEntityGroup group)(Code)

Parameters:
  group - IEntityGroup. File



getFilePathFromKey
protected String getFilePathFromKey(String key)(Code)



getFileRoot
protected File getFileRoot(Class type)(Code)
Returns a File that is the root for groups of the given type.



getGoodSeparator
protected char getGoodSeparator()(Code)
Returns the filesystem separator character in use. char



getGroupIdsFromFile
protected Collection getGroupIdsFromFile(File idFile) throws IOException, FileNotFoundException(Code)

Parameters:
  idFile - java.io.File - a file of ids. String[] ids.



getGroupsRootPath
public java.lang.String getGroupsRootPath()(Code)
java.lang.String



getIdsFromFile
protected Collection getIdsFromFile(File idFile, boolean groupIds) throws IOException, FileNotFoundException(Code)

Parameters:
  idFile - java.io.File - a file of ids. String[] ids.



getKeyFromFile
protected String getKeyFromFile(File f)(Code)



initialize
protected void initialize(GroupServiceConfiguration cfg)(Code)



newInstance
public IEntityGroup newInstance(Class entityType) throws GroupsException(Code)
org.jasig.portal.groups.IEntityGroupWe assume that new groups will be created updated via the file system,not the group service.



newInstance
public IEntity newInstance(String key) throws GroupsException(Code)



newInstance
public IEntity newInstance(String key, Class type) throws GroupsException(Code)



searchForEntities
public EntityIdentifier[] searchForEntities(String query, int method, Class type) throws GroupsException(Code)
Find EntityIdentifiers for entities whose name matches the query string according to the specified method and is of the specified type



searchForGroups
public EntityIdentifier[] searchForGroups(String query, int searchMethod, Class leafType) throws GroupsException(Code)
Returns an EntityIdentifier[] of groups of the given leaf type whose names match the query string according to the search method.
Parameters:
  query - String the string used to match group names.
Parameters:
  searchMethod - see org.jasig.portal.groups.IGroupConstants.
Parameters:
  leafType - the leaf type of the groups we are searching for. EntityIdentifier[]



setCache
protected void setCache(java.util.Map newCache)(Code)

Parameters:
  newCache - java.util.Map



setGroupsRootPath
protected void setGroupsRootPath(java.lang.String newGroupsRootPath)(Code)

Parameters:
  newGroupsRootPath - java.lang.String



update
public void update(org.jasig.portal.groups.IEntityGroup group) throws GroupsException(Code)
Adds or updates the IEntityGroup AND ITS MEMBERSHIPS to the data store, as appropriate. We assume that groups will be updated via the file system, not the group service.
Parameters:
  group - org.jasig.portal.groups.IEntityGroup



updateMembers
public void updateMembers(org.jasig.portal.groups.IEntityGroup group) throws GroupsException(Code)
Commits the group memberships of the IEntityGroup to the data store. We assume that groups will be updated via the file system, not the group service.
Parameters:
  group - org.jasig.portal.groups.IEntityGroup



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.